@final-commerce/common 2.6.0-staging.4 → 2.7.0-preprod.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/gate-done.mjs +5 -4
- package/dist/index.d.mts +45 -2
- package/dist/index.d.ts +45 -2
- package/dist/index.js +104 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -0
- package/dist/index.mjs.map +1 -1
- package/dist/pos-types/index.d.mts +117 -72
- package/dist/pos-types/index.d.ts +117 -72
- package/dist/pos-types/index.js +1 -0
- package/dist/pos-types/index.js.map +1 -1
- package/dist/pos-types/index.mjs +1 -0
- package/dist/pos-types/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -138,6 +138,25 @@ interface OrderPosData {
|
|
|
138
138
|
employee?: string;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
interface OrderAssignedUser {
|
|
142
|
+
userId: string;
|
|
143
|
+
assignedAt: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface OrderInCart {
|
|
147
|
+
active: boolean;
|
|
148
|
+
stationId: string | null;
|
|
149
|
+
since: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface OrderCustomStatus {
|
|
153
|
+
id: string;
|
|
154
|
+
key?: string;
|
|
155
|
+
label: string;
|
|
156
|
+
setAt: string;
|
|
157
|
+
setBy: string | null;
|
|
158
|
+
}
|
|
159
|
+
|
|
141
160
|
interface OrderLineItemDiscount {
|
|
142
161
|
itemDiscounts?: PriceModifierDetail[];
|
|
143
162
|
cartDiscount?: PriceModifierDetail;
|
|
@@ -815,6 +834,84 @@ interface FlowWebApp extends BaseDocument {
|
|
|
815
834
|
customDomain?: string;
|
|
816
835
|
}
|
|
817
836
|
|
|
837
|
+
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
838
|
+
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
839
|
+
interface StatePair {
|
|
840
|
+
payment: PaymentState;
|
|
841
|
+
fulfillment: FulfillmentState;
|
|
842
|
+
}
|
|
843
|
+
type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
|
|
844
|
+
type PathMode = 'strict' | 'permissive';
|
|
845
|
+
|
|
846
|
+
interface PaymentTransitionPath {
|
|
847
|
+
from: PaymentState;
|
|
848
|
+
to: PaymentState;
|
|
849
|
+
conditionSetId?: string;
|
|
850
|
+
_sourceExtensionId?: string;
|
|
851
|
+
}
|
|
852
|
+
interface FulfillmentTransitionPath {
|
|
853
|
+
from: FulfillmentState;
|
|
854
|
+
to: FulfillmentState;
|
|
855
|
+
conditionSetId?: string;
|
|
856
|
+
_sourceExtensionId?: string;
|
|
857
|
+
}
|
|
858
|
+
interface Condition {
|
|
859
|
+
field: string;
|
|
860
|
+
operator: ConditionOperator;
|
|
861
|
+
value: unknown;
|
|
862
|
+
}
|
|
863
|
+
interface ConditionGroup {
|
|
864
|
+
conditions: Condition[];
|
|
865
|
+
}
|
|
866
|
+
interface TransitionConditionSet {
|
|
867
|
+
id: string;
|
|
868
|
+
label: string;
|
|
869
|
+
groups: ConditionGroup[];
|
|
870
|
+
_sourceExtensionId?: string;
|
|
871
|
+
}
|
|
872
|
+
type CrossAxisTrigger = {
|
|
873
|
+
axis: 'payment';
|
|
874
|
+
to: PaymentState | PaymentState[];
|
|
875
|
+
} | {
|
|
876
|
+
axis: 'fulfillment';
|
|
877
|
+
to: FulfillmentState | FulfillmentState[];
|
|
878
|
+
};
|
|
879
|
+
type CrossAxisRequires = {
|
|
880
|
+
axis: 'payment';
|
|
881
|
+
states: PaymentState[];
|
|
882
|
+
} | {
|
|
883
|
+
axis: 'fulfillment';
|
|
884
|
+
states: FulfillmentState[];
|
|
885
|
+
};
|
|
886
|
+
interface CrossAxisRule {
|
|
887
|
+
id: string;
|
|
888
|
+
label: string;
|
|
889
|
+
description?: string;
|
|
890
|
+
enabled: boolean;
|
|
891
|
+
trigger: CrossAxisTrigger;
|
|
892
|
+
requires: CrossAxisRequires;
|
|
893
|
+
_sourceExtensionId?: string;
|
|
894
|
+
}
|
|
895
|
+
interface DisplayStateRule {
|
|
896
|
+
paymentState?: PaymentState | PaymentState[];
|
|
897
|
+
fulfillmentState?: FulfillmentState | FulfillmentState[];
|
|
898
|
+
label: string;
|
|
899
|
+
color?: string;
|
|
900
|
+
icon?: string;
|
|
901
|
+
_sourceExtensionId?: string;
|
|
902
|
+
}
|
|
903
|
+
type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
|
|
904
|
+
|
|
905
|
+
interface OrderStatusDefinition {
|
|
906
|
+
id: string;
|
|
907
|
+
key: string;
|
|
908
|
+
defaultLabel: string;
|
|
909
|
+
color?: string;
|
|
910
|
+
icon?: string;
|
|
911
|
+
fulfillmentState?: FulfillmentState;
|
|
912
|
+
requiresPaymentState?: PaymentState[];
|
|
913
|
+
}
|
|
914
|
+
|
|
818
915
|
interface FlowWebAppVersion extends BaseDocument {
|
|
819
916
|
checkoutFlowId: string;
|
|
820
917
|
version: string;
|
|
@@ -823,6 +920,7 @@ interface FlowWebAppVersion extends BaseDocument {
|
|
|
823
920
|
fileCount: number;
|
|
824
921
|
sizeBytes: number;
|
|
825
922
|
changelog?: string;
|
|
923
|
+
orderStatuses?: OrderStatusDefinition[];
|
|
826
924
|
}
|
|
827
925
|
|
|
828
926
|
interface NonRevenueItem$1 {
|
|
@@ -868,6 +966,11 @@ interface Order extends BaseEntity {
|
|
|
868
966
|
cartFees?: OrderCartFee[];
|
|
869
967
|
paymentMethods: OrderPaymentMethod[];
|
|
870
968
|
posData?: OrderPosData;
|
|
969
|
+
assignedUser?: OrderAssignedUser | null;
|
|
970
|
+
orderType?: string | null;
|
|
971
|
+
scheduledFor?: string | null;
|
|
972
|
+
inCart?: OrderInCart;
|
|
973
|
+
customStatus?: OrderCustomStatus | null;
|
|
871
974
|
metadata?: Metadata[];
|
|
872
975
|
notes: OrderNote$1[];
|
|
873
976
|
billing?: Address$1;
|
|
@@ -981,74 +1084,6 @@ interface Transaction extends BaseEntity {
|
|
|
981
1084
|
minorUnits?: number;
|
|
982
1085
|
}
|
|
983
1086
|
|
|
984
|
-
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
985
|
-
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
986
|
-
interface StatePair {
|
|
987
|
-
payment: PaymentState;
|
|
988
|
-
fulfillment: FulfillmentState;
|
|
989
|
-
}
|
|
990
|
-
type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
|
|
991
|
-
type PathMode = 'strict' | 'permissive';
|
|
992
|
-
|
|
993
|
-
interface PaymentTransitionPath {
|
|
994
|
-
from: PaymentState;
|
|
995
|
-
to: PaymentState;
|
|
996
|
-
conditionSetId?: string;
|
|
997
|
-
_sourceExtensionId?: string;
|
|
998
|
-
}
|
|
999
|
-
interface FulfillmentTransitionPath {
|
|
1000
|
-
from: FulfillmentState;
|
|
1001
|
-
to: FulfillmentState;
|
|
1002
|
-
conditionSetId?: string;
|
|
1003
|
-
_sourceExtensionId?: string;
|
|
1004
|
-
}
|
|
1005
|
-
interface Condition {
|
|
1006
|
-
field: string;
|
|
1007
|
-
operator: ConditionOperator;
|
|
1008
|
-
value: unknown;
|
|
1009
|
-
}
|
|
1010
|
-
interface ConditionGroup {
|
|
1011
|
-
conditions: Condition[];
|
|
1012
|
-
}
|
|
1013
|
-
interface TransitionConditionSet {
|
|
1014
|
-
id: string;
|
|
1015
|
-
label: string;
|
|
1016
|
-
groups: ConditionGroup[];
|
|
1017
|
-
_sourceExtensionId?: string;
|
|
1018
|
-
}
|
|
1019
|
-
type CrossAxisTrigger = {
|
|
1020
|
-
axis: 'payment';
|
|
1021
|
-
to: PaymentState | PaymentState[];
|
|
1022
|
-
} | {
|
|
1023
|
-
axis: 'fulfillment';
|
|
1024
|
-
to: FulfillmentState | FulfillmentState[];
|
|
1025
|
-
};
|
|
1026
|
-
type CrossAxisRequires = {
|
|
1027
|
-
axis: 'payment';
|
|
1028
|
-
states: PaymentState[];
|
|
1029
|
-
} | {
|
|
1030
|
-
axis: 'fulfillment';
|
|
1031
|
-
states: FulfillmentState[];
|
|
1032
|
-
};
|
|
1033
|
-
interface CrossAxisRule {
|
|
1034
|
-
id: string;
|
|
1035
|
-
label: string;
|
|
1036
|
-
description?: string;
|
|
1037
|
-
enabled: boolean;
|
|
1038
|
-
trigger: CrossAxisTrigger;
|
|
1039
|
-
requires: CrossAxisRequires;
|
|
1040
|
-
_sourceExtensionId?: string;
|
|
1041
|
-
}
|
|
1042
|
-
interface DisplayStateRule {
|
|
1043
|
-
paymentState?: PaymentState | PaymentState[];
|
|
1044
|
-
fulfillmentState?: FulfillmentState | FulfillmentState[];
|
|
1045
|
-
label: string;
|
|
1046
|
-
color?: string;
|
|
1047
|
-
icon?: string;
|
|
1048
|
-
_sourceExtensionId?: string;
|
|
1049
|
-
}
|
|
1050
|
-
type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
|
|
1051
|
-
|
|
1052
1087
|
interface OrderStateConfig extends BaseEntity {
|
|
1053
1088
|
version: number;
|
|
1054
1089
|
name: string;
|
|
@@ -2017,7 +2052,8 @@ declare enum ProcessorType {
|
|
|
2017
2052
|
VENDARA = "Vendara",
|
|
2018
2053
|
REDEEM = "Redeem",
|
|
2019
2054
|
INTEGRATION = "Integration",
|
|
2020
|
-
PAYMENT_LINK = "PaymentLink"
|
|
2055
|
+
PAYMENT_LINK = "PaymentLink",
|
|
2056
|
+
EXTERNAL = "External"
|
|
2021
2057
|
}
|
|
2022
2058
|
|
|
2023
2059
|
interface PrinterDetails {
|
|
@@ -2387,6 +2423,7 @@ interface SelectionFlowContext {
|
|
|
2387
2423
|
flowVersionUrl: string | null;
|
|
2388
2424
|
flowSettings: Record<string, string> | null;
|
|
2389
2425
|
flowSettingsKey: Record<string, string> | null;
|
|
2426
|
+
orderStatuses?: OrderStatusDefinition[] | null;
|
|
2390
2427
|
}
|
|
2391
2428
|
interface SelectionContext {
|
|
2392
2429
|
user: ActiveUser;
|
|
@@ -2409,7 +2446,7 @@ type CashDrawerPolicy = 'everySale' | 'never';
|
|
|
2409
2446
|
interface PrinterSettings {
|
|
2410
2447
|
cashDrawer: CashDrawerPolicy;
|
|
2411
2448
|
}
|
|
2412
|
-
type ServiceChannelMessageType = 'POSBRAIN_READY' | 'HOST_HELLO' | 'SERVICE_INIT' | 'BOOTSTRAP' | 'TOKEN_REFRESH' | 'SELECTION' | 'HOST_SHUTDOWN' | 'READER_CAPABILITIES' | 'PRINTER_SETTINGS' | 'RUNTIME_READY' | 'HOST_NAVIGATE' | 'SYNC_PROGRESS' | 'DEVICE_OP_REQUEST' | 'DEVICE_OP_RESPONSE' | 'PUBSUB_TOPICS_REQUEST' | 'PUBSUB_TOPICS_LIST' | 'PUBSUB_SUBSCRIBE' | 'PUBSUB_UNSUBSCRIBE' | 'PUBSUB_EVENT';
|
|
2449
|
+
type ServiceChannelMessageType = 'POSBRAIN_READY' | 'HOST_HELLO' | 'SERVICE_INIT' | 'BOOTSTRAP' | 'TOKEN_REFRESH' | 'REQUEST_TOKEN_REFRESH' | 'SELECTION' | 'HOST_SHUTDOWN' | 'READER_CAPABILITIES' | 'PRINTER_SETTINGS' | 'RUNTIME_READY' | 'HOST_NAVIGATE' | 'SYNC_PROGRESS' | 'DEVICE_OP_REQUEST' | 'DEVICE_OP_RESPONSE' | 'PUBSUB_TOPICS_REQUEST' | 'PUBSUB_TOPICS_LIST' | 'PUBSUB_SUBSCRIBE' | 'PUBSUB_UNSUBSCRIBE' | 'PUBSUB_EVENT';
|
|
2413
2450
|
interface PosBrainReadyMessage {
|
|
2414
2451
|
type: 'POSBRAIN_READY';
|
|
2415
2452
|
}
|
|
@@ -2431,11 +2468,19 @@ interface BootstrapMessage {
|
|
|
2431
2468
|
};
|
|
2432
2469
|
paymentProvider?: PaymentProcessor;
|
|
2433
2470
|
printerSettings?: PrinterSettings | null;
|
|
2471
|
+
adyenCardEntry?: AdyenCardEntryConfig | null;
|
|
2472
|
+
}
|
|
2473
|
+
interface AdyenCardEntryConfig {
|
|
2474
|
+
clientKey: string;
|
|
2475
|
+
environment: 'test' | 'live';
|
|
2434
2476
|
}
|
|
2435
2477
|
interface TokenRefreshMessage {
|
|
2436
2478
|
type: 'TOKEN_REFRESH';
|
|
2437
2479
|
token: string;
|
|
2438
2480
|
}
|
|
2481
|
+
interface RequestTokenRefreshMessage {
|
|
2482
|
+
type: 'REQUEST_TOKEN_REFRESH';
|
|
2483
|
+
}
|
|
2439
2484
|
interface SelectionMessage {
|
|
2440
2485
|
type: 'SELECTION';
|
|
2441
2486
|
selection: SelectionContext;
|
|
@@ -2513,6 +2558,6 @@ interface PubsubEventMessage {
|
|
|
2513
2558
|
type: 'PUBSUB_EVENT';
|
|
2514
2559
|
event: TopicEventWire;
|
|
2515
2560
|
}
|
|
2516
|
-
type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | PrinterSettingsMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
|
|
2561
|
+
type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | RequestTokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | PrinterSettingsMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
|
|
2517
2562
|
|
|
2518
|
-
export { type ActiveCart, type ActiveCartProduct, type ActiveCompany, type ActiveCustomSales, type ActiveCustomer, type ActiveEntityChanges, ActiveEntityType, type ActiveFullProduct, type ActiveOrder, type ActiveOrderReservation, type ActiveOutlet, type ActivePark, type ActiveProduct, type ActiveRefundOrder, type ActiveSession, type ActiveSplitPayment, type ActiveStation, type ActiveTaxDetails, type ActiveTimer, type ActiveUpdatedOrder, type ActiveUser, type ActiveUserRole, type Address, type Attribute, type AttributeEmbedded, type AttributeOption, type BaseDocument, type BaseEntity, type BaseTile, type Booking, type BookingAvailability, type BookingResource, type BookingSlot, type BookingSlotResource, type BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CartLineComponent, type CartLineModifier, type CartReservation, type CashDrawerPolicy, type CashPaymentSettings, type CashRoundingIncrement, type Category, type CompanyExtension, type CompanySettingsEavValue, type CompanySettingsEavValueType, type Composite, type CompositeChoice, type CompositeItem, type CompositeItemUnavailable, type CompositePart, type CompositePick, type CustomExtension, type CustomFee, type CustomSale, type CustomSaleDetails, type CustomTable, type CustomTableField, type CustomTableMetadata, type CustomTableRow, type CustomTableValue, type Customer, type CustomerNote, type DeviceEnvAttribute, type DeviceEnvCategory, type DeviceEnvValue, type DeviceOpName, type DeviceOpRequestMessage, type DeviceOpResponseMessage, type Discount, type DiscountDetail, type DiscountLineItem, type Enrich, EnvironmentDataKeys, EnvironmentDataSubKeys, type FeeDetail, type FeeLineItem, type Flow, type FlowSettings, type FlowSettingsKey, type FlowWebApp, type FlowWebAppVersion, type FullProduct, type HostHelloMessage, type HostNavigateMessage, type HostNavigateTarget, type HostShutdownMessage, type Inventory, type LineItem, type Metadata, type MetadataItem, type ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderLineItem, type OrderLineItemComponent, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, type OrderNote, type OrderPaymentMethod, type OrderPosData, type OrderRefund, type OrderRefundSummary, type OrderReservation, type OrderStateActor, type OrderStateActorType, type OrderStateConfig, type OrderStateEvent, type OrderStateEventTrigger, type OrderStateHistoryEntry, type OrderStateOperation, type OrderStatePair, type OrderSummary, type OrderSummaryPayments, type OrderTax, type OrderTip, type Outlet, type PaymentMethod, type PaymentResponse, type PaymentSetting, PaymentStatus, type PosBrainReadyMessage, type PosDataItem, type PriceModifierDetail, type PrinterDetails, type PrinterSettings, type PrinterSettingsMessage, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
|
|
2563
|
+
export { type ActiveCart, type ActiveCartProduct, type ActiveCompany, type ActiveCustomSales, type ActiveCustomer, type ActiveEntityChanges, ActiveEntityType, type ActiveFullProduct, type ActiveOrder, type ActiveOrderReservation, type ActiveOutlet, type ActivePark, type ActiveProduct, type ActiveRefundOrder, type ActiveSession, type ActiveSplitPayment, type ActiveStation, type ActiveTaxDetails, type ActiveTimer, type ActiveUpdatedOrder, type ActiveUser, type ActiveUserRole, type Address, type AdyenCardEntryConfig, type Attribute, type AttributeEmbedded, type AttributeOption, type BaseDocument, type BaseEntity, type BaseTile, type Booking, type BookingAvailability, type BookingResource, type BookingSlot, type BookingSlotResource, type BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CartLineComponent, type CartLineModifier, type CartReservation, type CashDrawerPolicy, type CashPaymentSettings, type CashRoundingIncrement, type Category, type CompanyExtension, type CompanySettingsEavValue, type CompanySettingsEavValueType, type Composite, type CompositeChoice, type CompositeItem, type CompositeItemUnavailable, type CompositePart, type CompositePick, type CustomExtension, type CustomFee, type CustomSale, type CustomSaleDetails, type CustomTable, type CustomTableField, type CustomTableMetadata, type CustomTableRow, type CustomTableValue, type Customer, type CustomerNote, type DeviceEnvAttribute, type DeviceEnvCategory, type DeviceEnvValue, type DeviceOpName, type DeviceOpRequestMessage, type DeviceOpResponseMessage, type Discount, type DiscountDetail, type DiscountLineItem, type Enrich, EnvironmentDataKeys, EnvironmentDataSubKeys, type FeeDetail, type FeeLineItem, type Flow, type FlowSettings, type FlowSettingsKey, type FlowWebApp, type FlowWebAppVersion, type FullProduct, type HostHelloMessage, type HostNavigateMessage, type HostNavigateTarget, type HostShutdownMessage, type Inventory, type LineItem, type Metadata, type MetadataItem, type ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderAssignedUser, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderCustomStatus, type OrderInCart, type OrderLineItem, type OrderLineItemComponent, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, type OrderNote, type OrderPaymentMethod, type OrderPosData, type OrderRefund, type OrderRefundSummary, type OrderReservation, type OrderStateActor, type OrderStateActorType, type OrderStateConfig, type OrderStateEvent, type OrderStateEventTrigger, type OrderStateHistoryEntry, type OrderStateOperation, type OrderStatePair, type OrderSummary, type OrderSummaryPayments, type OrderTax, type OrderTip, type Outlet, type PaymentMethod, type PaymentResponse, type PaymentSetting, PaymentStatus, type PosBrainReadyMessage, type PosDataItem, type PriceModifierDetail, type PrinterDetails, type PrinterSettings, type PrinterSettingsMessage, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type RequestTokenRefreshMessage, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
|
|
@@ -138,6 +138,25 @@ interface OrderPosData {
|
|
|
138
138
|
employee?: string;
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
interface OrderAssignedUser {
|
|
142
|
+
userId: string;
|
|
143
|
+
assignedAt: string;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface OrderInCart {
|
|
147
|
+
active: boolean;
|
|
148
|
+
stationId: string | null;
|
|
149
|
+
since: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
interface OrderCustomStatus {
|
|
153
|
+
id: string;
|
|
154
|
+
key?: string;
|
|
155
|
+
label: string;
|
|
156
|
+
setAt: string;
|
|
157
|
+
setBy: string | null;
|
|
158
|
+
}
|
|
159
|
+
|
|
141
160
|
interface OrderLineItemDiscount {
|
|
142
161
|
itemDiscounts?: PriceModifierDetail[];
|
|
143
162
|
cartDiscount?: PriceModifierDetail;
|
|
@@ -815,6 +834,84 @@ interface FlowWebApp extends BaseDocument {
|
|
|
815
834
|
customDomain?: string;
|
|
816
835
|
}
|
|
817
836
|
|
|
837
|
+
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
838
|
+
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
839
|
+
interface StatePair {
|
|
840
|
+
payment: PaymentState;
|
|
841
|
+
fulfillment: FulfillmentState;
|
|
842
|
+
}
|
|
843
|
+
type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
|
|
844
|
+
type PathMode = 'strict' | 'permissive';
|
|
845
|
+
|
|
846
|
+
interface PaymentTransitionPath {
|
|
847
|
+
from: PaymentState;
|
|
848
|
+
to: PaymentState;
|
|
849
|
+
conditionSetId?: string;
|
|
850
|
+
_sourceExtensionId?: string;
|
|
851
|
+
}
|
|
852
|
+
interface FulfillmentTransitionPath {
|
|
853
|
+
from: FulfillmentState;
|
|
854
|
+
to: FulfillmentState;
|
|
855
|
+
conditionSetId?: string;
|
|
856
|
+
_sourceExtensionId?: string;
|
|
857
|
+
}
|
|
858
|
+
interface Condition {
|
|
859
|
+
field: string;
|
|
860
|
+
operator: ConditionOperator;
|
|
861
|
+
value: unknown;
|
|
862
|
+
}
|
|
863
|
+
interface ConditionGroup {
|
|
864
|
+
conditions: Condition[];
|
|
865
|
+
}
|
|
866
|
+
interface TransitionConditionSet {
|
|
867
|
+
id: string;
|
|
868
|
+
label: string;
|
|
869
|
+
groups: ConditionGroup[];
|
|
870
|
+
_sourceExtensionId?: string;
|
|
871
|
+
}
|
|
872
|
+
type CrossAxisTrigger = {
|
|
873
|
+
axis: 'payment';
|
|
874
|
+
to: PaymentState | PaymentState[];
|
|
875
|
+
} | {
|
|
876
|
+
axis: 'fulfillment';
|
|
877
|
+
to: FulfillmentState | FulfillmentState[];
|
|
878
|
+
};
|
|
879
|
+
type CrossAxisRequires = {
|
|
880
|
+
axis: 'payment';
|
|
881
|
+
states: PaymentState[];
|
|
882
|
+
} | {
|
|
883
|
+
axis: 'fulfillment';
|
|
884
|
+
states: FulfillmentState[];
|
|
885
|
+
};
|
|
886
|
+
interface CrossAxisRule {
|
|
887
|
+
id: string;
|
|
888
|
+
label: string;
|
|
889
|
+
description?: string;
|
|
890
|
+
enabled: boolean;
|
|
891
|
+
trigger: CrossAxisTrigger;
|
|
892
|
+
requires: CrossAxisRequires;
|
|
893
|
+
_sourceExtensionId?: string;
|
|
894
|
+
}
|
|
895
|
+
interface DisplayStateRule {
|
|
896
|
+
paymentState?: PaymentState | PaymentState[];
|
|
897
|
+
fulfillmentState?: FulfillmentState | FulfillmentState[];
|
|
898
|
+
label: string;
|
|
899
|
+
color?: string;
|
|
900
|
+
icon?: string;
|
|
901
|
+
_sourceExtensionId?: string;
|
|
902
|
+
}
|
|
903
|
+
type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
|
|
904
|
+
|
|
905
|
+
interface OrderStatusDefinition {
|
|
906
|
+
id: string;
|
|
907
|
+
key: string;
|
|
908
|
+
defaultLabel: string;
|
|
909
|
+
color?: string;
|
|
910
|
+
icon?: string;
|
|
911
|
+
fulfillmentState?: FulfillmentState;
|
|
912
|
+
requiresPaymentState?: PaymentState[];
|
|
913
|
+
}
|
|
914
|
+
|
|
818
915
|
interface FlowWebAppVersion extends BaseDocument {
|
|
819
916
|
checkoutFlowId: string;
|
|
820
917
|
version: string;
|
|
@@ -823,6 +920,7 @@ interface FlowWebAppVersion extends BaseDocument {
|
|
|
823
920
|
fileCount: number;
|
|
824
921
|
sizeBytes: number;
|
|
825
922
|
changelog?: string;
|
|
923
|
+
orderStatuses?: OrderStatusDefinition[];
|
|
826
924
|
}
|
|
827
925
|
|
|
828
926
|
interface NonRevenueItem$1 {
|
|
@@ -868,6 +966,11 @@ interface Order extends BaseEntity {
|
|
|
868
966
|
cartFees?: OrderCartFee[];
|
|
869
967
|
paymentMethods: OrderPaymentMethod[];
|
|
870
968
|
posData?: OrderPosData;
|
|
969
|
+
assignedUser?: OrderAssignedUser | null;
|
|
970
|
+
orderType?: string | null;
|
|
971
|
+
scheduledFor?: string | null;
|
|
972
|
+
inCart?: OrderInCart;
|
|
973
|
+
customStatus?: OrderCustomStatus | null;
|
|
871
974
|
metadata?: Metadata[];
|
|
872
975
|
notes: OrderNote$1[];
|
|
873
976
|
billing?: Address$1;
|
|
@@ -981,74 +1084,6 @@ interface Transaction extends BaseEntity {
|
|
|
981
1084
|
minorUnits?: number;
|
|
982
1085
|
}
|
|
983
1086
|
|
|
984
|
-
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
985
|
-
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
986
|
-
interface StatePair {
|
|
987
|
-
payment: PaymentState;
|
|
988
|
-
fulfillment: FulfillmentState;
|
|
989
|
-
}
|
|
990
|
-
type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
|
|
991
|
-
type PathMode = 'strict' | 'permissive';
|
|
992
|
-
|
|
993
|
-
interface PaymentTransitionPath {
|
|
994
|
-
from: PaymentState;
|
|
995
|
-
to: PaymentState;
|
|
996
|
-
conditionSetId?: string;
|
|
997
|
-
_sourceExtensionId?: string;
|
|
998
|
-
}
|
|
999
|
-
interface FulfillmentTransitionPath {
|
|
1000
|
-
from: FulfillmentState;
|
|
1001
|
-
to: FulfillmentState;
|
|
1002
|
-
conditionSetId?: string;
|
|
1003
|
-
_sourceExtensionId?: string;
|
|
1004
|
-
}
|
|
1005
|
-
interface Condition {
|
|
1006
|
-
field: string;
|
|
1007
|
-
operator: ConditionOperator;
|
|
1008
|
-
value: unknown;
|
|
1009
|
-
}
|
|
1010
|
-
interface ConditionGroup {
|
|
1011
|
-
conditions: Condition[];
|
|
1012
|
-
}
|
|
1013
|
-
interface TransitionConditionSet {
|
|
1014
|
-
id: string;
|
|
1015
|
-
label: string;
|
|
1016
|
-
groups: ConditionGroup[];
|
|
1017
|
-
_sourceExtensionId?: string;
|
|
1018
|
-
}
|
|
1019
|
-
type CrossAxisTrigger = {
|
|
1020
|
-
axis: 'payment';
|
|
1021
|
-
to: PaymentState | PaymentState[];
|
|
1022
|
-
} | {
|
|
1023
|
-
axis: 'fulfillment';
|
|
1024
|
-
to: FulfillmentState | FulfillmentState[];
|
|
1025
|
-
};
|
|
1026
|
-
type CrossAxisRequires = {
|
|
1027
|
-
axis: 'payment';
|
|
1028
|
-
states: PaymentState[];
|
|
1029
|
-
} | {
|
|
1030
|
-
axis: 'fulfillment';
|
|
1031
|
-
states: FulfillmentState[];
|
|
1032
|
-
};
|
|
1033
|
-
interface CrossAxisRule {
|
|
1034
|
-
id: string;
|
|
1035
|
-
label: string;
|
|
1036
|
-
description?: string;
|
|
1037
|
-
enabled: boolean;
|
|
1038
|
-
trigger: CrossAxisTrigger;
|
|
1039
|
-
requires: CrossAxisRequires;
|
|
1040
|
-
_sourceExtensionId?: string;
|
|
1041
|
-
}
|
|
1042
|
-
interface DisplayStateRule {
|
|
1043
|
-
paymentState?: PaymentState | PaymentState[];
|
|
1044
|
-
fulfillmentState?: FulfillmentState | FulfillmentState[];
|
|
1045
|
-
label: string;
|
|
1046
|
-
color?: string;
|
|
1047
|
-
icon?: string;
|
|
1048
|
-
_sourceExtensionId?: string;
|
|
1049
|
-
}
|
|
1050
|
-
type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
|
|
1051
|
-
|
|
1052
1087
|
interface OrderStateConfig extends BaseEntity {
|
|
1053
1088
|
version: number;
|
|
1054
1089
|
name: string;
|
|
@@ -2017,7 +2052,8 @@ declare enum ProcessorType {
|
|
|
2017
2052
|
VENDARA = "Vendara",
|
|
2018
2053
|
REDEEM = "Redeem",
|
|
2019
2054
|
INTEGRATION = "Integration",
|
|
2020
|
-
PAYMENT_LINK = "PaymentLink"
|
|
2055
|
+
PAYMENT_LINK = "PaymentLink",
|
|
2056
|
+
EXTERNAL = "External"
|
|
2021
2057
|
}
|
|
2022
2058
|
|
|
2023
2059
|
interface PrinterDetails {
|
|
@@ -2387,6 +2423,7 @@ interface SelectionFlowContext {
|
|
|
2387
2423
|
flowVersionUrl: string | null;
|
|
2388
2424
|
flowSettings: Record<string, string> | null;
|
|
2389
2425
|
flowSettingsKey: Record<string, string> | null;
|
|
2426
|
+
orderStatuses?: OrderStatusDefinition[] | null;
|
|
2390
2427
|
}
|
|
2391
2428
|
interface SelectionContext {
|
|
2392
2429
|
user: ActiveUser;
|
|
@@ -2409,7 +2446,7 @@ type CashDrawerPolicy = 'everySale' | 'never';
|
|
|
2409
2446
|
interface PrinterSettings {
|
|
2410
2447
|
cashDrawer: CashDrawerPolicy;
|
|
2411
2448
|
}
|
|
2412
|
-
type ServiceChannelMessageType = 'POSBRAIN_READY' | 'HOST_HELLO' | 'SERVICE_INIT' | 'BOOTSTRAP' | 'TOKEN_REFRESH' | 'SELECTION' | 'HOST_SHUTDOWN' | 'READER_CAPABILITIES' | 'PRINTER_SETTINGS' | 'RUNTIME_READY' | 'HOST_NAVIGATE' | 'SYNC_PROGRESS' | 'DEVICE_OP_REQUEST' | 'DEVICE_OP_RESPONSE' | 'PUBSUB_TOPICS_REQUEST' | 'PUBSUB_TOPICS_LIST' | 'PUBSUB_SUBSCRIBE' | 'PUBSUB_UNSUBSCRIBE' | 'PUBSUB_EVENT';
|
|
2449
|
+
type ServiceChannelMessageType = 'POSBRAIN_READY' | 'HOST_HELLO' | 'SERVICE_INIT' | 'BOOTSTRAP' | 'TOKEN_REFRESH' | 'REQUEST_TOKEN_REFRESH' | 'SELECTION' | 'HOST_SHUTDOWN' | 'READER_CAPABILITIES' | 'PRINTER_SETTINGS' | 'RUNTIME_READY' | 'HOST_NAVIGATE' | 'SYNC_PROGRESS' | 'DEVICE_OP_REQUEST' | 'DEVICE_OP_RESPONSE' | 'PUBSUB_TOPICS_REQUEST' | 'PUBSUB_TOPICS_LIST' | 'PUBSUB_SUBSCRIBE' | 'PUBSUB_UNSUBSCRIBE' | 'PUBSUB_EVENT';
|
|
2413
2450
|
interface PosBrainReadyMessage {
|
|
2414
2451
|
type: 'POSBRAIN_READY';
|
|
2415
2452
|
}
|
|
@@ -2431,11 +2468,19 @@ interface BootstrapMessage {
|
|
|
2431
2468
|
};
|
|
2432
2469
|
paymentProvider?: PaymentProcessor;
|
|
2433
2470
|
printerSettings?: PrinterSettings | null;
|
|
2471
|
+
adyenCardEntry?: AdyenCardEntryConfig | null;
|
|
2472
|
+
}
|
|
2473
|
+
interface AdyenCardEntryConfig {
|
|
2474
|
+
clientKey: string;
|
|
2475
|
+
environment: 'test' | 'live';
|
|
2434
2476
|
}
|
|
2435
2477
|
interface TokenRefreshMessage {
|
|
2436
2478
|
type: 'TOKEN_REFRESH';
|
|
2437
2479
|
token: string;
|
|
2438
2480
|
}
|
|
2481
|
+
interface RequestTokenRefreshMessage {
|
|
2482
|
+
type: 'REQUEST_TOKEN_REFRESH';
|
|
2483
|
+
}
|
|
2439
2484
|
interface SelectionMessage {
|
|
2440
2485
|
type: 'SELECTION';
|
|
2441
2486
|
selection: SelectionContext;
|
|
@@ -2513,6 +2558,6 @@ interface PubsubEventMessage {
|
|
|
2513
2558
|
type: 'PUBSUB_EVENT';
|
|
2514
2559
|
event: TopicEventWire;
|
|
2515
2560
|
}
|
|
2516
|
-
type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | PrinterSettingsMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
|
|
2561
|
+
type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | RequestTokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | PrinterSettingsMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
|
|
2517
2562
|
|
|
2518
|
-
export { type ActiveCart, type ActiveCartProduct, type ActiveCompany, type ActiveCustomSales, type ActiveCustomer, type ActiveEntityChanges, ActiveEntityType, type ActiveFullProduct, type ActiveOrder, type ActiveOrderReservation, type ActiveOutlet, type ActivePark, type ActiveProduct, type ActiveRefundOrder, type ActiveSession, type ActiveSplitPayment, type ActiveStation, type ActiveTaxDetails, type ActiveTimer, type ActiveUpdatedOrder, type ActiveUser, type ActiveUserRole, type Address, type Attribute, type AttributeEmbedded, type AttributeOption, type BaseDocument, type BaseEntity, type BaseTile, type Booking, type BookingAvailability, type BookingResource, type BookingSlot, type BookingSlotResource, type BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CartLineComponent, type CartLineModifier, type CartReservation, type CashDrawerPolicy, type CashPaymentSettings, type CashRoundingIncrement, type Category, type CompanyExtension, type CompanySettingsEavValue, type CompanySettingsEavValueType, type Composite, type CompositeChoice, type CompositeItem, type CompositeItemUnavailable, type CompositePart, type CompositePick, type CustomExtension, type CustomFee, type CustomSale, type CustomSaleDetails, type CustomTable, type CustomTableField, type CustomTableMetadata, type CustomTableRow, type CustomTableValue, type Customer, type CustomerNote, type DeviceEnvAttribute, type DeviceEnvCategory, type DeviceEnvValue, type DeviceOpName, type DeviceOpRequestMessage, type DeviceOpResponseMessage, type Discount, type DiscountDetail, type DiscountLineItem, type Enrich, EnvironmentDataKeys, EnvironmentDataSubKeys, type FeeDetail, type FeeLineItem, type Flow, type FlowSettings, type FlowSettingsKey, type FlowWebApp, type FlowWebAppVersion, type FullProduct, type HostHelloMessage, type HostNavigateMessage, type HostNavigateTarget, type HostShutdownMessage, type Inventory, type LineItem, type Metadata, type MetadataItem, type ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderLineItem, type OrderLineItemComponent, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, type OrderNote, type OrderPaymentMethod, type OrderPosData, type OrderRefund, type OrderRefundSummary, type OrderReservation, type OrderStateActor, type OrderStateActorType, type OrderStateConfig, type OrderStateEvent, type OrderStateEventTrigger, type OrderStateHistoryEntry, type OrderStateOperation, type OrderStatePair, type OrderSummary, type OrderSummaryPayments, type OrderTax, type OrderTip, type Outlet, type PaymentMethod, type PaymentResponse, type PaymentSetting, PaymentStatus, type PosBrainReadyMessage, type PosDataItem, type PriceModifierDetail, type PrinterDetails, type PrinterSettings, type PrinterSettingsMessage, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
|
|
2563
|
+
export { type ActiveCart, type ActiveCartProduct, type ActiveCompany, type ActiveCustomSales, type ActiveCustomer, type ActiveEntityChanges, ActiveEntityType, type ActiveFullProduct, type ActiveOrder, type ActiveOrderReservation, type ActiveOutlet, type ActivePark, type ActiveProduct, type ActiveRefundOrder, type ActiveSession, type ActiveSplitPayment, type ActiveStation, type ActiveTaxDetails, type ActiveTimer, type ActiveUpdatedOrder, type ActiveUser, type ActiveUserRole, type Address, type AdyenCardEntryConfig, type Attribute, type AttributeEmbedded, type AttributeOption, type BaseDocument, type BaseEntity, type BaseTile, type Booking, type BookingAvailability, type BookingResource, type BookingSlot, type BookingSlotResource, type BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CartLineComponent, type CartLineModifier, type CartReservation, type CashDrawerPolicy, type CashPaymentSettings, type CashRoundingIncrement, type Category, type CompanyExtension, type CompanySettingsEavValue, type CompanySettingsEavValueType, type Composite, type CompositeChoice, type CompositeItem, type CompositeItemUnavailable, type CompositePart, type CompositePick, type CustomExtension, type CustomFee, type CustomSale, type CustomSaleDetails, type CustomTable, type CustomTableField, type CustomTableMetadata, type CustomTableRow, type CustomTableValue, type Customer, type CustomerNote, type DeviceEnvAttribute, type DeviceEnvCategory, type DeviceEnvValue, type DeviceOpName, type DeviceOpRequestMessage, type DeviceOpResponseMessage, type Discount, type DiscountDetail, type DiscountLineItem, type Enrich, EnvironmentDataKeys, EnvironmentDataSubKeys, type FeeDetail, type FeeLineItem, type Flow, type FlowSettings, type FlowSettingsKey, type FlowWebApp, type FlowWebAppVersion, type FullProduct, type HostHelloMessage, type HostNavigateMessage, type HostNavigateTarget, type HostShutdownMessage, type Inventory, type LineItem, type Metadata, type MetadataItem, type ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderAssignedUser, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderCustomStatus, type OrderInCart, type OrderLineItem, type OrderLineItemComponent, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, type OrderNote, type OrderPaymentMethod, type OrderPosData, type OrderRefund, type OrderRefundSummary, type OrderReservation, type OrderStateActor, type OrderStateActorType, type OrderStateConfig, type OrderStateEvent, type OrderStateEventTrigger, type OrderStateHistoryEntry, type OrderStateOperation, type OrderStatePair, type OrderSummary, type OrderSummaryPayments, type OrderTax, type OrderTip, type Outlet, type PaymentMethod, type PaymentResponse, type PaymentSetting, PaymentStatus, type PosBrainReadyMessage, type PosDataItem, type PriceModifierDetail, type PrinterDetails, type PrinterSettings, type PrinterSettingsMessage, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type RequestTokenRefreshMessage, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
|
package/dist/pos-types/index.js
CHANGED
|
@@ -49,6 +49,7 @@ var ProcessorType = /* @__PURE__ */ ((ProcessorType2) => {
|
|
|
49
49
|
ProcessorType2["REDEEM"] = "Redeem";
|
|
50
50
|
ProcessorType2["INTEGRATION"] = "Integration";
|
|
51
51
|
ProcessorType2["PAYMENT_LINK"] = "PaymentLink";
|
|
52
|
+
ProcessorType2["EXTERNAL"] = "External";
|
|
52
53
|
return ProcessorType2;
|
|
53
54
|
})(ProcessorType || {});
|
|
54
55
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../pos-types/index.ts","../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["// @final-commerce/common/pos-types\n//\n// Public POS contract types for Final Commerce terminals — consumed by render\n// and command-frame. These mirror the public (wire) subset of data-layer's\n// Mongoose schemas (option D: manually mirrored, no data-layer dependency),\n// public-scrubbed: `_id`→`id`, `__v`/`_class`/`isDeleted` omitted, ObjectId\n// refs stringified, dates as ISO 8601 strings, secrets dropped.\n//\n// Shared primitives (CurrencyCode and the other enums, the order-state-machine\n// engine types) live elsewhere in this package — import them from\n// `@final-commerce/common` directly.\n\n// Type-level helpers (e.g. `Enrich` — builds Active* types from wire bases).\nexport type { Enrich } from './util';\n\n// Public bases for entities (BaseDocument = no companyId; BaseEntity adds it).\nexport type { BaseDocument, BaseEntity } from './base';\n\n// Embedded sub-document shapes.\nexport * from './embedded';\n\n// Entity shapes (wire).\nexport * from './entities';\n\n// Enriched (Render in-memory) `Active*` layer.\nexport * from './active';\n\n// Seam contract — the frozen station-home (HOST) ↔ pos-brain (runtime)\n// interface: selection-context snapshot + ServiceChannel message union.\nexport * from './seam';\n","export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n /**\n * @deprecated No payment path stamps this. Bluetooth-reader sales stamp `FINAL_PAY`\n * ('Terminal') as their processor; station-home reuses this member only for the\n * unrelated reader-connectionType UI field, not for an order/payment record.\n */\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n /**\n * Written by hub-api's payment-link settle as the payment method's processor label — the\n * channel (like Moto/Terminal/Cloud), not the PSP brand (that lives in `paymentData.processor`).\n * Card-not-present for receipt purposes.\n */\n PAYMENT_LINK = 'PaymentLink',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\nimport type { OrderTax } from '../embedded/OrderTax';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\n/**\n * One modifier row after the tax engine ran (FT-0010): the cart row extended by the\n * line quantity, plus the tax computed on it. buildOrderFromCart copies these onto\n * OrderLineItem.modifiers[] as { …row, total: amount, totalTax: tax }.\n */\nexport interface ProdModifierBreakdown {\n modifierId: string;\n modifierName: string;\n choiceId: string;\n choiceName: string;\n /** Display label from the cart row — \"{modifierName} - {choiceName}\". Not persisted on the order row. */\n label?: string;\n unitPrice: number;\n quantity: number;\n /** unitPrice × quantity × line.quantity, in minor units. */\n amount: number;\n tax: number;\n /** Engine INPUT (from the cart row): which table taxes this row. Not persisted on the order row. */\n taxTableId?: string;\n /** Engine OUTPUT: per-rate breakdown of `tax` — becomes OrderLineItemModifier.taxes. */\n taxes?: OrderTax[];\n /** From the cart row: the composite component it applies to, so rows arrive split per component (B28). */\n componentIndex?: number;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) + sum(modifiers) */\n lineNetWithFees?: number;\n /** Σ modifier rows extended by the line quantity — fee-level money, joins the line after the product discount. */\n modifierDisplay?: number;\n /** Tax computed on the modifier rows (product's tax table unless a row names its own). Inside computedLineTax. */\n modifierTax?: number;\n modifiers?: ProdModifierBreakdown[];\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n /**\n * Stable ObjectId hub-api keys FlowSettings / PaymentSettings under.\n * Set for AI flows resolved Miami-direct (station-home adapts the service\n * projection onto this shape); absent on regular flows, where `_id` is the\n * settings key. Settings lookups should key by `hubId ?? _id`.\n */\n hubId?: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":"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","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
|
|
1
|
+
{"version":3,"sources":["../../pos-types/index.ts","../../pos-types/active/PaymentStatus.ts","../../pos-types/active/ProcessorType.ts","../../pos-types/active/pos-runtime.ts"],"sourcesContent":["// @final-commerce/common/pos-types\n//\n// Public POS contract types for Final Commerce terminals — consumed by render\n// and command-frame. These mirror the public (wire) subset of data-layer's\n// Mongoose schemas (option D: manually mirrored, no data-layer dependency),\n// public-scrubbed: `_id`→`id`, `__v`/`_class`/`isDeleted` omitted, ObjectId\n// refs stringified, dates as ISO 8601 strings, secrets dropped.\n//\n// Shared primitives (CurrencyCode and the other enums, the order-state-machine\n// engine types) live elsewhere in this package — import them from\n// `@final-commerce/common` directly.\n\n// Type-level helpers (e.g. `Enrich` — builds Active* types from wire bases).\nexport type { Enrich } from './util';\n\n// Public bases for entities (BaseDocument = no companyId; BaseEntity adds it).\nexport type { BaseDocument, BaseEntity } from './base';\n\n// Embedded sub-document shapes.\nexport * from './embedded';\n\n// Entity shapes (wire).\nexport * from './entities';\n\n// Enriched (Render in-memory) `Active*` layer.\nexport * from './active';\n\n// Seam contract — the frozen station-home (HOST) ↔ pos-brain (runtime)\n// interface: selection-context snapshot + ServiceChannel message union.\nexport * from './seam';\n","export enum PaymentStatus {\n FAILED = 'failed',\n SUCCESS = 'success',\n CANCELED = 'canceled',\n IN_PROGRESS = 'inProgress',\n}\n","// Payment processor / tender type for a POS payment. Shared by Render and\n// command-frame; the string values are the wire contract used by orders.\nexport enum ProcessorType {\n FINAL_PAY = 'Terminal',\n TAP_TO_PAY = 'TapToPay',\n MOTO = 'Moto',\n CLOUD = 'Cloud',\n /**\n * @deprecated No payment path stamps this. Bluetooth-reader sales stamp `FINAL_PAY`\n * ('Terminal') as their processor; station-home reuses this member only for the\n * unrelated reader-connectionType UI field, not for an order/payment record.\n */\n BLUETOOTH = 'Bluetooth',\n CASH = 'Cash',\n CUSTOM_PAY = 'CustomPay',\n VENDARA = 'Vendara',\n /** Extension-controlled payment (e.g. gift card redeem); order uses paymentType `redeem`. */\n REDEEM = 'Redeem',\n /** Extension-controlled integration (e.g. Stripe-like); order uses paymentType `integration`. */\n INTEGRATION = 'Integration',\n /**\n * Written by hub-api's payment-link settle as the payment method's processor label — the\n * channel (like Moto/Terminal/Cloud), not the PSP brand (that lives in `paymentData.processor`).\n * Card-not-present for receipt purposes.\n */\n PAYMENT_LINK = 'PaymentLink',\n /**\n * Money taken outside the terminal (online, a delivery app, a voucher…), recorded under\n * a label with no device and no cash drawer. The order uses paymentType `external` —\n * deliberately distinct from `custom`, the Custom Payments extension's billed tender.\n */\n EXTERNAL = 'External',\n}\n","// Render in-memory POS runtime support types (tax engine, tips, cash, active-entity discriminator, environment data, flow) — the PaymentStatus-dependent active types (ActiveSplitPayment/RefundProcessingStatus/ActiveRefundOrder) remain in Render until PaymentStatus moves.\n\nimport type { CartFeeTaxEntry } from './CartFee';\nimport type { OrderTax } from '../embedded/OrderTax';\n\ninterface TaxesDetails {\n [id: string]: {\n amount: number;\n percentage: number;\n name: string;\n taxTableName: string;\n taxTableId: string;\n compounding?: boolean;\n priority?: number;\n };\n}\n\nexport interface ProdDiscountBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n}\n\nexport interface ProdFeeBreakdown {\n amount: number;\n percentage: number;\n label?: string;\n tax: number;\n taxTableId?: string;\n taxRateId?: string;\n applyTaxes: boolean;\n}\n\n/**\n * One modifier row after the tax engine ran (FT-0010): the cart row extended by the\n * line quantity, plus the tax computed on it. buildOrderFromCart copies these onto\n * OrderLineItem.modifiers[] as { …row, total: amount, totalTax: tax }.\n */\nexport interface ProdModifierBreakdown {\n modifierId: string;\n modifierName: string;\n choiceId: string;\n choiceName: string;\n /** Display label from the cart row — \"{modifierName} - {choiceName}\". Not persisted on the order row. */\n label?: string;\n unitPrice: number;\n quantity: number;\n /** unitPrice × quantity × line.quantity, in minor units. */\n amount: number;\n tax: number;\n /** Engine INPUT (from the cart row): which table taxes this row. Not persisted on the order row. */\n taxTableId?: string;\n /** Engine OUTPUT: per-rate breakdown of `tax` — becomes OrderLineItemModifier.taxes. */\n taxes?: OrderTax[];\n /** From the cart row: the composite component it applies to, so rows arrive split per component (B28). */\n componentIndex?: number;\n}\n\nexport interface ProductTaxDetails {\n tax: number;\n prodDiscount: number;\n /** Line-level item discount in minor units (originalLineTotal − lineDisplayBase); drift-free, matches the value written to orders/refunds. */\n prodDiscountTotal: number;\n cartDiscount: number;\n prodDiscountPercentage: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n fee?: number;\n feeTax?: number;\n feePercentage?: number;\n feeLabel?: string;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n feeTaxTableId?: string;\n cartFeeTaxTableId?: string;\n prodDiscountLabel?: string;\n /** Staging: line total including fee for discount allocation */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n feeDisplay?: number;\n prodDiscounts?: ProdDiscountBreakdown[];\n fees?: ProdFeeBreakdown[];\n /** Staging: (price × qty) − sum(itemDiscounts) + sum(itemFees) + sum(modifiers) */\n lineNetWithFees?: number;\n /** Σ modifier rows extended by the line quantity — fee-level money, joins the line after the product discount. */\n modifierDisplay?: number;\n /** Tax computed on the modifier rows (product's tax table unless a row names its own). Inside computedLineTax. */\n modifierTax?: number;\n modifiers?: ProdModifierBreakdown[];\n}\n\nexport interface CustomSaleDetails {\n tax: number;\n cartDiscount: number;\n cartDiscountPercentage: number;\n taxes: TaxesDetails;\n cartFee?: number;\n cartFeeTax?: number;\n cartFeePercentage?: number;\n cartFeeLabel?: string;\n cartFeeTaxTableId?: string;\n applyTaxes?: boolean;\n /** Staging: for discount allocation and order total */\n lineDisplayWithFee?: number;\n cartDiscountAllocated?: number;\n lineAfterCartDiscount?: number;\n computedLineTotal?: number;\n computedLineTax?: number;\n}\n\nexport interface CartFeesDetails {\n name: string;\n amount: number;\n percentage: number;\n feeTax: number;\n taxTableId: string;\n taxName: string;\n /** Per-rate breakdown (gst, hst, etc.) so order/refund summary can show correct amounts per rate. */\n taxes?: CartFeeTaxEntry[];\n}\n\nexport interface CalculatedTaxDetails {\n tax: number;\n total: number;\n subtotal: number;\n orderSubtotal: number;\n totalDiscount: number;\n /** Staging: cart discount amount and subtotal after discount */\n discountAmount?: number;\n subtotalAfterDiscount?: number;\n products: { [id: string]: ProductTaxDetails };\n customSales: { [id: string]: CustomSaleDetails };\n totalTaxes: TaxesDetails;\n cartFees: CartFeesDetails[];\n}\n\nexport interface TipData {\n value: number;\n label?: string;\n isPercent: boolean;\n}\n\nexport interface TipsDetails {\n total: number;\n tips: TipData[];\n currency?: string;\n noTipLabel?: string;\n customTipLabel?: string;\n selectedTip?: TipData;\n cashChange?: number;\n enabled?: boolean;\n}\n\nexport type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';\n\nexport interface CashPaymentSettings {\n cashRounding: CashRoundingIncrement;\n}\n\nexport enum ActiveEntityType {\n TAX = 'tax',\n CART = 'cart',\n USER = 'user',\n ORDER = 'order',\n PRODUCT = 'product',\n FULL_PRODUCT = 'fullProduct',\n CUSTOMER = 'customer',\n OUTLET = 'outlet',\n CHANGES = 'changes',\n SPLIT_PAYMENT = 'splitPayment',\n CALCULATED_TAX = 'calculatedTaxDetails',\n TIPS_DETAILS = 'tipsDetails',\n CASH_PAYMENT_SETTINGS = 'cashPaymentSettings',\n REFUND_DETAILS = 'refundDetails',\n COMPANY = 'company',\n IS_AUTHENTICATED = 'isAuthenticated',\n TIMER = 'timer',\n UPDATED_ORDER_ACTIONS = 'updatedOrderActions', //FOR ORDER UPDATE VIA ACTION\n BUILD = 'activeBuild',\n BUILD_UPDATE_INFO = 'buildUpdateInfo',\n GLOBAL_BLOCKS = 'globalBlocks',\n ACTIVE_STATION = 'activeStation',\n SMART_GRID = 'smartGrid',\n CUSTOM_SALE = 'customSale',\n ACTIVE_FLOW = 'activeFlow',\n ACTIVE_FLOW_VERSION_URL = 'activeFlowVersionUrl',\n}\n\nexport enum EnvironmentDataKeys {\n NETWORK_INFO = 'Network Info',\n DISPLAY = 'Display',\n APP_INFO = 'App Info',\n LOCATION = 'Location',\n DEVICE_INFO = 'Device Info',\n SYSTEM_HEALTH = 'System Health',\n DEVELOPER = 'Developer',\n PERIPHERAL_DEVICES = 'Peripheral Devices',\n}\n\nexport enum EnvironmentDataSubKeys {\n DEVICE_STATUS = 'Device Status',\n LAST_ONLINE_TIME = 'Last Online Time',\n NETWORK_TYPE = 'Network Type',\n SIGNAL_STRENGTH = 'Signal Strength',\n NETWORK_NAME = 'Network name',\n IP_ADDRESS = 'IP Address',\n\n SCREEN_RESOLUTION = 'Screen Resolution',\n PIXEL_RATIO = 'Pixel Ratio',\n ORIENTATION = 'Orientation',\n\n APP_VERSION = 'App Version',\n BUILD_NUMBER = 'Build Number',\n BUNDLE_ID = 'Bundle ID',\n INSTALLED = 'Installed',\n LAST_UPDATED = 'Last Updated',\n\n LOCATION_ACCESS = 'Location Access',\n CURRENT_LOCATION = 'Current Location',\n\n MODEL = 'Model',\n SYSTEM_VERSION = 'System Version',\n FIRMWARE_VERSION = 'Firmware Version',\n SERIAL_NUMBER = 'Serial Number',\n IMEI_NUMBER = 'IMEI Number',\n MAC_ADDRESS = 'MAC Address',\n ACTIVATION_TIME = 'Activation Time',\n TIME_ZONE = 'Time Zone',\n DEVICE_LANGUAGE = 'Device Language',\n\n TOTAL_RAM = 'Total RAM',\n BATTERY_LEVEL = 'Battery Level',\n BATTERY_STATUS = 'Battery Status',\n LOW_POWER_MODE = 'Low Power Mode',\n AVERAGE_CPU_USAGE = 'Average CPU Usage',\n CPU_SPEED = 'CPU Speed',\n AVAILABLE_STORAGE = 'Available Storage',\n TOTAL_STORAGE = 'Total Storage',\n UPTIME = 'Uptime',\n\n FLUTTER_VERSION = 'Flutter Version',\n DART_VERSION = 'Dart Version',\n ENVIRONMENT = 'Environment',\n\n CONNECTED_PRINTER = 'Connected Printer',\n}\n\nexport interface ActiveTimer {\n initialTimer: string;\n currentTimer: string;\n}\n\nexport interface ActiveUpdatedOrder {\n customerNote?: string;\n status?: string;\n}\n\nexport interface TaxTableActive {\n name: string;\n country: string;\n postcode: string;\n rate: number;\n priority: number;\n compounding: boolean;\n id: string;\n taxTableName: string;\n taxTableId: string;\n}\n\nexport interface ActiveTaxDetails {\n taxIncl?: boolean;\n tables: { [name: string]: TaxTableActive[] };\n}\n\nexport interface ActiveEntityChanges {\n productInCart: string[] | null; //array of ids of product in cart\n numberOfProductsInCart: number;\n cartValue: number;\n user: string | null;\n customer: string | null;\n order: string | null;\n role: string | null;\n product: string | null;\n}\n\nexport interface Flow {\n _id: string;\n /**\n * Stable ObjectId hub-api keys FlowSettings / PaymentSettings under.\n * Set for AI flows resolved Miami-direct (station-home adapts the service\n * projection onto this shape); absent on regular flows, where `_id` is the\n * settings key. Settings lookups should key by `hubId ?? _id`.\n */\n hubId?: string;\n companyId: string;\n title: string;\n description: string;\n template: string;\n createdBy: string;\n flowData: Record<string, any>;\n isDeleted: boolean;\n createdAt: string;\n updatedAt: string;\n previewImage: string;\n currentVersion: string;\n webAppId: string;\n}\n"],"mappings":"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","names":["PaymentStatus","ProcessorType","ActiveEntityType","EnvironmentDataKeys","EnvironmentDataSubKeys"]}
|
package/dist/pos-types/index.mjs
CHANGED
|
@@ -20,6 +20,7 @@ var ProcessorType = /* @__PURE__ */ ((ProcessorType2) => {
|
|
|
20
20
|
ProcessorType2["REDEEM"] = "Redeem";
|
|
21
21
|
ProcessorType2["INTEGRATION"] = "Integration";
|
|
22
22
|
ProcessorType2["PAYMENT_LINK"] = "PaymentLink";
|
|
23
|
+
ProcessorType2["EXTERNAL"] = "External";
|
|
23
24
|
return ProcessorType2;
|
|
24
25
|
})(ProcessorType || {});
|
|
25
26
|
|