import { AddressesAddressDataDto as AddressDataDto, GetPickProductDiscountOptionsForOrderResponse, GetProductsResponse, OrdersDtoOrderDto as OrderDto, OrdersOpenOrderAmounts as OpenOrderAmounts, PrefigureDiscountsResponse, OrdersProductRequirementModel as ProductRequirementModel, SetPickProductDiscountOptionsForOrderLine, GetAddressRequirementsResponse, UsersUserDto as UserDto, CardBalanceCheckResponse, GetOrderLoyaltyDataResponse, UsersSubscriptionsUserSubscriptionDto, AddressesAddressBookDto } from "@springtree/eva-services-core"; import { LoyaltyGetUserLoyaltyBadgesResponse_LoyaltyProgramBadgeDto, LoyaltyGetUserLoyaltyTierDetailsResponse_LoyaltyProgramTierDto } from "@springtree/eva-services-core-management"; import { IClientAppMessagePayload } from "./client-app-hub.js"; export type TCheckoutStatus = "started" | "stopped" | "completed"; /** * The order update payload for the CFD to display */ export interface IClientAppCFDOrderUpdatePayload extends IClientAppMessagePayload { Action: "cfd:orderUpdate"; Data: { /** * The current order details */ Order: OrderDto; /** * The current order amounts data: (sub)totals, discounts, taxes, etc */ Amounts: OpenOrderAmounts; /** * The details of the payment that was started or finished */ Payment?: { Method: string; ChangeAmount?: number; Success?: boolean; Status?: TCheckoutStatus; }; /** * Potential discount details for display purposes. Always sent if available */ PrefigureDiscounts?: PrefigureDiscountsResponse; /** * Potential discount products for display purposes. Always sent if available */ DiscountProducts?: GetProductsResponse; /** * Potential gift product choices for display purposes. Always sent if available */ PickProductDiscountsForOrder?: GetPickProductDiscountOptionsForOrderResponse; /** * The status of the checkout in the POS. Defaults to 'stopped' */ CheckoutStatus: "started" | "stopped" | "completed"; /** * Optional additional content */ AdditionalContent?: { QrCode?: string; QrTitle?: string; QrSubTitle?: string; OrderAppToken?: string; IsInLocalMode?: boolean; GiftcardBalanceCheck?: CardBalanceCheckResponse; Subscription?: UsersSubscriptionsUserSubscriptionDto; }; /** * Product requirements for current order lines. Always sent if available */ ProductRequirements?: ProductRequirementModel[]; }; } /** * The pick discount production selection response from CFD to POS */ export interface IClientAppCFDPickDiscountProductResponsePayload extends IClientAppMessagePayload { Action: "cfd:pickDiscountProductResponse"; Data: SetPickProductDiscountOptionsForOrderLine; } /** * The user details confirmation feedback event payload. * User will be presented their details and an opt-in for the newsletter to confirm */ export interface IConfirmUserDetails { /** * A UUID v4 to identify which user details confirm request answer is received */ RequestID: string; /** * The identifier of the user */ UserID: string; /** * The email address of the user */ Email: string; /** * The phone number of the user */ PhoneNumber?: string; /** * Optional opt-in choice for a newsletter subscription */ SubscribeToNewsletter: boolean; /** * Can be used to indicate the user cancelled the details confirm */ Cancelled?: boolean; } /** * The user details confirmation request payload from POS to CFD */ export interface IClientAppCFDConfirmUserDetailsPayload extends IClientAppMessagePayload { Action: "cfd:confirmUserDetails"; Data: IConfirmUserDetails; } /** * The user details confirmation response payload from CFD to POS */ export interface IClientAppCFDConfirmUserDetailsResponsePayload extends IClientAppMessagePayload { Action: "cfd:confirmUserDetailsResponse"; Data: IConfirmUserDetails; } /** * A message to indicate the CFD can go idle */ export interface IClientAppCFDIdlePayload extends IClientAppMessagePayload { Action: "cfd:idle"; } /** * A user form button */ export interface ICFDUserFormButton { title: string; action: string; role?: string; } export type TCFDUserFormFieldType = "text" | "multilineText" | "email" | "number" | "decimal" | "date" | "dateTime" | "address" | "enum" | "boolean" | "phone" | "signature" | "blob" | "star"; /** * A field for a user form */ export interface ICFDUserFormField { addressRequirements?: { countryId: string; requirements: GetAddressRequirementsResponse["AddressRequirements"]; }; blobUrl?: string; description?: string; disabled?: boolean; enumOptions?: { key: string; value: string; }[]; id: string; isArray?: boolean; maxLength?: number; minLength?: number; maxDate?: string; minDate?: string; maxValue?: number; minValue?: number; placeholder?: string; remarks?: string; required?: boolean; sectionData?: { id: string; name: string; }; title: string; type: TCFDUserFormFieldType; valid?: boolean; validationDetailsMessage?: { maxLength?: string; minLength?: string; addressFields?: { [key: string]: string; }; }; validationMessage?: string; value?: string | number | boolean | AddressDataDto | string[]; } /** * A user form */ export interface ICFDUserForm { title: string; fields: ICFDUserFormField[]; buttons: ICFDUserFormButton[]; description?: string; /** * The user form type indicates the purpose of the form and may * trigger specific views in the CFD * * - onboarding: 1st time customer signup * - orderUser: customer initiated (on CFD) sign up * - email: request an email address for customer lookup * - signature: get a signature from the customer * - survey: display a survey to the customer * - searchCustomer: search for a customer by name or email * * email form expects at least one field of type email * signature form expects at least one field of type signature */ type: "onboarding" | "orderUser" | "email" | "signature" | "survey" | "searchCustomer"; content?: { qrCode?: string; blobUrl?: string; }; } /** * A user form request message sent from POS to the CFD */ export interface IClientAppCFDUserFormPayload extends IClientAppMessagePayload { Action: "cfd:userForm"; Data: { form: ICFDUserForm; }; } /** * A user form response message sent from CFD to POS for processing */ export interface IClientAppCFDUserFormResponsePayload extends IClientAppMessagePayload { Action: "cfd:userFormResponse"; Data: { form: ICFDUserForm; buttonAction: string; }; } /** * This message is a request from the CFD to client App to attach a user to the * (current) order. A user could have been identified by scanning a card or qr */ export interface IUserOrderAction { /** * The identifier of the user */ UserID: string; /** * The identifier of the order */ OrderID: string; } /** * The attach user to order payload for a message from CFD to POS */ export interface IClientAppCFDAttachUserToOrderPayload extends IClientAppMessagePayload { Action: "cfd:attachUserToOrder"; Data: IUserOrderAction; } /** * The detach user from order payload for a message from CFD to POS */ export interface IClientAppCFDDetachUserToOrderPayload extends IClientAppMessagePayload { Action: "cfd:detachUserFromOrder"; Data: IUserOrderAction; } export interface IUpdateUserForOrder { /** * The user details */ User: UserDto; /** * The identifier of the order to attach the user to */ OrderID: string; } export interface IClientAppCFDRequestUserOrderFormPayload extends IClientAppMessagePayload { Action: "cfd:requestUserOrderForm"; Data: IUserOrderAction; } /** * A message to indicate the CFD can start scanning for loyalty card */ export interface IClientAppCFDLoyaltyCardScanPayload extends IClientAppMessagePayload { Action: "cfd:loyaltyCardScan"; } /** * A message from POS to CFD to start scanning */ export interface IClientAppCFDStartScanPayload extends IClientAppMessagePayload { Action: "cfd:startScan"; Data: { type: "loyaltyCard" | "coupon" | "giftcard"; }; } /** * A message that includes the result of a scan from CFD to POS */ export interface IClientAppCFDScanResponsePayload extends IClientAppMessagePayload { Action: "cfd:scanResponse"; Data: { barcode: string; }; } /** * A message to cancel scanning either from POS or CFD */ export interface IClientAppCFDCancelScanPayload extends IClientAppMessagePayload { Action: "cfd:cancelScan"; } /** * A message from either from POS or CFD to start headless onboarding or signal that it has started */ export interface IClientAppCFDStartOnboardingPayload extends IClientAppMessagePayload { Action: "cfd:startOnboarding"; Data: { fields: ICFDUserFormField[]; }; } /** * A message from CFD to POS that includes the result of completing headless onboarding process */ export interface IClientAppCFDOnboardingCompletedPayload extends IClientAppMessagePayload { Action: "cfd:customerCreatedSuccessfully"; Data: { customerID: string; }; } /** * A message either from POS or CFD to cancel headless onboarding process */ export interface IClientAppCFDCancelOnboardingPayload extends IClientAppMessagePayload { Action: "cfd:cancelOnboarding"; } /** * A message from CFD to POS to request loyalty data */ export interface IClientAppCFDRequestLoyaltyDataPayload extends IClientAppMessagePayload { Action: "cfd:requestLoyaltyData"; } /** * A message from POS to CFD that includes loyalty program data */ export interface IClientAppCFDLoyaltyProgramDataPayload extends IClientAppMessagePayload { Action: "cfd:loyaltyProgramData"; Data: { loyaltyProgram: GetOrderLoyaltyDataResponse; badges: LoyaltyGetUserLoyaltyBadgesResponse_LoyaltyProgramBadgeDto; tiers: LoyaltyGetUserLoyaltyTierDetailsResponse_LoyaltyProgramTierDto; }; } /** * A message from CFD to POS to request profile subscriptions data */ export interface IClientAppCFDRequestProfileSubscriptionDataPayload extends IClientAppMessagePayload { Action: "cfd:requestProfileSubscriptionsData"; } /** * A message from POS to CFD that includes profile subscriptions data */ export interface IClientAppCFDProfileSubscriptionsDataPayload extends IClientAppMessagePayload { Action: "cfd:profileSubscriptionsData"; Data: { subscriptions: UsersSubscriptionsUserSubscriptionDto[]; }; } /** * A message from CFD to POS that requests to save the selected profile subscriptions */ export interface IClientAppCFDSaveProfileSubscriptionsPayload extends IClientAppMessagePayload { Action: "cfd:saveProfileSubscriptions"; Data: { selectedSubscriptionIDs: string[]; }; } /** * A message from POS to CFD to indicate that the profile subscriptions have been saved */ export interface IClientAppCFDProfileSubscriptionsSavedPayload extends IClientAppMessagePayload { Action: "cfd:profileSubscriptionsSaved"; } /** * A message from CFD to POS to request profile loyalty programs data */ export interface IClientAppCFDRequestProfileLoyaltyProgramsDataPayload extends IClientAppMessagePayload { Action: "cfd:requestProfileLoyaltyProgramsData"; } /** * A message from POS to CFD that includes profile loyalty programs data */ export interface IClientAppCFDProfileLoyaltyProgramsDataPayload extends IClientAppMessagePayload { Action: "cfd:profileLoyaltyProgramsData"; Data: { subscriptions: UsersSubscriptionsUserSubscriptionDto[]; }; } /** * A message from CFD to POS that requests to save the selected profile loyalty programs */ export interface IClientAppCFDSaveProfileLoyaltyProgramsPayload extends IClientAppMessagePayload { Action: "cfd:saveProfileLoyaltyPrograms"; Data: { selectedSubscriptionIDs: string[]; }; } /** * A message from POS to CFD to indicate that the profile loyalty programs have been saved */ export interface IClientAppCFDProfileLoyaltyProgramsSavedPayload extends IClientAppMessagePayload { Action: "cfd:profileLoyaltyProgramsSaved"; } /** * A message from CFD to POS to request profile addresses data */ export interface IClientAppCFDRequestProfileAddressesDataPayload extends IClientAppMessagePayload { Action: "cfd:requestProfileAddressesData"; } /** * A message from POS to CFD that includes profile addresses data */ export interface IClientAppCFDProfileAddressesDataPayload extends IClientAppMessagePayload { Action: "cfd:profileAddressesData"; Data: { addresses: AddressesAddressBookDto[]; }; } /** * A message from CFD to POS that requests to save the address book item * POS needs to react with 'cfd:profileAddressesData' */ export interface IClientAppCFDSaveProfileAddressPayload extends IClientAppMessagePayload { Action: "cfd:saveProfileAddress"; Data: { UserID: string; addressBookItem: AddressesAddressBookDto; }; } /** * A message from CFD to POS that requests the creation of a new address book item * POS needs to react with 'cfd:profileAddressesData' */ export interface IClientAppCFDCreateProfileAddressPayload extends IClientAppMessagePayload { Action: "cfd:createProfileAddress"; Data: { UserID: string; address: AddressDataDto; useAsDefaultBillingAddress: boolean; useAsDefaultShippingAddress: boolean; }; } /** * A message from CFD to POS to request order loyalty data */ export interface IClientAppCFDRequestOrderLoyaltyDataPayload extends IClientAppMessagePayload { Action: "cfd:requestOrderLoyaltyData"; } /** * A message from POS to CFD that includes order loyalty program data */ export interface IClientAppCFDOrderLoyaltyProgramDataPayload extends IClientAppMessagePayload { Action: "cfd:orderLoyaltyData"; Data: GetOrderLoyaltyDataResponse; } /** * A message from CFD to POS to request order subscription data * POS needs to react with 'cfd:orderUpdate' with additional content 'Subscription' */ export interface IClientAppCFDRefreshOrderSubscriptionPayload extends IClientAppMessagePayload { Action: "cfd:refreshOrderSubscription"; } //# sourceMappingURL=client-app-hub-cfd.d.ts.map