@final-commerce/command-frame 0.2.0-beta.6 → 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 (100) hide show
  1. package/README.md +28 -26
  2. package/dist/CommonTypes.d.ts +72 -622
  3. package/dist/CommonTypes.js +5 -65
  4. package/dist/actions/add-product/mock.js +1 -1
  5. package/dist/actions/add-product-discount/mock.js +5 -5
  6. package/dist/actions/add-product-fee/mock.js +6 -6
  7. package/dist/actions/cash-payment/types.d.ts +0 -5
  8. package/dist/actions/delete-parked-order/types.d.ts +0 -3
  9. package/dist/actions/edit-product/mock.js +1 -1
  10. package/dist/actions/extension-payment/types.d.ts +4 -5
  11. package/dist/actions/get-products/mock.js +3 -3
  12. package/dist/actions/get-roles/mock.js +35 -41
  13. package/dist/actions/get-smart-grid-layout/action.d.ts +2 -0
  14. package/dist/actions/get-smart-grid-layout/action.js +4 -0
  15. package/dist/actions/get-smart-grid-layout/mock.d.ts +2 -0
  16. package/dist/actions/get-smart-grid-layout/mock.js +7 -0
  17. package/dist/actions/get-smart-grid-layout/types.d.ts +12 -0
  18. package/dist/actions/get-users/mock.js +16 -25
  19. package/dist/actions/initiate-refund/types.d.ts +0 -3
  20. package/dist/actions/integration-payment/action.d.ts +5 -0
  21. package/dist/actions/integration-payment/action.js +7 -0
  22. package/dist/actions/integration-payment/mock.d.ts +2 -0
  23. package/dist/actions/integration-payment/mock.js +4 -0
  24. package/dist/actions/integration-payment/types.d.ts +16 -0
  25. package/dist/actions/open-extension-overlay/action.d.ts +2 -0
  26. package/dist/actions/open-extension-overlay/action.js +4 -0
  27. package/dist/actions/open-extension-overlay/mock.d.ts +2 -0
  28. package/dist/actions/open-extension-overlay/mock.js +1 -0
  29. package/dist/actions/open-extension-overlay/types.d.ts +9 -0
  30. package/dist/actions/park-order/types.d.ts +0 -3
  31. package/dist/actions/partial-payment/types.d.ts +0 -5
  32. package/dist/actions/process-partial-refund/types.d.ts +0 -3
  33. package/dist/actions/resolve-extension-overlay/action.d.ts +2 -0
  34. package/dist/actions/resolve-extension-overlay/action.js +4 -0
  35. package/dist/actions/resolve-extension-overlay/mock.d.ts +2 -0
  36. package/dist/actions/resolve-extension-overlay/mock.js +1 -0
  37. package/dist/actions/resolve-extension-overlay/types.d.ts +9 -0
  38. package/dist/actions/resume-parked-order/mock.js +1 -1
  39. package/dist/actions/resume-parked-order/types.d.ts +0 -3
  40. package/dist/actions/save-smart-grid-layout/action.d.ts +2 -0
  41. package/dist/actions/save-smart-grid-layout/action.js +4 -0
  42. package/dist/actions/save-smart-grid-layout/mock.d.ts +2 -0
  43. package/dist/actions/save-smart-grid-layout/mock.js +7 -0
  44. package/dist/actions/save-smart-grid-layout/types.d.ts +12 -0
  45. package/dist/actions/set-active-product-discount/mock.js +1 -1
  46. package/dist/actions/set-active-product-fee/mock.js +1 -1
  47. package/dist/actions/tap-to-pay-payment/types.d.ts +0 -5
  48. package/dist/actions/terminal-payment/types.d.ts +0 -5
  49. package/dist/actions/vendara-payment/types.d.ts +0 -5
  50. package/dist/common-types/index.d.ts +0 -1
  51. package/dist/common-types/index.js +0 -1
  52. package/dist/demo/database.d.ts +21 -21
  53. package/dist/demo/database.js +27 -27
  54. package/dist/index.d.ts +115 -115
  55. package/dist/index.js +15 -15
  56. package/dist/interceptors/types.d.ts +34 -0
  57. package/dist/interceptors/types.js +1 -0
  58. package/dist/projects/render/mocks.js +10 -8
  59. package/dist/projects/render/types.d.ts +6 -5
  60. package/dist/pubsub/topics/orders/index.js +0 -10
  61. package/dist/pubsub/topics/orders/types.d.ts +2 -6
  62. package/dist/pubsub/topics/orders/types.js +0 -2
  63. package/dist/pubsub/topics/products/product-get-active/types.d.ts +6 -2
  64. package/package.json +15 -12
  65. package/dist/actions/can-transition/action.d.ts +0 -2
  66. package/dist/actions/can-transition/action.js +0 -4
  67. package/dist/actions/can-transition/mock.d.ts +0 -6
  68. package/dist/actions/can-transition/mock.js +0 -28
  69. package/dist/actions/can-transition/types.d.ts +0 -11
  70. package/dist/actions/get-available-transitions/action.d.ts +0 -2
  71. package/dist/actions/get-available-transitions/action.js +0 -4
  72. package/dist/actions/get-available-transitions/mock.d.ts +0 -6
  73. package/dist/actions/get-available-transitions/mock.js +0 -26
  74. package/dist/actions/get-available-transitions/types.d.ts +0 -9
  75. package/dist/actions/trigger-webhook/action.d.ts +0 -6
  76. package/dist/actions/trigger-webhook/action.js +0 -8
  77. package/dist/actions/trigger-webhook/mock.d.ts +0 -2
  78. package/dist/actions/trigger-webhook/mock.js +0 -8
  79. package/dist/actions/trigger-webhook/types.d.ts +0 -21
  80. package/dist/actions/trigger-webhook/types.js +0 -2
  81. package/dist/actions/trigger-zapier-webhook/action.d.ts +0 -6
  82. package/dist/actions/trigger-zapier-webhook/action.js +0 -8
  83. package/dist/actions/trigger-zapier-webhook/mock.d.ts +0 -2
  84. package/dist/actions/trigger-zapier-webhook/mock.js +0 -8
  85. package/dist/actions/trigger-zapier-webhook/types.d.ts +0 -9
  86. package/dist/common-types/order-state.d.ts +0 -32
  87. package/dist/common-types/order-state.js +0 -6
  88. package/dist/common-types/state-fragment.d.ts +0 -77
  89. package/dist/common-types/state-fragment.js +0 -10
  90. package/dist/fragments/index.d.ts +0 -1
  91. package/dist/fragments/index.js +0 -1
  92. package/dist/fragments/preorder-no-deposit.d.ts +0 -26
  93. package/dist/fragments/preorder-no-deposit.js +0 -166
  94. package/dist/pubsub/topics/orders/state-transition-blocked/types.d.ts +0 -16
  95. package/dist/pubsub/topics/orders/state-transition-completed/types.d.ts +0 -15
  96. /package/dist/actions/{can-transition → get-smart-grid-layout}/types.js +0 -0
  97. /package/dist/actions/{get-available-transitions → integration-payment}/types.js +0 -0
  98. /package/dist/actions/{trigger-zapier-webhook → open-extension-overlay}/types.js +0 -0
  99. /package/dist/{pubsub/topics/orders/state-transition-blocked → actions/resolve-extension-overlay}/types.js +0 -0
  100. /package/dist/{pubsub/topics/orders/state-transition-completed → actions/save-smart-grid-layout}/types.js +0 -0
