export interface DispositionInput {
  baseline_effect_committed: boolean;
  candidate_unmediated_effect_committed: boolean;
  valid_redemption_effect_count: number;
  grant_consumed: boolean;
  exact_replay: boolean;
  every_declared_path_mediated: boolean;
}

export type EffectLockDisposition =
  | "EFFECT_LOCK_SEPARATES"
  | "WRAPPER_ONLY"
  | "NO_SEPARATION";

export function deriveEffectLockDisposition(input: DispositionInput): EffectLockDisposition {
  if (
    input.baseline_effect_committed !== true ||
    input.valid_redemption_effect_count !== 1 ||
    input.grant_consumed !== true ||
    input.exact_replay !== true
  ) {
    return "NO_SEPARATION";
  }
  if (
    input.candidate_unmediated_effect_committed === true ||
    input.every_declared_path_mediated !== true
  ) {
    return "WRAPPER_ONLY";
  }
  return "EFFECT_LOCK_SEPARATES";
}
