@final-commerce/common 2.2.3-staging3.1 → 2.3.0-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +193 -2
- package/dist/index.d.ts +193 -2
- package/dist/index.js +450 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +432 -9
- package/dist/index.mjs.map +1 -1
- package/dist/pos-types/index.d.mts +120 -87
- package/dist/pos-types/index.d.ts +120 -87
- package/dist/pos-types/index.js.map +1 -1
- package/dist/pos-types/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -78,9 +78,6 @@ interface OrderSummary {
|
|
|
78
78
|
cartFeesTotal?: number;
|
|
79
79
|
taxableFeesTotal?: number;
|
|
80
80
|
nonTaxableFeesTotal?: number;
|
|
81
|
-
modifiersTotal?: number;
|
|
82
|
-
taxableModifiersTotal?: number;
|
|
83
|
-
nonTaxableModifiersTotal?: number;
|
|
84
81
|
totalTaxableSales?: number;
|
|
85
82
|
totalNonTaxableSales?: number;
|
|
86
83
|
tipTotal?: number;
|
|
@@ -146,17 +143,6 @@ interface OrderLineItemFee {
|
|
|
146
143
|
cartFee?: PriceModifierDetail;
|
|
147
144
|
itemFees?: PriceModifierDetail[];
|
|
148
145
|
}
|
|
149
|
-
interface OrderLineItemModifier {
|
|
150
|
-
modifierId: string;
|
|
151
|
-
modifierName: string;
|
|
152
|
-
choiceId: string;
|
|
153
|
-
choiceName: string;
|
|
154
|
-
unitPrice: number;
|
|
155
|
-
quantity: number;
|
|
156
|
-
total: number;
|
|
157
|
-
totalTax?: number;
|
|
158
|
-
taxes?: OrderTax[];
|
|
159
|
-
}
|
|
160
146
|
interface OrderLineItem {
|
|
161
147
|
id?: string;
|
|
162
148
|
productId?: string;
|
|
@@ -179,7 +165,6 @@ interface OrderLineItem {
|
|
|
179
165
|
taxes?: OrderTax[];
|
|
180
166
|
discount?: OrderLineItemDiscount;
|
|
181
167
|
fee?: OrderLineItemFee;
|
|
182
|
-
modifiers?: OrderLineItemModifier[];
|
|
183
168
|
lineNetWithFees?: number;
|
|
184
169
|
metadata?: Metadata[];
|
|
185
170
|
stock?: number;
|
|
@@ -456,7 +441,8 @@ declare enum NonRevenueItemType {
|
|
|
456
441
|
|
|
457
442
|
declare enum ProductType {
|
|
458
443
|
SIMPLE = "simple",
|
|
459
|
-
VARIABLE = "variable"
|
|
444
|
+
VARIABLE = "variable",
|
|
445
|
+
BOOKING = "booking"
|
|
460
446
|
}
|
|
461
447
|
declare enum ProductStatus {
|
|
462
448
|
ACTIVE = "active",
|
|
@@ -470,11 +456,38 @@ declare enum PaymentProcessor {
|
|
|
470
456
|
EXTERNAL = "external"
|
|
471
457
|
}
|
|
472
458
|
|
|
459
|
+
declare enum BookingType {
|
|
460
|
+
RENTAL = "rental",
|
|
461
|
+
APPOINTMENT = "appointment",
|
|
462
|
+
OVERNIGHT = "overnight",
|
|
463
|
+
GROUP = "group"
|
|
464
|
+
}
|
|
465
|
+
declare enum BookingRatePeriod {
|
|
466
|
+
SLOT = "slot",
|
|
467
|
+
DAY = "day",
|
|
468
|
+
NIGHT = "night",
|
|
469
|
+
WEEK = "week",
|
|
470
|
+
MONTH = "month"
|
|
471
|
+
}
|
|
472
|
+
declare enum BookingResourceKind {
|
|
473
|
+
ASSET = "asset",
|
|
474
|
+
ROOM = "room",
|
|
475
|
+
PROPERTY = "property",
|
|
476
|
+
SPACE = "space",
|
|
477
|
+
STAFF = "staff",
|
|
478
|
+
TABLE = "table"
|
|
479
|
+
}
|
|
480
|
+
declare enum ReservationStatus {
|
|
481
|
+
HELD = "held",
|
|
482
|
+
CONFIRMED = "confirmed",
|
|
483
|
+
CANCELLED = "cancelled",
|
|
484
|
+
EXPIRED = "expired"
|
|
485
|
+
}
|
|
486
|
+
|
|
473
487
|
interface RefundLineItem {
|
|
474
488
|
taxes?: OrderTax[];
|
|
475
489
|
discount?: RefundDiscount;
|
|
476
490
|
fee?: OrderLineItemFee;
|
|
477
|
-
modifiers?: OrderLineItemModifier[];
|
|
478
491
|
lineNetWithFees?: number;
|
|
479
492
|
quantity?: number;
|
|
480
493
|
stockQuantity?: number;
|
|
@@ -534,9 +547,6 @@ interface RefundSummary {
|
|
|
534
547
|
cartFeesTotal?: number;
|
|
535
548
|
taxableFeesTotal?: number;
|
|
536
549
|
nonTaxableFeesTotal?: number;
|
|
537
|
-
modifiersTotal?: number;
|
|
538
|
-
taxableModifiersTotal?: number;
|
|
539
|
-
nonTaxableModifiersTotal?: number;
|
|
540
550
|
totalTaxableSales?: number;
|
|
541
551
|
totalNonTaxableSales?: number;
|
|
542
552
|
tipTotal?: number;
|
|
@@ -576,6 +586,32 @@ interface TransactionPaymentData {
|
|
|
576
586
|
chargeId?: string;
|
|
577
587
|
}
|
|
578
588
|
|
|
589
|
+
interface OrderReservation {
|
|
590
|
+
internalId: string;
|
|
591
|
+
bookingId?: string;
|
|
592
|
+
productId: string;
|
|
593
|
+
variantId?: string | null;
|
|
594
|
+
resourceId: string;
|
|
595
|
+
name: string;
|
|
596
|
+
resourceName?: string;
|
|
597
|
+
price: number;
|
|
598
|
+
quantity?: number;
|
|
599
|
+
fulfilledQuantity?: number;
|
|
600
|
+
returnedQuantity?: number;
|
|
601
|
+
taxes?: OrderTax[];
|
|
602
|
+
discount?: OrderLineItemDiscount;
|
|
603
|
+
fee?: OrderLineItemFee;
|
|
604
|
+
totalTax?: number;
|
|
605
|
+
total: number;
|
|
606
|
+
taxTableId?: string;
|
|
607
|
+
startAt: string;
|
|
608
|
+
endAt: string;
|
|
609
|
+
bufferEndAt: string;
|
|
610
|
+
status: ReservationStatus;
|
|
611
|
+
override?: boolean;
|
|
612
|
+
overriddenBy?: string | null;
|
|
613
|
+
}
|
|
614
|
+
|
|
579
615
|
interface Attribute extends BaseEntity {
|
|
580
616
|
optionName: string;
|
|
581
617
|
sortingOrder: number;
|
|
@@ -791,6 +827,7 @@ interface Order extends BaseEntity {
|
|
|
791
827
|
lineItems: Partial<OrderLineItem>[];
|
|
792
828
|
customSales?: OrderCustomSale[];
|
|
793
829
|
nonRevenueItems?: NonRevenueItem$1[];
|
|
830
|
+
reservations?: OrderReservation[];
|
|
794
831
|
refund?: OrderRefund[];
|
|
795
832
|
minorUnits?: number;
|
|
796
833
|
}
|
|
@@ -1349,7 +1386,6 @@ interface LineItem {
|
|
|
1349
1386
|
taxes: Tax[];
|
|
1350
1387
|
discount: DiscountLineItem;
|
|
1351
1388
|
fee: FeeLineItem;
|
|
1352
|
-
modifiers?: OrderLineItemModifier[];
|
|
1353
1389
|
totalTax: number;
|
|
1354
1390
|
total: number;
|
|
1355
1391
|
lineNetWithFees: number;
|
|
@@ -1423,9 +1459,6 @@ interface Summary {
|
|
|
1423
1459
|
cartFeesTotal?: number;
|
|
1424
1460
|
taxableFeesTotal?: number;
|
|
1425
1461
|
nonTaxableFeesTotal?: number;
|
|
1426
|
-
modifiersTotal?: number;
|
|
1427
|
-
taxableModifiersTotal?: number;
|
|
1428
|
-
nonTaxableModifiersTotal?: number;
|
|
1429
1462
|
totalTaxableSales?: number;
|
|
1430
1463
|
totalNonTaxableSales?: number;
|
|
1431
1464
|
tipTotal?: number;
|
|
@@ -1461,7 +1494,6 @@ interface RefundedLineItem {
|
|
|
1461
1494
|
description?: string;
|
|
1462
1495
|
images?: string[];
|
|
1463
1496
|
fee: FeeLineItem;
|
|
1464
|
-
modifiers?: OrderLineItemModifier[];
|
|
1465
1497
|
}
|
|
1466
1498
|
interface RefundItem {
|
|
1467
1499
|
lineItems: RefundedLineItem[];
|
|
@@ -1513,47 +1545,6 @@ type ActiveOrder = Enrich<Order, {
|
|
|
1513
1545
|
station?: ActiveStation;
|
|
1514
1546
|
}>;
|
|
1515
1547
|
|
|
1516
|
-
type ModifierSelectionType = 'single' | 'multiple' | 'quantity';
|
|
1517
|
-
interface ResolvedModifierChoice {
|
|
1518
|
-
_id: string;
|
|
1519
|
-
name: string;
|
|
1520
|
-
price: number;
|
|
1521
|
-
isDefault?: boolean;
|
|
1522
|
-
defaultQuantity?: number;
|
|
1523
|
-
unavailableOutletIds?: string[];
|
|
1524
|
-
sortOrder: number;
|
|
1525
|
-
}
|
|
1526
|
-
interface ResolvedModifier {
|
|
1527
|
-
_id: string;
|
|
1528
|
-
name: string;
|
|
1529
|
-
selectionType: ModifierSelectionType;
|
|
1530
|
-
allowQuantity?: boolean;
|
|
1531
|
-
required: boolean;
|
|
1532
|
-
min?: number | null;
|
|
1533
|
-
max?: number | null;
|
|
1534
|
-
sortOrder: number;
|
|
1535
|
-
choices: ResolvedModifierChoice[];
|
|
1536
|
-
}
|
|
1537
|
-
interface ModifierChoiceSelection {
|
|
1538
|
-
choiceId: string;
|
|
1539
|
-
quantity: number;
|
|
1540
|
-
}
|
|
1541
|
-
interface ModifierSelection {
|
|
1542
|
-
modifierId: string;
|
|
1543
|
-
choices: ModifierChoiceSelection[];
|
|
1544
|
-
}
|
|
1545
|
-
interface CartLineModifier {
|
|
1546
|
-
modifierId: string;
|
|
1547
|
-
modifierName: string;
|
|
1548
|
-
choiceId: string;
|
|
1549
|
-
choiceName: string;
|
|
1550
|
-
label?: string;
|
|
1551
|
-
unitPrice: number;
|
|
1552
|
-
quantity: number;
|
|
1553
|
-
taxTableId?: string;
|
|
1554
|
-
taxRateId?: string;
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1557
1548
|
interface Discount {
|
|
1558
1549
|
value: number;
|
|
1559
1550
|
label?: string;
|
|
@@ -1601,8 +1592,6 @@ interface ActiveProduct {
|
|
|
1601
1592
|
stock: number;
|
|
1602
1593
|
allowBackOrder?: boolean;
|
|
1603
1594
|
fees?: CustomFee[];
|
|
1604
|
-
modifierSelections?: ModifierSelection[];
|
|
1605
|
-
modifiers?: CartLineModifier[];
|
|
1606
1595
|
currency?: CurrencyCode;
|
|
1607
1596
|
minorUnits?: number;
|
|
1608
1597
|
isUnlimited?: boolean;
|
|
@@ -1614,6 +1603,13 @@ interface ActiveProduct {
|
|
|
1614
1603
|
productType?: ProductType;
|
|
1615
1604
|
}
|
|
1616
1605
|
|
|
1606
|
+
interface CartReservation extends OrderReservation {
|
|
1607
|
+
bookingId: string;
|
|
1608
|
+
expiresAt?: string;
|
|
1609
|
+
discounts?: Discount[];
|
|
1610
|
+
fees?: CustomFee[];
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1617
1613
|
interface ActiveCustomSales {
|
|
1618
1614
|
id: string;
|
|
1619
1615
|
name: string;
|
|
@@ -1638,11 +1634,13 @@ interface ActiveCart {
|
|
|
1638
1634
|
taxes?: Tax[];
|
|
1639
1635
|
total: number;
|
|
1640
1636
|
subtotal: number;
|
|
1637
|
+
itemCount?: number;
|
|
1641
1638
|
discount?: Discount;
|
|
1642
1639
|
customFee?: CustomFee[];
|
|
1643
1640
|
products: ActiveProduct[];
|
|
1644
1641
|
customSales?: ActiveCustomSales[];
|
|
1645
1642
|
nonRevenueItems?: NonRevenueItem[];
|
|
1643
|
+
reservations?: CartReservation[];
|
|
1646
1644
|
remainingBalance?: number;
|
|
1647
1645
|
amountToBeCharged: number;
|
|
1648
1646
|
customer?: Partial<ActiveCustomer | null> | null;
|
|
@@ -1724,8 +1722,8 @@ interface FullProduct {
|
|
|
1724
1722
|
supplier?: string;
|
|
1725
1723
|
sku?: string;
|
|
1726
1724
|
productType: ProductType;
|
|
1725
|
+
bookingRulesId?: string;
|
|
1727
1726
|
variants: ProductVariant[];
|
|
1728
|
-
modifiers?: ResolvedModifier[];
|
|
1729
1727
|
minPrice?: number;
|
|
1730
1728
|
maxPrice?: number;
|
|
1731
1729
|
price?: number;
|
|
@@ -1738,6 +1736,58 @@ interface FullProduct {
|
|
|
1738
1736
|
}
|
|
1739
1737
|
type ActiveFullProduct = FullProduct;
|
|
1740
1738
|
|
|
1739
|
+
interface BookingSlotResource {
|
|
1740
|
+
resourceId: string;
|
|
1741
|
+
name: string;
|
|
1742
|
+
capacity: number;
|
|
1743
|
+
booked: number;
|
|
1744
|
+
free: number;
|
|
1745
|
+
}
|
|
1746
|
+
interface BookingSlot {
|
|
1747
|
+
startAt: string;
|
|
1748
|
+
endAt: string;
|
|
1749
|
+
bufferEndAt: string;
|
|
1750
|
+
canStart: boolean;
|
|
1751
|
+
capacity: number;
|
|
1752
|
+
booked: number;
|
|
1753
|
+
free: number;
|
|
1754
|
+
resources: BookingSlotResource[];
|
|
1755
|
+
}
|
|
1756
|
+
interface BookingAvailability {
|
|
1757
|
+
productId: string;
|
|
1758
|
+
bookingRulesId: string;
|
|
1759
|
+
bookingType: BookingType;
|
|
1760
|
+
ratePeriod: BookingRatePeriod;
|
|
1761
|
+
minimumToRun?: number;
|
|
1762
|
+
minStay?: number;
|
|
1763
|
+
maxStay?: number;
|
|
1764
|
+
bookableUntil?: string;
|
|
1765
|
+
beyondWindow?: boolean;
|
|
1766
|
+
slots: BookingSlot[];
|
|
1767
|
+
}
|
|
1768
|
+
interface BookingResource {
|
|
1769
|
+
id: string;
|
|
1770
|
+
name: string;
|
|
1771
|
+
kind: BookingResourceKind;
|
|
1772
|
+
tag?: string;
|
|
1773
|
+
}
|
|
1774
|
+
interface Booking {
|
|
1775
|
+
id: string;
|
|
1776
|
+
productId: string;
|
|
1777
|
+
resourceId: string;
|
|
1778
|
+
variantId?: string;
|
|
1779
|
+
startAt: string;
|
|
1780
|
+
endAt: string;
|
|
1781
|
+
bufferEndAt: string;
|
|
1782
|
+
status: ReservationStatus;
|
|
1783
|
+
expiresAt?: string;
|
|
1784
|
+
orderId?: string;
|
|
1785
|
+
customerId?: string;
|
|
1786
|
+
productName?: string;
|
|
1787
|
+
resourceName?: string;
|
|
1788
|
+
customerName?: string;
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1741
1791
|
interface ActiveSession {
|
|
1742
1792
|
id: string;
|
|
1743
1793
|
stationId: string;
|
|
@@ -1889,20 +1939,6 @@ interface ProdFeeBreakdown {
|
|
|
1889
1939
|
taxRateId?: string;
|
|
1890
1940
|
applyTaxes: boolean;
|
|
1891
1941
|
}
|
|
1892
|
-
interface ProdModifierBreakdown {
|
|
1893
|
-
modifierId: string;
|
|
1894
|
-
modifierName: string;
|
|
1895
|
-
choiceId: string;
|
|
1896
|
-
choiceName: string;
|
|
1897
|
-
label?: string;
|
|
1898
|
-
unitPrice: number;
|
|
1899
|
-
quantity: number;
|
|
1900
|
-
amount: number;
|
|
1901
|
-
tax: number;
|
|
1902
|
-
taxTableId?: string;
|
|
1903
|
-
taxRateId?: string;
|
|
1904
|
-
taxes?: OrderTax[];
|
|
1905
|
-
}
|
|
1906
1942
|
interface ProductTaxDetails {
|
|
1907
1943
|
tax: number;
|
|
1908
1944
|
prodDiscount: number;
|
|
@@ -1931,9 +1967,6 @@ interface ProductTaxDetails {
|
|
|
1931
1967
|
prodDiscounts?: ProdDiscountBreakdown[];
|
|
1932
1968
|
fees?: ProdFeeBreakdown[];
|
|
1933
1969
|
lineNetWithFees?: number;
|
|
1934
|
-
modifierDisplay?: number;
|
|
1935
|
-
modifierTax?: number;
|
|
1936
|
-
modifiers?: ProdModifierBreakdown[];
|
|
1937
1970
|
}
|
|
1938
1971
|
interface CustomSaleDetails {
|
|
1939
1972
|
tax: number;
|
|
@@ -2251,4 +2284,4 @@ interface PubsubEventMessage {
|
|
|
2251
2284
|
}
|
|
2252
2285
|
type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
|
|
2253
2286
|
|
|
2254
|
-
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
|
|
2287
|
+
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 Booking, type BookingAvailability, type BookingResource, type BookingSlot, type BookingSlotResource, type BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CartReservation, 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 HostNavigateMessage, type HostNavigateTarget, 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 OrderReservation, type OrderStateActor, type OrderStateActorType, type OrderStateConfig, type OrderStateEvent, type OrderStateEventTrigger, type OrderStateHistoryEntry, type OrderStateOperation, type OrderStatePair, type OrderSummary, type OrderSummaryPayments, type OrderTax, type OrderTip, type Outlet, type PaymentMethod, type PaymentResponse, type PaymentSetting, PaymentStatus, type PosBrainReadyMessage, type PosDataItem, type PriceModifierDetail, type PrinterDetails, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, 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 TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
|