@final-commerce/common 2.3.0 → 2.4.0-preprod.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;
@@ -578,6 +607,31 @@ interface TransactionPaymentData {
578
607
  chargeId?: string;
579
608
  }
580
609
 
610
+ interface OrderReservation {
611
+ internalId: string;
612
+ bookingId?: string;
613
+ productId: string;
614
+ variantId?: string | null;
615
+ resourceId: string;
616
+ name: string;
617
+ resourceName?: string;
618
+ price: number;
619
+ quantity?: number;
620
+ fulfilledQuantity?: number;
621
+ returnedQuantity?: number;
622
+ taxes?: OrderTax[];
623
+ discount?: OrderLineItemDiscount;
624
+ fee?: OrderLineItemFee;
625
+ totalTax?: number;
626
+ total: number;
627
+ taxTableId?: string;
628
+ startAt: string;
629
+ endAt: string;
630
+ bufferEndAt: string;
631
+ override?: boolean;
632
+ overriddenBy?: string | null;
633
+ }
634
+
581
635
  interface Attribute extends BaseEntity {
582
636
  optionName: string;
583
637
  sortingOrder: number;
@@ -793,6 +847,7 @@ interface Order extends BaseEntity {
793
847
  lineItems: Partial<OrderLineItem>[];
794
848
  customSales?: OrderCustomSale[];
795
849
  nonRevenueItems?: NonRevenueItem$1[];
850
+ reservations?: OrderReservation[];
796
851
  refund?: OrderRefund[];
797
852
  minorUnits?: number;
798
853
  }
@@ -1129,6 +1184,22 @@ interface Variant extends BaseEntity {
1129
1184
  stockVariantId?: string;
1130
1185
  }
1131
1186
 
1187
+ interface Tax {
1188
+ id: string;
1189
+ name: string;
1190
+ percentage: number;
1191
+ amount: number;
1192
+ taxableAmount?: number;
1193
+ taxTableName: string;
1194
+ taxTableId: string;
1195
+ compounding?: boolean;
1196
+ priority?: number;
1197
+ }
1198
+ interface Tip {
1199
+ amount: number;
1200
+ percentage: number;
1201
+ }
1202
+
1132
1203
  interface Address {
1133
1204
  firstName: string;
1134
1205
  lastName: string;
@@ -1190,6 +1261,7 @@ interface ActiveOutlet {
1190
1261
  taxId: string;
1191
1262
  postCode?: string;
1192
1263
  name?: string;
1264
+ timeZone?: string;
1193
1265
  stripe?: {
1194
1266
  locationId: string;
1195
1267
  };
@@ -1320,22 +1392,6 @@ interface PosDataItem {
1320
1392
  };
1321
1393
  }
1322
1394
 
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
1395
  interface DiscountDetail {
1340
1396
  percentage: number;
1341
1397
  amount: number;
@@ -1486,6 +1542,7 @@ interface RefundedLineItem {
1486
1542
  interface RefundItem {
1487
1543
  lineItems: RefundedLineItem[];
1488
1544
  customSales: RefundedCustomSale[];
1545
+ reservations?: OrderReservation[];
1489
1546
  cartFees: CartFeeItem[];
1490
1547
  tips: RefundedTipPayment[];
1491
1548
  refundedBy: string;
@@ -1498,6 +1555,9 @@ interface RefundItem {
1498
1555
  minorUnits?: number;
1499
1556
  }
1500
1557
 
1558
+ type ActiveOrderReservation = Omit<OrderReservation, 'taxes'> & {
1559
+ taxes?: Tax[];
1560
+ };
1501
1561
  type ActiveOrder = Enrich<Order, {
1502
1562
  _id: string;
1503
1563
  id?: string;
@@ -1521,6 +1581,7 @@ type ActiveOrder = Enrich<Order, {
1521
1581
  shipping: Address | null;
1522
1582
  lineItems: LineItem[];
1523
1583
  customSales: CustomSale[];
1584
+ reservations?: ActiveOrderReservation[];
1524
1585
  nonRevenueItems?: NonRevenueItem[];
1525
1586
  refund?: RefundItem[];
1526
1587
  signature?: string | null;
@@ -1633,6 +1694,13 @@ interface ActiveProduct {
1633
1694
  productType?: ProductType;
1634
1695
  }
1635
1696
 
1697
+ interface CartReservation extends OrderReservation {
1698
+ bookingId: string;
1699
+ expiresAt?: string;
1700
+ discounts?: Discount[];
1701
+ fees?: CustomFee[];
1702
+ }
1703
+
1636
1704
  interface ActiveCustomSales {
1637
1705
  id: string;
1638
1706
  name: string;
@@ -1657,11 +1725,13 @@ interface ActiveCart {
1657
1725
  taxes?: Tax[];
1658
1726
  total: number;
1659
1727
  subtotal: number;
1728
+ itemCount?: number;
1660
1729
  discount?: Discount;
1661
1730
  customFee?: CustomFee[];
1662
1731
  products: ActiveProduct[];
1663
1732
  customSales?: ActiveCustomSales[];
1664
1733
  nonRevenueItems?: NonRevenueItem[];
1734
+ reservations?: CartReservation[];
1665
1735
  remainingBalance?: number;
1666
1736
  amountToBeCharged: number;
1667
1737
  customer?: Partial<ActiveCustomer | null> | null;
@@ -1743,6 +1813,7 @@ interface FullProduct {
1743
1813
  supplier?: string;
1744
1814
  sku?: string;
1745
1815
  productType: ProductType;
1816
+ bookingRulesId?: string;
1746
1817
  variants: ProductVariant[];
1747
1818
  modifiers?: ResolvedModifier[];
1748
1819
  minPrice?: number;
@@ -1757,6 +1828,64 @@ interface FullProduct {
1757
1828
  }
1758
1829
  type ActiveFullProduct = FullProduct;
1759
1830
 
1831
+ interface BookingSlotResource {
1832
+ resourceId: string;
1833
+ name: string;
1834
+ capacity: number;
1835
+ booked: number;
1836
+ free: number;
1837
+ }
1838
+ interface BookingSlot {
1839
+ startAt: string;
1840
+ endAt: string;
1841
+ bufferEndAt: string;
1842
+ canStart: boolean;
1843
+ capacity: number;
1844
+ booked: number;
1845
+ free: number;
1846
+ resources: BookingSlotResource[];
1847
+ dayKey?: string;
1848
+ }
1849
+ interface BookingAvailability {
1850
+ productId: string;
1851
+ bookingRulesId: string;
1852
+ bookingType: BookingType;
1853
+ ratePeriod: BookingRatePeriod;
1854
+ minimumToRun?: number;
1855
+ minStay?: number;
1856
+ maxStay?: number;
1857
+ bookableUntil?: string;
1858
+ beyondWindow?: boolean;
1859
+ slots: BookingSlot[];
1860
+ timeZone?: string | null;
1861
+ days?: string[];
1862
+ }
1863
+ interface BookingResource {
1864
+ id: string;
1865
+ name: string;
1866
+ kind: BookingResourceKind;
1867
+ tag?: string;
1868
+ }
1869
+ interface Booking {
1870
+ id: string;
1871
+ productId: string;
1872
+ resourceId: string;
1873
+ variantId?: string;
1874
+ startAt: string;
1875
+ endAt: string;
1876
+ bufferEndAt: string;
1877
+ status: ReservationStatus;
1878
+ expiresAt?: string;
1879
+ orderId?: string;
1880
+ customerId?: string;
1881
+ productName?: string;
1882
+ resourceName?: string;
1883
+ customerName?: string;
1884
+ outletId?: string;
1885
+ outletName?: string;
1886
+ timeZone?: string;
1887
+ }
1888
+
1760
1889
  interface ActiveSession {
1761
1890
  id: string;
1762
1891
  stationId: string;
@@ -2275,4 +2404,4 @@ interface PubsubEventMessage {
2275
2404
  }
2276
2405
  type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
2277
2406
 
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 };
2407
+ 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;
@@ -578,6 +607,31 @@ interface TransactionPaymentData {
578
607
  chargeId?: string;
579
608
  }
580
609
 
610
+ interface OrderReservation {
611
+ internalId: string;
612
+ bookingId?: string;
613
+ productId: string;
614
+ variantId?: string | null;
615
+ resourceId: string;
616
+ name: string;
617
+ resourceName?: string;
618
+ price: number;
619
+ quantity?: number;
620
+ fulfilledQuantity?: number;
621
+ returnedQuantity?: number;
622
+ taxes?: OrderTax[];
623
+ discount?: OrderLineItemDiscount;
624
+ fee?: OrderLineItemFee;
625
+ totalTax?: number;
626
+ total: number;
627
+ taxTableId?: string;
628
+ startAt: string;
629
+ endAt: string;
630
+ bufferEndAt: string;
631
+ override?: boolean;
632
+ overriddenBy?: string | null;
633
+ }
634
+
581
635
  interface Attribute extends BaseEntity {
582
636
  optionName: string;
583
637
  sortingOrder: number;
@@ -793,6 +847,7 @@ interface Order extends BaseEntity {
793
847
  lineItems: Partial<OrderLineItem>[];
794
848
  customSales?: OrderCustomSale[];
795
849
  nonRevenueItems?: NonRevenueItem$1[];
850
+ reservations?: OrderReservation[];
796
851
  refund?: OrderRefund[];
797
852
  minorUnits?: number;
798
853
  }
@@ -1129,6 +1184,22 @@ interface Variant extends BaseEntity {
1129
1184
  stockVariantId?: string;
1130
1185
  }
1131
1186
 
1187
+ interface Tax {
1188
+ id: string;
1189
+ name: string;
1190
+ percentage: number;
1191
+ amount: number;
1192
+ taxableAmount?: number;
1193
+ taxTableName: string;
1194
+ taxTableId: string;
1195
+ compounding?: boolean;
1196
+ priority?: number;
1197
+ }
1198
+ interface Tip {
1199
+ amount: number;
1200
+ percentage: number;
1201
+ }
1202
+
1132
1203
  interface Address {
1133
1204
  firstName: string;
1134
1205
  lastName: string;
@@ -1190,6 +1261,7 @@ interface ActiveOutlet {
1190
1261
  taxId: string;
1191
1262
  postCode?: string;
1192
1263
  name?: string;
1264
+ timeZone?: string;
1193
1265
  stripe?: {
1194
1266
  locationId: string;
1195
1267
  };
@@ -1320,22 +1392,6 @@ interface PosDataItem {
1320
1392
  };
1321
1393
  }
1322
1394
 
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
1395
  interface DiscountDetail {
1340
1396
  percentage: number;
1341
1397
  amount: number;
@@ -1486,6 +1542,7 @@ interface RefundedLineItem {
1486
1542
  interface RefundItem {
1487
1543
  lineItems: RefundedLineItem[];
1488
1544
  customSales: RefundedCustomSale[];
1545
+ reservations?: OrderReservation[];
1489
1546
  cartFees: CartFeeItem[];
1490
1547
  tips: RefundedTipPayment[];
1491
1548
  refundedBy: string;
@@ -1498,6 +1555,9 @@ interface RefundItem {
1498
1555
  minorUnits?: number;
1499
1556
  }
1500
1557
 
1558
+ type ActiveOrderReservation = Omit<OrderReservation, 'taxes'> & {
1559
+ taxes?: Tax[];
1560
+ };
1501
1561
  type ActiveOrder = Enrich<Order, {
1502
1562
  _id: string;
1503
1563
  id?: string;
@@ -1521,6 +1581,7 @@ type ActiveOrder = Enrich<Order, {
1521
1581
  shipping: Address | null;
1522
1582
  lineItems: LineItem[];
1523
1583
  customSales: CustomSale[];
1584
+ reservations?: ActiveOrderReservation[];
1524
1585
  nonRevenueItems?: NonRevenueItem[];
1525
1586
  refund?: RefundItem[];
1526
1587
  signature?: string | null;
@@ -1633,6 +1694,13 @@ interface ActiveProduct {
1633
1694
  productType?: ProductType;
1634
1695
  }
1635
1696
 
1697
+ interface CartReservation extends OrderReservation {
1698
+ bookingId: string;
1699
+ expiresAt?: string;
1700
+ discounts?: Discount[];
1701
+ fees?: CustomFee[];
1702
+ }
1703
+
1636
1704
  interface ActiveCustomSales {
1637
1705
  id: string;
1638
1706
  name: string;
@@ -1657,11 +1725,13 @@ interface ActiveCart {
1657
1725
  taxes?: Tax[];
1658
1726
  total: number;
1659
1727
  subtotal: number;
1728
+ itemCount?: number;
1660
1729
  discount?: Discount;
1661
1730
  customFee?: CustomFee[];
1662
1731
  products: ActiveProduct[];
1663
1732
  customSales?: ActiveCustomSales[];
1664
1733
  nonRevenueItems?: NonRevenueItem[];
1734
+ reservations?: CartReservation[];
1665
1735
  remainingBalance?: number;
1666
1736
  amountToBeCharged: number;
1667
1737
  customer?: Partial<ActiveCustomer | null> | null;
@@ -1743,6 +1813,7 @@ interface FullProduct {
1743
1813
  supplier?: string;
1744
1814
  sku?: string;
1745
1815
  productType: ProductType;
1816
+ bookingRulesId?: string;
1746
1817
  variants: ProductVariant[];
1747
1818
  modifiers?: ResolvedModifier[];
1748
1819
  minPrice?: number;
@@ -1757,6 +1828,64 @@ interface FullProduct {
1757
1828
  }
1758
1829
  type ActiveFullProduct = FullProduct;
1759
1830
 
1831
+ interface BookingSlotResource {
1832
+ resourceId: string;
1833
+ name: string;
1834
+ capacity: number;
1835
+ booked: number;
1836
+ free: number;
1837
+ }
1838
+ interface BookingSlot {
1839
+ startAt: string;
1840
+ endAt: string;
1841
+ bufferEndAt: string;
1842
+ canStart: boolean;
1843
+ capacity: number;
1844
+ booked: number;
1845
+ free: number;
1846
+ resources: BookingSlotResource[];
1847
+ dayKey?: string;
1848
+ }
1849
+ interface BookingAvailability {
1850
+ productId: string;
1851
+ bookingRulesId: string;
1852
+ bookingType: BookingType;
1853
+ ratePeriod: BookingRatePeriod;
1854
+ minimumToRun?: number;
1855
+ minStay?: number;
1856
+ maxStay?: number;
1857
+ bookableUntil?: string;
1858
+ beyondWindow?: boolean;
1859
+ slots: BookingSlot[];
1860
+ timeZone?: string | null;
1861
+ days?: string[];
1862
+ }
1863
+ interface BookingResource {
1864
+ id: string;
1865
+ name: string;
1866
+ kind: BookingResourceKind;
1867
+ tag?: string;
1868
+ }
1869
+ interface Booking {
1870
+ id: string;
1871
+ productId: string;
1872
+ resourceId: string;
1873
+ variantId?: string;
1874
+ startAt: string;
1875
+ endAt: string;
1876
+ bufferEndAt: string;
1877
+ status: ReservationStatus;
1878
+ expiresAt?: string;
1879
+ orderId?: string;
1880
+ customerId?: string;
1881
+ productName?: string;
1882
+ resourceName?: string;
1883
+ customerName?: string;
1884
+ outletId?: string;
1885
+ outletName?: string;
1886
+ timeZone?: string;
1887
+ }
1888
+
1760
1889
  interface ActiveSession {
1761
1890
  id: string;
1762
1891
  stationId: string;
@@ -2275,4 +2404,4 @@ interface PubsubEventMessage {
2275
2404
  }
2276
2405
  type ServiceChannelMessage = PosBrainReadyMessage | HostHelloMessage | ServiceInitMessage | BootstrapMessage | TokenRefreshMessage | SelectionMessage | HostShutdownMessage | ReaderCapabilitiesMessage | RuntimeReadyMessage | HostNavigateMessage | SyncProgressMessage | DeviceOpRequestMessage | DeviceOpResponseMessage | PubsubTopicsRequestMessage | PubsubTopicsListMessage | PubsubSubscribeMessage | PubsubEventMessage;
2277
2406
 
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 };
2407
+ 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.3.0",
3
+ "version": "2.4.0-preprod.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": {