@final-commerce/common 2.0.5-beta.1 → 2.0.6

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 CHANGED
@@ -189,8 +189,7 @@ declare enum Platform {
189
189
  }
190
190
  declare enum OrderPlatform {
191
191
  POS = "in-store",
192
- WOO_COMMERCE = "woo-commerce",
193
- PUBLIC_API = "public-api"
192
+ WOO_COMMERCE = "woo-commerce"
194
193
  }
195
194
  declare enum CustomerPlatform {
196
195
  POS = "in-store",
@@ -933,40 +932,6 @@ declare function setOrderState(order: OrderStateWritable, paymentState: PaymentS
933
932
 
934
933
  declare function inferStatesFromLegacyStatus(order: OrderLikeForLegacyInference): StatePair;
935
934
 
936
- interface OrderMutationData extends OrderStateWritable {
937
- total?: number;
938
- balance?: number;
939
- paymentMethods?: {
940
- amount?: number;
941
- [key: string]: unknown;
942
- }[];
943
- refunds?: {
944
- quantity?: number;
945
- [key: string]: unknown;
946
- }[];
947
- refund?: {
948
- quantity?: number;
949
- [key: string]: unknown;
950
- }[];
951
- lineItems?: {
952
- quantity?: number;
953
- fulfilledQuantity?: number;
954
- returnedQuantity?: number;
955
- [key: string]: unknown;
956
- }[];
957
- }
958
- interface OrderWriteStrategy {
959
- applyState(order: OrderMutationData): void;
960
- }
961
- declare class LegacyWriteStrategy implements OrderWriteStrategy {
962
- applyState(_order: OrderMutationData): void;
963
- }
964
- declare class DualWriteStrategy implements OrderWriteStrategy {
965
- private readonly config;
966
- constructor(config: StoredStateConfig);
967
- applyState(order: OrderMutationData): void;
968
- }
969
-
970
935
  interface ResolveTemplateResult {
971
936
  fragment: StateConfigFragment;
972
937
  resolvedValues: Record<string, unknown>;
@@ -1093,4 +1058,4 @@ declare const EUFixedRates: Record<string, CurrencyRate>;
1093
1058
  declare const OtherFixedRates: Record<string, CurrencyRate>;
1094
1059
  declare const COUNTRY_CURRENCIES: Record<string, string>;
1095
1060
 
1096
- export { type Amount, AttributeType, type AvailableTransition, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_RESOLVED_CONFIG, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, MenuProject, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderStateEventPayload, type OrderStateWritable, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, addAmounts, amountToString, baseFulfillmentDefinitions, basePaymentDefinitions, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, formatCurrency, formatMinorUnitsToString, fromMinorUnits, generateMongoID, getAvailableTransitions, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getMinorUnitMultiplier, getMinorUnits, getPricingRegionFromCountry, inferStatesFromLegacyStatus, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, mapToLegacyStatus, mergeFragment, multiplyAmount, normalizeMongoIdString, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, removeFragment, resolveTemplate, setOrderState, signReportForDisplay, stringifyMinorUnits, subtractAmounts, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant };
1061
+ export { type Amount, AttributeType, type AvailableTransition, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_RESOLVED_CONFIG, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LibraryItemType, MenuProject, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderStateEventPayload, type OrderStateWritable, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, addAmounts, amountToString, baseFulfillmentDefinitions, basePaymentDefinitions, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, formatCurrency, formatMinorUnitsToString, fromMinorUnits, generateMongoID, getAvailableTransitions, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getMinorUnitMultiplier, getMinorUnits, getPricingRegionFromCountry, inferStatesFromLegacyStatus, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, mapToLegacyStatus, mergeFragment, multiplyAmount, normalizeMongoIdString, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, removeFragment, resolveTemplate, setOrderState, signReportForDisplay, stringifyMinorUnits, subtractAmounts, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant };
package/dist/index.d.ts CHANGED
@@ -189,8 +189,7 @@ declare enum Platform {
189
189
  }
190
190
  declare enum OrderPlatform {
191
191
  POS = "in-store",
192
- WOO_COMMERCE = "woo-commerce",
193
- PUBLIC_API = "public-api"
192
+ WOO_COMMERCE = "woo-commerce"
194
193
  }
195
194
  declare enum CustomerPlatform {
196
195
  POS = "in-store",
@@ -933,40 +932,6 @@ declare function setOrderState(order: OrderStateWritable, paymentState: PaymentS
933
932
 
934
933
  declare function inferStatesFromLegacyStatus(order: OrderLikeForLegacyInference): StatePair;
935
934
 
936
- interface OrderMutationData extends OrderStateWritable {
937
- total?: number;
938
- balance?: number;
939
- paymentMethods?: {
940
- amount?: number;
941
- [key: string]: unknown;
942
- }[];
943
- refunds?: {
944
- quantity?: number;
945
- [key: string]: unknown;
946
- }[];
947
- refund?: {
948
- quantity?: number;
949
- [key: string]: unknown;
950
- }[];
951
- lineItems?: {
952
- quantity?: number;
953
- fulfilledQuantity?: number;
954
- returnedQuantity?: number;
955
- [key: string]: unknown;
956
- }[];
957
- }
958
- interface OrderWriteStrategy {
959
- applyState(order: OrderMutationData): void;
960
- }
961
- declare class LegacyWriteStrategy implements OrderWriteStrategy {
962
- applyState(_order: OrderMutationData): void;
963
- }
964
- declare class DualWriteStrategy implements OrderWriteStrategy {
965
- private readonly config;
966
- constructor(config: StoredStateConfig);
967
- applyState(order: OrderMutationData): void;
968
- }
969
-
970
935
  interface ResolveTemplateResult {
971
936
  fragment: StateConfigFragment;
972
937
  resolvedValues: Record<string, unknown>;
@@ -1093,4 +1058,4 @@ declare const EUFixedRates: Record<string, CurrencyRate>;
1093
1058
  declare const OtherFixedRates: Record<string, CurrencyRate>;
1094
1059
  declare const COUNTRY_CURRENCIES: Record<string, string>;
1095
1060
 
1096
- export { type Amount, AttributeType, type AvailableTransition, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_RESOLVED_CONFIG, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, DualWriteStrategy, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LegacyWriteStrategy, LibraryItemType, MenuProject, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderMutationData, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderStateEventPayload, type OrderStateWritable, type OrderWriteStrategy, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, addAmounts, amountToString, baseFulfillmentDefinitions, basePaymentDefinitions, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, formatCurrency, formatMinorUnitsToString, fromMinorUnits, generateMongoID, getAvailableTransitions, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getMinorUnitMultiplier, getMinorUnits, getPricingRegionFromCountry, inferStatesFromLegacyStatus, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, mapToLegacyStatus, mergeFragment, multiplyAmount, normalizeMongoIdString, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, removeFragment, resolveTemplate, setOrderState, signReportForDisplay, stringifyMinorUnits, subtractAmounts, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant };
1061
+ export { type Amount, AttributeType, type AvailableTransition, CONDITION_OPERATORS, COUNTRY_CURRENCIES, CURRENCY_CONFIG, type CartDiscountBucket, type CartFeeBucket, type CashDrawer, type CashRoundingTuple, CompanyType, type Condition, type ConditionGroup, type ConditionOperator, type ConfigUpdatedPayload, type ConfigValidationError, type ConfigValidationResult, type ConfigValidationWarning, type CrossAxisRequires, type CrossAxisRule, type CrossAxisTrigger, CurrencyCode, type CurrencyConfig, type CurrencyRate, CustomTableAvailability, CustomerPlatform, DEFAULT_CONFIG, DEFAULT_CROSS_AXIS_RULES, DEFAULT_DISPLAY_STATE_MAP, DEFAULT_RESOLVED_CONFIG, type DeleteStateConfigFragmentParams, type DeleteStateConfigFragmentResponse, type DiscountsBreakdown, type DiscountsTuple, type DisplayStateResult, type DisplayStateRule, EUFixedRates, EUROPE, type EndOfSessionReport, ExtensionCategory, FINANCIAL_INVARIANTS, FULFILLMENT_STATES, type FailedCondition, type FeesBreakdown, FeesCustomBillingStatus, type FeesTuple, type FinancialInvariant, type FragmentParam, type FragmentValidationResult, type FulfillmentState, type FulfillmentStateDefinition, type FulfillmentTransitionPath, type GetAvailableTransitionsParams, type GetAvailableTransitionsResponse, type GetOrderDisplayStateParams, type GetOrderDisplayStateResponse, type GetOrderStateConfigParams, type GetOrderStateConfigResponse, type GetStateConfigFragmentParams, type GetStateConfigFragmentResponse, InventoryBaseActionEnum, type InventoryBaseActionType, InventorySpecificActionType, InvoiceStatus, LibraryItemType, MenuProject, NAFixedRates, NORTH_AMERICA, NonRevenueItemType, ORDER_STATE_ACTIONS, ORDER_STATE_EVENTS, ORDER_STATE_TOPIC, type OrderContext, type OrderLikeForContext, type OrderLikeForLegacyInference, type OrderLineItem, type OrderPaymentMethod, OrderPlatform, type OrderRefund, type OrderStateEventPayload, type OrderStateWritable, OtherFixedRates, OwnerType, PATH_MODES, PAYMENT_STATES, POS_VALID_INITIAL_STATES, type PathMode, PaymentMethod, type PaymentState, type PaymentStateDefinition, type PaymentTransitionPath, Platform, PreviewImageMode, PricingLevel, PricingPlanEnum, PricingRegionEnum, type ProductDiscountBucket, type ProductFeeBucket, ProductStatus, ProductType, PublicationAvailability, type PublicationConfig, PublicationStatus, REGION_MAPPING, REPORT_NEGATE_PATHS, ReceiptSendChannel, ReceiptType, type RefundsBreakdown, ResidualPaymentMethod, ResidualStatus, type ResolveTemplateResult, STATE_SCHEMA, STRIPE_SUPPORTED_COUNTRIES, type SalesSummary, type SaveStateConfigFragmentParams, type SaveStateConfigFragmentResponse, type SettlementBreakdown, type SettlementCardSection, type SettlementCashSection, type SettlementCustomEntry, type SplitPayment, type SplitPaymentPayment, type StaffSales, type StaffSalesEntry, type StateConfig, type StateConfigFragment, type StateDefinition, type StatePair, type StateSchema, type StateTransitionBlockedPayload, type StateTransitionCompletedPayload, StationStatus, type StoredStateConfig, StripeCurrencyCode, StripeStatus, type TaxBreakdown, type TaxBreakdownRateEntry, type TaxBreakdownSection, type TaxBreakdownSubtotal, type TaxesTuple, TimePeriod, type TipEntry, type TipsBreakdown, type TipsTuple, TopMetericsSort, type TransitionBlockedBy, type TransitionConditionSet, type TransitionOrderStateParams, type TransitionOrderStateResponse, type TransitionPath, type TransitionRequest, type TransitionResult, UserTypes, addAmounts, amountToString, baseFulfillmentDefinitions, basePaymentDefinitions, buildOrderContext, buildPosPresetConfig, buildResolvedConfig, calculatePercentage, canTransition, conditionSummary, convertFixedFeeToLocalCurrency, createAmount, crossAxisRuleApplies, deriveDisplayState, displayRuleMatchesPair, divideAmount, evaluateCondition, evaluateConditionSet, formatCurrency, formatMinorUnitsToString, fromMinorUnits, generateMongoID, getAvailableTransitions, getCountriesByRegion, getCurrencyConfig, getCurrentISODate, getFinancialInvariantViolations, getMinorUnitMultiplier, getMinorUnits, getPricingRegionFromCountry, inferStatesFromLegacyStatus, isConditionOperator, isFulfillmentState, isPaymentState, isSupportedCurrency, mapToLegacyStatus, mergeFragment, multiplyAmount, normalizeMongoIdString, parseAmountToMinorUnits, parseCurrencyCode, parseStripeCurrencyCode, removeFragment, resolveTemplate, setOrderState, signReportForDisplay, stringifyMinorUnits, subtractAmounts, toMinorUnits, validateConfig, validateFragmentCompatibility, violatesFinancialInvariant };
package/dist/index.js CHANGED
@@ -31,7 +31,6 @@ __export(index_exports, {
31
31
  DEFAULT_CROSS_AXIS_RULES: () => DEFAULT_CROSS_AXIS_RULES,
32
32
  DEFAULT_DISPLAY_STATE_MAP: () => DEFAULT_DISPLAY_STATE_MAP,
33
33
  DEFAULT_RESOLVED_CONFIG: () => DEFAULT_RESOLVED_CONFIG,
34
- DualWriteStrategy: () => DualWriteStrategy,
35
34
  EUFixedRates: () => EUFixedRates,
36
35
  EUROPE: () => EUROPE,
37
36
  ExtensionCategory: () => ExtensionCategory,
@@ -41,7 +40,6 @@ __export(index_exports, {
41
40
  InventoryBaseActionEnum: () => InventoryBaseActionEnum,
42
41
  InventorySpecificActionType: () => InventorySpecificActionType,
43
42
  InvoiceStatus: () => InvoiceStatus,
44
- LegacyWriteStrategy: () => LegacyWriteStrategy,
45
43
  LibraryItemType: () => LibraryItemType,
46
44
  MenuProject: () => MenuProject,
47
45
  NAFixedRates: () => NAFixedRates,
@@ -336,7 +334,6 @@ var Platform = /* @__PURE__ */ ((Platform2) => {
336
334
  var OrderPlatform = /* @__PURE__ */ ((OrderPlatform2) => {
337
335
  OrderPlatform2["POS"] = "in-store";
338
336
  OrderPlatform2["WOO_COMMERCE"] = "woo-commerce";
339
- OrderPlatform2["PUBLIC_API"] = "public-api";
340
337
  return OrderPlatform2;
341
338
  })(OrderPlatform || {});
342
339
  var CustomerPlatform = /* @__PURE__ */ ((CustomerPlatform2) => {
@@ -1134,7 +1131,10 @@ function negateAtPaths(value, path, paths) {
1134
1131
  function padHex(value, length) {
1135
1132
  return value.toString(16).padStart(length, "0");
1136
1133
  }
1137
- var PROCESS_RANDOM = Array.from({ length: 5 }, () => padHex(Math.floor(Math.random() * 256), 2)).join("");
1134
+ var PROCESS_RANDOM = Array.from(
1135
+ { length: 5 },
1136
+ () => padHex(Math.floor(Math.random() * 256), 2)
1137
+ ).join("");
1138
1138
  var objectIdCounter = Math.floor(Math.random() * 16777215);
1139
1139
  function generateMongoID() {
1140
1140
  const timestamp = padHex(Math.floor(Date.now() / 1e3), 8);
@@ -1352,8 +1352,12 @@ var DEFAULT_CROSS_AXIS_RULES = [
1352
1352
 
1353
1353
  // order-state-machine/default-config.ts
1354
1354
  var DEFAULT_EPOCH = /* @__PURE__ */ new Date(0);
1355
- var PAYMENT_LABELS = new Map(basePaymentDefinitions().map((d) => [d.id, d.label]));
1356
- var FULFILLMENT_LABELS = new Map(baseFulfillmentDefinitions().map((d) => [d.id, d.label]));
1355
+ var PAYMENT_LABELS = new Map(
1356
+ basePaymentDefinitions().map((d) => [d.id, d.label])
1357
+ );
1358
+ var FULFILLMENT_LABELS = new Map(
1359
+ baseFulfillmentDefinitions().map((d) => [d.id, d.label])
1360
+ );
1357
1361
  var TERMINAL_PAYMENT_STATES = new Set(
1358
1362
  basePaymentDefinitions().filter((d) => d.isTerminal).map((d) => d.id)
1359
1363
  );
@@ -2265,27 +2269,6 @@ function inferStatesFromLegacyStatus(order) {
2265
2269
  return { payment: "unpaid", fulfillment: "pending" };
2266
2270
  }
2267
2271
 
2268
- // order-state-machine/write-strategy.ts
2269
- var LegacyWriteStrategy = class {
2270
- applyState(_order) {
2271
- }
2272
- };
2273
- var DualWriteStrategy = class {
2274
- constructor(config) {
2275
- this.config = config;
2276
- }
2277
- applyState(order) {
2278
- if (order.paymentState && order.fulfillmentState) {
2279
- setOrderState(order, order.paymentState, order.fulfillmentState, this.config);
2280
- return;
2281
- }
2282
- if (order.status) {
2283
- const inferred = inferStatesFromLegacyStatus(order);
2284
- setOrderState(order, inferred.payment, inferred.fulfillment, this.config);
2285
- }
2286
- }
2287
- };
2288
-
2289
2272
  // order-state-machine/resolve-template.ts
2290
2273
  function resolveTemplate(templateJson, params, values = {}) {
2291
2274
  const resolvedValues = {};
@@ -2601,7 +2584,6 @@ var ORDER_STATE_EVENTS = {
2601
2584
  DEFAULT_CROSS_AXIS_RULES,
2602
2585
  DEFAULT_DISPLAY_STATE_MAP,
2603
2586
  DEFAULT_RESOLVED_CONFIG,
2604
- DualWriteStrategy,
2605
2587
  EUFixedRates,
2606
2588
  EUROPE,
2607
2589
  ExtensionCategory,
@@ -2611,7 +2593,6 @@ var ORDER_STATE_EVENTS = {
2611
2593
  InventoryBaseActionEnum,
2612
2594
  InventorySpecificActionType,
2613
2595
  InvoiceStatus,
2614
- LegacyWriteStrategy,
2615
2596
  LibraryItemType,
2616
2597
  MenuProject,
2617
2598
  NAFixedRates,