@final-commerce/command-frame 0.2.0-beta.1 → 0.3.0-beta.3

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.
Files changed (151) hide show
  1. package/README.md +28 -26
  2. package/dist/CommonTypes.d.ts +79 -534
  3. package/dist/CommonTypes.js +5 -65
  4. package/dist/actions/add-customer-note/mock.js +24 -15
  5. package/dist/actions/add-customer-note/types.d.ts +3 -2
  6. package/dist/actions/add-product/mock.js +12 -6
  7. package/dist/actions/add-product-discount/mock.js +5 -5
  8. package/dist/actions/add-product-fee/mock.js +6 -6
  9. package/dist/actions/cash-payment/types.d.ts +0 -5
  10. package/dist/actions/delete-parked-order/types.d.ts +0 -3
  11. package/dist/actions/edit-product/mock.js +5 -3
  12. package/dist/actions/extension-payment/types.d.ts +4 -5
  13. package/dist/actions/get-context/mock.js +12 -6
  14. package/dist/actions/get-products/mock.js +3 -3
  15. package/dist/actions/get-roles/mock.js +35 -41
  16. package/dist/actions/get-smart-grid-layout/action.d.ts +2 -0
  17. package/dist/actions/get-smart-grid-layout/action.js +4 -0
  18. package/dist/actions/get-smart-grid-layout/mock.d.ts +2 -0
  19. package/dist/actions/get-smart-grid-layout/mock.js +7 -0
  20. package/dist/actions/get-smart-grid-layout/types.d.ts +12 -0
  21. package/dist/actions/get-users/mock.js +16 -25
  22. package/dist/actions/initiate-refund/types.d.ts +0 -3
  23. package/dist/actions/integration-payment/action.d.ts +5 -0
  24. package/dist/actions/integration-payment/action.js +7 -0
  25. package/dist/actions/integration-payment/mock.d.ts +2 -0
  26. package/dist/actions/integration-payment/mock.js +4 -0
  27. package/dist/actions/integration-payment/types.d.ts +16 -0
  28. package/dist/actions/open-extension-overlay/action.d.ts +2 -0
  29. package/dist/actions/open-extension-overlay/action.js +4 -0
  30. package/dist/actions/open-extension-overlay/mock.d.ts +2 -0
  31. package/dist/actions/open-extension-overlay/mock.js +1 -0
  32. package/dist/actions/open-extension-overlay/types.d.ts +9 -0
  33. package/dist/actions/park-order/types.d.ts +0 -3
  34. package/dist/actions/partial-payment/types.d.ts +0 -5
  35. package/dist/actions/print/mock.js +3 -6
  36. package/dist/actions/print/types.d.ts +1 -7
  37. package/dist/actions/process-partial-refund/types.d.ts +0 -3
  38. package/dist/actions/remove-customer-note/mock.js +14 -5
  39. package/dist/actions/resolve-extension-overlay/action.d.ts +2 -0
  40. package/dist/actions/resolve-extension-overlay/action.js +4 -0
  41. package/dist/actions/resolve-extension-overlay/mock.d.ts +2 -0
  42. package/dist/actions/resolve-extension-overlay/mock.js +1 -0
  43. package/dist/actions/resolve-extension-overlay/types.d.ts +9 -0
  44. package/dist/actions/resume-parked-order/mock.js +1 -1
  45. package/dist/actions/resume-parked-order/types.d.ts +0 -3
  46. package/dist/actions/save-smart-grid-layout/action.d.ts +2 -0
  47. package/dist/actions/save-smart-grid-layout/action.js +4 -0
  48. package/dist/actions/save-smart-grid-layout/mock.d.ts +2 -0
  49. package/dist/actions/save-smart-grid-layout/mock.js +7 -0
  50. package/dist/actions/save-smart-grid-layout/types.d.ts +12 -0
  51. package/dist/actions/set-active-product-discount/mock.js +1 -1
  52. package/dist/actions/set-active-product-fee/mock.js +1 -1
  53. package/dist/actions/tap-to-pay-payment/types.d.ts +0 -5
  54. package/dist/actions/terminal-payment/types.d.ts +0 -5
  55. package/dist/actions/vendara-payment/types.d.ts +0 -5
  56. package/dist/common-types/index.d.ts +0 -1
  57. package/dist/common-types/index.js +0 -1
  58. package/dist/demo/database.d.ts +21 -21
  59. package/dist/demo/database.js +36 -51
  60. package/dist/index.d.ts +124 -116
  61. package/dist/index.js +19 -15
  62. package/dist/interceptors/types.d.ts +34 -0
  63. package/dist/interceptors/types.js +1 -0
  64. package/dist/projects/render/mocks.js +10 -8
  65. package/dist/projects/render/types.d.ts +6 -5
  66. package/dist/pubsub/topics/attributes/attribute-created/types.d.ts +6 -0
  67. package/dist/pubsub/topics/attributes/attribute-created/types.js +1 -0
  68. package/dist/pubsub/topics/attributes/attribute-updated/types.d.ts +6 -0
  69. package/dist/pubsub/topics/attributes/attribute-updated/types.js +1 -0
  70. package/dist/pubsub/topics/attributes/index.d.ts +3 -0
  71. package/dist/pubsub/topics/attributes/index.js +18 -0
  72. package/dist/pubsub/topics/attributes/types.d.ts +6 -0
  73. package/dist/pubsub/topics/attributes/types.js +2 -0
  74. package/dist/pubsub/topics/categories/category-created/types.d.ts +6 -0
  75. package/dist/pubsub/topics/categories/category-created/types.js +1 -0
  76. package/dist/pubsub/topics/categories/category-updated/types.d.ts +6 -0
  77. package/dist/pubsub/topics/categories/category-updated/types.js +1 -0
  78. package/dist/pubsub/topics/categories/index.d.ts +3 -0
  79. package/dist/pubsub/topics/categories/index.js +18 -0
  80. package/dist/pubsub/topics/categories/types.d.ts +6 -0
  81. package/dist/pubsub/topics/categories/types.js +2 -0
  82. package/dist/pubsub/topics/index.d.ts +4 -0
  83. package/dist/pubsub/topics/index.js +4 -0
  84. package/dist/pubsub/topics/orders/index.js +0 -10
  85. package/dist/pubsub/topics/orders/types.d.ts +2 -6
  86. package/dist/pubsub/topics/orders/types.js +0 -2
  87. package/dist/pubsub/topics/print/print-completed/types.d.ts +1 -1
  88. package/dist/pubsub/topics/print/print-error/types.d.ts +1 -1
  89. package/dist/pubsub/topics/print/print-started/types.d.ts +1 -1
  90. package/dist/pubsub/topics/products/product-get-active/types.d.ts +6 -2
  91. package/dist/pubsub/topics/transactions/index.d.ts +3 -0
  92. package/dist/pubsub/topics/transactions/index.js +18 -0
  93. package/dist/pubsub/topics/transactions/transaction-created/types.d.ts +6 -0
  94. package/dist/pubsub/topics/transactions/transaction-created/types.js +1 -0
  95. package/dist/pubsub/topics/transactions/transaction-updated/types.d.ts +6 -0
  96. package/dist/pubsub/topics/transactions/transaction-updated/types.js +1 -0
  97. package/dist/pubsub/topics/transactions/types.d.ts +6 -0
  98. package/dist/pubsub/topics/transactions/types.js +2 -0
  99. package/dist/pubsub/topics/types.d.ts +8 -0
  100. package/dist/pubsub/topics/users/index.js +10 -0
  101. package/dist/pubsub/topics/users/types.d.ts +6 -2
  102. package/dist/pubsub/topics/users/types.js +2 -0
  103. package/dist/pubsub/topics/users/user-created/types.d.ts +6 -0
  104. package/dist/pubsub/topics/users/user-created/types.js +1 -0
  105. package/dist/pubsub/topics/users/user-updated/types.d.ts +6 -0
  106. package/dist/pubsub/topics/users/user-updated/types.js +1 -0
  107. package/dist/pubsub/topics/variants/index.d.ts +3 -0
  108. package/dist/pubsub/topics/variants/index.js +18 -0
  109. package/dist/pubsub/topics/variants/types.d.ts +6 -0
  110. package/dist/pubsub/topics/variants/types.js +2 -0
  111. package/dist/pubsub/topics/variants/variant-created/types.d.ts +6 -0
  112. package/dist/pubsub/topics/variants/variant-created/types.js +1 -0
  113. package/dist/pubsub/topics/variants/variant-updated/types.d.ts +6 -0
  114. package/dist/pubsub/topics/variants/variant-updated/types.js +1 -0
  115. package/package.json +15 -12
  116. package/dist/actions/can-transition/action.d.ts +0 -2
  117. package/dist/actions/can-transition/action.js +0 -4
  118. package/dist/actions/can-transition/mock.d.ts +0 -6
  119. package/dist/actions/can-transition/mock.js +0 -28
  120. package/dist/actions/can-transition/types.d.ts +0 -11
  121. package/dist/actions/get-available-transitions/action.d.ts +0 -2
  122. package/dist/actions/get-available-transitions/action.js +0 -4
  123. package/dist/actions/get-available-transitions/mock.d.ts +0 -6
  124. package/dist/actions/get-available-transitions/mock.js +0 -26
  125. package/dist/actions/get-available-transitions/types.d.ts +0 -9
  126. package/dist/actions/trigger-webhook/action.d.ts +0 -6
  127. package/dist/actions/trigger-webhook/action.js +0 -8
  128. package/dist/actions/trigger-webhook/mock.d.ts +0 -2
  129. package/dist/actions/trigger-webhook/mock.js +0 -8
  130. package/dist/actions/trigger-webhook/types.d.ts +0 -21
  131. package/dist/actions/trigger-webhook/types.js +0 -2
  132. package/dist/actions/trigger-zapier-webhook/action.d.ts +0 -6
  133. package/dist/actions/trigger-zapier-webhook/action.js +0 -8
  134. package/dist/actions/trigger-zapier-webhook/mock.d.ts +0 -2
  135. package/dist/actions/trigger-zapier-webhook/mock.js +0 -8
  136. package/dist/actions/trigger-zapier-webhook/types.d.ts +0 -9
  137. package/dist/common-types/order-state.d.ts +0 -32
  138. package/dist/common-types/order-state.js +0 -6
  139. package/dist/common-types/state-fragment.d.ts +0 -77
  140. package/dist/common-types/state-fragment.js +0 -10
  141. package/dist/fragments/index.d.ts +0 -1
  142. package/dist/fragments/index.js +0 -1
  143. package/dist/fragments/preorder-no-deposit.d.ts +0 -26
  144. package/dist/fragments/preorder-no-deposit.js +0 -166
  145. package/dist/pubsub/topics/orders/state-transition-blocked/types.d.ts +0 -16
  146. package/dist/pubsub/topics/orders/state-transition-completed/types.d.ts +0 -15
  147. /package/dist/actions/{can-transition → get-smart-grid-layout}/types.js +0 -0
  148. /package/dist/actions/{get-available-transitions → integration-payment}/types.js +0 -0
  149. /package/dist/actions/{trigger-zapier-webhook → open-extension-overlay}/types.js +0 -0
  150. /package/dist/{pubsub/topics/orders/state-transition-blocked → actions/resolve-extension-overlay}/types.js +0 -0
  151. /package/dist/{pubsub/topics/orders/state-transition-completed → actions/save-smart-grid-layout}/types.js +0 -0
