@final-commerce/common 2.1.0 → 2.1.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.
package/dist/index.mjs CHANGED
@@ -2453,6 +2453,27 @@ var ORDER_STATE_EVENTS = {
2453
2453
  stateTransitionBlocked: "state-transition-blocked",
2454
2454
  configUpdated: "config-updated"
2455
2455
  };
2456
+
2457
+ // order-state-machine/write-strategy.ts
2458
+ var LegacyWriteStrategy = class {
2459
+ applyState(_order) {
2460
+ }
2461
+ };
2462
+ var DualWriteStrategy = class {
2463
+ constructor(config) {
2464
+ this.config = config;
2465
+ }
2466
+ applyState(order) {
2467
+ if (order.paymentState && order.fulfillmentState) {
2468
+ setOrderState(order, order.paymentState, order.fulfillmentState, this.config);
2469
+ return;
2470
+ }
2471
+ if (order.status) {
2472
+ const inferred = inferStatesFromLegacyStatus(order);
2473
+ setOrderState(order, inferred.payment, inferred.fulfillment, this.config);
2474
+ }
2475
+ }
2476
+ };
2456
2477
  export {
2457
2478
  AttributeType,
2458
2479
  CONDITION_OPERATORS,
@@ -2466,6 +2487,7 @@ export {
2466
2487
  DEFAULT_CROSS_AXIS_RULES,
2467
2488
  DEFAULT_DISPLAY_STATE_MAP,
2468
2489
  DEFAULT_RESOLVED_CONFIG,
2490
+ DualWriteStrategy,
2469
2491
  EUFixedRates,
2470
2492
  EUROPE,
2471
2493
  ExtensionCategory,
@@ -2475,6 +2497,7 @@ export {
2475
2497
  InventoryBaseActionEnum,
2476
2498
  InventorySpecificActionType,
2477
2499
  InvoiceStatus,
2500
+ LegacyWriteStrategy,
2478
2501
  LibraryItemType,
2479
2502
  MenuProject,
2480
2503
  NAFixedRates,