export type StructuredUiRequest =
  | {
      kind: "stay_context";
      runId: string;
      title: string;
      submitLabel: string;
      initialValues: {
        checkIn?: string | undefined;
        checkOut?: string | undefined;
        adults?: number | undefined;
        children?: number | undefined;
        rooms?: number | undefined;
        notes?: string | undefined;
      };
    }
  | {
      kind: "contact_details";
      runId: string;
      title: string;
      submitLabel: string;
      consentLabel?: string | undefined;
      firstNameLabel?: string | undefined;
      lastNameLabel?: string | undefined;
      emailLabel?: string | undefined;
      phoneLabel?: string | undefined;
      privacyAcknowledgementLabel?: string | undefined;
      privacyNoticeLabel?: string | undefined;
      privacyNoticeUrl?: string | undefined;
      declineLabel?: string | undefined;
    }
  | {
      kind: "handoff_choice";
      runId: string;
      title: string;
      options: Array<{
        value: "booking_engine" | "staff";
        label: string;
      }>;
    }
  | {
      kind: "handoff_result";
      runId: string;
      title: string;
      message: string;
      destinationUrl: string | null;
      destinationLabel: string | null;
    };

export interface SubmitPlaybookFieldsRequest {
  sessionId: string;
  step: "stay_context" | "contact_details" | "handoff_choice";
  values: Record<string, string | number | boolean>;
  idempotencyKey: string;
}

export interface SubmitPlaybookFieldsResponse {
  nextUiRequest: StructuredUiRequest | null;
}
