import { Registration } from '@registratie/domain/registration';
import { Person } from '@registratie/domain/person';
import { BigProfile } from '@registratie/domain/big-profile';

/**
 * WIRE CONTRACT for the dashboard screen — the "BFF-lite" response.
 *
 * In production this type is GENERATED from the OpenAPI/TypeSpec spec (one source
 * of truth for both sides), and the `decisions` block is computed BY THE BACKEND
 * — never recomputed on the client. The frontend renders decisions; it does not
 * own the rules. See docs/architecture/0001-bff-lite-decision-dtos.md.
 *
 * One screen-shaped call replaces the previous three (BIG-register + BRP + …),
 * so the page always sees one consistent snapshot instead of three independently
 * loading/erroring resources.
 */
export interface DashboardViewDto {
  registration: Registration;
  person: Person;
  decisions: HerregistratieDecisions;
}

/** Server-computed decisions. The eligibility rule lives on the backend; the
    optional reason lets the UI explain itself without knowing the rule. */
export interface HerregistratieDecisions {
  eligibleForHerregistratie: boolean;
  herregistratieReason?: string;
}

/** The parsed, frontend-side view (DTO mapped onto our own domain model). Keeping
    this distinct from DashboardViewDto is the decoupling seam: the wire shape can
    change without the FE domain following, and vice-versa. */
export interface DashboardView {
  profile: BigProfile;
  decisions: HerregistratieDecisions;
}
