@final-commerce/common 2.4.1-staging2.1 → 2.4.1-staging2.2

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.
@@ -458,7 +458,8 @@ declare enum NonRevenueItemType {
458
458
 
459
459
  declare enum ProductType {
460
460
  SIMPLE = "simple",
461
- VARIABLE = "variable"
461
+ VARIABLE = "variable",
462
+ BOOKING = "booking"
462
463
  }
463
464
  declare enum ProductStatus {
464
465
  ACTIVE = "active",
@@ -472,6 +473,34 @@ declare enum PaymentProcessor {
472
473
  EXTERNAL = "external"
473
474
  }
474
475
 
476
+ declare enum BookingType {
477
+ RENTAL = "rental",
478
+ APPOINTMENT = "appointment",
479
+ OVERNIGHT = "overnight",
480
+ GROUP = "group"
481
+ }
482
+ declare enum BookingRatePeriod {
483
+ SLOT = "slot",
484
+ DAY = "day",
485
+ NIGHT = "night",
486
+ WEEK = "week",
487
+ MONTH = "month"
488
+ }
489
+ declare enum BookingResourceKind {
490
+ ASSET = "asset",
491
+ ROOM = "room",
492
+ PROPERTY = "property",
493
+ SPACE = "space",
494
+ STAFF = "staff",
495
+ TABLE = "table"
496
+ }
497
+ declare enum ReservationStatus {
498
+ HELD = "held",
499
+ CONFIRMED = "confirmed",
500
+ CANCELLED = "cancelled",
501
+ EXPIRED = "expired"
502
+ }
503
+
475
504
  interface RefundLineItem {
476
505
  taxes?: OrderTax[];
477
506
  discount?: RefundDiscount;
@@ -510,6 +539,7 @@ interface RefundPayment {
510
539
  processor?: string;
511
540
  saleId?: string;
512
541
  tendered?: number;
542
+ tip?: OrderTip | null;
513
543
  }
514
544
 
515
545
  interface RefundTip {
@@ -578,6 +608,31 @@ interface TransactionPaymentData {
578
608
  chargeId?: string;
579
609
  }
580
610
 
611
+ interface OrderReservation {
612
+ internalId: string;
613
+ bookingId?: string;
614
+ productId: string;
615
+ variantId?: string | null;
616
+ resourceId: string;
617
+ name: string;
618
+ resourceName?: string;
619
+ price: number;
620
+ quantity?: number;
621
+ fulfilledQuantity?: number;
622
+ returnedQuantity?: number;
623
+ taxes?: OrderTax[];
624
+ discount?: OrderLineItemDiscount;
625
+ fee?: OrderLineItemFee;
626
+ totalTax?: number;
627
+ total: number;
628
+ taxTableId?: string;
629
+ startAt: string;
630
+ endAt: string;
631
+ bufferEndAt: string;
632
+ override?: boolean;
633
+ overriddenBy?: string | null;
634
+ }
635
+
581
636
  interface Attribute extends BaseEntity {
582
637
  optionName: string;
583
638
  sortingOrder: number;
@@ -793,6 +848,7 @@ interface Order extends BaseEntity {
793
848
  lineItems: Partial<OrderLineItem>[];
794
849
  customSales?: OrderCustomSale[];
795
850
  nonRevenueItems?: NonRevenueItem$1[];
851
+ reservations?: OrderReservation[];
796
852
  refund?: OrderRefund[];
797
853
  minorUnits?: number;
798
854
  }
@@ -841,6 +897,7 @@ interface Product extends BaseEntity {
841
897
  maxPrice?: number;
842
898
  supplier?: string;
843
899
  taxTable?: string | null;
900
+ defaultVariantId?: string;
844
901
  categories?: string[];
845
902
  outlets?: string[];
846
903
  currency?: CurrencyCode;
@@ -1129,6 +1186,22 @@ interface Variant extends BaseEntity {
1129
1186
  stockVariantId?: string;
1130
1187
  }
1131
1188
 
1189
+ interface Tax {
1190
+ id: string;
1191
+ name: string;
1192
+ percentage: number;
1193
+ amount: number;
1194
+ taxableAmount?: number;
1195
+ taxTableName: string;
1196
+ taxTableId: string;
1197
+ compounding?: boolean;
1198
+ priority?: number;
1199
+ }
1200
+ interface Tip {
1201
+ amount: number;
1202
+ percentage: number;
1203
+ }
1204
+
1132
1205
  interface Address {
1133
1206
  firstName: string;
1134
1207
  lastName: string;
@@ -1190,6 +1263,7 @@ interface ActiveOutlet {
1190
1263
  taxId: string;
1191
1264
  postCode?: string;
1192
1265
  name?: string;
1266
+ timeZone?: string;
1193
1267
  stripe?: {
1194
1268
  locationId: string;
1195
1269
  };
@@ -1320,22 +1394,6 @@ interface PosDataItem {
1320
1394
  };
1321
1395
  }
1322
1396
 
1323
- interface Tax {
1324
- id: string;
1325
- name: string;
1326
- percentage: number;
1327
- amount: number;
1328
- taxableAmount?: number;
1329
- taxTableName: string;
1330
- taxTableId: string;
1331
- compounding?: boolean;
1332
- priority?: number;
1333
- }
1334
- interface Tip {
1335
- amount: number;
1336
- percentage: number;
1337
- }
1338
-
1339
1397
  interface DiscountDetail {
1340
1398
  percentage: number;
1341
1399
  amount: number;
@@ -1486,6 +1544,7 @@ interface RefundedLineItem {
1486
1544
  interface RefundItem {
1487
1545
  lineItems: RefundedLineItem[];
1488
1546
  customSales: RefundedCustomSale[];
1547
+ reservations?: OrderReservation[];
1489
1548
  cartFees: CartFeeItem[];
1490
1549
  tips: RefundedTipPayment[];
1491
1550
  refundedBy: string;
@@ -1498,6 +1557,9 @@ interface RefundItem {
1498
1557
  minorUnits?: number;
1499
1558
  }
1500
1559
 
1560
+ type ActiveOrderReservation = Omit<OrderReservation, 'taxes'> & {
1561
+ taxes?: Tax[];
1562
+ };
1501
1563
  type ActiveOrder = Enrich<Order, {
1502
1564
  _id: string;
1503
1565
  id?: string;
@@ -1521,6 +1583,7 @@ type ActiveOrder = Enrich<Order, {
1521
1583
  shipping: Address | null;
1522
1584
  lineItems: LineItem[];
1523
1585
  customSales: CustomSale[];
1586
+ reservations?: ActiveOrderReservation[];
1524
1587
  nonRevenueItems?: NonRevenueItem[];
1525
1588
  refund?: RefundItem[];
1526
1589
  signature?: string | null;
@@ -1633,6 +1696,13 @@ interface ActiveProduct {
1633
1696
  productType?: ProductType;
1634
1697
  }
1635
1698
 
1699
+ interface CartReservation extends OrderReservation {
1700
+ bookingId: string;
1701
+ expiresAt?: string;
1702
+ discounts?: Discount[];
1703
+ fees?: CustomFee[];
1704
+ }
1705
+
1636
1706
  interface ActiveCustomSales {
1637
1707
  id: string;
1638
1708
  name: string;
@@ -1657,11 +1727,13 @@ interface ActiveCart {
1657
1727
  taxes?: Tax[];
1658
1728
  total: number;
1659
1729
  subtotal: number;
1730
+ itemCount?: number;
1660
1731
  discount?: Discount;
1661
1732
  customFee?: CustomFee[];
1662
1733
  products: ActiveProduct[];
1663
1734
  customSales?: ActiveCustomSales[];
1664
1735
  nonRevenueItems?: NonRevenueItem[];
1736
+ reservations?: CartReservation[];
1665
1737
  remainingBalance?: number;
1666
1738
  amountToBeCharged: number;
1667
1739
  customer?: Partial<ActiveCustomer | null> | null;
@@ -1743,7 +1815,9 @@ interface FullProduct {
1743
1815
  supplier?: string;
1744
1816
  sku?: string;
1745
1817
  productType: ProductType;
1818
+ bookingRulesId?: string;
1746
1819
  variants: ProductVariant[];
1820
+ defaultVariantId?: string;
1747
1821
  modifiers?: ResolvedModifier[];
1748
1822
  minPrice?: number;
1749
1823
  maxPrice?: number;
@@ -1757,6 +1831,65 @@ interface FullProduct {
1757
1831
  }
1758
1832
  type ActiveFullProduct = FullProduct;
1759
1833
 
1834
+ interface BookingSlotResource {
1835
+ resourceId: string;
1836
+ name: string;
1837
+ capacity: number;
1838
+ booked: number;
1839
+ free: number;
1840
+ }
1841
+ interface BookingSlot {
1842
+ startAt: string;
1843
+ endAt: string;
1844
+ bufferEndAt: string;
1845
+ canStart: boolean;
1846
+ capacity: number;
1847
+ booked: number;
1848
+ free: number;
1849
+ resources: BookingSlotResource[];
1850
+ dayKey?: string;
1851
+ }
1852
+ interface BookingAvailability {
1853
+ productId: string;
1854
+ bookingRulesId: string;
1855
+ bookingType: BookingType;
1856
+ ratePeriod: BookingRatePeriod;
1857
+ minimumToRun?: number;
1858
+ minStay?: number;
1859
+ maxStay?: number;
1860
+ bookableUntil?: string;
1861
+ beyondWindow?: boolean;
1862
+ slots: BookingSlot[];
1863
+ timeZone?: string | null;
1864
+ days?: string[];
1865
+ }
1866
+ interface BookingResource {
1867
+ id: string;
1868
+ name: string;
1869
+ kind: BookingResourceKind;
1870
+ tag?: string;
1871
+ image?: string;
1872
+ }
1873
+ interface Booking {
1874
+ id: string;
1875
+ productId: string;
1876
+ resourceId: string;
1877
+ variantId?: string;
1878
+ startAt: string;
1879
+ endAt: string;
1880
+ bufferEndAt: string;
1881
+ status: ReservationStatus;
1882
+ expiresAt?: string;
1883
+ orderId?: string;
1884
+ customerId?: string;
1885
+ productName?: string;
1886
+ resourceName?: string;
1887
+ customerName?: string;
1888
+ outletId?: string;
1889
+ outletName?: string;
1890
+ timeZone?: string;
1891
+ }
1892
+
1760
1893
  interface ActiveSession {
1761
1894
  id: string;
1762
1895
  stationId: string;
@@ -2275,4 +2408,4 @@ interface PubsubEventMessage {
2275
2408
  }
2276
2409
  type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
2277
2410
 
2278
- 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 CartLineModifier, 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 ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderLineItem, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, 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 ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
2411
+ export { type ActiveCart, type ActiveCartProduct, type ActiveCompany, type ActiveCustomSales, type ActiveCustomer, type ActiveEntityChanges, ActiveEntityType, type ActiveFullProduct, type ActiveOrder, type ActiveOrderReservation, type ActiveOutlet, type ActivePark, type ActiveProduct, type ActiveRefundOrder, type ActiveSession, type ActiveSplitPayment, type ActiveStation, type ActiveTaxDetails, type ActiveTimer, type ActiveUpdatedOrder, type ActiveUser, type ActiveUserRole, type Address, type Attribute, type AttributeEmbedded, type AttributeOption, type BaseDocument, type BaseEntity, type BaseTile, type Booking, type BookingAvailability, type BookingResource, type BookingSlot, type BookingSlotResource, type BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CartLineModifier, 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 ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderLineItem, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, type OrderNote, type OrderPaymentMethod, type OrderPosData, type OrderRefund, type OrderRefundSummary, type OrderReservation, type OrderStateActor, type OrderStateActorType, type OrderStateConfig, type OrderStateEvent, type OrderStateEventTrigger, type OrderStateHistoryEntry, type OrderStateOperation, type OrderStatePair, type OrderSummary, type OrderSummaryPayments, type OrderTax, type OrderTip, type Outlet, type PaymentMethod, type PaymentResponse, type PaymentSetting, PaymentStatus, type PosBrainReadyMessage, type PosDataItem, type PriceModifierDetail, type PrinterDetails, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
@@ -458,7 +458,8 @@ declare enum NonRevenueItemType {
458
458
 
459
459
  declare enum ProductType {
460
460
  SIMPLE = "simple",
461
- VARIABLE = "variable"
461
+ VARIABLE = "variable",
462
+ BOOKING = "booking"
462
463
  }
463
464
  declare enum ProductStatus {
464
465
  ACTIVE = "active",
@@ -472,6 +473,34 @@ declare enum PaymentProcessor {
472
473
  EXTERNAL = "external"
473
474
  }
474
475
 
476
+ declare enum BookingType {
477
+ RENTAL = "rental",
478
+ APPOINTMENT = "appointment",
479
+ OVERNIGHT = "overnight",
480
+ GROUP = "group"
481
+ }
482
+ declare enum BookingRatePeriod {
483
+ SLOT = "slot",
484
+ DAY = "day",
485
+ NIGHT = "night",
486
+ WEEK = "week",
487
+ MONTH = "month"
488
+ }
489
+ declare enum BookingResourceKind {
490
+ ASSET = "asset",
491
+ ROOM = "room",
492
+ PROPERTY = "property",
493
+ SPACE = "space",
494
+ STAFF = "staff",
495
+ TABLE = "table"
496
+ }
497
+ declare enum ReservationStatus {
498
+ HELD = "held",
499
+ CONFIRMED = "confirmed",
500
+ CANCELLED = "cancelled",
501
+ EXPIRED = "expired"
502
+ }
503
+
475
504
  interface RefundLineItem {
476
505
  taxes?: OrderTax[];
477
506
  discount?: RefundDiscount;
@@ -510,6 +539,7 @@ interface RefundPayment {
510
539
  processor?: string;
511
540
  saleId?: string;
512
541
  tendered?: number;
542
+ tip?: OrderTip | null;
513
543
  }
514
544
 
515
545
  interface RefundTip {
@@ -578,6 +608,31 @@ interface TransactionPaymentData {
578
608
  chargeId?: string;
579
609
  }
580
610
 
611
+ interface OrderReservation {
612
+ internalId: string;
613
+ bookingId?: string;
614
+ productId: string;
615
+ variantId?: string | null;
616
+ resourceId: string;
617
+ name: string;
618
+ resourceName?: string;
619
+ price: number;
620
+ quantity?: number;
621
+ fulfilledQuantity?: number;
622
+ returnedQuantity?: number;
623
+ taxes?: OrderTax[];
624
+ discount?: OrderLineItemDiscount;
625
+ fee?: OrderLineItemFee;
626
+ totalTax?: number;
627
+ total: number;
628
+ taxTableId?: string;
629
+ startAt: string;
630
+ endAt: string;
631
+ bufferEndAt: string;
632
+ override?: boolean;
633
+ overriddenBy?: string | null;
634
+ }
635
+
581
636
  interface Attribute extends BaseEntity {
582
637
  optionName: string;
583
638
  sortingOrder: number;
@@ -793,6 +848,7 @@ interface Order extends BaseEntity {
793
848
  lineItems: Partial<OrderLineItem>[];
794
849
  customSales?: OrderCustomSale[];
795
850
  nonRevenueItems?: NonRevenueItem$1[];
851
+ reservations?: OrderReservation[];
796
852
  refund?: OrderRefund[];
797
853
  minorUnits?: number;
798
854
  }
@@ -841,6 +897,7 @@ interface Product extends BaseEntity {
841
897
  maxPrice?: number;
842
898
  supplier?: string;
843
899
  taxTable?: string | null;
900
+ defaultVariantId?: string;
844
901
  categories?: string[];
845
902
  outlets?: string[];
846
903
  currency?: CurrencyCode;
@@ -1129,6 +1186,22 @@ interface Variant extends BaseEntity {
1129
1186
  stockVariantId?: string;
1130
1187
  }
1131
1188
 
1189
+ interface Tax {
1190
+ id: string;
1191
+ name: string;
1192
+ percentage: number;
1193
+ amount: number;
1194
+ taxableAmount?: number;
1195
+ taxTableName: string;
1196
+ taxTableId: string;
1197
+ compounding?: boolean;
1198
+ priority?: number;
1199
+ }
1200
+ interface Tip {
1201
+ amount: number;
1202
+ percentage: number;
1203
+ }
1204
+
1132
1205
  interface Address {
1133
1206
  firstName: string;
1134
1207
  lastName: string;
@@ -1190,6 +1263,7 @@ interface ActiveOutlet {
1190
1263
  taxId: string;
1191
1264
  postCode?: string;
1192
1265
  name?: string;
1266
+ timeZone?: string;
1193
1267
  stripe?: {
1194
1268
  locationId: string;
1195
1269
  };
@@ -1320,22 +1394,6 @@ interface PosDataItem {
1320
1394
  };
1321
1395
  }
1322
1396
 
1323
- interface Tax {
1324
- id: string;
1325
- name: string;
1326
- percentage: number;
1327
- amount: number;
1328
- taxableAmount?: number;
1329
- taxTableName: string;
1330
- taxTableId: string;
1331
- compounding?: boolean;
1332
- priority?: number;
1333
- }
1334
- interface Tip {
1335
- amount: number;
1336
- percentage: number;
1337
- }
1338
-
1339
1397
  interface DiscountDetail {
1340
1398
  percentage: number;
1341
1399
  amount: number;
@@ -1486,6 +1544,7 @@ interface RefundedLineItem {
1486
1544
  interface RefundItem {
1487
1545
  lineItems: RefundedLineItem[];
1488
1546
  customSales: RefundedCustomSale[];
1547
+ reservations?: OrderReservation[];
1489
1548
  cartFees: CartFeeItem[];
1490
1549
  tips: RefundedTipPayment[];
1491
1550
  refundedBy: string;
@@ -1498,6 +1557,9 @@ interface RefundItem {
1498
1557
  minorUnits?: number;
1499
1558
  }
1500
1559
 
1560
+ type ActiveOrderReservation = Omit<OrderReservation, 'taxes'> & {
1561
+ taxes?: Tax[];
1562
+ };
1501
1563
  type ActiveOrder = Enrich<Order, {
1502
1564
  _id: string;
1503
1565
  id?: string;
@@ -1521,6 +1583,7 @@ type ActiveOrder = Enrich<Order, {
1521
1583
  shipping: Address | null;
1522
1584
  lineItems: LineItem[];
1523
1585
  customSales: CustomSale[];
1586
+ reservations?: ActiveOrderReservation[];
1524
1587
  nonRevenueItems?: NonRevenueItem[];
1525
1588
  refund?: RefundItem[];
1526
1589
  signature?: string | null;
@@ -1633,6 +1696,13 @@ interface ActiveProduct {
1633
1696
  productType?: ProductType;
1634
1697
  }
1635
1698
 
1699
+ interface CartReservation extends OrderReservation {
1700
+ bookingId: string;
1701
+ expiresAt?: string;
1702
+ discounts?: Discount[];
1703
+ fees?: CustomFee[];
1704
+ }
1705
+
1636
1706
  interface ActiveCustomSales {
1637
1707
  id: string;
1638
1708
  name: string;
@@ -1657,11 +1727,13 @@ interface ActiveCart {
1657
1727
  taxes?: Tax[];
1658
1728
  total: number;
1659
1729
  subtotal: number;
1730
+ itemCount?: number;
1660
1731
  discount?: Discount;
1661
1732
  customFee?: CustomFee[];
1662
1733
  products: ActiveProduct[];
1663
1734
  customSales?: ActiveCustomSales[];
1664
1735
  nonRevenueItems?: NonRevenueItem[];
1736
+ reservations?: CartReservation[];
1665
1737
  remainingBalance?: number;
1666
1738
  amountToBeCharged: number;
1667
1739
  customer?: Partial<ActiveCustomer | null> | null;
@@ -1743,7 +1815,9 @@ interface FullProduct {
1743
1815
  supplier?: string;
1744
1816
  sku?: string;
1745
1817
  productType: ProductType;
1818
+ bookingRulesId?: string;
1746
1819
  variants: ProductVariant[];
1820
+ defaultVariantId?: string;
1747
1821
  modifiers?: ResolvedModifier[];
1748
1822
  minPrice?: number;
1749
1823
  maxPrice?: number;
@@ -1757,6 +1831,65 @@ interface FullProduct {
1757
1831
  }
1758
1832
  type ActiveFullProduct = FullProduct;
1759
1833
 
1834
+ interface BookingSlotResource {
1835
+ resourceId: string;
1836
+ name: string;
1837
+ capacity: number;
1838
+ booked: number;
1839
+ free: number;
1840
+ }
1841
+ interface BookingSlot {
1842
+ startAt: string;
1843
+ endAt: string;
1844
+ bufferEndAt: string;
1845
+ canStart: boolean;
1846
+ capacity: number;
1847
+ booked: number;
1848
+ free: number;
1849
+ resources: BookingSlotResource[];
1850
+ dayKey?: string;
1851
+ }
1852
+ interface BookingAvailability {
1853
+ productId: string;
1854
+ bookingRulesId: string;
1855
+ bookingType: BookingType;
1856
+ ratePeriod: BookingRatePeriod;
1857
+ minimumToRun?: number;
1858
+ minStay?: number;
1859
+ maxStay?: number;
1860
+ bookableUntil?: string;
1861
+ beyondWindow?: boolean;
1862
+ slots: BookingSlot[];
1863
+ timeZone?: string | null;
1864
+ days?: string[];
1865
+ }
1866
+ interface BookingResource {
1867
+ id: string;
1868
+ name: string;
1869
+ kind: BookingResourceKind;
1870
+ tag?: string;
1871
+ image?: string;
1872
+ }
1873
+ interface Booking {
1874
+ id: string;
1875
+ productId: string;
1876
+ resourceId: string;
1877
+ variantId?: string;
1878
+ startAt: string;
1879
+ endAt: string;
1880
+ bufferEndAt: string;
1881
+ status: ReservationStatus;
1882
+ expiresAt?: string;
1883
+ orderId?: string;
1884
+ customerId?: string;
1885
+ productName?: string;
1886
+ resourceName?: string;
1887
+ customerName?: string;
1888
+ outletId?: string;
1889
+ outletName?: string;
1890
+ timeZone?: string;
1891
+ }
1892
+
1760
1893
  interface ActiveSession {
1761
1894
  id: string;
1762
1895
  stationId: string;
@@ -2275,4 +2408,4 @@ interface PubsubEventMessage {
2275
2408
  }
2276
2409
  type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
2277
2410
 
2278
- 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 CartLineModifier, 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 ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderLineItem, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, 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 ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
2411
+ export { type ActiveCart, type ActiveCartProduct, type ActiveCompany, type ActiveCustomSales, type ActiveCustomer, type ActiveEntityChanges, ActiveEntityType, type ActiveFullProduct, type ActiveOrder, type ActiveOrderReservation, type ActiveOutlet, type ActivePark, type ActiveProduct, type ActiveRefundOrder, type ActiveSession, type ActiveSplitPayment, type ActiveStation, type ActiveTaxDetails, type ActiveTimer, type ActiveUpdatedOrder, type ActiveUser, type ActiveUserRole, type Address, type Attribute, type AttributeEmbedded, type AttributeOption, type BaseDocument, type BaseEntity, type BaseTile, type Booking, type BookingAvailability, type BookingResource, type BookingSlot, type BookingSlotResource, type BootstrapMessage, type CalculatedTaxDetails, type CartDiscountItem, type CartFeeItem, type CartFeeTaxEntry, type CartFeesDetails, type CartLineModifier, 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 ModifierChoiceSelection, type ModifierSelection, type ModifierSelectionType, type NonRevenueItem, type Note, type Order, type OrderCartDiscount, type OrderCartFee, type OrderCustomSale, type OrderCustomSaleDiscount, type OrderCustomSaleFee, type OrderLineItem, type OrderLineItemDiscount, type OrderLineItemFee, type OrderLineItemModifier, type OrderNote, type OrderPaymentMethod, type OrderPosData, type OrderRefund, type OrderRefundSummary, type OrderReservation, type OrderStateActor, type OrderStateActorType, type OrderStateConfig, type OrderStateEvent, type OrderStateEventTrigger, type OrderStateHistoryEntry, type OrderStateOperation, type OrderStatePair, type OrderSummary, type OrderSummaryPayments, type OrderTax, type OrderTip, type Outlet, type PaymentMethod, type PaymentResponse, type PaymentSetting, PaymentStatus, type PosBrainReadyMessage, type PosDataItem, type PriceModifierDetail, type PrinterDetails, ProcessorType, type ProdDiscountBreakdown, type ProdFeeBreakdown, type ProdModifierBreakdown, type Product, type ProductTaxDetails, type ProductVariant, type PubsubEventMessage, type PubsubSubscribeMessage, type PubsubTopicsListMessage, type PubsubTopicsRequestMessage, type Reader, type ReaderAvailability, type ReaderCapabilities, type ReaderCapabilitiesMessage, type Refund, type RefundCartDiscount, type RefundDiscount, type RefundItem, type RefundItemDiscount, type RefundLineItem, type RefundPayment, type RefundProcessingStatus, type RefundSummary, type RefundTip, type RefundedCustomSale, type RefundedLineItem, type RefundedTipPayment, type ResolvedModifier, type ResolvedModifierChoice, type Role, type RolePermission, type RuntimeReadyMessage, type SelectionContext, type SelectionFlowContext, type SelectionMessage, type SelectionRoleContext, type ServiceChannelMessage, type ServiceChannelMessageType, type ServiceInitMessage, type Session, type SessionClosingAmounts, type SmartGridSetting, type SmartGridSettings, type SmartGridSettingsData, type Station, type StripeAccount, type Summary, type SummaryPayments, type SyncProgressMessage, type Tax, type TaxRate, type TaxRateValue, type TaxTable, type TaxTableActive, type TaxTableRate, type TileGrid, type TimeClockEntry, type TimeClockEntryStatus, type Tip, type TipData, type TipPayment, type TipsDetails, type TokenRefreshMessage, type TopicDefinitionWire, type TopicEventWire, type Transaction, type TransactionPaymentData, type User, type UserType, type Variant, type VariantInventory };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/common",
3
- "version": "2.4.1-staging2.1",
3
+ "version": "2.4.1-staging2.2",
4
4
  "description": "Shared utilities, types, constants, and engineering governance configs for the Final Commerce platform.",
5
5
  "homepage": "https://github.com/Final-Commerce/common#readme",
6
6
  "bugs": {