import type { TimeSlot } from "./availability";
import type { BookingPaymentOptionsSource, BookingPaymentTermsConfig, PublicBookingPaymentTermsAvailability, BookingPricing, BookingPricingInput } from "./bookingConfig";
import type { CourseEnrollmentRefundFailedCode, EventAttendeeRefundFailedCode } from "./bookingRefundOutcomes";
/**
 * Booking Operations Contracts
 *
 * These types cover event-host ops workflows, appointment resource/service
 * management, and public booking-session payloads.
 *
 * Note: Do NOT use these API types as validation schemas. They document wire
 * contracts while the owning services validate and normalize inputs.
 */
export type OpsEventOccurrenceSummary = {
    id: string;
    siteId: string;
    seriesId: string;
    seriesTitle: string;
    startsAt: string;
    endsAt: string | null;
    timeZone: string;
    status: string;
};
export type OpsOccurrenceAttendee = {
    id: string;
    customerId: string;
    customerName: string | null;
    customerEmail: string;
    customerPhone: string | null;
    status: "confirmed" | "waitlist" | "cancelled";
    ticketsCount: number;
    checkedInCount: number;
    checkedInLastAt: string | null;
    checkedInLastBy: string | null;
    guests: Array<{
        name: string;
        phone: string | null;
    }>;
};
export type OpsListUpcomingEventOccurrencesResponse = {
    occurrences: OpsEventOccurrenceSummary[];
};
export type OpsOccurrenceAttendeesResponse = {
    occurrence: {
        id: string;
        seriesId: string;
        seriesTitle: string;
        startsAt: string;
        endsAt: string | null;
        timeZone: string;
    };
    ticketingEnabled: boolean;
    attendees: OpsOccurrenceAttendee[];
};
export type OpsValidateEventTicketRequest = {
    token: string;
};
export type OpsValidateEventTicketResponse = {
    ticketingEnabled: boolean;
    attendee: OpsOccurrenceAttendee;
};
export type OpsEventAttendeeCheckinUpdate = {
    attendeeId: string;
    siteId: string;
    occurrenceId: string;
    checkedInCount: number;
    ticketsCount: number;
    checkedInLastAt: string;
    checkedInLastBy: string;
};
export type OpsUpdateEventAttendeeCheckinRequest = {
    delta: 1 | -1;
};
export type OpsUpdateEventAttendeeCheckinResponse = {
    checkin: OpsEventAttendeeCheckinUpdate;
};
export type OpsEventAttendeeDetailsResponse = {
    occurrence: {
        id: string;
        seriesId: string;
        seriesTitle: string;
        startsAt: string;
        endsAt: string;
        timeZone: string;
    };
    attendee: OpsOccurrenceAttendee;
    payment: {
        method: string;
        status: string;
        isAdminAdded?: boolean;
        amountPaidCents: number | null;
        currency: string | null;
        stripeCheckoutSessionId: string | null;
    };
    actions: {
        canCancel: boolean;
        cancelCutoffAt?: string;
        defaultRefund: "refund" | "no_refund";
        canOverrideRefund: boolean;
        refundCutoffAt?: string | null;
        remainingRefundableCents: number | null;
        currency: string | null;
    };
};
export type AdminBookingRefundSelection = "follow_policy" | "force_refund" | "force_no_refund";
export type AdminBookingCancellationRequest = {
    cancellation?: import("./common/cancellation").StaffCancellationContextInput;
    reason?: string | null;
    refundSelection?: AdminBookingRefundSelection;
    refundCommand?: BookingRefundCommandRequest;
};
export type OpsCancelEventAttendeeResult = {
    cancelled: boolean;
    refunded: boolean;
    blockedReason?: "already_cancelled" | "already_started" | "payment_in_progress" | "invalid_start_time" | "policy_disallows" | "no_refundable_payment_link" | "nothing_remaining_to_refund";
    refund?: {
        status: "succeeded" | "failed" | "skipped";
        amountCents: number | null;
        currency: string | null;
        paymentLast4: string | null;
        stripeRefundId: string | null;
        errorMessage?: string;
        errorCode?: string;
        totalRefundedCents?: number;
        remainingRefundableCents?: number | null;
    };
    message: string;
};
export type OpsCancelEventAttendeeRequest = AdminBookingCancellationRequest;
export type OpsCancelEventAttendeeResponse = {
    result: OpsCancelEventAttendeeResult;
};
export type OpsRefundEventAttendeeResponse = {
    cancelled: boolean;
    result: EventAttendeeRefundResult;
};
export type BookingRefundAmountRequest = Readonly<{
    kind: "full_remaining";
}> | Readonly<{
    kind: "partial_amount";
    amountCents: number;
}>;
export type BookingRefundProtectedDepositOverride = "respect_policy" | "allow_protected_deposit_override";
export type BookingRequestedRefundMethod = "original_payment" | "site_credit";
export type BookingRefundCommandRequest = Readonly<{
    kind: "refund_only";
    amount: BookingRefundAmountRequest;
    requestedRefundMethod: BookingRequestedRefundMethod;
    protectedDepositOverride: BookingRefundProtectedDepositOverride;
}> | Readonly<{
    kind: "refund_and_revoke";
    amount: Readonly<{
        kind: "full_remaining";
    }>;
    requestedRefundMethod: BookingRequestedRefundMethod;
    protectedDepositOverride: BookingRefundProtectedDepositOverride;
}>;
export type RefundEventAttendeeRequest = {
    command: BookingRefundCommandRequest;
    reason?: string | null;
    idempotencyKey?: string;
};
type EventAttendeeRefundBase = {
    refundRecordId: string;
    refundMethod: "cash" | "credit" | "mixed" | null;
    amountCents: number | null;
    currency: string | null;
    paymentLast4: string | null;
    stripeRefundId: string | null;
    totalRefundedCents?: number;
    remainingRefundableCents?: number | null;
};
export type EventAttendeeRefundResult = (EventAttendeeRefundBase & {
    status: "succeeded";
}) | (EventAttendeeRefundBase & {
    status: "failed";
    errorCode: EventAttendeeRefundFailedCode;
    errorMessage: string;
});
export type RefundEventAttendeeResponse = {
    result: EventAttendeeRefundResult;
};
export type TransferEventAttendeeRequest = {
    toEmail: string;
    toName?: string;
    reason?: string | null;
};
export type EventAttendeeTransferResult = {
    transferred: boolean;
    transferId?: string;
    message: string;
};
export type TransferEventAttendeeResponse = {
    result: EventAttendeeTransferResult;
};
export type EventAttendeeRefundHistoryItem = {
    id: string;
    siteId: string;
    attendeeId: string;
    sourceType: "order_refund";
    refundMethod: "cash" | "credit" | "mixed";
    amountCents: number;
    currency: string;
    status: "pending" | "succeeded" | "failed" | "reconciliation_needed";
    stripeRefundId: string | null;
    stripePaymentIntentId: string | null;
    stripeCheckoutSessionId: string | null;
    failureCode: string | null;
    failureMessage: string | null;
    paymentLast4: string | null;
    initiatedBy: "customer" | "admin";
    initiatorCustomerId: string | null;
    initiatorUserId: string | null;
    reason: string | null;
    createdAt: string;
};
export type ListEventAttendeeRefundsResponse = {
    refunds: EventAttendeeRefundHistoryItem[];
    protectedDepositPolicy: "not_applicable" | "refundable" | "non_refundable";
};
export type RefundCourseEnrollmentRequest = {
    command: BookingRefundCommandRequest;
    reason?: string | null;
    idempotencyKey?: string;
};
type CourseEnrollmentRefundBase = {
    refundRecordId: string;
    refundMethod: "cash" | "credit" | "mixed" | null;
    amountCents: number | null;
    currency: string | null;
    paymentLast4: string | null;
    stripeRefundId: string | null;
    totalRefundedCents?: number;
    remainingRefundableCents?: number | null;
};
export type CourseEnrollmentRefundResult = (CourseEnrollmentRefundBase & {
    status: "succeeded";
}) | (CourseEnrollmentRefundBase & {
    status: "failed";
    errorCode: CourseEnrollmentRefundFailedCode;
    errorMessage: string;
});
export type RefundCourseEnrollmentResponse = {
    result: CourseEnrollmentRefundResult;
};
export type CourseEnrollmentRefundHistoryItem = {
    id: string;
    siteId: string;
    enrollmentId: string;
    sourceType: "order_refund";
    refundMethod: "cash" | "credit" | "mixed";
    amountCents: number;
    currency: string;
    status: "pending" | "succeeded" | "failed" | "reconciliation_needed";
    stripeRefundId: string | null;
    stripePaymentIntentId: string | null;
    stripeCheckoutSessionId: string | null;
    failureCode: string | null;
    failureMessage: string | null;
    paymentLast4: string | null;
    initiatedBy: "customer" | "admin";
    initiatorCustomerId: string | null;
    initiatorUserId: string | null;
    reason: string | null;
    createdAt: string;
};
export type ListCourseEnrollmentRefundsResponse = {
    refunds: CourseEnrollmentRefundHistoryItem[];
    protectedDepositPolicy: "not_applicable" | "refundable" | "non_refundable";
};
export type EventAttendeeTransferHistoryItem = {
    id: string;
    siteId: string;
    attendeeId: string;
    fromCustomerId: string;
    toCustomerId: string;
    initiatedBy: "customer" | "admin";
    initiatorCustomerId: string | null;
    initiatorUserId: string | null;
    createdAt: string;
};
export type ListEventAttendeeTransfersResponse = {
    transfers: EventAttendeeTransferHistoryItem[];
};
export type AppointmentResource = {
    id: string;
    siteId: string;
    userId: string | null;
    displayName: string;
    roleLabel: string | null;
    shortBio: string | null;
    bio: string | null;
    colorHex: string | null;
    avatarAssetId: string | null;
    timezone: string;
    calendarSyncEnabled: boolean;
    createdAt: string;
    updatedAt: string;
};
export type DashboardAppointmentResource = AppointmentResource & {
    archivedAt: string | null;
};
export type CreateAppointmentResourceRequest = {
    displayName: string;
    bio?: string | null;
    timezone?: string;
    colorHex?: string | null;
    calendarSyncEnabled?: boolean;
};
export type UpdateAppointmentResourceRequest = Partial<CreateAppointmentResourceRequest>;
export type AppointmentResourceResponse = {
    resource: DashboardAppointmentResource;
};
export type ListAppointmentResourcesResponse = {
    resources: DashboardAppointmentResource[];
};
export type CreateTeamMemberProfileResponse = {
    contentEntryId: string;
};
export type UpdateTeamMemberProfilePolicyRequest = {
    policy: import("./bookingConfig").TeamMemberProfilePagePolicyMode;
};
export type UpdateTeamMemberProfilePolicyResponse = {
    profilePolicy: {
        kind: import("./bookingConfig").TeamMemberProfilePagePolicyMode;
    };
};
export type UpdateTeamMemberProfileContentRequest = {
    data: Record<string, unknown>;
    optimistic_hash?: string | null;
} | {
    path: string;
    value: unknown;
    optimistic_hash?: string | null;
};
export type TeamMemberProfileContentResponse = import("./contentRuntime").ContentEntryOrPageResponse;
export type PublishTeamMemberProfileRequest = Record<string, unknown> | undefined;
export type PublishTeamMemberProfileResponse = import("./contentRuntime").PublishedContentEntryOrPageResponse;
export type DiscardTeamMemberProfileDraftResponse = import("./contentRuntime").ContentEntryOrPageResponse;
export type UnpublishTeamMemberProfileResponse = import("./contentRuntime").ContentEntryOrPageResponse;
export type ScheduleTeamMemberProfileRequest = {
    publishAt: string;
};
export type ScheduleTeamMemberProfileResponse = import("./contentRuntime").ScheduledContentEntryOrPageResponse;
export type CancelScheduledTeamMemberProfileResponse = import("./contentRuntime").ScheduledContentEntryOrPageResponse;
export type UpdateTeamMemberProfileRouteMetadataRequest = import("./routes").RouteMetadataPayload;
export type UpdateTeamMemberProfileRouteMetadataResponse = import("./routes").RouteMetadataResponse;
export type RemoveAppointmentResourceResponse = {
    success: boolean;
    action: "deleted" | "archived";
};
export type AppointmentService = {
    id: string;
    siteId: string;
    title: string;
    slug: string;
    description: string | null;
    durationMinutes: number;
    pricing?: BookingPricing;
    priceAmount: number | null;
    priceCurrency: string;
    paymentTerms: BookingPaymentTermsConfig;
    prepMinutes: number;
    cleanupMinutes: number;
    colorHex: string | null;
    isActive: boolean;
    locationType: "virtual" | "in_person" | "hybrid";
    venueId: string | null;
    timezone: string | null;
    formId: string | null;
    cancellationPolicy: {
        refunds: {
            mode: "inherit" | "never" | "always" | "cutoff";
            cutoffHours?: number;
        };
    };
    createdAt: string;
    updatedAt: string;
};
export type CreateAppointmentServiceRequest = {
    title: string;
    description?: string | null;
    durationMinutes: number;
    pricing?: BookingPricingInput;
    priceAmount?: number | null;
    priceCurrency?: string;
    paymentTerms?: BookingPaymentTermsConfig;
    paymentOptionsSource?: BookingPaymentOptionsSource;
    prepMinutes?: number;
    cleanupMinutes?: number;
    colorHex?: string | null;
    isActive?: boolean;
    locationType?: "virtual" | "in_person" | "hybrid";
    venueId?: string | null;
    timezone?: string | null;
    formId?: string | null;
    cancellationPolicy?: AppointmentService["cancellationPolicy"];
};
export type UpdateAppointmentServiceRequest = Partial<CreateAppointmentServiceRequest>;
export type AppointmentServiceResponse = {
    service: AppointmentService;
};
export type ListAppointmentServicesResponse = {
    services: AppointmentService[];
};
export type DeleteServiceResponse = {
    success: boolean;
};
export type ReferenceOption = {
    id: string;
    label: string;
};
export type ReferenceOptionsResponse = {
    options: ReferenceOption[];
};
export type PublicBookingService = {
    id: string;
    siteId: string;
    title: string;
    description: string | null;
    durationMinutes: number;
    pricing?: BookingPricing;
    priceAmount: number | null;
    priceCurrency: string | null;
    paymentTerms: BookingPaymentTermsConfig;
    paymentTermsAvailability: PublicBookingPaymentTermsAvailability;
};
export type PublicBookingAvailabilityQuery = {
    siteId: string;
    serviceId: string;
    resourceId?: string;
    startDate: string;
    endDate: string;
    timezone?: string;
};
export type PublicBookingAvailableDatesResponse = {
    dates: string[];
    startDate: string;
    endDate: string;
    hasMore: boolean;
    nextStartDate?: string;
};
export type PublicBookingAvailableSlotsResponse = {
    slots: TimeSlot[];
};
export type PublicCreateBookingAppointmentRequest = {
    formId: string;
    serviceId: string;
    resourceId?: string | null;
    startAt: string;
    endAt: string;
    customFields: Record<string, unknown>;
    timezone?: string;
    discountCode?: string;
    selectedCollectionOptionKind?: "upfront" | "deferred_manual" | "instalment_plan" | "flexible_balance";
    altchaSolution?: string | null;
    successUrl?: string;
    cancelUrl?: string;
};
export type PublicBookingAppointmentSummary = {
    id: string;
    status: "confirmed" | "pending" | "cancelled";
    startAt: string;
    endAt: string;
    timezone: string;
    resourceName: string | null;
};
export type PublicBookingCustomerSummary = {
    id: string;
    email: string | null;
    name: string | null;
    phone: string | null;
};
export type PublicCreateBookingAppointmentResponse = {
    type: "booked";
    orderId: string;
    orderNumber: string;
    appointment: PublicBookingAppointmentSummary;
    customer: PublicBookingCustomerSummary;
} | {
    type: "checkout_redirect";
    orderId: string;
    orderNumber: string;
    checkoutUrl: string;
    sessionId: string;
    appointment: PublicBookingAppointmentSummary;
    customer: PublicBookingCustomerSummary;
};
export type PublicBookingAppointmentStatusResponse = {
    appointmentId: string;
    appointmentStatus: "pending" | "confirmed" | "cancelled";
    resourceName: string | null;
    paymentStatus: "pending" | "completed" | "failed" | "cancelled" | "refunded" | "not_required";
};
export type BookingSessionMeResponse = {
    customer: {
        id: string;
        email: string | null;
        name: string | null;
        phone: string | null;
    };
    session: {
        siteId: string;
        expiresAt: string;
    };
};
export type BookingSessionUpdateMeRequest = {
    name?: string;
    phone?: string | null;
};
export type BookingSessionUpdateMeResponse = {
    customer: {
        id: string;
        email: string | null;
        name: string | null;
        phone: string | null;
    };
};
export type BookingAppointmentWithDetails = {
    id: string;
    siteId: string;
    serviceId: string;
    resourceId: string | null;
    customerId: string;
    startAt: string;
    endAt: string;
    timezone: string;
    status: string;
    createdAt: string;
    updatedAt: string;
    customerName: string;
    customerEmail: string;
    serviceName: string;
    resourceName: string;
    cancellation: {
        canCancel: boolean;
        defaultRefund: "refund" | "no_refund";
        canOverrideRefund: boolean;
        refundCutoffAt: string | null;
        remainingRefundableCents: number | null;
        currency: string | null;
    };
};
export type AppointmentBookingQuestionsTask = {
    status: "complete" | "incomplete" | "overdue";
    dueAt: string;
    completedAt: string | null;
    prefillAvailable: boolean;
};
export type BookingSessionListAppointmentsResponse = {
    appointments: BookingAppointmentWithDetails[];
    pagination: {
        limit: number;
        offset: number;
        count: number;
    };
};
export type BookingSessionCreateAppointmentRequest = Omit<PublicCreateBookingAppointmentRequest, "altchaSolution" | "cancelUrl" | "discountCode" | "selectedCollectionOptionKind" | "successUrl"> & {
    customerPassId: string;
};
export type BookingSessionCreateAppointmentResponse = PublicCreateBookingAppointmentResponse;
export type BookingSessionEligibleAppointmentPackage = {
    customerPassId: string;
    passId: string;
    passName: string;
    passDescription: string | null;
    creditsRemaining: number;
    creditsTotal: number;
    expiresAt: string | null;
};
export type BookingSessionListEligibleAppointmentPackagesResponse = {
    packages: BookingSessionEligibleAppointmentPackage[];
};
export type BookingSessionGetAppointmentResponse = {
    appointment: BookingAppointmentWithDetails;
};
export type BookingSessionCancelAppointmentRequest = {
    confirmCancelWithoutRefund?: boolean;
};
export type BookingSessionCancelAppointmentResponse = {
    result: {
        cancelled: boolean;
        refunded: boolean;
        refund?: {
            status: "succeeded" | "failed" | "skipped";
            amountCents: number | null;
            currency: string | null;
            paymentLast4: string | null;
            stripeRefundId: string | null;
            errorMessage?: string;
            errorCode?: string;
        };
        requiresCancelWithoutRefundConfirmation?: boolean;
        failedToRestoreCredit?: boolean;
        message: string;
    };
};
export type AdminBookingCancellationResult = {
    cancelled: boolean;
    refunded: boolean;
    refund?: {
        status: "succeeded" | "failed" | "skipped";
        amountCents: number | null;
        currency: string | null;
        paymentLast4: string | null;
        stripeRefundId: string | null;
        errorMessage?: string;
        errorCode?: string;
        totalRefundedCents?: number;
        remainingRefundableCents?: number | null;
    };
    emailSent: boolean;
    message: string;
};
export type BookingSessionListEventsResponse = {
    registrations: Array<Record<string, unknown>>;
    pagination: {
        limit: number;
        offset: number;
        count: number;
    };
};
export type BookingSessionGetEventResponse = {
    registration: Record<string, unknown>;
};
export type BookingSessionListMembershipsResponse = {
    memberships: Array<Record<string, unknown>>;
};
export type BookingSessionListPassesResponse = {
    passes: Array<Record<string, unknown>>;
};
export {};
