import { IStringKeyRecord } from "./utils"; export * from "./kiosk"; export * from "./kioskErrors"; export * from "./api"; export * from "./loyalty"; export { type IStringKeyRecord } from "./utils"; export interface IRestaurant { id: string; name: string; geoPosition: IGeoPosition; address: IAddress; } export interface IGeoPosition { lat: number; lng: number; } export interface IAddress { street: string; number: string; postal: string; city: string; country: string; } export declare enum ECouponViewType { CAROUSEL = "carousel", NORMAL = "normal", IMAGE = "image" } export interface ICoupon { id: string; img: string; viewType?: ECouponViewType; size?: "md" | "lg"; price?: number; name?: string; endDate?: string; timeToEnd?: any; } export interface ILanguage { label: string; key: string; icon: any; } export type TStringBoolean = "true" | "false"; export declare enum EProductKind { GROUP = "3e/group", PRODUCT = "3e/product", CATEGORY = "3e/group/category", OPTIONS = "3e/group/options", CONFIG = "3e/group/config", GROUP_UPSELL = "3e/group/upsell", STATIC = "3e/static", REF = "3e/ref", QUERY = "3e/query", CMS = "3e/cms" } export declare enum EProductKindBucket { GROUP = "group", PRODUCT = "product" } export type TLiterals = { name: string; upsizeName?: string; fiscal?: string; "target-product-id"?: string; description?: string; } & IStringKeyRecord; export type TMedia = { url: string; name: string; }; type TDetails = { literals?: TLiterals; media?: TMedia[]; }; export interface IProductAvailability { MON?: string[]; TUE?: string[]; WED?: string[]; THU?: string[]; FRI?: string[]; SAT?: string[]; SUN?: string[]; } /** * IProductExtra interface * * @interface IProductExtra * @related {string} comma separated related products IDs */ export interface IProductExtra extends IStringKeyRecord { /** * comma separated values */ tags?: string; /** * stringified nutrients object */ nutrients?: string; related?: string; category?: string; "ALLOW-MULTIPLE-LINE"?: "true" | "false"; "rbi-reward"?: "true" | "false"; "rbi-offer"?: "true" | "false"; "rbi-rewards-cat"?: "true" | "false"; "rbi-offers-cat"?: "true" | "false"; "rbi-reward-points"?: string; /** * CSS column span of ui item in grid */ viewCols?: string; /** * CSS column span of ui item in grid */ viewRows?: string; /** * CSS column start of ui item in grid */ "col-start"?: string; /** * CSS row start of ui item in grid */ "row-start"?: string; } interface IMenuItem { id: string; _?: IProductExtra; kind: EProductKind | EProductKindBucket; details?: TDetails; state?: IProductState; emit?: IProductEmit; items?: IMenuProduct[]; price?: string; vat?: string; minPrice?: string; selCtx?: string; fltCtx?: string; weighted?: boolean; qtyMin?: string; qtyMax?: string; availability?: IProductAvailability; bom?: IStringKeyRecord<{ unit: string; qty: string; }>; outsideAvailabilitySlot?: boolean; __?: IProductFrontAttributes; } export interface ICmsReference extends Pick { kind: EProductKind.CMS; reference: string; } export interface IStatic extends Pick { kind: EProductKind.STATIC; details: TDetails; } export interface IGroupConfig extends IMenuItem { kind: EProductKind.CONFIG; details?: TDetails; selCtx?: string; fltCtx?: string; attrs?: IGroupAttributes; filter?: IProductFilter; } export interface IGroupOptions extends IMenuItem { kind: EProductKind.OPTIONS; details?: TDetails; selCtx?: string; fltCtx?: string; attrs?: IGroupAttributes; filter?: IProductFilter; } export interface IMenuCategory extends Pick { kind: EProductKind.CATEGORY; } export interface IMenuProduct extends IMenuItem { kind: EProductKind.PRODUCT; } export type MenuProduct = IMenuCategory | ICmsReference | IStatic | IGroupConfig | IGroupOptions | IMenuProduct; /** * IProductFrontAttributes * * @interface IProductFrontAttributes attributes are added by useMenu hook * @isHiddenByEnableKey {boolean} product has not been enabled by one of its enableKeys */ export interface IProductFrontAttributes extends IStringKeyRecord { isHiddenByEnableKey?: boolean; lineExtra?: IStringKeyRecord; cmsData?: any; } export declare const ALLERGENS: readonly ["GLU", "CRU", "EGG", "FSH", "PEA", "SOY", "LAC", "NUT", "CEL", "MUS", "SES", "SO2", "LUP", "MOL"]; export type AllergenKey = (typeof ALLERGENS)[number]; export declare const NUTRIENTS: readonly ["kcal", "fat", "fatSat", "fatTrans", "carbo", "carboSug", "protein", "fiber", "salt"]; export type NutrientKey = (typeof NUTRIENTS)[number]; export interface IProduct { availability?: IProductAvailability; allergensInfo?: { contain?: AllergenKey[]; mayContain?: AllergenKey[]; }; id: string; img?: string; reference?: string; items?: IProduct[]; kind: EProductKind | EProductKindBucket; literals?: TLiterals; details?: { literals?: TLiterals; media?: TMedia[]; }; drs?: string; price?: string; minPrice?: string; quantity?: string; vat?: string; nutritional?: { [key in NutrientKey]?: number; }; outsideAvailabilitySlot?: boolean; physicalInfo?: { weight?: number; volume?: number; }; state?: IProductState; selCtx: string; filter?: IProductFilter; fltCtx?: string; emit?: IProductEmit; isSup?: boolean; qtyMin?: string; qtyMax?: string; _?: IProductExtra; bom?: IStringKeyRecord<{ unit: string; qty: string; }>; attrs?: IGroupAttributes; __?: IProductFrontAttributes; } export interface IGroupAttributes { selMin?: string; selMax?: string; qtyMin?: string; qtyMax?: string; vital?: boolean; allowFraction?: boolean; allowMultiple?: boolean; hidden?: boolean; } export interface IProductState { selected: IProductStateSelected; filter: IProductStateFilter; } export interface IProductStateFilter { [flxCtx: string]: { [id: string]: string; }; } export interface IProductStateSelected { [selCtx: string]: { [id: string]: string; }; } export interface IProductEmit { [id: string]: string; } export interface IProductFilter { [fltCtx: string]: string[]; } export interface IUser { userId?: string; roles?: Array; name?: string; phone?: string; email?: string; extra?: IStringKeyRecord; } export declare enum EOrderUserRole { CREATOR = "CREATOR", CUSTOMER = "CUSTOMER", COUPONS = "COUPON", KIOSK = "KIOSK", WAITER = "WAITER", MANAGER = "MANAGER", VIEWER = "VIEWER", DRIVER = "DRIVER", STAFF = "STAFF" } export declare enum EOrderType { TAKE_AWAY = "TAKE_AWAY", DELIVERY = "DELIVERY", DINE_IN = "DINE_IN", DINE_IN_OPEN = "DINE_IN_OPEN", GLOVO_DELIVERY = "GLOVO_DELIVERY", GLOVO_TAKE_AWAY = "GLOVO_TAKE_AWAY", JUSTEAT_DELIVERY = "JUSTEAT_DELIVERY", JUSTEAT_TAKE_AWAY = "JUSTEAT_TAKE_AWAY", UBER_DELIVERY = "UBER_DELIVERY", UBER_TAKE_AWAY = "UBER_TAKE_AWAY", UBER_DINE_IN = "UBER_DINE_IN", WOLT_DELIVERY = "WOLT_DELIVERY", WOLT_TAKE_AWAY = "WOLT_TAKE_AWAY", WOLT_DINE_IN = "WOLT_DINE_IN", BOLT_DELIVERY = "BOLT_DELIVERY", BOLT_TAKE_AWAY = "BOLT_TAKE_AWAY", BOLT_DINE_IN = "BOLT_DINE_IN", TAZZ_DELIVERY = "TAZZ_DELIVERY", TAZZ_TAKE_AWAY = "TAZZ_TAKE_AWAY", UPMENU_DELIVERY = "UPMENU_DELIVERY", UPMENU_TAKE_AWAY = "UPMENU_TAKE_AWAY", UPMENU_DINE_IN = "UPMENU_DINE_IN" } export declare enum EOrderSource { KIOSK = "KIOSK", WEB = "WEB", JUST_EAT_TAKE_AWAY = "JUSTEATTAKEAWAY", GLOVO = "GLOVO", PYSZNE = "PYSZNE", WOLT = "WOLT", UBER = "UBER", BOLT = "BOLT", TAZZ = "TAZZ", POS = "POS", UPMENU = "UPMENU", APP = "APP", CASHIER = "CASHIER" } export declare const CHANNEL_NAMES: readonly ["DINE_IN", "TAKE_AWAY", "DELIVERY", "GLOVO", "JUSTEAT", "UBER", "BOLT", "WOLT", "TAZZ", "UPMENU"]; export declare enum EChannelName { DINE_IN = "DINE_IN", TAKE_AWAY = "TAKE_AWAY", DELIVERY = "DELIVERY", GLOVO = "GLOVO", JUSTEAT = "JUSTEAT", UBER = "UBER", BOLT = "BOLT", WOLT = "WOLT", TAZZ = "TAZZ", UPMENU = "UPMENU" } export interface IOrderDeliveryAddress { street: string; number: string; door?: string; postal?: string; city: string; country: string; } export declare const TEST_VARIANTS: readonly ["A", "B"]; export type TestVariant = (typeof TEST_VARIANTS)[number]; export interface IOrder { tenant: string; id: string; extId?: string; created: string; due?: string; closedDate?: string; lastChanged?: string; completedTime?: string; verifiedTime?: string; processingStartedTime?: string; deliveredTime?: string; source: string; users?: IUser[]; loyaltyId?: string; coupons?: IOrderCoupon[]; orderType: EOrderType; deliveryAddress?: IOrderDeliveryAddress; geoPosition?: { lat: number; lng: number; }; total: string; editTotal: string; status: EOrderStatus; statusInfo?: string; comments?: IOrderComment[]; claimCode?: string; buckets?: IOrderInBucket[]; payments?: IOrderPayment[]; fiscal?: IOrderFiscal[]; tax?: ITaxSummary[]; extra?: IOrderExtra; traces?: { [propName: string]: string; }; logs?: IOrderLog[]; locked?: boolean; completed?: boolean; verified?: boolean; closed?: boolean; variant?: TestVariant; drsSummary?: [ { deposit: string; count: number; confirmed: boolean; } ]; } export interface IOrderCoupon { coupon: string; addedAt: string; addedBy?: string; id: string; data?: { campaign?: string; categoryId?: string; productId?: string; enableKey?: string | string[]; couponKey?: string; userId?: string; extra?: IStringKeyRecord; }; } export declare enum EOrderStatus { NEW = "NEW", COMPLETED = "COMPLETED",// Payments === total VERIFIED = "VERIFIED",// auto or manually set when conditions are met i.e fiscalization DELIVER = "DELIVER",// all lines have final state DELIVERED = "DELIVERED", CLOSED = "CLOSED", ABANDONED = "ABANDONED", CANCELLED = "CANCELLED", PICKED = "PICKED" } export interface IOrderComment { id: string; creator: string; timestamp?: string; comment: string; extra?: IStringKeyRecord; } export interface IOrderInBucket { venue: string; sync?: boolean; syncId?: string; name: string; menu: string; lines: IOrderLine[]; priceList?: string; warehouse?: string; queuePos?: string; extra?: IStringKeyRecord; } export interface IOrderPayment { id: string; type: EOrderPaymentType; source: string; amount: number | string; initialAmount?: number | string; user?: string; timestamp?: string; extra?: IStringKeyRecord; deferred?: boolean; } export declare enum EOrderPaymentType { CARD = "CARD", CARD_CLOUD = "CARD_CLOUD", CASH = "CASH", COD = "COD", COUPON = "COUPON", EPAYMENT = "EPAYMENT", EXTERNAL = "EXTERNAL", GIFTCARD = "GIFTCARD", PREAUTHORIZED = "PREAUTHORIZED", RETURN = "RETURN", TERMINAL = "TERMINAL", WALLET = "WALLET" } export interface IOrderFiscal { timestamp: string; user?: string; venue?: string; amount: number; printer: string; slip: string; taxId?: string; message?: string; entries?: ISlipEntry[]; payments?: { [propName: string]: number; }; subTotalDiscounts?: ISubTotalDiscount[]; extra?: IStringKeyRecord; } export interface ITaxSummary { rate: string; confirmed?: boolean; netto: number; tax: number; brutto: number; } export declare enum ERbiOrderExtra { LOYALTY_ID = "x-ext-loyalty-id", TRANSACTION_ID = "x-rbi-id", ITEMS_EXTENSIONS = "x-rbi-ext", POINTS_TOTAL = "x-rbi-loyalty-points", POINTS_EARNED = "x-rbi-points-earned", REWARDS = "x-rbi-rewards", OFFERS = "x-rbi-offers", CUSTOMER_NAME = "x-customer-name" } /** * OrderExtra interface * * @interface IOrderExtra * @manual-verify {string} order needs manual verification * @x-collect-time {string} estimated pickup time from aggregator * @courier-name {string} courier name from aggregator * @courier-phone {string} courier phone from aggregator * @customer-name {string} customer name from aggregator * @customer-phone {string} customer phone from aggregator * @requiresVatInvoice {boolean} * @allergies {string} customer allergies from aggregator * @x-agg-id {string} order ID from aggregator * @support-order-id {string} order code from aggregator to be used with support and same as seen by customer, * @x-rbi-loyalty-points {string} current user RBI loyalty points * @x-rbi-points-earned {string} RBI loyalty points to be earned for a current order basket * @x-rbi-rewards {string} comma separated product IDs of preselected RBI REWARDS * @x-rbi-offers {string} comma separated product IDs of preselected RBI OFFERS */ interface IOrderExtra { "x-source"?: EOrderSource; "x-source-type"?: "INTEGRATOR"; "manual-verify"?: string; "x-collect-time"?: string; "courier-name"?: string; "courier-phone"?: string; "customer-name"?: string; "customer-phone"?: string; requiresVatInvoice?: string; allergies?: string; "x-agg-id"?: string; "support-order-id"?: string; "x-pos-id"?: string; "company-tax-id"?: string; "x-kiosk-id"?: string; "x-table-number"?: string; "x-tax-id"?: string; [ERbiOrderExtra.OFFERS]?: string; [ERbiOrderExtra.REWARDS]?: string; [ERbiOrderExtra.POINTS_EARNED]?: string; [ERbiOrderExtra.POINTS_TOTAL]?: string; [ERbiOrderExtra.CUSTOMER_NAME]?: string; [key: string]: string | undefined; } export interface IOrderLog { timestamp?: string; user?: string; ip?: string; message?: string; lines?: string[]; } export interface IOrderLine { bom?: IStringKeyRecord; comments?: IOrderComment[]; created: string; creator?: string; discounts?: IDiscount[]; drsSummary?: Array<{ deposit: string; count: number; }>; extra?: IStringKeyRecord; hash: string; id: string; price: string; product: IOrderProduct; productConfig?: Partial; productId: string; quantity: number; source: string; status: EOrderLineStatus; total: string; updated: string; } export interface ISlipEntry { item: string; qty: number; price: number; discount?: number; total: number; vat: string; } export interface ISubTotalDiscount { name: string; discount: number; vat: string; } export type IOrderGroupProduct = Pick; export interface IOrderProduct { id: string; kind: EOrderProductKind; literals: IProductLiterals; items?: Array; img?: string; quantity: string; price: string; drs?: string; vat?: string; extra?: IProductExtra; } export declare enum EOrderLineStatus { NEW = "NEW", TECHNICAL = "TECHNICAL", CONFIRMED = "CONFIRMED", PROCESSING = "PROCESSING", PROCESSED = "PROCESSED", VOID = "VOID", WASTE = "WASTE" } export interface IDiscount { layer: string; name?: string; discountPrice: number | string; type: string; product?: string; path?: string; price?: number | string; extra?: IStringKeyRecord; } export declare enum EOrderProductKind { GROUP = "group", PRODUCT = "product" } export interface IProductLiterals { [propName: string]: any; } export type TWeekDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN"; export type TSaleChannelWeek = Partial>; export interface ISaleChannel { active?: boolean; minDeliveryTime?: string; minOrderValue?: string; week?: TSaleChannelWeek; } export interface IVenueConfig { active?: boolean; address?: { city: string; country: string; number: string; postal: string; street: string; }; channelConstraints?: Partial>; description?: string; device?: IStringKeyRecord>; email?: string; extra?: IStringKeyRecord; geoPosition?: IGeoPosition; id: string; menu?: string; name: string; phone?: string; sync?: boolean; syncId?: string; tempDisabled?: boolean; tempDisabledReason?: string; timeZone: string; warehouse?: string; posIntegratorStatus?: { monitor: boolean; lastHeartBest: string; version: string; }; } export interface IFiscalEntry { discount?: string; item: string; price: string; qty: string; total: string; vat: string; } export interface IFiscalData { amount: string; entries: IFiscalEntry[]; payments: Partial>; timestamp: string; drsSummary?: [ { deposit: string; count: number; } ]; } /** * @interface IFiscalizeData * @timestamp {string} IsoString * */ export interface IFiscalizeData { timestamp: string; slip: string; printer: string; venue: string; amount: number; extra?: { FiscalReceiptId: string; FiscalDateTime: string; FiscalDeviceMemoryNo: string; USN: string; } | IStringKeyRecord; proforma?: boolean; user?: string; taxId?: string; message?: string; drsSummary?: Array<{ deposit: number; count: number; }>; } export declare const sizes: readonly [48, 57, 70, 100, 160, 250, 300, 500, 600, 900, 1000, 1920, 1080, 900]; export type TMediaSize = (typeof sizes)[number]; export declare enum ENotificationType { ORDER_MESSAGE = "OrderMessage", ORDER_EVENT_ERROR = "OrderEventError", ORDER_APPLIED_EVENTS = "OrderAppliedEvents", ORDER_EVENT_FISCAL = "OrderEventFiscal", ORDER_UPSELL = "OrderUpsell" } export type TUpsellKind = "ANY" | "POPUP" | "SIDE" | "BASKET" | "AUTOUPSELL" | "CART_ADDONS" | 'PACKAGING_UPSELL'; export interface IUpsellNotification { details: { literals?: IStringKeyRecord; media?: { url?: string; name: string; }[]; }; orderId: string; items: string[]; showAs: TUpsellKind; type: ENotificationType.ORDER_UPSELL; extra?: IStringKeyRecord; } /** * @interface INotificationMessage * correlationId can be directly in correlationId property, event.correlationId or events array */ export interface INotificationMessage { type: ENotificationType; users?: string[]; orderId: string; correlationId?: string; event?: { correlationId: string; user?: string; orderId?: string; }; events?: string[]; message?: string; codes?: { code: string; message: string; args?: string[]; }[]; fiscal?: IFiscalData; } export interface ICategory { id: string; name: string; img?: string; selectedSubcategory?: string; } export interface ISteeringCommand { /** * Only when receiving command */ correlationId?: string; command: string; venue: string; properties?: Record; } export declare const modules: readonly ["POS_INTEGRATOR", "KIOSK", "BI_CONNECTOR", "AGGREGATOR", "KDS", "STATUS_SCREEN", "LOYALTY_INTEGRATOR", "LOYALTY", "MOBILE_APP_LOYALTY", "ORDERING_WEB", "DELIVERY_PANEL", "CASHIER"]; export type TModuleType = (typeof modules)[number]; type VariantsConfig = Partial> & Partial>; interface IModuleConfig extends VariantsConfig { abTestingEnabled?: boolean; KIOSK_MEDIA_2_cmsId?: string; KIOSK_MEDIA_3_cmsId?: string; [key: string]: any; } export interface IModule { id: string; type: TModuleType; production: boolean; venue: string; created?: string; createdBy?: string; updated?: string; updatedBy?: string; user?: string; extra?: IStringKeyRecord; config?: IModuleConfig; } export interface IModuleCommonConfig { type: TModuleType; properties: { [key: string]: string; }; } export type ISODateTimeString = `${number}-${number}-${number}T${number}:${number}:${number}Z` | `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`; export interface IUserData { active: boolean; authStrategies: any[]; consents?: { TERMS_AND_CONDITIONS?: ISODateTimeString | undefined; COMMUNICATION_EMAIL?: ISODateTimeString | undefined; COMMUNICATION_EMAIL_MARKETING?: ISODateTimeString | undefined; } & Record; failedAttempts: number; firstName?: string; id?: string; lastName?: string; login: string; mfa?: boolean; phone?: string; properties: any; pushId?: string; roles: any[]; trusted?: boolean; UUID: string; deleteAfter?: string; } export interface IPublicTenantProperties extends IStringKeyRecord { defaultLanguage?: string; allowedLanguages?: string; currency?: string; fiscalFromPos?: "true" | "false"; } export interface IMenuLock { id: string; products?: string[]; instances?: string[]; lockedInChannel?: Partial>; description?: string; plannedLockExpirationDate?: string | null; lockReason?: string | null; } export declare enum EWSMenuClass { LOCK_REMOVE = ".LockRemove", LOCK_ADD = ".LockAdd", PRODUCT_CHANGE = ".ProductChange", IMPORT_MENU = ".ImportMenu", MENU_SET_CHANGE = ".MenuSetChange" } export interface IMenuWSInfo { class: EWSMenuClass; product?: string; lock?: IMenuLock; menu?: { id?: string; }; } export interface IValidLockRemoveInfo extends IMenuWSInfo { class: EWSMenuClass.LOCK_REMOVE; lock: IMenuLock; } export interface IValidLockAddInfo extends IMenuWSInfo { class: EWSMenuClass.LOCK_ADD; lock: IMenuLock; } export interface IValidProductChangeInfo extends IMenuWSInfo { class: EWSMenuClass.PRODUCT_CHANGE; product: string; }