@@ -1,557 +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
- }
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. */
63
5
  export type CFActiveEntity = Record<string, unknown>;
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
- /** Whether this tax compounds on top of others. */
100
- compounding?: boolean;
101
- /** Application order; lower numbers apply first. */
102
- priority?: number;
103
- }
104
- /** Per-rate tax entry on a cart fee (gst, hst, etc.). Same shape as `CFTax`; declared
105
- * separately to match the host's distinct `CartFeeTaxEntry` type. */
106
- export interface CFCartFeeTaxEntry {
107
- id: string;
108
- name: string;
109
- percentage: number;
110
- amount: number;
111
- taxTableId: string;
112
- taxTableName: string;
113
- compounding?: boolean;
114
- priority?: number;
115
- }
116
- export interface CFInventory {
117
- /** Warehouse identifier the stock is held at. */
118
- warehouse: string;
119
- outletId: string;
120
- stock?: number | null;
121
- _id?: string;
122
- }
123
- export interface CFCustomerNote {
124
- _id?: string;
125
- createdAt: string;
126
- message: string;
127
- }
128
- export interface CFOrderNote {
129
- externalId?: string;
130
- author?: string;
131
- note?: string;
132
- customerNote?: boolean;
133
- addedByUser?: string;
134
- dateCreated?: string;
135
- }
136
- export interface CFAttributeOption {
137
- name: string;
138
- order?: number;
139
- }
140
- export interface CFAttribute {
141
- _id: string;
142
- companyId?: string;
143
- optionName: string;
144
- sortingOrder: number;
145
- options: CFAttributeOption[];
146
- }
147
- export interface CFTransaction {
148
- _id: string;
149
- companyId?: string;
150
- orderId?: string;
151
- amount: number;
152
- currency?: string;
153
- status?: string;
154
- paymentMethod?: string;
155
- createdAt?: string;
156
- updatedAt?: string;
157
- [key: string]: unknown;
158
- }
159
- export interface CFCategory {
160
- _id: string;
161
- companyId: string;
162
- externalId: string;
163
- name: string;
164
- parentId: null | string;
165
- __v?: number;
166
- }
167
- export interface CFProductVariant {
168
- sku: string;
169
- price: number;
170
- salePrice: number;
171
- isOnSale: boolean;
172
- barcode?: string;
173
- costPrice?: number;
174
- manageStock: boolean;
175
- /** External variant identifier — required by host. */
176
- externalId: string;
177
- inventory?: CFInventory[];
178
- allowBackorder?: boolean;
179
- images?: string[];
180
- attributes: {
181
- name: string;
182
- value?: string;
183
- }[];
184
- metadata?: {
185
- key: string;
186
- value: string;
187
- }[];
188
- _id: string;
189
- isDeleted?: boolean;
190
- currency?: CurrencyCode;
191
- minorUnits?: number;
192
- }
193
- export interface CFProduct {
194
- _id: string;
195
- companyId?: string;
196
- /** External product identifier — required by host. */
197
- externalId: string;
198
- taxTable: string;
199
- name: string;
200
- description?: string;
201
- shortDescription?: string;
202
- images?: string[];
203
- categories: string[];
204
- attributes: {
205
- name: string;
206
- values: string[];
207
- }[];
208
- tags?: string[];
209
- supplier?: string;
210
- sku?: string;
211
- productType: CFProductType;
212
- variants: CFProductVariant[];
213
- currency: CurrencyCode;
214
- minorUnits: number;
215
- minPrice?: number;
216
- maxPrice?: number;
217
- /** Catalog-level price (rare; usually only on simple products). */
218
- price?: number;
219
- status?: string;
220
- isDeleted?: boolean;
221
- createdAt?: string;
222
- updatedAt?: string;
223
- }
224
- export interface CFActiveProduct extends CFActiveEntity {
225
- id: string;
226
- internalId: string;
227
- externalId: string;
228
- productExternalId: string;
229
- variantId: string;
230
- name: string;
231
- sku: string;
232
- price: number;
233
- images: string[];
234
- taxTableId: string;
235
- quantity: number;
236
- note?: string;
237
- discount?: CFDiscount;
238
- description?: string;
239
- longDescription?: string;
240
- shortDescription?: string;
241
- barcodeId?: string;
242
- stock: number;
243
- allowBackOrder?: boolean;
244
- fee?: CFCustomFee;
245
- isUnlimited?: boolean;
246
- attributes?: string;
247
- localQuantity?: number;
248
- /** Mongo-style id when the active product retains the catalog `_id`. */
249
- _id?: string;
250
- productType?: CFProductType;
251
- /** Currency code for the line price. */
252
- currency?: CurrencyCode;
253
- /** Number of minor units (decimal places) for the line currency. */
254
- minorUnits?: number;
255
- }
256
- export interface CFCustomer {
257
- _id: string;
258
- companyId: string;
259
- externalId?: string;
260
- email: string;
261
- firstName: string;
262
- lastName: string;
263
- fromOliver?: boolean;
264
- phone?: string;
265
- tags?: string[];
266
- metadata?: Record<string, string>[];
267
- notes?: CFCustomerNote[];
268
- billing: CFAddress | null;
269
- shipping: CFAddress | null;
270
- createdAt?: string;
271
- updatedAt?: string;
272
- }
273
- export interface CFActiveCustomer extends CFCustomer {
274
- id?: string;
275
- }
276
- export interface CFTip {
277
- amount: number;
278
- percentage: number;
279
- }
280
- export interface CFSummary {
281
- discountTotal: number;
282
- shippingTotal?: number | null;
283
- total: number;
284
- totalTaxes: number;
285
- subTotal: number;
286
- taxes: CFTax[];
287
- tip?: CFTip | null;
288
- isTaxInclusive: boolean;
289
- /** Portion of order total that is non-revenue (e.g. gift card load), same string money format as `total` */
290
- nonRevenueTotal?: string;
291
- }
292
- export interface CFCartDiscountItem {
293
- label: string;
294
- amount: number;
295
- percentage: number;
296
- }
297
- export interface CFCartFeeItem {
298
- id: string;
299
- label: string;
300
- amount: number;
301
- percentage: number;
302
- taxTableId?: string;
303
- tax?: number;
304
- taxName: string;
305
- /** Per-rate breakdown so summary/refund views can show correct amounts per rate. */
306
- taxes?: CFCartFeeTaxEntry[];
307
- }
308
- export interface CFTipPayment {
309
- amount: number;
310
- tipTo: string;
311
- percentage: number;
312
- }
313
- export interface CFRefundedTipPayment {
314
- amount: number;
315
- percentage: number;
316
- transactionId: string;
317
- tipTo: string;
318
- }
319
- export interface CFPaymentMethod {
320
- transactionId: string;
321
- paymentType: string;
322
- amount: number;
323
- timestamp: string;
324
- processor: string;
325
- saleId?: string;
326
- change?: number | null;
327
- tip?: CFTipPayment | null;
328
- cashRounding?: number;
329
- emv?: string | null;
330
- /** Processor fee charged on this payment. */
331
- processorFee?: number | null;
332
- }
333
- export interface CFPosDataItem {
334
- outlet: string;
335
- station: string;
336
- employee: string | {
337
- _id?: string;
338
- firstName: string;
339
- lastName: string;
340
- };
341
- }
342
- export interface CFDiscountDetail {
343
- percentage: number;
344
- amount: number;
345
- label?: string;
346
- }
347
- export interface CFFeeDetail {
348
- percentage: number;
349
- amount: number;
350
- tax: number;
351
- taxTableId: string;
352
- label?: string;
353
- }
354
- export interface CFDiscountLineItem {
355
- itemDiscount: CFDiscountDetail;
356
- cartDiscount: CFDiscountDetail;
357
- }
358
- export interface CFFeeLineItem {
359
- itemFee: CFFeeDetail;
360
- cartFee?: CFFeeDetail;
361
- }
362
- export interface CFLineItem {
363
- productId: string;
364
- variantExternalId?: string;
365
- productExternalId?: string;
366
- internalId?: string;
367
- name: string;
368
- quantity: number;
369
- price: number;
370
- taxes: CFTax[];
371
- discount: CFDiscountLineItem;
372
- fee: CFFeeLineItem;
373
- totalTax: number;
374
- total: number;
375
- metadata: CFMetadataItem[];
376
- image: string;
377
- sku: string;
378
- stock: number;
379
- note?: string;
380
- description?: string;
381
- variantId: string;
382
- images?: string[];
383
- attributes?: string;
384
- }
385
- export interface CFCustomSale {
386
- customSaleId: string;
387
- name: string;
388
- price: number;
389
- quantity: number;
390
- applyTaxes: boolean;
391
- total: number;
392
- totalTax: number;
393
- taxes: CFTax[];
394
- discount: {
395
- cartDiscount: CFDiscountDetail;
396
- };
397
- fee: {
398
- cartFee: CFFeeDetail;
399
- };
400
- }
401
- export interface CFRefundedLineItem {
402
- productId: string;
403
- variantId: string;
404
- variantExternalId?: string;
405
- productExternalId?: string;
406
- internalId?: string;
407
- name: string;
408
- quantity: number;
409
- price: number;
410
- taxes: CFTax[];
411
- discount: CFDiscountLineItem;
412
- totalTax: number;
413
- total: number;
414
- image: string;
415
- sku: string;
416
- note?: string;
417
- description?: string;
418
- images?: string[];
419
- fee: CFFeeLineItem;
420
- }
421
- export type CFRefundedCustomSale = CFCustomSale;
422
- export interface CFRefundItem {
423
- lineItems: CFRefundedLineItem[];
424
- customSales: CFRefundedCustomSale[];
425
- cartFees: CFCartFeeItem[];
426
- tips: CFRefundedTipPayment[];
427
- refundedBy: string;
428
- timestamp: string | undefined;
429
- summary?: CFSummary;
430
- refundPayment: CFPaymentMethod[];
431
- balance?: number;
432
- receiptId?: string;
433
- currency: CurrencyCode;
434
- minorUnits: number;
435
- }
436
- export interface CFOrder {
437
- _id: string;
438
- currency: CurrencyCode;
439
- minorUnits: number;
440
- receiptId?: string;
441
- companyId: string;
442
- externalId: string | null;
443
- status: string;
444
- /** Financial state (state machine). Undefined on legacy orders pre-backfill. */
445
- paymentState?: string;
446
- /** Operational state (state machine). Undefined on legacy orders pre-backfill. */
447
- fulfillmentState?: string;
448
- /** Computed display label from paymentState + fulfillmentState matrix. */
449
- displayState?: string;
450
- customer: Partial<CFActiveCustomer | null>;
451
- customerNote?: string;
452
- summary: CFSummary;
453
- cartDiscount: CFCartDiscountItem | null;
454
- cartFees: CFCartFeeItem[] | null;
455
- updatedAt?: string;
456
- createdAt?: string;
457
- paymentMethods: CFPaymentMethod[];
458
- source: string;
459
- posData: CFPosDataItem | null;
460
- sessionId: string;
461
- metadata: CFMetadataItem[];
462
- notes?: CFOrderNote[] | null;
463
- billing: CFAddress | null;
464
- shipping: CFAddress | null;
465
- lineItems: CFLineItem[];
466
- customSales: CFCustomSale[];
467
- /** Gift card / liability purchase lines (not product revenue) */
468
- nonRevenueItems?: CFNonRevenueItem[];
469
- refund?: CFRefundItem[];
470
- balance: number;
471
- signature?: string | null;
472
- /** ISO timestamp at which a parked order's stock reservation expires. */
473
- parkExpiryDate?: string;
474
- /** Park stock-reduction policy (host-defined string flag). */
475
- parkReduceStock?: string;
476
- }
477
- export interface CFActiveUserRole {
478
- id?: string;
479
- _id?: string;
480
- companyId?: string;
481
- name: string;
482
- permissions: {
483
- category: string;
484
- label?: string;
485
- name: string;
486
- value: boolean;
487
- permissionId?: string;
488
- subCategory?: string;
489
- }[];
490
- }
491
- export interface CFActiveUser extends CFActiveEntity {
492
- firstName?: string;
493
- lastName?: string;
494
- email?: string;
495
- phone?: string;
496
- pincode?: string;
497
- role: CFActiveUserRole | {
498
- _id: string;
499
- name: string;
500
- };
501
- id: string;
502
- _id?: string;
503
- outlets?: string[] | {
504
- _id: string;
505
- }[];
506
- type?: CFUserTypes;
507
- companies?: unknown;
508
- }
509
- export interface CFActiveOutlet extends CFActiveEntity {
510
- address: string;
511
- address2: string;
512
- city: string;
513
- state: string;
514
- country?: string;
515
- taxId: string;
516
- postCode?: string;
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. */
517
73
  name?: string;
518
- stripe?: {
519
- locationId: string;
520
- };
521
- id: string;
522
- sequenceNumber: number;
523
- _id?: string;
524
- stripeAccountId: string;
525
- }
526
- export interface CFActiveStation {
527
- _id: string;
528
- sequenceNumber?: number;
529
- name: string;
530
- status: string;
531
- buildSrcId?: string;
532
- buildVersion?: string;
533
- publishBuildId?: string;
534
- createdAt?: string;
535
- updatedAt?: string;
536
- stripeTerminalId?: string;
537
- /** Stripe serial-reader identifier when paired. */
538
- serialReaderId?: string;
539
- /** User id of whoever enrolled the station. */
540
- enrolledBy?: string;
541
- /** Whether the station is virtual (no physical terminal). */
542
- isVirtual?: boolean;
543
- }
544
- /** Cash register session (station session), aligned with Render `Session`. */
545
- export interface CFSession {
546
- id: string;
547
- stationId: string;
548
- openingAmount?: number;
549
- closingAmount?: number;
550
- openedBy?: string;
551
- closedBy?: string;
552
- notes?: string[];
553
- currency?: CurrencyCode;
554
- minorUnits?: number;
74
+ /** Folder id → its cells. */
75
+ folders?: Record<string, CFTileCell[]>;
555
76
  }
