import type { CheckoutEventLevel, CheckoutEventType, FulfillmentType } from '@/enums'; import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface'; import type { ICart, ICartUpdateItem } from '@/interfaces/api/cart.interface'; import type { IProductPresale } from '@/interfaces/api/product.interface'; export interface ICheckoutComplete { orderNumber: string; } export interface ICheckoutPaymentSession { key: string; secret: string; } export interface ICheckoutPaymentConfirmParams { confirmationTokenId: string; setupIntentId: string; } export interface ICheckoutPaymentConfirmCard { brand: string; expMonth: string; expYear: string; last4: string; } export interface ICheckoutPaymentConfirm { id: string; card: ICheckoutPaymentConfirmCard; } export interface ICheckoutCustomer { email: string; firstName: string; lastName: string; company: string; phone: string; birthDate: string; } export interface ICheckoutBilling { firstName: string; lastName: string; email: string; phone: string; company: string; one: string; two: string; city: string; state: string; zip: string; } export interface ICheckoutGiftRecipient { firstName: string; lastName: string; email: string; phone: string; message: string; } export interface ICheckoutMarketingPreferences { canEmail: boolean; canSms: boolean; } export interface ICheckoutDeliveryTip { fulfillmentId: string; tip: number; } export interface ICheckoutDeliveryInstructions { fulfillmentId: string; instructions: string; } export interface ICheckoutPrepareParams { cartId?: string; token?: string; customer?: ICheckoutCustomer; shippingAddressTwo?: string; billingAddress?: ICheckoutBilling; isGift?: boolean; billingSameAsShipping?: boolean; giftOptions?: ICheckoutGiftRecipient; marketingPreferences?: ICheckoutMarketingPreferences; deliveryTips?: ICheckoutDeliveryTip[]; deliveryInstructions?: ICheckoutDeliveryInstructions[]; payment?: string; promoCode?: string; giftCards?: string[]; } export interface ICheckoutUpdateItem { id?: string; partNumber: string; quantity: number; fulfillmentId: string; engravingLines?: string[]; } export interface ICheckoutItemsUpdateParams { cartId: string; items: ICheckoutUpdateItem[]; location?: ILocation; } export interface ICheckoutItemsUpdateResponse { cart: ICart; checkout: ICheckoutPrepare; } export interface IAnonymousCheckoutAddProductItem { identifier: string; fulfillmentType: FulfillmentType; quantity: number; } export interface IAnonymousCheckoutAddProductParams { items?: IAnonymousCheckoutAddProductItem[]; cartItems?: ICartUpdateItem[]; location: ILocation; promoCode?: string; } export interface IAnonymousCheckoutUnavailableItem { identifier: string; productName: string | null; fulfillmentType: FulfillmentType; reason: 'product_not_available' | 'fulfillment_not_available'; } export interface IAnonymousCheckoutAddProductResponse { checkout: ICheckoutPrepare | null; unavailableItems: IAnonymousCheckoutUnavailableItem[]; } export interface ICheckoutAmounts { subtotal: number; engraving: number; service: number; shipping: number; delivery: number; platform: number; discounts: number; giftCards: number; tax: number; tip: number; total: number; } export interface ICheckoutPromoCode { code: string; discount: number; freeDelivery: boolean; freeServiceFee: boolean; freeShipping: boolean; } export interface ICheckoutGiftCard { code: string; applied: number; } export interface ICheckoutShippingAddress { formattedAddress: string; address: IAddressAddress; coordinates: IAddressCoordinates; } export interface ICheckoutItemEngraving { isEngravable: boolean; isRequired: boolean; hasEngraving: boolean; fee: number; maxCharsPerLine: number; maxLines: number; location: string; lines: string[]; } export interface ICheckoutItemAttributes { engraving: ICheckoutItemEngraving; presale: IProductPresale; } export interface ICheckoutItem { variantId: string; cartItemId: string; liquidId: string; retailerId: string; fulfillmentId: string; salsifyPid?: string; salsifyGrouping?: string; name: string; catPath: string; volume: string; uom: string; proof: string; abv: string; containerType: string; container: string; size: string; pack: boolean; packDesc: string; mainImage: string; brand: string; partNumber: string; upc: string; sku: string; price: number; unitPrice: number; quantity: number; tax: number; unitTax: number; bottleDeposits: number; attributes: ICheckoutItemAttributes; } export interface ICheckoutFulfillment { id: string; deliveryInstructions: string; type: FulfillmentType; expectation: string; engravingExpectation: string; itemIds: string[]; doesAllowPromos: boolean; doesAllowGiftCards: boolean; amounts: ICheckoutAmounts; itemsQuantity: number; } export interface ICheckoutRetailer { id: string; name: string; fulfillments: Record; amounts: ICheckoutAmounts; } export interface ICheckoutPresale { isLocked: boolean; expiresAt: string; } export interface ICheckoutEvent { type: CheckoutEventType; message: string; level: CheckoutEventLevel; } export interface ICheckoutPrepare { token: string; cartId: string; customer: ICheckoutCustomer; isGift: boolean; billingSameAsShipping: boolean; payment?: string; giftOptions: ICheckoutGiftRecipient; marketingPreferences: ICheckoutMarketingPreferences; shippingAddress: ICheckoutShippingAddress; billingAddress: ICheckoutBilling; promoCode: ICheckoutPromoCode | null; amounts: ICheckoutAmounts; giftCards: ICheckoutGiftCard[]; presale: ICheckoutPresale | null; itemsQuantity: number; items: Record; retailers: Record; events: ICheckoutEvent[]; }