@@ -1,486 +1,78 @@
1
1
  export * from "./common-types";
2
- export declare enum CurrencyCode {
3
- USD = "USD",
4
- EUR = "EUR",
5
- GBP = "GBP",
6
- CAD = "CAD",
7
- AUD = "AUD",
8
- NZD = "NZD",
9
- CHF = "CHF",
10
- CNY = "CNY",
11
- INR = "INR",
12
- MXN = "MXN",
13
- BRL = "BRL",
14
- ZAR = "ZAR",
15
- SGD = "SGD",
16
- HKD = "HKD",
17
- SEK = "SEK",
18
- NOK = "NOK",
19
- DKK = "DKK",
20
- PLN = "PLN",
21
- THB = "THB",
22
- MYR = "MYR",
23
- PHP = "PHP",
24
- IDR = "IDR",
25
- AED = "AED",
26
- SAR = "SAR",
27
- ILS = "ILS",
28
- TRY = "TRY",
29
- RUB = "RUB",
30
- JPY = "JPY",
31
- KRW = "KRW",
32
- VND = "VND",
33
- CLP = "CLP",
34
- ISK = "ISK",
35
- HUF = "HUF",
36
- TWD = "TWD",
37
- KWD = "KWD",
38
- BHD = "BHD",
39
- OMR = "OMR",
40
- JOD = "JOD",
41
- TND = "TND",
42
- LYD = "LYD",
43
- IQD = "IQD"
44
- }
45
- export declare enum CFProductType {
46
- SIMPLE = "simple",
47
- VARIABLE = "variable"
48
- }
49
- export declare enum CFUserTypes {
50
- OWNER = "owner",
51
- ORG_USER = "organization_user",
52
- ORG_OWNER = "organization_owner",
53
- FINAL_USER = "final_user",
54
- FINAL_OWNER = "final_owner",
55
- EMPLOYEE = "employee",
56
- SUPER_ADMIN = "super_admin",
57
- MANAGER = "manager",
58
- ADMIN = "admin",
59
- ASSISTANT_MANAGER = "assistant",
60
- CASHIER = "cashier",
61
- RESELLER = "reseller"
62
- }
63
- export type CFActiveEntity = object;
64
- export interface CFDiscount {
65
- value: number;
66
- label?: string;
67
- isPercent?: boolean;
68
- }
69
- export interface CFCustomFee {
70
- label: string;
71
- amount: number;
72
- isPercent: boolean;
73
- applyTaxes: boolean;
74
- taxTableId?: string;
75
- }
76
- export interface CFAddress {
77
- firstName: string;
78
- lastName: string;
79
- company?: string | null;
80
- city: string;
81
- postCode: string;
82
- province?: string;
83
- state?: string;
84
- country?: string;
85
- address1: string;
86
- address2: string;
87
- }
88
- export interface CFMetadataItem {
89
- key: string;
90
- value: string;
91
- }
92
- export interface CFTax {
93
- id: string;
94
- name: string;
95
- percentage: number;
96
- amount: number;
97
- taxTableName: string;
98
- taxTableId: string;
99
- }
100
- export interface CFInventory {
101
- outletId: string;
102
- stock?: number | null;
103
- _id?: string;
104
- }
105
- export interface CFCustomerNote {
106
- _id?: string;
107
- createdAt: string;
108
- message: string;
109
- }
110
- export interface CFOrderNote {
111
- externalId?: string;
112
- author?: string;
113
- note?: string;
114
- customerNote?: boolean;
115
- addedByUser?: string;
116
- dateCreated?: string;
117
- }
118
- export interface CFCategory {
119
- _id: string;
120
- companyId: string;
121
- externalId: string;
122
- name: string;
123
- parentId: null | string;
124
- __v?: number;
125
- }
126
- export interface CFProductVariant {
127
- sku: string;
128
- price: number;
129
- salePrice: number;
130
- isOnSale: boolean;
131
- barcode?: string;
132
- costPrice?: number;
133
- manageStock: boolean;
134
- externalId?: string;
135
- inventory?: CFInventory[];
136
- allowBackorder?: boolean;
137
- images?: string[];
138
- attributes: {
139
- name: string;
140
- value?: string;
141
- }[];
142
- metadata?: {
143
- key: string;
144
- value: string;
145
- }[];
146
- _id: string;
147
- }
148
- export interface CFProduct {
149
- _id: string;
150
- companyId?: string;
151
- externalId?: string;
152
- taxTable: string;
153
- name: string;
154
- description?: string;
155
- shortDescription?: string;
156
- images?: string[];
157
- categories: string[];
158
- attributes: {
159
- name: string;
160
- values: string[];
161
- }[];
162
- tags?: string[];
163
- supplier?: string;
164
- sku?: string;
165
- productType: CFProductType;
166
- variants: CFProductVariant[];
167
- currency: CurrencyCode;
168
- minorUnits: number;
169
- minPrice?: number;
170
- maxPrice?: number;
171
- status?: string;
172
- isDeleted?: boolean;
173
- }
174
- export interface CFActiveProduct extends CFActiveEntity {
175
- id: string;
176
- internalId: string;
177
- externalId: string;
178
- productExternalId: string;
179
- variantId: string;
180
- name: string;
181
- sku: string;
182
- price: number;
183
- images: string[];
184
- taxTableId: string;
185
- quantity: number;
186
- note?: string;
187
- discount?: CFDiscount;
188
- description?: string;
189
- longDescription?: string;
190
- shortDescription?: string;
191
- barcodeId?: string;
192
- stock: number;
193
- allowBackOrder?: boolean;
194
- fee?: CFCustomFee;
195
- isUnlimited?: boolean;
196
- attributes?: string;
197
- localQuantity?: number;
198
- }
199
- export interface CFCustomer {
200
- _id: string;
201
- companyId: string;
202
- externalId?: string;
203
- email: string;
204
- firstName: string;
205
- lastName: string;
206
- fromOliver?: boolean;
207
- phone?: string;
208
- tags?: string[];
209
- metadata?: Record<string, string>[];
210
- notes?: CFCustomerNote[];
211
- billing: CFAddress | null;
212
- shipping: CFAddress | null;
213
- createdAt?: string;
214
- updatedAt?: string;
215
- }
216
- export interface CFActiveCustomer extends CFCustomer {
217
- id?: string;
218
- }
219
- export interface CFTip {
220
- amount: number;
221
- percentage: number;
222
- }
223
- export interface CFSummary {
224
- discountTotal: number;
225
- shippingTotal?: number | null;
226
- total: number;
227
- totalTaxes: number;
228
- subTotal: number;
229
- taxes: CFTax[];
230
- tip?: CFTip | null;
231
- isTaxInclusive: boolean;
232
- /** Portion of order total that is non-revenue (e.g. gift card load), same string money format as `total` */
233
- nonRevenueTotal?: string;
234
- }
235
- export interface CFCartDiscountItem {
236
- label: string;
237
- amount: number;
238
- percentage: number;
239
- }
240
- export interface CFCartFeeItem {
241
- id: string;
242
- label: string;
243
- amount: number;
244
- percentage: number;
245
- taxTableId?: string;
246
- tax?: number;
247
- taxName: string;
248
- }
249
- export interface CFTipPayment {
250
- amount: number;
251
- tipTo: string;
252
- percentage: number;
253
- }
254
- export interface CFRefundedTipPayment {
255
- amount: number;
256
- percentage: number;
257
- transactionId: string;
258
- tipTo: string;
259
- }
260
- export interface CFPaymentMethod {
261
- transactionId: string;
262
- paymentType: string;
263
- amount: number;
264
- timestamp: string;
265
- processor: string;
266
- saleId?: string;
267
- change?: number | null;
268
- tip?: CFTipPayment | null;
269
- cashRounding?: number;
270
- emv?: string | null;
271
- }
272
- export interface CFPosDataItem {
273
- outlet: string;
274
- station: string;
275
- employee: string | {
276
- _id?: string;
277
- firstName: string;
278
- lastName: string;
279
- };
280
- }
281
- export interface CFDiscountDetail {
282
- percentage: number;
283
- amount: number;
284
- label?: string;
285
- }
286
- export interface CFFeeDetail {
287
- percentage: number;
288
- amount: number;
289
- tax: number;
290
- taxTableId: string;
291
- label?: string;
292
- }
293
- export interface CFDiscountLineItem {
294
- itemDiscount: CFDiscountDetail;
295
- cartDiscount: CFDiscountDetail;
296
- }
297
- export interface CFFeeLineItem {
298
- itemFee: CFFeeDetail;
299
- cartFee?: CFFeeDetail;
300
- }
301
- export interface CFLineItem {
302
- productId: string;
303
- variantExternalId?: string;
304
- productExternalId?: string;
305
- internalId?: string;
306
- name: string;
307
- quantity: number;
308
- price: number;
309
- taxes: CFTax[];
310
- discount: CFDiscountLineItem;
311
- fee: CFFeeLineItem;
312
- totalTax: number;
313
- total: number;
314
- metadata: CFMetadataItem[];
315
- image: string;
316
- sku: string;
317
- stock: number;
318
- note?: string;
319
- description?: string;
320
- variantId: string;
321
- images?: string[];
322
- attributes?: string;
323
- }
324
- export interface CFCustomSale {
325
- customSaleId: string;
326
- name: string;
327
- price: number;
328
- quantity: number;
329
- applyTaxes: boolean;
330
- total: number;
331
- totalTax: number;
332
- taxes: CFTax[];
333
- discount: {
334
- cartDiscount: CFDiscountDetail;
335
- };
336
- fee: {
337
- cartFee: CFFeeDetail;
338
- };
339
- }
340
- export interface CFRefundedLineItem {
341
- productId: string;
342
- variantId: string;
343
- variantExternalId?: string;
344
- productExternalId?: string;
345
- internalId?: string;
346
- name: string;
347
- quantity: number;
348
- price: number;
349
- taxes: CFTax[];
350
- discount: CFDiscountLineItem;
351
- totalTax: number;
352
- total: number;
353
- image: string;
354
- sku: string;
355
- note?: string;
356
- description?: string;
357
- images?: string[];
358
- fee: CFFeeLineItem;
359
- }
360
- export type CFRefundedCustomSale = CFCustomSale;
361
- export interface CFRefundItem {
362
- lineItems: CFRefundedLineItem[];
363
- customSales: CFRefundedCustomSale[];
364
- cartFees: CFCartFeeItem[];
365
- tips: CFRefundedTipPayment[];
366
- refundedBy: string;
367
- timestamp: string | undefined;
368
- summary?: CFSummary;
369
- refundPayment: CFPaymentMethod[];
370
- balance?: number;
371
- receiptId?: string;
372
- currency: CurrencyCode;
373
- minorUnits: number;
374
- }
375
- export interface CFOrder {
376
- _id: string;
377
- currency: CurrencyCode;
378
- minorUnits: number;
379
- receiptId?: string;
380
- companyId: string;
381
- externalId: string | null;
382
- status: string;
383
- /** Financial state (state machine). Undefined on legacy orders pre-backfill. */
384
- paymentState?: string;
385
- /** Operational state (state machine). Undefined on legacy orders pre-backfill. */
386
- fulfillmentState?: string;
387
- /** Computed display label from paymentState + fulfillmentState matrix. */
388
- displayState?: string;
389
- customer: Partial<CFActiveCustomer | null>;
390
- customerNote?: string;
391
- summary: CFSummary;
392
- cartDiscount: CFCartDiscountItem | null;
393
- cartFees: CFCartFeeItem[] | null;
394
- updatedAt?: string;
395
- createdAt?: string;
396
- paymentMethods: CFPaymentMethod[];
397
- source: string;
398
- posData: CFPosDataItem | null;
399
- sessionId: string;
400
- metadata: CFMetadataItem[];
401
- notes?: CFOrderNote[] | null;
402
- billing: CFAddress | null;
403
- shipping: CFAddress | null;
404
- lineItems: CFLineItem[];
405
- customSales: CFCustomSale[];
406
- /** Gift card / liability purchase lines (not product revenue) */
407
- nonRevenueItems?: CFNonRevenueItem[];
408
- refund?: CFRefundItem[];
409
- balance: number;
410
- signature?: string | null;
411
- }
412
- export interface CFActiveUserRole {
413
- id?: string;
414
- _id?: string;
415
- companyId?: string;
416
- name: string;
417
- permissions: {
418
- category: string;
419
- label?: string;
420
- name: string;
421
- value: boolean;
422
- permissionId?: string;
423
- subCategory?: string;
424
- }[];
425
- }
426
- export interface CFActiveUser extends CFActiveEntity {
427
- firstName?: string;
428
- lastName?: string;
429
- email?: string;
430
- phone?: string;
431
- pincode?: string;
432
- role: CFActiveUserRole | {
433
- _id: string;
434
- name: string;
435
- };
436
- id: string;
437
- _id?: string;
438
- outlets?: string[] | {
439
- _id: string;
440
- }[];
441
- type?: CFUserTypes;
442
- companies?: unknown;
443
- }
444
- export interface CFActiveOutlet extends CFActiveEntity {
445
- address: string;
446
- address2: string;
447
- city: string;
448
- state: string;
449
- country?: string;
450
- taxId: string;
451
- postCode?: string;
2
+ import type { Tax, Tip, Address, MetadataItem, PosDataItem, CartFeeTaxEntry, CartFeeItem, CartDiscountItem, OrderNote, NonRevenueItem, DiscountDetail, FeeDetail, DiscountLineItem, FeeLineItem, LineItem, TipPayment, RefundedTipPayment, PaymentMethod, Discount, CustomFee, Summary, CustomSale, RefundedCustomSale, RefundItem, RefundedLineItem, ActiveStation, ActiveSession, ActiveOutlet, ActiveUser, ActiveUserRole, ActiveOrder, ActiveCart, ActivePark, ActiveCompany, ActiveCustomSales, ActiveProduct, ActiveCustomer, FullProduct, ProductVariant, Inventory, CustomerNote, Attribute, AttributeOption, Category, Transaction } from "@final-commerce/common/pos-types";
3
+ export { CurrencyCode, ProductType as CFProductType, UserTypes as CFUserTypes } from "@final-commerce/common";
4
+ /** Open record used as a base for active entities. */
5
+ export type CFActiveEntity = Record<string, unknown>;
6
+ export type CFDiscount = Discount;
7
+ export type CFCustomFee = CustomFee;
8
+ export type CFAddress = Address;
9
+ export type CFMetadataItem = MetadataItem;
10
+ export type CFTax = Tax;
11
+ export type CFCartFeeTaxEntry = CartFeeTaxEntry;
12
+ export type CFInventory = Inventory;
13
+ export type CFCustomerNote = CustomerNote;
14
+ export type CFOrderNote = OrderNote;
15
+ export type CFAttributeOption = AttributeOption;
16
+ export type CFAttribute = Attribute;
17
+ export type CFTransaction = Transaction;
18
+ export type CFCategory = Category;
19
+ export type CFProductVariant = ProductVariant;
20
+ export type CFProduct = FullProduct;
21
+ export type CFActiveProduct = ActiveProduct;
22
+ export type CFCustomer = ActiveCustomer;
23
+ export type CFActiveCustomer = ActiveCustomer;
24
+ export type CFTip = Tip;
25
+ export type CFSummary = Summary;
26
+ export type CFCartDiscountItem = CartDiscountItem;
27
+ export type CFCartFeeItem = CartFeeItem;
28
+ export type CFTipPayment = TipPayment;
29
+ export type CFRefundedTipPayment = RefundedTipPayment;
30
+ export type CFPaymentMethod = PaymentMethod;
31
+ export type CFPosDataItem = PosDataItem;
32
+ export type CFDiscountDetail = DiscountDetail;
33
+ export type CFFeeDetail = FeeDetail;
34
+ export type CFDiscountLineItem = DiscountLineItem;
35
+ export type CFFeeLineItem = FeeLineItem;
36
+ export type CFLineItem = LineItem;
37
+ export type CFCustomSale = CustomSale;
38
+ export type CFRefundedLineItem = RefundedLineItem;
39
+ export type CFRefundedCustomSale = RefundedCustomSale;
40
+ export type CFRefundItem = RefundItem;
41
+ export type CFOrder = ActiveOrder;
42
+ export type CFActiveUserRole = ActiveUserRole;
43
+ export type CFActiveUser = ActiveUser;
44
+ export type CFActiveOutlet = ActiveOutlet;
45
+ export type CFActiveStation = ActiveStation;
46
+ export type CFSession = ActiveSession;
47
+ export type CFActiveOrder = ActiveOrder;
48
+ export type CFActiveCustomSales = ActiveCustomSales;
49
+ export type CFNonRevenueItem = NonRevenueItem;
50
+ export type CFActiveCart = ActiveCart;
51
+ export type CFActivePark = ActivePark;
52
+ export type CFActiveCompany = ActiveCompany;
53
+ /** Tile kinds a SmartGrid cell can represent. Mirrors common's `BaseTile['type']`. */
54
+ export type CFTileType = "empty" | "product" | "action" | "category" | "folder" | "back";
55
+ /**
56
+ * A single positioned cell in a SmartGrid layout. The wire/extension-facing shape
57
+ * (Render's adapter maps this to/from common's `BaseTile`).
58
+ */
59
+ export interface CFTileCell {
60
+ /** Position of the cell within its grid (or folder). */
61
+ index: number;
62
+ type: CFTileType;
63
+ /** Entity id the cell points at (product/category/folder id, action key, …). */
64
+ entityId?: string;
65
+ /** Opaque entity payload round-tripped with the cell. */
66
+ entityData?: Record<string, unknown>;
67
+ }
68
+ /** A builder SmartGrid layout addressed by `gridId`, with optional folder sub-grids. */
69
+ export interface CFSmartGridLayout {
70
+ gridId: string;
71
+ cells: CFTileCell[];
72
+ /** Operator-editable display name for the grid. */
452
73
  name?: string;
453
- stripe?: {
454
- locationId: string;
455
- };
456
- id: string;
457
- sequenceNumber: number;
458
- _id?: string;
459
- stripeAccountId: string;
460
- }
461
- export interface CFActiveStation {
462
- _id: string;
463
- sequenceNumber?: number;
464
- name: string;
465
- status: string;
466
- buildSrcId?: string;
467
- buildVersion?: string;
468
- publishBuildId?: string;
469
- createdAt?: string;
470
- updatedAt?: string;
471
- stripeTerminalId?: string;
472
- }
473
- /** Cash register session (station session), aligned with Render `Session`. */
474
- export interface CFSession {
475
- id: string;
476
- stationId: string;
477
- openingAmount?: number;
478
- closingAmount?: number;
479
- openedBy?: string;
480
- closedBy?: string;
481
- notes?: string[];
482
- currency?: CurrencyCode;
483
- minorUnits?: number;
74
+ /** Folder id → its cells. */
75
+ folders?: Record<string, CFTileCell[]>;
484
76
  }
485
77
  /** Refund UI / selection state in POS, aligned with Render `ActiveRefundOrder`. */
486
78
  export interface CFRefundProcessingStatus {
@@ -503,59 +95,6 @@ export interface CFActiveRefundDetails {
503
95
  refundProcessingStatus?: CFRefundProcessingStatus | null;
504
96
  sessionRefundedTotal?: number;
505
97
  }
506
- export interface CFActiveOrder extends CFOrder {
507
- id?: string;
508
- internalId?: string;
509
- user?: CFActiveUser;
510
- outlet?: CFActiveOutlet;
511
- isDeleted?: boolean;
512
- newOrder?: boolean;
513
- station?: CFActiveStation;
514
- }
515
- export interface CFActiveCustomSales {
516
- id: string;
517
- name: string;
518
- applyTaxes: boolean;
519
- taxTableId?: string;
520
- quantity: number;
521
- price: number;
522
- discount?: Record<string, unknown>;
523
- fee?: Record<string, unknown>;
524
- }
525
- /** Non-revenue cart line (e.g. gift card load) — aligned with Render `NonRevenueItem.externalId` (order line id). */
526
- export interface CFNonRevenueItem {
527
- /** Unique cart/order line id (Mongo-style id from host). Extension reference is usually `metadata.refId`. */
528
- externalId: string;
529
- amount: number | string;
530
- label?: string;
531
- metadata?: Record<string, unknown>;
532
- applyTaxes?: boolean;
533
- taxTableId?: string;
534
- }
535
- export interface CFActiveCart extends CFActiveEntity {
536
- tax?: number;
537
- total: number;
538
- subtotal: number;
539
- discount?: CFDiscount;
540
- customFee?: CFCustomFee[];
541
- products: CFActiveProduct[];
542
- customSales?: CFActiveCustomSales[];
543
- /** Gift card / liability lines — included in cart total */
544
- nonRevenueItems?: CFNonRevenueItem[];
545
- remainingBalance?: number;
546
- amountToBeCharged: number;
547
- customer?: Partial<CFCustomer | null> | null;
548
- orderNotes?: string;
549
- cartTotal?: number;
550
- orderTotal?: number;
551
- orderId?: string;
552
- }
553
- export interface CFActiveCompany extends CFActiveEntity {
554
- id?: string;
555
- name?: string;
556
- logo?: string;
557
- settings?: Record<string, unknown>;
558
- }
559
98
  export type CFProjectName = "Render" | "Manage";
560
99
  export interface CFContextRender {
561
100
  userId: string | null;
@@ -572,6 +111,12 @@ export interface CFContextRender {
572
111
  buildSourceId: string | null;
573
112
  buildIsPremium: boolean;
574
113
  isOffline: boolean;
114
+ currency: string | null;
115
+ currencySymbol: string | null;
116
+ currencyPrefix: string | null;
117
+ currencySuffix: string | null;
118
+ thousandSeparator: string | null;
119
+ decimalSeparator: string | null;
575
120
  user: Record<string, unknown> | null;
576
121
  company: Omit<Record<string, unknown>, "settings"> | null;
577
122
  station: Record<string, unknown> | null;
@@ -1,66 +1,6 @@
1
1
  export * from "./common-types";
2
- export var CurrencyCode;
3
- (function (CurrencyCode) {
4
- CurrencyCode["USD"] = "USD";
5
- CurrencyCode["EUR"] = "EUR";
6
- CurrencyCode["GBP"] = "GBP";
7
- CurrencyCode["CAD"] = "CAD";
8
- CurrencyCode["AUD"] = "AUD";
9
- CurrencyCode["NZD"] = "NZD";
10
- CurrencyCode["CHF"] = "CHF";
11
- CurrencyCode["CNY"] = "CNY";
12
- CurrencyCode["INR"] = "INR";
13
- CurrencyCode["MXN"] = "MXN";
14
- CurrencyCode["BRL"] = "BRL";
15
- CurrencyCode["ZAR"] = "ZAR";
16
- CurrencyCode["SGD"] = "SGD";
17
- CurrencyCode["HKD"] = "HKD";
18
- CurrencyCode["SEK"] = "SEK";
19
- CurrencyCode["NOK"] = "NOK";
20
- CurrencyCode["DKK"] = "DKK";
21
- CurrencyCode["PLN"] = "PLN";
22
- CurrencyCode["THB"] = "THB";
23
- CurrencyCode["MYR"] = "MYR";
24
- CurrencyCode["PHP"] = "PHP";
25
- CurrencyCode["IDR"] = "IDR";
26
- CurrencyCode["AED"] = "AED";
27
- CurrencyCode["SAR"] = "SAR";
28
- CurrencyCode["ILS"] = "ILS";
29
- CurrencyCode["TRY"] = "TRY";
30
- CurrencyCode["RUB"] = "RUB";
31
- CurrencyCode["JPY"] = "JPY";
32
- CurrencyCode["KRW"] = "KRW";
33
- CurrencyCode["VND"] = "VND";
34
- CurrencyCode["CLP"] = "CLP";
35
- CurrencyCode["ISK"] = "ISK";
36
- CurrencyCode["HUF"] = "HUF";
37
- CurrencyCode["TWD"] = "TWD";
38
- CurrencyCode["KWD"] = "KWD";
39
- CurrencyCode["BHD"] = "BHD";
40
- CurrencyCode["OMR"] = "OMR";
41
- CurrencyCode["JOD"] = "JOD";
42
- CurrencyCode["TND"] = "TND";
43
- CurrencyCode["LYD"] = "LYD";
44
- CurrencyCode["IQD"] = "IQD";
45
- })(CurrencyCode || (CurrencyCode = {}));
46
- // Enums
47
- export var CFProductType;
48
- (function (CFProductType) {
49
- CFProductType["SIMPLE"] = "simple";
50
- CFProductType["VARIABLE"] = "variable";
51
- })(CFProductType || (CFProductType = {}));
52
- export var CFUserTypes;
53
- (function (CFUserTypes) {
54
- CFUserTypes["OWNER"] = "owner";
55
- CFUserTypes["ORG_USER"] = "organization_user";
56
- CFUserTypes["ORG_OWNER"] = "organization_owner";
57
- CFUserTypes["FINAL_USER"] = "final_user";
58
- CFUserTypes["FINAL_OWNER"] = "final_owner";
59
- CFUserTypes["EMPLOYEE"] = "employee";
60
- CFUserTypes["SUPER_ADMIN"] = "super_admin";
61
- CFUserTypes["MANAGER"] = "manager";
62
- CFUserTypes["ADMIN"] = "admin";
63
- CFUserTypes["ASSISTANT_MANAGER"] = "assistant";
64
- CFUserTypes["CASHIER"] = "cashier";
65
- CFUserTypes["RESELLER"] = "reseller";
66
- })(CFUserTypes || (CFUserTypes = {}));
2
+ // Enums — re-exported from common (single source). CurrencyCode keeps its name;
3
+ // CFProductType/CFUserTypes alias common's ProductType/UserTypes. Note: common's
4
+ // UserTypes uses `COMPANY_OWNER` where command-frame's enum previously had `OWNER`
5
+ // (same value `'owner'`).
6
+ export { CurrencyCode, ProductType as CFProductType, UserTypes as CFUserTypes } from "@final-commerce/common";