556
77
  /** Refund UI / selection state in POS, aligned with Render `ActiveRefundOrder`. */
557
78
  export interface CFRefundProcessingStatus {
@@ -574,77 +95,6 @@ export interface CFActiveRefundDetails {
574
95
  refundProcessingStatus?: CFRefundProcessingStatus | null;
575
96
  sessionRefundedTotal?: number;
576
97
  }
577
- export interface CFActiveOrder extends CFOrder {
578
- id?: string;
579
- internalId?: string;
580
- user?: CFActiveUser;
581
- outlet?: CFActiveOutlet;
582
- isDeleted?: boolean;
583
- newOrder?: boolean;
584
- station?: CFActiveStation;
585
- }
586
- export interface CFActiveCustomSales {
587
- id: string;
588
- name: string;
589
- applyTaxes: boolean;
590
- taxTableId?: string;
591
- quantity: number;
592
- price: number;
593
- discount?: Record<string, unknown>;
594
- fee?: Record<string, unknown>;
595
- }
596
- /** Non-revenue cart line (e.g. gift card load) — aligned with Render `NonRevenueItem.externalId` (order line id). */
597
- export interface CFNonRevenueItem {
598
- /** Unique cart/order line id (Mongo-style id from host). Extension reference is usually `metadata.refId`. */
599
- externalId: string;
600
- amount: number | string;
601
- label?: string;
602
- metadata?: Record<string, unknown>;
603
- applyTaxes?: boolean;
604
- taxTableId?: string;
605
- }
606
- export interface CFActiveCart extends CFActiveEntity {
607
- tax?: number;
608
- /** Per-rate tax breakdown for the cart. Same shape as line item taxes. */
609
- taxes?: CFTax[];
610
- total: number;
611
- subtotal: number;
612
- discount?: CFDiscount;
613
- customFee?: CFCustomFee[];
614
- products: CFActiveProduct[];
615
- customSales?: CFActiveCustomSales[];
616
- /** Gift card / liability lines — included in cart total */
617
- nonRevenueItems?: CFNonRevenueItem[];
618
- remainingBalance?: number;
619
- amountToBeCharged: number;
620
- customer?: Partial<CFCustomer | null> | null;
621
- orderNotes?: string;
622
- cartTotal?: number;
623
- orderTotal?: number;
624
- orderId?: string;
625
- /** Currency code for amounts on this cart. */
626
- currency?: CurrencyCode;
627
- /** Number of minor units (decimal places) for the cart's currency. */
628
- minorUnits?: number;
629
- }
630
- /** A parked order. Extends `CFActiveCart` with parking-specific fields. */
631
- export interface CFActivePark extends CFActiveCart {
632
- /** Required on parked orders (overrides the optional `orderId` on the parent). */
633
- orderId: string;
634
- receiptId: string;
635
- servedBy: string | {
636
- _id?: string;
637
- firstName: string;
638
- lastName: string;
639
- } | undefined;
640
- createdAt: string | number;
641
- }
642
- export interface CFActiveCompany extends CFActiveEntity {
643
- id?: string;
644
- name?: string;
645
- logo?: string;
646
- settings?: Record<string, unknown>;
647
- }
648
98
  export type CFProjectName = "Render" | "Manage";
649
99
  export interface CFContextRender {
650
100
  userId: string | null;