import { BillToModel, ShipToModel } from "@insite/client-framework/Types/ApiModels";

type BillingAddressFormState = {
    address: BillToModel;
    formErrors: {
        [key: string]: React.ReactNode;
    };
};

type ShippingAddressFormState = {
    address: ShipToModel;
    formErrors: {
        [key: string]: React.ReactNode;
    };
};

export default interface OnePageCheckoutState {
    cartId?: string;
    isSavingShipping: boolean;
    isBillingAddressTheSameAsShipping: boolean;
    billingAddressFormState?: BillingAddressFormState;
    shippingAddressFormState?: ShippingAddressFormState;
    isBillingAddressUpdateRequired: boolean;
    isShippingAddressUpdateRequired: boolean;
    isUpdatingCustomer: boolean;
    paymentDetailsState: "waiting" | "active" | "complete";
    isPlacingOrder: boolean;
    placeOrderErrorMessage?: string;
    requestedDeliveryDate?: Date | null;
    requestedDeliveryDateDisabled?: boolean;
    requestedPickupDate?: Date | null;
    requestedPickUpDateDisabled?: boolean;
}
