@final-commerce/common 1.1.4-beta.4
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/README.md +224 -0
- package/bin/gate-done.mjs +161 -0
- package/bin/gate-i18n-sync.mjs +351 -0
- package/bin/gate-save.mjs +146 -0
- package/bin/gate-setup.mjs +227 -0
- package/bin/gate-start.mjs +101 -0
- package/bin/prepare-commit-msg.sh +16 -0
- package/commitlint/index.mjs +14 -0
- package/dist/index.d.mts +468 -0
- package/dist/index.d.ts +468 -0
- package/dist/index.js +2702 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2565 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interfaces-6GnQyqYd.d.mts +598 -0
- package/dist/interfaces-6GnQyqYd.d.ts +598 -0
- package/dist/pos-types/index.d.mts +1782 -0
- package/dist/pos-types/index.d.ts +1782 -0
- package/dist/pos-types/index.js +144 -0
- package/dist/pos-types/index.js.map +1 -0
- package/dist/pos-types/index.mjs +114 -0
- package/dist/pos-types/index.mjs.map +1 -0
- package/eslint/backend-nestjs.mjs +30 -0
- package/eslint/frontend-react.mjs +27 -0
- package/eslint/library.mjs +19 -0
- package/lint-staged/index.mjs +4 -0
- package/package.json +160 -0
- package/prettier/index.json +10 -0
- package/typescript/backend-nestjs.json +13 -0
- package/typescript/base.json +13 -0
- package/typescript/frontend-react.json +15 -0
- package/typescript/library.json +12 -0
- package/vitest/backend.ts +20 -0
- package/vitest/frontend.ts +22 -0
- package/vitest/library.ts +20 -0
|
@@ -0,0 +1,1782 @@
|
|
|
1
|
+
import { R as InventorySpecificActionType, H as CustomTableAvailability, v as AttributeType, a0 as OwnerType, X as NonRevenueItemType, C as CurrencyCode, a6 as Platform, aa as ProductStatus, a5 as PaymentTransitionPath, M as FulfillmentTransitionPath, a3 as PathMode, c as CrossAxisRule, T as TransitionConditionSet, S as StatePair, D as DisplayStateRule, u as TransitionBlockedBy, al as StationStatus, aq as UserTypes, o as PaymentState, p as FulfillmentState, ab as ProductType } from '../interfaces-6GnQyqYd.js';
|
|
2
|
+
|
|
3
|
+
type Enrich<TBase, TEnrichment> = Omit<TBase, keyof TEnrichment> & TEnrichment;
|
|
4
|
+
|
|
5
|
+
interface BaseDocument {
|
|
6
|
+
id: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
}
|
|
10
|
+
interface BaseEntity extends BaseDocument {
|
|
11
|
+
companyId: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface AttributeEmbedded {
|
|
15
|
+
name: string;
|
|
16
|
+
values?: string[];
|
|
17
|
+
value?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface AttributeOption {
|
|
21
|
+
name: string;
|
|
22
|
+
order: number;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Metadata {
|
|
26
|
+
key: string;
|
|
27
|
+
value: string;
|
|
28
|
+
externalId?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface Note {
|
|
32
|
+
id: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
message?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface VariantInventory {
|
|
39
|
+
stock: number;
|
|
40
|
+
outletId: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface OrderTax {
|
|
44
|
+
name: string;
|
|
45
|
+
taxTableId?: string;
|
|
46
|
+
taxTableName?: string;
|
|
47
|
+
id?: string;
|
|
48
|
+
percentage: number;
|
|
49
|
+
amount: number;
|
|
50
|
+
taxableAmount?: number;
|
|
51
|
+
compounding?: boolean;
|
|
52
|
+
priority?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface OrderTip {
|
|
56
|
+
percentage?: number;
|
|
57
|
+
amount?: number;
|
|
58
|
+
tipTo?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
interface OrderSummaryPayments {
|
|
62
|
+
cardTotal: number;
|
|
63
|
+
cashTotal: number;
|
|
64
|
+
customTotal: number;
|
|
65
|
+
cardProcessingFeesTotal: number;
|
|
66
|
+
}
|
|
67
|
+
interface OrderSummary {
|
|
68
|
+
discountTotal: number;
|
|
69
|
+
shippingTotal?: number;
|
|
70
|
+
total: number;
|
|
71
|
+
totalTaxes: number;
|
|
72
|
+
isTaxInclusive: boolean;
|
|
73
|
+
subtotalAfterFees: number;
|
|
74
|
+
nonRevenueTotal?: number;
|
|
75
|
+
grossSales?: number;
|
|
76
|
+
lineDiscountTotal?: number;
|
|
77
|
+
cartDiscountTotal?: number;
|
|
78
|
+
feesTotal?: number;
|
|
79
|
+
lineFeesTotal?: number;
|
|
80
|
+
cartFeesTotal?: number;
|
|
81
|
+
taxableFeesTotal?: number;
|
|
82
|
+
nonTaxableFeesTotal?: number;
|
|
83
|
+
totalTaxableSales?: number;
|
|
84
|
+
totalNonTaxableSales?: number;
|
|
85
|
+
tipTotal?: number;
|
|
86
|
+
cashRounding: number;
|
|
87
|
+
payments?: OrderSummaryPayments;
|
|
88
|
+
totalBeforeTip?: number;
|
|
89
|
+
amountPaid?: number;
|
|
90
|
+
taxes: OrderTax[];
|
|
91
|
+
tip?: OrderTip;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
interface PriceModifierDetail {
|
|
95
|
+
percentage: number;
|
|
96
|
+
amount: number;
|
|
97
|
+
label?: string;
|
|
98
|
+
tax?: number;
|
|
99
|
+
taxTableId?: string;
|
|
100
|
+
taxRateId?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
interface OrderCartDiscount {
|
|
104
|
+
amount: number;
|
|
105
|
+
percentage: number;
|
|
106
|
+
label?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
interface OrderCartFee {
|
|
110
|
+
label: string;
|
|
111
|
+
id: string;
|
|
112
|
+
percentage: number;
|
|
113
|
+
amount: number;
|
|
114
|
+
taxName?: string;
|
|
115
|
+
taxTableId?: string;
|
|
116
|
+
tax?: number;
|
|
117
|
+
taxes?: OrderTax[];
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
interface OrderPaymentMethod {
|
|
121
|
+
paymentType: string;
|
|
122
|
+
amount: number;
|
|
123
|
+
transactionId: string;
|
|
124
|
+
timestamp?: string;
|
|
125
|
+
emv?: string | null;
|
|
126
|
+
cashRounding?: number;
|
|
127
|
+
change?: number;
|
|
128
|
+
processor?: string;
|
|
129
|
+
processorFee?: number;
|
|
130
|
+
tendered?: number;
|
|
131
|
+
tip?: OrderTip | null;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
interface OrderPosData {
|
|
135
|
+
outlet?: string;
|
|
136
|
+
station?: string;
|
|
137
|
+
employee?: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface OrderLineItemDiscount {
|
|
141
|
+
itemDiscounts?: PriceModifierDetail[];
|
|
142
|
+
cartDiscount?: PriceModifierDetail;
|
|
143
|
+
}
|
|
144
|
+
interface OrderLineItemFee {
|
|
145
|
+
cartFee?: PriceModifierDetail;
|
|
146
|
+
itemFees?: PriceModifierDetail[];
|
|
147
|
+
}
|
|
148
|
+
interface OrderLineItem {
|
|
149
|
+
id?: string;
|
|
150
|
+
productId?: string;
|
|
151
|
+
variantId?: string;
|
|
152
|
+
name?: string;
|
|
153
|
+
quantity?: number;
|
|
154
|
+
manageStock?: boolean;
|
|
155
|
+
price?: number;
|
|
156
|
+
description?: string;
|
|
157
|
+
sku?: string;
|
|
158
|
+
totalTax?: number;
|
|
159
|
+
total?: number;
|
|
160
|
+
productExternalId?: string;
|
|
161
|
+
variantExternalId?: string;
|
|
162
|
+
lineItemExternalId?: string;
|
|
163
|
+
internalId?: string;
|
|
164
|
+
note?: string;
|
|
165
|
+
image?: string;
|
|
166
|
+
attributes?: string;
|
|
167
|
+
taxes?: OrderTax[];
|
|
168
|
+
discount?: OrderLineItemDiscount;
|
|
169
|
+
fee?: OrderLineItemFee;
|
|
170
|
+
lineNetWithFees?: number;
|
|
171
|
+
metadata?: Metadata[];
|
|
172
|
+
stock?: number;
|
|
173
|
+
subTotal?: number;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface OrderCustomSaleDiscount {
|
|
177
|
+
cartDiscount: OrderCartDiscount;
|
|
178
|
+
}
|
|
179
|
+
interface OrderCustomSaleFee {
|
|
180
|
+
cartFee: PriceModifierDetail;
|
|
181
|
+
}
|
|
182
|
+
interface OrderCustomSale {
|
|
183
|
+
customSaleId: string;
|
|
184
|
+
applyTaxes: boolean;
|
|
185
|
+
quantity: number;
|
|
186
|
+
name: string;
|
|
187
|
+
price: number;
|
|
188
|
+
totalTax: number;
|
|
189
|
+
total: number;
|
|
190
|
+
taxes?: OrderTax[];
|
|
191
|
+
discount?: OrderCustomSaleDiscount;
|
|
192
|
+
fee?: OrderCustomSaleFee;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
interface OrderRefundSummary {
|
|
196
|
+
total?: number;
|
|
197
|
+
}
|
|
198
|
+
interface OrderRefund {
|
|
199
|
+
externalId?: string;
|
|
200
|
+
reason?: string;
|
|
201
|
+
summary?: OrderRefundSummary;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
interface RefundCartDiscount {
|
|
205
|
+
amount?: number;
|
|
206
|
+
percentage?: number;
|
|
207
|
+
}
|
|
208
|
+
interface RefundItemDiscount {
|
|
209
|
+
amount?: number;
|
|
210
|
+
percentage?: number;
|
|
211
|
+
label?: string;
|
|
212
|
+
}
|
|
213
|
+
interface RefundDiscount {
|
|
214
|
+
cartDiscount?: RefundCartDiscount;
|
|
215
|
+
itemDiscounts?: RefundItemDiscount[];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
interface RefundLineItem {
|
|
219
|
+
taxes?: OrderTax[];
|
|
220
|
+
discount?: RefundDiscount;
|
|
221
|
+
fee?: OrderLineItemFee;
|
|
222
|
+
lineNetWithFees?: number;
|
|
223
|
+
quantity?: number;
|
|
224
|
+
total?: number;
|
|
225
|
+
price?: number;
|
|
226
|
+
name?: string;
|
|
227
|
+
subTotal?: number;
|
|
228
|
+
sku?: string;
|
|
229
|
+
image?: string;
|
|
230
|
+
productId: string;
|
|
231
|
+
productExternalId?: string;
|
|
232
|
+
variantExternalId?: string;
|
|
233
|
+
lineItemExternalId?: string;
|
|
234
|
+
internalId?: string;
|
|
235
|
+
action?: InventorySpecificActionType;
|
|
236
|
+
variantId: string;
|
|
237
|
+
totalTax?: number;
|
|
238
|
+
note?: string;
|
|
239
|
+
description?: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
interface RefundPayment {
|
|
243
|
+
transactionId?: string;
|
|
244
|
+
paymentType?: string;
|
|
245
|
+
amount?: number;
|
|
246
|
+
timestamp?: string;
|
|
247
|
+
processor?: string;
|
|
248
|
+
saleId?: string;
|
|
249
|
+
tendered?: number;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
interface RefundTip {
|
|
253
|
+
amount?: number;
|
|
254
|
+
percentage?: number;
|
|
255
|
+
transactionId?: string;
|
|
256
|
+
tipTo?: string;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
interface RefundSummary {
|
|
260
|
+
discountTotal?: number;
|
|
261
|
+
shippingTotal?: number;
|
|
262
|
+
total?: number;
|
|
263
|
+
totalTaxes?: number;
|
|
264
|
+
isTaxInclusive: boolean;
|
|
265
|
+
subtotalAfterFees: number;
|
|
266
|
+
taxes?: OrderTax[];
|
|
267
|
+
tip?: RefundTip;
|
|
268
|
+
grossSales?: number;
|
|
269
|
+
lineDiscountTotal?: number;
|
|
270
|
+
cartDiscountTotal?: number;
|
|
271
|
+
feesTotal?: number;
|
|
272
|
+
lineFeesTotal?: number;
|
|
273
|
+
cartFeesTotal?: number;
|
|
274
|
+
taxableFeesTotal?: number;
|
|
275
|
+
nonTaxableFeesTotal?: number;
|
|
276
|
+
totalTaxableSales?: number;
|
|
277
|
+
totalNonTaxableSales?: number;
|
|
278
|
+
tipTotal?: number;
|
|
279
|
+
cashRounding?: number;
|
|
280
|
+
payments?: OrderSummaryPayments;
|
|
281
|
+
totalBeforeTip?: number;
|
|
282
|
+
amountRefunded?: number;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
interface RolePermission {
|
|
286
|
+
name: string;
|
|
287
|
+
permissionId: string;
|
|
288
|
+
category: string;
|
|
289
|
+
subCategory: string;
|
|
290
|
+
value: boolean;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
interface OrderStateHistoryEntry {
|
|
294
|
+
payment: string;
|
|
295
|
+
fulfillment: string;
|
|
296
|
+
posTimestamp: string;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
interface SessionClosingAmounts {
|
|
300
|
+
cash?: number;
|
|
301
|
+
card?: number;
|
|
302
|
+
oliverPay?: number;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
interface TransactionPaymentData {
|
|
306
|
+
processor?: string;
|
|
307
|
+
processorTransactionId?: string;
|
|
308
|
+
device?: string;
|
|
309
|
+
processorData?: string;
|
|
310
|
+
processorFee?: number;
|
|
311
|
+
paymentMethodType?: string;
|
|
312
|
+
chargeId?: string;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
interface Attribute extends BaseEntity {
|
|
316
|
+
optionName: string;
|
|
317
|
+
sortingOrder: number;
|
|
318
|
+
options: AttributeOption[];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
interface Category extends BaseEntity {
|
|
322
|
+
externalId?: string;
|
|
323
|
+
name: string;
|
|
324
|
+
description?: string;
|
|
325
|
+
image?: string;
|
|
326
|
+
parentId?: string;
|
|
327
|
+
menuOrder?: number;
|
|
328
|
+
source?: string;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
interface CompanyExtension extends BaseEntity {
|
|
332
|
+
extensionId: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
type CompanySettingsEavValueType = string | number | boolean | Record<string, unknown>;
|
|
336
|
+
interface CompanySettingsEavValue extends BaseEntity {
|
|
337
|
+
entityId: string;
|
|
338
|
+
attributeId: string;
|
|
339
|
+
value: CompanySettingsEavValueType;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
interface CustomExtension extends BaseEntity {
|
|
343
|
+
label: string;
|
|
344
|
+
url?: string;
|
|
345
|
+
description: string;
|
|
346
|
+
backgroundUrl?: string;
|
|
347
|
+
gallery?: string[];
|
|
348
|
+
theme?: string;
|
|
349
|
+
redirectUrl?: string;
|
|
350
|
+
organizationId?: string;
|
|
351
|
+
category: string;
|
|
352
|
+
short_description: string;
|
|
353
|
+
long_description: string;
|
|
354
|
+
main_image?: string;
|
|
355
|
+
price?: string;
|
|
356
|
+
website?: string;
|
|
357
|
+
status: string;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
interface CustomTableMetadata {
|
|
361
|
+
key: string;
|
|
362
|
+
val: unknown;
|
|
363
|
+
}
|
|
364
|
+
interface CustomTable extends BaseDocument {
|
|
365
|
+
organizationId: string;
|
|
366
|
+
availability: CustomTableAvailability;
|
|
367
|
+
name: string;
|
|
368
|
+
description?: string;
|
|
369
|
+
metadata?: CustomTableMetadata[];
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
interface CustomTableField extends BaseDocument {
|
|
373
|
+
tableId: string;
|
|
374
|
+
name: string;
|
|
375
|
+
type: AttributeType;
|
|
376
|
+
required?: boolean;
|
|
377
|
+
defaultValue?: string;
|
|
378
|
+
referenceLinkedCollection?: string;
|
|
379
|
+
referenceLinkedField?: string;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
interface CustomTableRow extends BaseEntity {
|
|
383
|
+
tableId: string;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
interface CustomTableValue extends BaseEntity {
|
|
387
|
+
tableId: string;
|
|
388
|
+
rowId: string;
|
|
389
|
+
fieldId: string;
|
|
390
|
+
value: string;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
interface Address$1 {
|
|
394
|
+
firstName?: string;
|
|
395
|
+
lastName?: string;
|
|
396
|
+
address1?: string;
|
|
397
|
+
address2?: string;
|
|
398
|
+
city?: string;
|
|
399
|
+
state?: string;
|
|
400
|
+
country?: string;
|
|
401
|
+
postCode?: string;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
interface Customer extends BaseEntity {
|
|
405
|
+
email?: string;
|
|
406
|
+
firstName?: string;
|
|
407
|
+
lastName?: string;
|
|
408
|
+
fromOliver?: boolean;
|
|
409
|
+
outletId?: string;
|
|
410
|
+
externalId?: string;
|
|
411
|
+
phone?: string;
|
|
412
|
+
totalSpent?: number;
|
|
413
|
+
lastAction?: string;
|
|
414
|
+
tags?: string[];
|
|
415
|
+
billing?: Address$1;
|
|
416
|
+
shipping?: Address$1;
|
|
417
|
+
metadata?: Metadata[];
|
|
418
|
+
notes?: Note[];
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
interface DeviceEnvAttribute extends BaseDocument {
|
|
422
|
+
categoryId: string;
|
|
423
|
+
type: AttributeType;
|
|
424
|
+
guid: string;
|
|
425
|
+
name: string;
|
|
426
|
+
description?: string;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
interface DeviceEnvCategory extends BaseDocument {
|
|
430
|
+
guid: string;
|
|
431
|
+
name: string;
|
|
432
|
+
description?: string;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
interface DeviceEnvValue extends BaseEntity {
|
|
436
|
+
attributeid: string;
|
|
437
|
+
stationId: string;
|
|
438
|
+
unit?: string;
|
|
439
|
+
value: string;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
interface FlowSettings extends BaseEntity {
|
|
443
|
+
flowId: string;
|
|
444
|
+
flowSettingsKeyId?: string;
|
|
445
|
+
key: string;
|
|
446
|
+
value: string;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
interface FlowSettingsKey extends BaseEntity {
|
|
450
|
+
flowId: string;
|
|
451
|
+
key: string;
|
|
452
|
+
dataType: string;
|
|
453
|
+
label: string;
|
|
454
|
+
placeholder?: string;
|
|
455
|
+
description?: string;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
interface FlowWebApp extends BaseDocument {
|
|
459
|
+
name: string;
|
|
460
|
+
subdomain: string;
|
|
461
|
+
mongoAppId: string;
|
|
462
|
+
ownerType: OwnerType;
|
|
463
|
+
organizationId?: string;
|
|
464
|
+
companyId?: string;
|
|
465
|
+
currentVersion: string;
|
|
466
|
+
bucketPath: string;
|
|
467
|
+
customDomain?: string;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
interface FlowWebAppVersion extends BaseDocument {
|
|
471
|
+
checkoutFlowId: string;
|
|
472
|
+
version: string;
|
|
473
|
+
subdomain: string;
|
|
474
|
+
bucketPath: string;
|
|
475
|
+
fileCount: number;
|
|
476
|
+
sizeBytes: number;
|
|
477
|
+
changelog?: string;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
interface NonRevenueItem$1 {
|
|
481
|
+
externalId: string;
|
|
482
|
+
amount: number;
|
|
483
|
+
label?: string;
|
|
484
|
+
metadata?: Metadata[];
|
|
485
|
+
applyTaxes?: boolean;
|
|
486
|
+
taxTableId?: string;
|
|
487
|
+
type?: NonRevenueItemType;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
interface OrderNote$1 {
|
|
491
|
+
author: string;
|
|
492
|
+
note: string;
|
|
493
|
+
externalId?: string;
|
|
494
|
+
addedByUser: boolean;
|
|
495
|
+
dateCreated: string;
|
|
496
|
+
customerNote?: boolean;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
interface Order extends BaseEntity {
|
|
500
|
+
currency?: CurrencyCode;
|
|
501
|
+
receiptId: string;
|
|
502
|
+
status: string;
|
|
503
|
+
paymentState?: string;
|
|
504
|
+
fulfillmentState?: string;
|
|
505
|
+
displayState?: string;
|
|
506
|
+
stateHistory?: OrderStateHistoryEntry[];
|
|
507
|
+
completedAt?: string;
|
|
508
|
+
customerId?: string;
|
|
509
|
+
source: string;
|
|
510
|
+
sessionId?: string;
|
|
511
|
+
balance: number;
|
|
512
|
+
externalId?: string;
|
|
513
|
+
fromOliver?: boolean;
|
|
514
|
+
customerNote?: string;
|
|
515
|
+
parkReduceStock?: string;
|
|
516
|
+
parkExpiryDate?: string;
|
|
517
|
+
signature?: string;
|
|
518
|
+
summary: OrderSummary;
|
|
519
|
+
cartDiscount?: OrderCartDiscount;
|
|
520
|
+
cartFees?: OrderCartFee[];
|
|
521
|
+
paymentMethods: OrderPaymentMethod[];
|
|
522
|
+
posData?: OrderPosData;
|
|
523
|
+
metadata?: Metadata[];
|
|
524
|
+
notes: OrderNote$1[];
|
|
525
|
+
billing?: Address$1;
|
|
526
|
+
shipping?: Address$1;
|
|
527
|
+
lineItems: Partial<OrderLineItem>[];
|
|
528
|
+
customSales?: OrderCustomSale[];
|
|
529
|
+
nonRevenueItems?: NonRevenueItem$1[];
|
|
530
|
+
refund?: OrderRefund[];
|
|
531
|
+
minorUnits?: number;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
interface PaymentSetting extends BaseEntity {
|
|
535
|
+
buildId: string;
|
|
536
|
+
paymentType: string;
|
|
537
|
+
name: string;
|
|
538
|
+
status: boolean;
|
|
539
|
+
changeCalculator?: boolean;
|
|
540
|
+
cashRounding?: string;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
interface Outlet extends BaseEntity {
|
|
544
|
+
name: string;
|
|
545
|
+
address: string;
|
|
546
|
+
city: string;
|
|
547
|
+
state: string;
|
|
548
|
+
country: string;
|
|
549
|
+
postCode: string;
|
|
550
|
+
phone?: string;
|
|
551
|
+
address2?: string;
|
|
552
|
+
alias?: string;
|
|
553
|
+
sequenceNumber?: number;
|
|
554
|
+
stations?: string[];
|
|
555
|
+
stripeAccountId?: string;
|
|
556
|
+
stripe?: {
|
|
557
|
+
locationId?: string;
|
|
558
|
+
};
|
|
559
|
+
taxId?: string;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
interface Product extends BaseEntity {
|
|
563
|
+
name: string;
|
|
564
|
+
productType: string;
|
|
565
|
+
source: Platform;
|
|
566
|
+
externalId?: string;
|
|
567
|
+
description?: string;
|
|
568
|
+
shortDescription?: string;
|
|
569
|
+
sku?: string;
|
|
570
|
+
fromOliver?: boolean;
|
|
571
|
+
images?: string[];
|
|
572
|
+
tags?: string[];
|
|
573
|
+
status?: ProductStatus;
|
|
574
|
+
minPrice?: number;
|
|
575
|
+
maxPrice?: number;
|
|
576
|
+
supplier?: string;
|
|
577
|
+
taxTable?: string | null;
|
|
578
|
+
categories?: string[];
|
|
579
|
+
outlets?: string[];
|
|
580
|
+
currency?: CurrencyCode;
|
|
581
|
+
minorUnits?: number;
|
|
582
|
+
metadata?: Metadata[];
|
|
583
|
+
attributes?: AttributeEmbedded[];
|
|
584
|
+
barcode?: string;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
interface Refund extends BaseEntity {
|
|
588
|
+
orderId: string;
|
|
589
|
+
outletId?: string;
|
|
590
|
+
sessionId?: string;
|
|
591
|
+
externalId?: string;
|
|
592
|
+
currency?: CurrencyCode;
|
|
593
|
+
fromOliver?: boolean;
|
|
594
|
+
lineItems: RefundLineItem[];
|
|
595
|
+
customSales?: OrderCustomSale[];
|
|
596
|
+
reason?: string;
|
|
597
|
+
receiptId?: string;
|
|
598
|
+
refundedBy?: string;
|
|
599
|
+
refundedByExternalId?: string;
|
|
600
|
+
summary: RefundSummary;
|
|
601
|
+
cartFees?: OrderCartFee[];
|
|
602
|
+
payment?: RefundPayment[];
|
|
603
|
+
balance?: number;
|
|
604
|
+
tips?: RefundTip[];
|
|
605
|
+
minorUnits?: number;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
interface Role extends BaseEntity {
|
|
609
|
+
name: string;
|
|
610
|
+
permissions: RolePermission[];
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
interface Transaction extends BaseEntity {
|
|
614
|
+
externalId?: string;
|
|
615
|
+
paymentMethod: string;
|
|
616
|
+
amount: number;
|
|
617
|
+
currency: CurrencyCode;
|
|
618
|
+
type: string;
|
|
619
|
+
notes?: string;
|
|
620
|
+
employee?: string;
|
|
621
|
+
balance: number;
|
|
622
|
+
sessionId: string;
|
|
623
|
+
stationId?: string;
|
|
624
|
+
paymentData?: TransactionPaymentData;
|
|
625
|
+
orderId?: string;
|
|
626
|
+
refundId?: string;
|
|
627
|
+
outletId?: string;
|
|
628
|
+
receiptId?: string;
|
|
629
|
+
minorUnits?: number;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
interface OrderStateConfig extends BaseEntity {
|
|
633
|
+
version: number;
|
|
634
|
+
name: string;
|
|
635
|
+
isDefault: boolean;
|
|
636
|
+
paymentPaths: PaymentTransitionPath[];
|
|
637
|
+
fulfillmentPaths: FulfillmentTransitionPath[];
|
|
638
|
+
paymentPathMode: PathMode;
|
|
639
|
+
fulfillmentPathMode: PathMode;
|
|
640
|
+
crossAxisRules: CrossAxisRule[];
|
|
641
|
+
transitionConditions: TransitionConditionSet[];
|
|
642
|
+
validInitialStates: StatePair[];
|
|
643
|
+
displayStateMap: DisplayStateRule[];
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
type OrderStateEventTrigger = 'pos' | 'api' | 'webhook' | 'migration' | 'system';
|
|
647
|
+
type OrderStateOperation = 'pay' | 'refund' | 'park' | 'resume' | 'void' | 'delete-parked' | 'add-tip' | 'manual';
|
|
648
|
+
type OrderStateActorType = 'cashier' | 'system' | 'customer';
|
|
649
|
+
interface OrderStateActor {
|
|
650
|
+
type: OrderStateActorType;
|
|
651
|
+
userId?: string;
|
|
652
|
+
stationId?: string;
|
|
653
|
+
}
|
|
654
|
+
interface OrderStatePair {
|
|
655
|
+
payment: string;
|
|
656
|
+
fulfillment: string;
|
|
657
|
+
}
|
|
658
|
+
interface OrderStateEvent extends BaseEntity {
|
|
659
|
+
orderId: string;
|
|
660
|
+
previousState: OrderStatePair;
|
|
661
|
+
newState: OrderStatePair;
|
|
662
|
+
trigger: OrderStateEventTrigger;
|
|
663
|
+
triggeredBy: string;
|
|
664
|
+
posTimestamp: string;
|
|
665
|
+
metadata?: Record<string, unknown>;
|
|
666
|
+
forcedTransition?: boolean;
|
|
667
|
+
operationId?: string;
|
|
668
|
+
operation?: OrderStateOperation;
|
|
669
|
+
from?: StatePair | null;
|
|
670
|
+
to?: StatePair;
|
|
671
|
+
allowed?: boolean;
|
|
672
|
+
blockedBy?: TransitionBlockedBy;
|
|
673
|
+
guard?: string;
|
|
674
|
+
reason?: string;
|
|
675
|
+
actor?: OrderStateActor;
|
|
676
|
+
context?: Record<string, unknown>;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
interface Session extends BaseEntity {
|
|
680
|
+
stationId: string;
|
|
681
|
+
sessionNumber?: string;
|
|
682
|
+
openedBy: string;
|
|
683
|
+
closedBy?: string;
|
|
684
|
+
openTime: string;
|
|
685
|
+
closeTime?: string;
|
|
686
|
+
openingAmount: number;
|
|
687
|
+
closingAmount?: number;
|
|
688
|
+
closingReportData?: string;
|
|
689
|
+
notes?: string[];
|
|
690
|
+
closingAmounts?: SessionClosingAmounts;
|
|
691
|
+
closingNote?: string;
|
|
692
|
+
openingNote?: string;
|
|
693
|
+
currency?: CurrencyCode;
|
|
694
|
+
minorUnits?: number;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
interface SmartGridSetting extends BaseEntity {
|
|
698
|
+
buildId: string;
|
|
699
|
+
outletId: string;
|
|
700
|
+
settings?: string;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
interface Station extends BaseEntity {
|
|
704
|
+
name: string;
|
|
705
|
+
outletId: string;
|
|
706
|
+
status: StationStatus;
|
|
707
|
+
deviceId?: string;
|
|
708
|
+
deviceName?: string;
|
|
709
|
+
stripeTerminalId?: string;
|
|
710
|
+
serialReaderId?: string;
|
|
711
|
+
sequenceNumber?: number;
|
|
712
|
+
isVirtual?: boolean;
|
|
713
|
+
enrolledBy?: string;
|
|
714
|
+
buildSrcId?: string;
|
|
715
|
+
flowSrcId?: string;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
interface StripeAccount extends BaseEntity {
|
|
719
|
+
accountId: string;
|
|
720
|
+
countryCode: string;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
interface TaxRate extends BaseEntity {
|
|
724
|
+
name: string;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
interface TaxRateValue extends BaseEntity {
|
|
728
|
+
taxRateId: string;
|
|
729
|
+
outletId: string;
|
|
730
|
+
value: number;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
interface TaxTableRate {
|
|
734
|
+
compounding?: boolean;
|
|
735
|
+
taxRate: string;
|
|
736
|
+
}
|
|
737
|
+
interface TaxTable extends BaseEntity {
|
|
738
|
+
source?: string;
|
|
739
|
+
name: string;
|
|
740
|
+
slug?: string;
|
|
741
|
+
taxRates?: TaxTableRate[];
|
|
742
|
+
isStandard?: boolean;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
interface User extends BaseDocument {
|
|
746
|
+
accountId?: string;
|
|
747
|
+
companies: string[];
|
|
748
|
+
email: string;
|
|
749
|
+
firstName: string;
|
|
750
|
+
lastName: string;
|
|
751
|
+
outlets?: string[];
|
|
752
|
+
phone?: string;
|
|
753
|
+
role: string;
|
|
754
|
+
type: UserTypes;
|
|
755
|
+
image?: string;
|
|
756
|
+
organizationId: string;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
interface Variant extends BaseEntity {
|
|
760
|
+
productId: string;
|
|
761
|
+
manageStock: boolean;
|
|
762
|
+
sku?: string;
|
|
763
|
+
isOnSale?: boolean;
|
|
764
|
+
barcode?: string;
|
|
765
|
+
price: number;
|
|
766
|
+
salePrice?: number;
|
|
767
|
+
externalId?: string;
|
|
768
|
+
allowBackorder?: boolean;
|
|
769
|
+
costPrice?: number;
|
|
770
|
+
images?: string[];
|
|
771
|
+
currency?: CurrencyCode;
|
|
772
|
+
minorUnits?: number;
|
|
773
|
+
metadata?: Metadata[];
|
|
774
|
+
attributes?: AttributeEmbedded[];
|
|
775
|
+
inventory?: VariantInventory[];
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
interface Address {
|
|
779
|
+
firstName: string;
|
|
780
|
+
lastName: string;
|
|
781
|
+
company?: string | null;
|
|
782
|
+
city: string;
|
|
783
|
+
postCode: string;
|
|
784
|
+
province?: string;
|
|
785
|
+
state?: string;
|
|
786
|
+
country?: string;
|
|
787
|
+
address1: string;
|
|
788
|
+
address2: string;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
interface NonRevenueItem {
|
|
792
|
+
externalId: string;
|
|
793
|
+
amount: number | string;
|
|
794
|
+
label?: string;
|
|
795
|
+
metadata?: Record<string, unknown>;
|
|
796
|
+
applyTaxes?: boolean;
|
|
797
|
+
taxTableId?: string;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
interface OrderNote {
|
|
801
|
+
externalId?: string;
|
|
802
|
+
author?: string;
|
|
803
|
+
note?: string;
|
|
804
|
+
customerNote?: boolean;
|
|
805
|
+
addedByUser?: string;
|
|
806
|
+
dateCreated?: string;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
interface CustomerNote {
|
|
810
|
+
_id: string;
|
|
811
|
+
createdAt: string;
|
|
812
|
+
message: string;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
type ActiveCustomer = Enrich<Customer, {
|
|
816
|
+
_id: string;
|
|
817
|
+
id?: string;
|
|
818
|
+
email: string;
|
|
819
|
+
firstName: string;
|
|
820
|
+
lastName: string;
|
|
821
|
+
metadata?: Record<string, string>[];
|
|
822
|
+
notes?: CustomerNote[];
|
|
823
|
+
billing: Address | null;
|
|
824
|
+
shipping: Address | null;
|
|
825
|
+
createdAt?: string;
|
|
826
|
+
updatedAt?: string;
|
|
827
|
+
}>;
|
|
828
|
+
|
|
829
|
+
interface ActiveOutlet {
|
|
830
|
+
address: string;
|
|
831
|
+
address2: string;
|
|
832
|
+
city: string;
|
|
833
|
+
state: string;
|
|
834
|
+
country?: string;
|
|
835
|
+
taxId: string;
|
|
836
|
+
postCode?: string;
|
|
837
|
+
name?: string;
|
|
838
|
+
stripe?: {
|
|
839
|
+
locationId: string;
|
|
840
|
+
};
|
|
841
|
+
id: string;
|
|
842
|
+
sequenceNumber: number;
|
|
843
|
+
_id?: string;
|
|
844
|
+
stripeAccountId: string;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
interface ActiveStation {
|
|
848
|
+
_id: string;
|
|
849
|
+
sequenceNumber?: number;
|
|
850
|
+
name: string;
|
|
851
|
+
status: string;
|
|
852
|
+
buildSrcId?: string;
|
|
853
|
+
buildVersion?: string;
|
|
854
|
+
publishBuildId?: string;
|
|
855
|
+
createdAt?: string;
|
|
856
|
+
updatedAt?: string;
|
|
857
|
+
stripeTerminalId?: string;
|
|
858
|
+
serialReaderId?: string;
|
|
859
|
+
enrolledBy?: string;
|
|
860
|
+
isVirtual?: boolean;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
interface ActiveUserRole {
|
|
864
|
+
id?: string;
|
|
865
|
+
name: string;
|
|
866
|
+
permissions: {
|
|
867
|
+
category: string;
|
|
868
|
+
label: string;
|
|
869
|
+
name: string;
|
|
870
|
+
value: boolean;
|
|
871
|
+
}[];
|
|
872
|
+
}
|
|
873
|
+
interface ActiveUser {
|
|
874
|
+
firstName?: string;
|
|
875
|
+
lastName?: string;
|
|
876
|
+
email?: string;
|
|
877
|
+
phone?: string;
|
|
878
|
+
role: ActiveUserRole;
|
|
879
|
+
id: string;
|
|
880
|
+
outlets?: string[];
|
|
881
|
+
type?: UserTypes;
|
|
882
|
+
companies?: string[];
|
|
883
|
+
}
|
|
884
|
+
interface UserType {
|
|
885
|
+
id: string;
|
|
886
|
+
firstName?: string;
|
|
887
|
+
lastName?: string;
|
|
888
|
+
pincode?: string;
|
|
889
|
+
role: ActiveUserRole;
|
|
890
|
+
image?: string | null;
|
|
891
|
+
_id?: string;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
interface CartFeeTaxEntry {
|
|
895
|
+
id: string;
|
|
896
|
+
name: string;
|
|
897
|
+
percentage: number;
|
|
898
|
+
amount: number;
|
|
899
|
+
taxTableId: string;
|
|
900
|
+
taxTableName: string;
|
|
901
|
+
compounding?: boolean;
|
|
902
|
+
priority?: number;
|
|
903
|
+
}
|
|
904
|
+
interface CartFeeItem {
|
|
905
|
+
id: string;
|
|
906
|
+
label: string;
|
|
907
|
+
amount: number;
|
|
908
|
+
percentage: number;
|
|
909
|
+
taxTableId?: string;
|
|
910
|
+
tax?: number;
|
|
911
|
+
taxName: string;
|
|
912
|
+
taxes?: CartFeeTaxEntry[];
|
|
913
|
+
}
|
|
914
|
+
interface CartDiscountItem {
|
|
915
|
+
label: string;
|
|
916
|
+
amount: number;
|
|
917
|
+
percentage: number;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
interface CustomSale {
|
|
921
|
+
customSaleId: string;
|
|
922
|
+
name: string;
|
|
923
|
+
price: number;
|
|
924
|
+
quantity: number;
|
|
925
|
+
applyTaxes: boolean;
|
|
926
|
+
total: number;
|
|
927
|
+
totalTax: number;
|
|
928
|
+
taxes: {
|
|
929
|
+
name: string;
|
|
930
|
+
percentage: number;
|
|
931
|
+
amount: number;
|
|
932
|
+
taxTableName: string;
|
|
933
|
+
taxTableId: string;
|
|
934
|
+
id: string;
|
|
935
|
+
}[];
|
|
936
|
+
discount: {
|
|
937
|
+
cartDiscount: {
|
|
938
|
+
amount: number;
|
|
939
|
+
percentage: number;
|
|
940
|
+
};
|
|
941
|
+
};
|
|
942
|
+
fee: {
|
|
943
|
+
cartFee: {
|
|
944
|
+
amount: number;
|
|
945
|
+
label: string;
|
|
946
|
+
percentage: number;
|
|
947
|
+
tax: number;
|
|
948
|
+
taxTableId: string;
|
|
949
|
+
};
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
type RefundedCustomSale = CustomSale;
|
|
953
|
+
|
|
954
|
+
interface MetadataItem {
|
|
955
|
+
key: string;
|
|
956
|
+
value: string;
|
|
957
|
+
}
|
|
958
|
+
interface PosDataItem {
|
|
959
|
+
outlet: string;
|
|
960
|
+
station: string;
|
|
961
|
+
employee: string | {
|
|
962
|
+
_id?: string;
|
|
963
|
+
firstName: string;
|
|
964
|
+
lastName: string;
|
|
965
|
+
};
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
interface Tax {
|
|
969
|
+
id: string;
|
|
970
|
+
name: string;
|
|
971
|
+
percentage: number;
|
|
972
|
+
amount: number;
|
|
973
|
+
taxableAmount?: number;
|
|
974
|
+
taxTableName: string;
|
|
975
|
+
taxTableId: string;
|
|
976
|
+
compounding?: boolean;
|
|
977
|
+
priority?: number;
|
|
978
|
+
}
|
|
979
|
+
interface Tip {
|
|
980
|
+
amount: number;
|
|
981
|
+
percentage: number;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
interface DiscountDetail {
|
|
985
|
+
percentage: number;
|
|
986
|
+
amount: number;
|
|
987
|
+
label?: string;
|
|
988
|
+
}
|
|
989
|
+
interface FeeDetail {
|
|
990
|
+
percentage: number;
|
|
991
|
+
amount: number;
|
|
992
|
+
tax: number;
|
|
993
|
+
label?: string;
|
|
994
|
+
taxTableId: string;
|
|
995
|
+
taxRateId?: string;
|
|
996
|
+
applyTaxes?: boolean;
|
|
997
|
+
}
|
|
998
|
+
interface DiscountLineItem {
|
|
999
|
+
itemDiscounts: DiscountDetail[];
|
|
1000
|
+
cartDiscount: DiscountDetail;
|
|
1001
|
+
}
|
|
1002
|
+
interface FeeLineItem {
|
|
1003
|
+
itemFees: FeeDetail[];
|
|
1004
|
+
cartFee?: FeeDetail;
|
|
1005
|
+
}
|
|
1006
|
+
interface LineItem {
|
|
1007
|
+
productId: string;
|
|
1008
|
+
variantExternalId?: string;
|
|
1009
|
+
productExternalId?: string;
|
|
1010
|
+
internalId?: string;
|
|
1011
|
+
name: string;
|
|
1012
|
+
quantity: number;
|
|
1013
|
+
price: number;
|
|
1014
|
+
taxes: Tax[];
|
|
1015
|
+
discount: DiscountLineItem;
|
|
1016
|
+
fee: FeeLineItem;
|
|
1017
|
+
totalTax: number;
|
|
1018
|
+
total: number;
|
|
1019
|
+
lineNetWithFees: number;
|
|
1020
|
+
metadata: MetadataItem[];
|
|
1021
|
+
image: string;
|
|
1022
|
+
sku: string;
|
|
1023
|
+
stock: number;
|
|
1024
|
+
note?: string;
|
|
1025
|
+
description?: string;
|
|
1026
|
+
variantId: string;
|
|
1027
|
+
images?: string[];
|
|
1028
|
+
attributes?: string;
|
|
1029
|
+
isUnlimited?: boolean;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
interface TipPayment {
|
|
1033
|
+
amount: number;
|
|
1034
|
+
tipTo: string;
|
|
1035
|
+
percentage: number;
|
|
1036
|
+
}
|
|
1037
|
+
interface RefundedTipPayment {
|
|
1038
|
+
amount: number;
|
|
1039
|
+
percentage: number;
|
|
1040
|
+
transactionId: string;
|
|
1041
|
+
tipTo: string;
|
|
1042
|
+
tendered?: number;
|
|
1043
|
+
}
|
|
1044
|
+
interface PaymentMethod {
|
|
1045
|
+
transactionId: string;
|
|
1046
|
+
paymentType: string;
|
|
1047
|
+
amount: number;
|
|
1048
|
+
timestamp: string;
|
|
1049
|
+
processor: string;
|
|
1050
|
+
saleId?: string;
|
|
1051
|
+
change?: number | null;
|
|
1052
|
+
tip?: TipPayment | null;
|
|
1053
|
+
cashRounding?: number;
|
|
1054
|
+
emv?: string | null;
|
|
1055
|
+
processorFee?: number | null;
|
|
1056
|
+
tendered?: number;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
interface SummaryPayments {
|
|
1060
|
+
cardTotal: number;
|
|
1061
|
+
cashTotal: number;
|
|
1062
|
+
customTotal: number;
|
|
1063
|
+
cardProcessingFeesTotal: number;
|
|
1064
|
+
}
|
|
1065
|
+
interface Summary {
|
|
1066
|
+
discountTotal: number;
|
|
1067
|
+
shippingTotal?: number | null;
|
|
1068
|
+
total: number;
|
|
1069
|
+
totalTaxes: number;
|
|
1070
|
+
subtotalAfterFees: number;
|
|
1071
|
+
taxes: Tax[];
|
|
1072
|
+
tip?: Tip | null;
|
|
1073
|
+
isTaxInclusive: boolean;
|
|
1074
|
+
nonRevenueTotal?: number;
|
|
1075
|
+
grossSales?: number;
|
|
1076
|
+
lineDiscountTotal?: number;
|
|
1077
|
+
cartDiscountTotal?: number;
|
|
1078
|
+
feesTotal?: number;
|
|
1079
|
+
lineFeesTotal?: number;
|
|
1080
|
+
cartFeesTotal?: number;
|
|
1081
|
+
taxableFeesTotal?: number;
|
|
1082
|
+
nonTaxableFeesTotal?: number;
|
|
1083
|
+
totalTaxableSales?: number;
|
|
1084
|
+
totalNonTaxableSales?: number;
|
|
1085
|
+
tipTotal?: number;
|
|
1086
|
+
cashRounding?: number;
|
|
1087
|
+
totalBeforeTip?: number;
|
|
1088
|
+
amountPaid?: number;
|
|
1089
|
+
amountRefunded?: number;
|
|
1090
|
+
payments?: SummaryPayments;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
interface RefundedLineItem {
|
|
1094
|
+
productId: string;
|
|
1095
|
+
variantId: string;
|
|
1096
|
+
variantExternalId?: string;
|
|
1097
|
+
productExternalId?: string;
|
|
1098
|
+
internalId?: string;
|
|
1099
|
+
name: string;
|
|
1100
|
+
quantity: number;
|
|
1101
|
+
price: number;
|
|
1102
|
+
taxes: Tax[];
|
|
1103
|
+
discount: DiscountLineItem;
|
|
1104
|
+
totalTax: number;
|
|
1105
|
+
total: number;
|
|
1106
|
+
lineNetWithFees: number;
|
|
1107
|
+
image: string;
|
|
1108
|
+
sku: string;
|
|
1109
|
+
note?: string;
|
|
1110
|
+
description?: string;
|
|
1111
|
+
images?: string[];
|
|
1112
|
+
fee: FeeLineItem;
|
|
1113
|
+
}
|
|
1114
|
+
interface RefundItem {
|
|
1115
|
+
lineItems: RefundedLineItem[];
|
|
1116
|
+
customSales: RefundedCustomSale[];
|
|
1117
|
+
cartFees: CartFeeItem[];
|
|
1118
|
+
tips: RefundedTipPayment[];
|
|
1119
|
+
refundedBy: string;
|
|
1120
|
+
timestamp: string | undefined;
|
|
1121
|
+
summary?: Summary;
|
|
1122
|
+
refundPayment: PaymentMethod[];
|
|
1123
|
+
balance?: number;
|
|
1124
|
+
receiptId?: string;
|
|
1125
|
+
currency?: CurrencyCode;
|
|
1126
|
+
minorUnits?: number;
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
type ActiveOrder = Enrich<Order, {
|
|
1130
|
+
_id: string;
|
|
1131
|
+
id?: string;
|
|
1132
|
+
internalId?: string;
|
|
1133
|
+
receiptId?: string;
|
|
1134
|
+
externalId: string | null;
|
|
1135
|
+
customer: Partial<ActiveCustomer | null>;
|
|
1136
|
+
customerId?: string | null;
|
|
1137
|
+
summary: Summary;
|
|
1138
|
+
cartDiscount: CartDiscountItem | null;
|
|
1139
|
+
cartFees: CartFeeItem[] | null;
|
|
1140
|
+
updatedAt?: string;
|
|
1141
|
+
createdAt?: string;
|
|
1142
|
+
completedAt?: string | Date | null;
|
|
1143
|
+
paymentMethods: PaymentMethod[];
|
|
1144
|
+
posData: PosDataItem | null;
|
|
1145
|
+
sessionId: string;
|
|
1146
|
+
metadata: MetadataItem[];
|
|
1147
|
+
notes?: OrderNote[] | null;
|
|
1148
|
+
billing: Address | null;
|
|
1149
|
+
shipping: Address | null;
|
|
1150
|
+
lineItems: LineItem[];
|
|
1151
|
+
customSales: CustomSale[];
|
|
1152
|
+
nonRevenueItems?: NonRevenueItem[];
|
|
1153
|
+
refund?: RefundItem[];
|
|
1154
|
+
signature?: string | null;
|
|
1155
|
+
paymentState?: PaymentState;
|
|
1156
|
+
fulfillmentState?: FulfillmentState;
|
|
1157
|
+
user?: ActiveUser;
|
|
1158
|
+
outlet?: ActiveOutlet;
|
|
1159
|
+
isDeleted?: boolean;
|
|
1160
|
+
newOrder?: boolean;
|
|
1161
|
+
station?: ActiveStation;
|
|
1162
|
+
}>;
|
|
1163
|
+
|
|
1164
|
+
interface Discount {
|
|
1165
|
+
value: number;
|
|
1166
|
+
label?: string;
|
|
1167
|
+
isPercent?: boolean;
|
|
1168
|
+
}
|
|
1169
|
+
interface CustomFee {
|
|
1170
|
+
label: string;
|
|
1171
|
+
amount: number;
|
|
1172
|
+
isPercent: boolean;
|
|
1173
|
+
applyTaxes: boolean;
|
|
1174
|
+
taxTableId?: string;
|
|
1175
|
+
taxRateId?: string;
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
interface ActiveProduct {
|
|
1179
|
+
id: string;
|
|
1180
|
+
internalId: string;
|
|
1181
|
+
externalId: string;
|
|
1182
|
+
productExternalId: string;
|
|
1183
|
+
variantId: string;
|
|
1184
|
+
name: string;
|
|
1185
|
+
sku: string;
|
|
1186
|
+
price: number;
|
|
1187
|
+
images: string[];
|
|
1188
|
+
taxTableId: string;
|
|
1189
|
+
quantity: number;
|
|
1190
|
+
note?: string;
|
|
1191
|
+
discounts?: Discount[];
|
|
1192
|
+
description?: string;
|
|
1193
|
+
longDescription?: string;
|
|
1194
|
+
shortDescription?: string;
|
|
1195
|
+
barcodeId?: string;
|
|
1196
|
+
stock: number;
|
|
1197
|
+
allowBackOrder?: boolean;
|
|
1198
|
+
fees?: CustomFee[];
|
|
1199
|
+
currency?: CurrencyCode;
|
|
1200
|
+
minorUnits?: number;
|
|
1201
|
+
isUnlimited?: boolean;
|
|
1202
|
+
attributes?: string;
|
|
1203
|
+
localQuantity?: number;
|
|
1204
|
+
_id?: string;
|
|
1205
|
+
productType?: ProductType;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
interface ActiveCustomSales {
|
|
1209
|
+
id: string;
|
|
1210
|
+
name: string;
|
|
1211
|
+
applyTaxes: boolean;
|
|
1212
|
+
taxTableId?: string;
|
|
1213
|
+
quantity: number;
|
|
1214
|
+
price: number;
|
|
1215
|
+
discount?: unknown;
|
|
1216
|
+
fee?: unknown;
|
|
1217
|
+
}
|
|
1218
|
+
interface ActiveCartProduct {
|
|
1219
|
+
id: string;
|
|
1220
|
+
name: string;
|
|
1221
|
+
note?: string;
|
|
1222
|
+
price: number;
|
|
1223
|
+
quantity: number;
|
|
1224
|
+
discount?: Discount;
|
|
1225
|
+
taxTableId: string;
|
|
1226
|
+
}
|
|
1227
|
+
interface ActiveCart {
|
|
1228
|
+
tax?: number;
|
|
1229
|
+
taxes?: Tax[];
|
|
1230
|
+
total: number;
|
|
1231
|
+
subtotal: number;
|
|
1232
|
+
discount?: Discount;
|
|
1233
|
+
customFee?: CustomFee[];
|
|
1234
|
+
products: ActiveProduct[];
|
|
1235
|
+
customSales?: ActiveCustomSales[];
|
|
1236
|
+
nonRevenueItems?: NonRevenueItem[];
|
|
1237
|
+
remainingBalance?: number;
|
|
1238
|
+
amountToBeCharged: number;
|
|
1239
|
+
customer?: Partial<ActiveCustomer | null> | null;
|
|
1240
|
+
orderNotes?: string;
|
|
1241
|
+
cartTotal?: number;
|
|
1242
|
+
orderTotal?: number;
|
|
1243
|
+
orderId?: string;
|
|
1244
|
+
currency?: CurrencyCode;
|
|
1245
|
+
minorUnits?: number;
|
|
1246
|
+
}
|
|
1247
|
+
interface ActivePark extends ActiveCart {
|
|
1248
|
+
orderId: string;
|
|
1249
|
+
receiptId: string;
|
|
1250
|
+
servedBy: string | {
|
|
1251
|
+
_id?: string | undefined;
|
|
1252
|
+
firstName: string;
|
|
1253
|
+
lastName: string;
|
|
1254
|
+
} | undefined;
|
|
1255
|
+
createdAt: string | number;
|
|
1256
|
+
}
|
|
1257
|
+
interface ActiveCompany {
|
|
1258
|
+
id?: string;
|
|
1259
|
+
name?: string;
|
|
1260
|
+
logo?: string;
|
|
1261
|
+
settings?: unknown;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
interface Inventory {
|
|
1265
|
+
warehouse: string;
|
|
1266
|
+
outletId: string;
|
|
1267
|
+
stock?: number | null;
|
|
1268
|
+
}
|
|
1269
|
+
interface ProductVariant {
|
|
1270
|
+
sku: string;
|
|
1271
|
+
price: number;
|
|
1272
|
+
salePrice: number;
|
|
1273
|
+
isOnSale: boolean;
|
|
1274
|
+
barcode?: string;
|
|
1275
|
+
costPrice?: number;
|
|
1276
|
+
manageStock: boolean;
|
|
1277
|
+
externalId: string;
|
|
1278
|
+
inventory?: Inventory[];
|
|
1279
|
+
allowBackorder?: boolean;
|
|
1280
|
+
images?: string[];
|
|
1281
|
+
attributes: {
|
|
1282
|
+
name: string;
|
|
1283
|
+
value?: string;
|
|
1284
|
+
}[];
|
|
1285
|
+
metadata?: {
|
|
1286
|
+
key: string;
|
|
1287
|
+
value: string;
|
|
1288
|
+
}[];
|
|
1289
|
+
_id: string;
|
|
1290
|
+
isDeleted?: boolean;
|
|
1291
|
+
currency?: CurrencyCode;
|
|
1292
|
+
minorUnits?: number;
|
|
1293
|
+
}
|
|
1294
|
+
interface FullProduct {
|
|
1295
|
+
_id: string;
|
|
1296
|
+
companyId?: string;
|
|
1297
|
+
externalId: string;
|
|
1298
|
+
taxTable: string;
|
|
1299
|
+
name: string;
|
|
1300
|
+
description?: string;
|
|
1301
|
+
shortDescription?: string;
|
|
1302
|
+
images?: string[];
|
|
1303
|
+
categories: {
|
|
1304
|
+
name: string;
|
|
1305
|
+
externalId: string;
|
|
1306
|
+
}[];
|
|
1307
|
+
attributes: {
|
|
1308
|
+
name: string;
|
|
1309
|
+
values: string[];
|
|
1310
|
+
}[];
|
|
1311
|
+
tags?: string[];
|
|
1312
|
+
supplier?: string;
|
|
1313
|
+
sku?: string;
|
|
1314
|
+
productType: ProductType;
|
|
1315
|
+
variants: ProductVariant[];
|
|
1316
|
+
minPrice?: number;
|
|
1317
|
+
maxPrice?: number;
|
|
1318
|
+
price?: number;
|
|
1319
|
+
status?: string;
|
|
1320
|
+
isDeleted?: boolean;
|
|
1321
|
+
currency?: CurrencyCode;
|
|
1322
|
+
minorUnits?: number;
|
|
1323
|
+
createdAt?: string;
|
|
1324
|
+
updatedAt?: string;
|
|
1325
|
+
}
|
|
1326
|
+
type ActiveFullProduct = FullProduct;
|
|
1327
|
+
|
|
1328
|
+
interface ActiveSession {
|
|
1329
|
+
id: string;
|
|
1330
|
+
stationId: string;
|
|
1331
|
+
openingAmount?: number;
|
|
1332
|
+
closingAmount?: number;
|
|
1333
|
+
openedBy?: string;
|
|
1334
|
+
closedBy?: string;
|
|
1335
|
+
notes?: string[];
|
|
1336
|
+
currency?: CurrencyCode;
|
|
1337
|
+
minorUnits?: number;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
declare enum PaymentStatus {
|
|
1341
|
+
FAILED = "failed",
|
|
1342
|
+
SUCCESS = "success",
|
|
1343
|
+
CANCELED = "canceled",
|
|
1344
|
+
IN_PROGRESS = "inProgress"
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
declare enum ProcessorType {
|
|
1348
|
+
FINAL_PAY = "Terminal",
|
|
1349
|
+
TAP_TO_PAY = "TapToPay",
|
|
1350
|
+
MOTO = "Moto",
|
|
1351
|
+
CLOUD = "Cloud",
|
|
1352
|
+
BLUETOOTH = "Bluetooth",
|
|
1353
|
+
CASH = "Cash",
|
|
1354
|
+
CUSTOM_PAY = "CustomPay",
|
|
1355
|
+
VENDARA = "Vendara",
|
|
1356
|
+
REDEEM = "Redeem",
|
|
1357
|
+
INTEGRATION = "Integration"
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
interface PrinterDetails {
|
|
1361
|
+
deviceName: string;
|
|
1362
|
+
serial: string;
|
|
1363
|
+
address: string | null;
|
|
1364
|
+
isConnected: boolean;
|
|
1365
|
+
connectionType: string;
|
|
1366
|
+
ipAddress: string | null;
|
|
1367
|
+
macAddress: string | null;
|
|
1368
|
+
isAirPrint: boolean;
|
|
1369
|
+
}
|
|
1370
|
+
interface PaymentResponse {
|
|
1371
|
+
status: PaymentStatus;
|
|
1372
|
+
message?: string;
|
|
1373
|
+
error?: string;
|
|
1374
|
+
emv?: string | null;
|
|
1375
|
+
paymentData?: any;
|
|
1376
|
+
signature?: string | null;
|
|
1377
|
+
tipAmount?: number;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
interface Reader {
|
|
1381
|
+
label: string;
|
|
1382
|
+
connectionType: string;
|
|
1383
|
+
info: string;
|
|
1384
|
+
serial: string;
|
|
1385
|
+
isReconnecting?: boolean;
|
|
1386
|
+
supportsOnReaderTipping?: boolean;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
interface ActiveSplitPayment {
|
|
1390
|
+
amountRemaining?: number | null;
|
|
1391
|
+
amountToBeCharged?: number | null;
|
|
1392
|
+
splitNumber?: null | number;
|
|
1393
|
+
currentSplit?: number;
|
|
1394
|
+
status?: PaymentStatus;
|
|
1395
|
+
isFixed?: boolean;
|
|
1396
|
+
payments?: null | PaymentMethod[];
|
|
1397
|
+
paidAmount?: number;
|
|
1398
|
+
tip?: number | null;
|
|
1399
|
+
}
|
|
1400
|
+
interface RefundProcessingStatus {
|
|
1401
|
+
status: PaymentStatus;
|
|
1402
|
+
isCardPresent?: boolean;
|
|
1403
|
+
message?: string;
|
|
1404
|
+
}
|
|
1405
|
+
interface ActiveRefundOrder {
|
|
1406
|
+
quantities?: Record<string, number>;
|
|
1407
|
+
options?: Record<string, string>;
|
|
1408
|
+
refundAmounts?: Record<string, number>;
|
|
1409
|
+
stagedAmounts?: Record<string, number>;
|
|
1410
|
+
refundPayments?: PaymentMethod[] | null;
|
|
1411
|
+
currentRefundTotal?: number;
|
|
1412
|
+
amountRemaining?: number | null;
|
|
1413
|
+
buttonsDisabled?: Record<string, boolean>;
|
|
1414
|
+
isRefund?: boolean;
|
|
1415
|
+
customSalesQuantities?: Record<string, number>;
|
|
1416
|
+
cartFeesRefunds?: Record<string, number>;
|
|
1417
|
+
tipsRefunds?: Record<string, number>;
|
|
1418
|
+
refundProcessingStatus?: RefundProcessingStatus | null;
|
|
1419
|
+
sessionRefundedTotal?: number;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
interface BaseTile {
|
|
1423
|
+
id: string;
|
|
1424
|
+
index: number;
|
|
1425
|
+
type: 'product' | 'action' | 'category' | 'folder' | 'back' | 'empty';
|
|
1426
|
+
data: {
|
|
1427
|
+
tileData: string;
|
|
1428
|
+
folderId?: string;
|
|
1429
|
+
[key: string]: any;
|
|
1430
|
+
};
|
|
1431
|
+
}
|
|
1432
|
+
interface TileGrid {
|
|
1433
|
+
tiles: BaseTile[];
|
|
1434
|
+
}
|
|
1435
|
+
interface SmartGridSettingsData {
|
|
1436
|
+
root: TileGrid;
|
|
1437
|
+
folders: {
|
|
1438
|
+
[folderId: string]: TileGrid;
|
|
1439
|
+
};
|
|
1440
|
+
}
|
|
1441
|
+
interface SmartGridSettings {
|
|
1442
|
+
settings: SmartGridSettingsData | null;
|
|
1443
|
+
id: string | null;
|
|
1444
|
+
folderPath: string[];
|
|
1445
|
+
selectedTile: number | null;
|
|
1446
|
+
allowedActions?: string[];
|
|
1447
|
+
allowedRoles?: string[];
|
|
1448
|
+
allowedTypes?: string[];
|
|
1449
|
+
editMode?: boolean;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
interface TaxesDetails {
|
|
1453
|
+
[id: string]: {
|
|
1454
|
+
amount: number;
|
|
1455
|
+
percentage: number;
|
|
1456
|
+
name: string;
|
|
1457
|
+
taxTableName: string;
|
|
1458
|
+
taxTableId: string;
|
|
1459
|
+
compounding?: boolean;
|
|
1460
|
+
priority?: number;
|
|
1461
|
+
};
|
|
1462
|
+
}
|
|
1463
|
+
interface ProdDiscountBreakdown {
|
|
1464
|
+
amount: number;
|
|
1465
|
+
percentage: number;
|
|
1466
|
+
label?: string;
|
|
1467
|
+
}
|
|
1468
|
+
interface ProdFeeBreakdown {
|
|
1469
|
+
amount: number;
|
|
1470
|
+
percentage: number;
|
|
1471
|
+
label?: string;
|
|
1472
|
+
tax: number;
|
|
1473
|
+
taxTableId?: string;
|
|
1474
|
+
taxRateId?: string;
|
|
1475
|
+
applyTaxes: boolean;
|
|
1476
|
+
}
|
|
1477
|
+
interface ProductTaxDetails {
|
|
1478
|
+
tax: number;
|
|
1479
|
+
prodDiscount: number;
|
|
1480
|
+
prodDiscountTotal: number;
|
|
1481
|
+
cartDiscount: number;
|
|
1482
|
+
prodDiscountPercentage: number;
|
|
1483
|
+
cartDiscountPercentage: number;
|
|
1484
|
+
taxes: TaxesDetails;
|
|
1485
|
+
fee?: number;
|
|
1486
|
+
feeTax?: number;
|
|
1487
|
+
feePercentage?: number;
|
|
1488
|
+
feeLabel?: string;
|
|
1489
|
+
cartFee?: number;
|
|
1490
|
+
cartFeeTax?: number;
|
|
1491
|
+
cartFeePercentage?: number;
|
|
1492
|
+
cartFeeLabel?: string;
|
|
1493
|
+
feeTaxTableId?: string;
|
|
1494
|
+
cartFeeTaxTableId?: string;
|
|
1495
|
+
prodDiscountLabel?: string;
|
|
1496
|
+
lineDisplayWithFee?: number;
|
|
1497
|
+
cartDiscountAllocated?: number;
|
|
1498
|
+
lineAfterCartDiscount?: number;
|
|
1499
|
+
computedLineTotal?: number;
|
|
1500
|
+
computedLineTax?: number;
|
|
1501
|
+
feeDisplay?: number;
|
|
1502
|
+
prodDiscounts?: ProdDiscountBreakdown[];
|
|
1503
|
+
fees?: ProdFeeBreakdown[];
|
|
1504
|
+
lineNetWithFees?: number;
|
|
1505
|
+
}
|
|
1506
|
+
interface CustomSaleDetails {
|
|
1507
|
+
tax: number;
|
|
1508
|
+
cartDiscount: number;
|
|
1509
|
+
cartDiscountPercentage: number;
|
|
1510
|
+
taxes: TaxesDetails;
|
|
1511
|
+
cartFee?: number;
|
|
1512
|
+
cartFeeTax?: number;
|
|
1513
|
+
cartFeePercentage?: number;
|
|
1514
|
+
cartFeeLabel?: string;
|
|
1515
|
+
cartFeeTaxTableId?: string;
|
|
1516
|
+
applyTaxes?: boolean;
|
|
1517
|
+
lineDisplayWithFee?: number;
|
|
1518
|
+
cartDiscountAllocated?: number;
|
|
1519
|
+
lineAfterCartDiscount?: number;
|
|
1520
|
+
computedLineTotal?: number;
|
|
1521
|
+
computedLineTax?: number;
|
|
1522
|
+
}
|
|
1523
|
+
interface CartFeesDetails {
|
|
1524
|
+
name: string;
|
|
1525
|
+
amount: number;
|
|
1526
|
+
percentage: number;
|
|
1527
|
+
feeTax: number;
|
|
1528
|
+
taxTableId: string;
|
|
1529
|
+
taxName: string;
|
|
1530
|
+
taxes?: CartFeeTaxEntry[];
|
|
1531
|
+
}
|
|
1532
|
+
interface CalculatedTaxDetails {
|
|
1533
|
+
tax: number;
|
|
1534
|
+
total: number;
|
|
1535
|
+
subtotal: number;
|
|
1536
|
+
orderSubtotal: number;
|
|
1537
|
+
totalDiscount: number;
|
|
1538
|
+
discountAmount?: number;
|
|
1539
|
+
subtotalAfterDiscount?: number;
|
|
1540
|
+
products: {
|
|
1541
|
+
[id: string]: ProductTaxDetails;
|
|
1542
|
+
};
|
|
1543
|
+
customSales: {
|
|
1544
|
+
[id: string]: CustomSaleDetails;
|
|
1545
|
+
};
|
|
1546
|
+
totalTaxes: TaxesDetails;
|
|
1547
|
+
cartFees: CartFeesDetails[];
|
|
1548
|
+
}
|
|
1549
|
+
interface TipData {
|
|
1550
|
+
value: number;
|
|
1551
|
+
label?: string;
|
|
1552
|
+
isPercent: boolean;
|
|
1553
|
+
}
|
|
1554
|
+
interface TipsDetails {
|
|
1555
|
+
total: number;
|
|
1556
|
+
tips: TipData[];
|
|
1557
|
+
currency?: string;
|
|
1558
|
+
noTipLabel?: string;
|
|
1559
|
+
customTipLabel?: string;
|
|
1560
|
+
selectedTip?: TipData;
|
|
1561
|
+
cashChange?: number;
|
|
1562
|
+
enabled?: boolean;
|
|
1563
|
+
}
|
|
1564
|
+
type CashRoundingIncrement = '' | '0.05' | '0.10' | '0.25' | '0.50' | '1.00';
|
|
1565
|
+
interface CashPaymentSettings {
|
|
1566
|
+
cashRounding: CashRoundingIncrement;
|
|
1567
|
+
}
|
|
1568
|
+
declare enum ActiveEntityType {
|
|
1569
|
+
TAX = "tax",
|
|
1570
|
+
CART = "cart",
|
|
1571
|
+
USER = "user",
|
|
1572
|
+
ORDER = "order",
|
|
1573
|
+
PRODUCT = "product",
|
|
1574
|
+
FULL_PRODUCT = "fullProduct",
|
|
1575
|
+
CUSTOMER = "customer",
|
|
1576
|
+
OUTLET = "outlet",
|
|
1577
|
+
CHANGES = "changes",
|
|
1578
|
+
SPLIT_PAYMENT = "splitPayment",
|
|
1579
|
+
CALCULATED_TAX = "calculatedTaxDetails",
|
|
1580
|
+
TIPS_DETAILS = "tipsDetails",
|
|
1581
|
+
CASH_PAYMENT_SETTINGS = "cashPaymentSettings",
|
|
1582
|
+
REFUND_DETAILS = "refundDetails",
|
|
1583
|
+
COMPANY = "company",
|
|
1584
|
+
IS_AUTHENTICATED = "isAuthenticated",
|
|
1585
|
+
TIMER = "timer",
|
|
1586
|
+
UPDATED_ORDER_ACTIONS = "updatedOrderActions",
|
|
1587
|
+
BUILD = "activeBuild",
|
|
1588
|
+
BUILD_UPDATE_INFO = "buildUpdateInfo",
|
|
1589
|
+
GLOBAL_BLOCKS = "globalBlocks",
|
|
1590
|
+
ACTIVE_STATION = "activeStation",
|
|
1591
|
+
SMART_GRID = "smartGrid",
|
|
1592
|
+
CUSTOM_SALE = "customSale",
|
|
1593
|
+
ACTIVE_FLOW = "activeFlow",
|
|
1594
|
+
ACTIVE_FLOW_VERSION_URL = "activeFlowVersionUrl"
|
|
1595
|
+
}
|
|
1596
|
+
declare enum EnvironmentDataKeys {
|
|
1597
|
+
NETWORK_INFO = "Network Info",
|
|
1598
|
+
DISPLAY = "Display",
|
|
1599
|
+
APP_INFO = "App Info",
|
|
1600
|
+
LOCATION = "Location",
|
|
1601
|
+
DEVICE_INFO = "Device Info",
|
|
1602
|
+
SYSTEM_HEALTH = "System Health",
|
|
1603
|
+
DEVELOPER = "Developer",
|
|
1604
|
+
PERIPHERAL_DEVICES = "Peripheral Devices"
|
|
1605
|
+
}
|
|
1606
|
+
declare enum EnvironmentDataSubKeys {
|
|
1607
|
+
DEVICE_STATUS = "Device Status",
|
|
1608
|
+
LAST_ONLINE_TIME = "Last Online Time",
|
|
1609
|
+
NETWORK_TYPE = "Network Type",
|
|
1610
|
+
SIGNAL_STRENGTH = "Signal Strength",
|
|
1611
|
+
NETWORK_NAME = "Network name",
|
|
1612
|
+
IP_ADDRESS = "IP Address",
|
|
1613
|
+
SCREEN_RESOLUTION = "Screen Resolution",
|
|
1614
|
+
PIXEL_RATIO = "Pixel Ratio",
|
|
1615
|
+
ORIENTATION = "Orientation",
|
|
1616
|
+
APP_VERSION = "App Version",
|
|
1617
|
+
BUILD_NUMBER = "Build Number",
|
|
1618
|
+
BUNDLE_ID = "Bundle ID",
|
|
1619
|
+
INSTALLED = "Installed",
|
|
1620
|
+
LAST_UPDATED = "Last Updated",
|
|
1621
|
+
LOCATION_ACCESS = "Location Access",
|
|
1622
|
+
CURRENT_LOCATION = "Current Location",
|
|
1623
|
+
MODEL = "Model",
|
|
1624
|
+
SYSTEM_VERSION = "System Version",
|
|
1625
|
+
FIRMWARE_VERSION = "Firmware Version",
|
|
1626
|
+
SERIAL_NUMBER = "Serial Number",
|
|
1627
|
+
IMEI_NUMBER = "IMEI Number",
|
|
1628
|
+
MAC_ADDRESS = "MAC Address",
|
|
1629
|
+
ACTIVATION_TIME = "Activation Time",
|
|
1630
|
+
TIME_ZONE = "Time Zone",
|
|
1631
|
+
DEVICE_LANGUAGE = "Device Language",
|
|
1632
|
+
TOTAL_RAM = "Total RAM",
|
|
1633
|
+
BATTERY_LEVEL = "Battery Level",
|
|
1634
|
+
BATTERY_STATUS = "Battery Status",
|
|
1635
|
+
LOW_POWER_MODE = "Low Power Mode",
|
|
1636
|
+
AVERAGE_CPU_USAGE = "Average CPU Usage",
|
|
1637
|
+
CPU_SPEED = "CPU Speed",
|
|
1638
|
+
AVAILABLE_STORAGE = "Available Storage",
|
|
1639
|
+
TOTAL_STORAGE = "Total Storage",
|
|
1640
|
+
UPTIME = "Uptime",
|
|
1641
|
+
FLUTTER_VERSION = "Flutter Version",
|
|
1642
|
+
DART_VERSION = "Dart Version",
|
|
1643
|
+
ENVIRONMENT = "Environment",
|
|
1644
|
+
CONNECTED_PRINTER = "Connected Printer"
|
|
1645
|
+
}
|
|
1646
|
+
interface ActiveTimer {
|
|
1647
|
+
initialTimer: string;
|
|
1648
|
+
currentTimer: string;
|
|
1649
|
+
}
|
|
1650
|
+
interface ActiveUpdatedOrder {
|
|
1651
|
+
customerNote?: string;
|
|
1652
|
+
status?: string;
|
|
1653
|
+
}
|
|
1654
|
+
interface TaxTableActive {
|
|
1655
|
+
name: string;
|
|
1656
|
+
country: string;
|
|
1657
|
+
postcode: string;
|
|
1658
|
+
rate: number;
|
|
1659
|
+
priority: number;
|
|
1660
|
+
compounding: boolean;
|
|
1661
|
+
id: string;
|
|
1662
|
+
taxTableName: string;
|
|
1663
|
+
taxTableId: string;
|
|
1664
|
+
}
|
|
1665
|
+
interface ActiveTaxDetails {
|
|
1666
|
+
taxIncl?: boolean;
|
|
1667
|
+
tables: {
|
|
1668
|
+
[name: string]: TaxTableActive[];
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
interface ActiveEntityChanges {
|
|
1672
|
+
productInCart: string[] | null;
|
|
1673
|
+
numberOfProductsInCart: number;
|
|
1674
|
+
cartValue: number;
|
|
1675
|
+
user: string | null;
|
|
1676
|
+
customer: string | null;
|
|
1677
|
+
order: string | null;
|
|
1678
|
+
role: string | null;
|
|
1679
|
+
product: string | null;
|
|
1680
|
+
}
|
|
1681
|
+
interface Flow {
|
|
1682
|
+
_id: string;
|
|
1683
|
+
companyId: string;
|
|
1684
|
+
title: string;
|
|
1685
|
+
description: string;
|
|
1686
|
+
template: string;
|
|
1687
|
+
createdBy: string;
|
|
1688
|
+
flowData: Record<string, any>;
|
|
1689
|
+
isDeleted: boolean;
|
|
1690
|
+
createdAt: string;
|
|
1691
|
+
updatedAt: string;
|
|
1692
|
+
previewImage: string;
|
|
1693
|
+
currentVersion: string;
|
|
1694
|
+
webAppId: string;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
interface SelectionRoleContext {
|
|
1698
|
+
roleIds: string[] | null;
|
|
1699
|
+
switchUsers?: UserType[] | null;
|
|
1700
|
+
switchSpecificUser?: UserType | null;
|
|
1701
|
+
}
|
|
1702
|
+
interface SelectionFlowContext {
|
|
1703
|
+
flow: Flow;
|
|
1704
|
+
flowVersionUrl: string | null;
|
|
1705
|
+
flowSettings: Record<string, string> | null;
|
|
1706
|
+
flowSettingsKey: Record<string, string> | null;
|
|
1707
|
+
}
|
|
1708
|
+
interface SelectionContext {
|
|
1709
|
+
user: ActiveUser;
|
|
1710
|
+
roleContext: SelectionRoleContext;
|
|
1711
|
+
company: ActiveCompany;
|
|
1712
|
+
outlet: ActiveOutlet;
|
|
1713
|
+
station: ActiveStation;
|
|
1714
|
+
session: ActiveSession | null;
|
|
1715
|
+
flow: SelectionFlowContext;
|
|
1716
|
+
}
|
|
1717
|
+
interface ReaderCapabilities {
|
|
1718
|
+
tapToPay: boolean;
|
|
1719
|
+
terminal: boolean;
|
|
1720
|
+
}
|
|
1721
|
+
type ServiceChannelMessageType = 'POSBRAIN_READY' | 'HOST_HELLO' | 'SERVICE_INIT' | 'BOOTSTRAP' | 'TOKEN_REFRESH' | 'SELECTION' | 'HOST_SHUTDOWN' | 'READER_CAPABILITIES' | 'RUNTIME_READY' | 'SYNC_PROGRESS' | 'DEVICE_OP_REQUEST' | 'DEVICE_OP_RESPONSE';
|
|
1722
|
+
interface PosBrainReadyMessage {
|
|
1723
|
+
type: 'POSBRAIN_READY';
|
|
1724
|
+
}
|
|
1725
|
+
interface HostHelloMessage {
|
|
1726
|
+
type: 'HOST_HELLO';
|
|
1727
|
+
}
|
|
1728
|
+
interface ServiceInitMessage {
|
|
1729
|
+
type: 'SERVICE_INIT';
|
|
1730
|
+
}
|
|
1731
|
+
interface BootstrapMessage {
|
|
1732
|
+
type: 'BOOTSTRAP';
|
|
1733
|
+
token: string;
|
|
1734
|
+
selection: SelectionContext;
|
|
1735
|
+
syncCursor?: string | null;
|
|
1736
|
+
readerCapabilities?: ReaderCapabilities | null;
|
|
1737
|
+
endpoints?: {
|
|
1738
|
+
wsUrl?: string;
|
|
1739
|
+
apiUrl?: string;
|
|
1740
|
+
};
|
|
1741
|
+
}
|
|
1742
|
+
interface TokenRefreshMessage {
|
|
1743
|
+
type: 'TOKEN_REFRESH';
|
|
1744
|
+
token: string;
|
|
1745
|
+
}
|
|
1746
|
+
interface SelectionMessage {
|
|
1747
|
+
type: 'SELECTION';
|
|
1748
|
+
selection: SelectionContext;
|
|
1749
|
+
}
|
|
1750
|
+
interface HostShutdownMessage {
|
|
1751
|
+
type: 'HOST_SHUTDOWN';
|
|
1752
|
+
}
|
|
1753
|
+
interface ReaderCapabilitiesMessage {
|
|
1754
|
+
type: 'READER_CAPABILITIES';
|
|
1755
|
+
readerCapabilities: ReaderCapabilities;
|
|
1756
|
+
}
|
|
1757
|
+
interface RuntimeReadyMessage {
|
|
1758
|
+
type: 'RUNTIME_READY';
|
|
1759
|
+
}
|
|
1760
|
+
interface SyncProgressMessage {
|
|
1761
|
+
type: 'SYNC_PROGRESS';
|
|
1762
|
+
total: number;
|
|
1763
|
+
finished: number;
|
|
1764
|
+
pending: string[];
|
|
1765
|
+
done: boolean;
|
|
1766
|
+
}
|
|
1767
|
+
type DeviceOpName = 'printImage' | 'printHTML' | 'printReceipt' | 'openCashDrawer' | 'captureCardPresent';
|
|
1768
|
+
interface DeviceOpRequestMessage {
|
|
1769
|
+
type: 'DEVICE_OP_REQUEST';
|
|
1770
|
+
id: string;
|
|
1771
|
+
op: DeviceOpName;
|
|
1772
|
+
args: unknown[];
|
|
1773
|
+
}
|
|
1774
|
+
interface DeviceOpResponseMessage {
|
|
1775
|
+
type: 'DEVICE_OP_RESPONSE';
|
|
1776
|
+
id: string;
|
|
1777
|
+
ok: boolean;
|
|
1778
|
+
error?: string;
|
|
1779
|
+
}
|
|
1780
|
+
type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | RuntimeReadyMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage;
|
|
1781
|
+
|
|
1782
|
+
export { type ActiveCart, type ActiveCartProduct, type ActiveCompany, type ActiveCustomSales, type ActiveCustomer, type ActiveEntityChanges, ActiveEntityType, type ActiveFullProduct, type ActiveOrder, 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 BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CashPaymentSettings, type CashRoundingIncrement, type Category, type CompanyExtension, type CompanySettingsEavValue, type CompanySettingsEavValueType, 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 HostShutdownMessage, type Inventory, type LineItem, type Metadata, type MetadataItem, type NonRevenueItem, type Note, type Order, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderLineItem, type OrderLineItemDiscount, type OrderLineItemFee, type OrderNote, type OrderPaymentMethod, type OrderPosData, type OrderRefund, type OrderRefundSummary, 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, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type Reader, 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 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 Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
|