@final-commerce/common 2.0.2 → 2.0.4

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.js CHANGED
@@ -39,6 +39,7 @@ __export(index_exports, {
39
39
  FeesCustomBillingStatus: () => FeesCustomBillingStatus,
40
40
  InventoryBaseActionEnum: () => InventoryBaseActionEnum,
41
41
  InventorySpecificActionType: () => InventorySpecificActionType,
42
+ InvoiceStatus: () => InvoiceStatus,
42
43
  LibraryItemType: () => LibraryItemType,
43
44
  MenuProject: () => MenuProject,
44
45
  NAFixedRates: () => NAFixedRates,
@@ -52,7 +53,6 @@ __export(index_exports, {
52
53
  OwnerType: () => OwnerType,
53
54
  PATH_MODES: () => PATH_MODES,
54
55
  PAYMENT_STATES: () => PAYMENT_STATES,
55
- POS_CROSS_AXIS_RULES: () => POS_CROSS_AXIS_RULES,
56
56
  POS_VALID_INITIAL_STATES: () => POS_VALID_INITIAL_STATES,
57
57
  PaymentMethod: () => PaymentMethod,
58
58
  Platform: () => Platform,
@@ -67,6 +67,7 @@ __export(index_exports, {
67
67
  REGION_MAPPING: () => REGION_MAPPING,
68
68
  REPORT_NEGATE_PATHS: () => REPORT_NEGATE_PATHS,
69
69
  ReceiptSendChannel: () => ReceiptSendChannel,
70
+ ReceiptType: () => ReceiptType,
70
71
  ResidualPaymentMethod: () => ResidualPaymentMethod,
71
72
  ResidualStatus: () => ResidualStatus,
72
73
  STATE_SCHEMA: () => STATE_SCHEMA,
@@ -481,6 +482,11 @@ var ReceiptSendChannel = /* @__PURE__ */ ((ReceiptSendChannel2) => {
481
482
  ReceiptSendChannel2["TEXT"] = "text";
482
483
  return ReceiptSendChannel2;
483
484
  })(ReceiptSendChannel || {});
485
+ var ReceiptType = /* @__PURE__ */ ((ReceiptType2) => {
486
+ ReceiptType2["ORDER"] = "order";
487
+ ReceiptType2["REFUND"] = "refund";
488
+ return ReceiptType2;
489
+ })(ReceiptType || {});
484
490
  var StripeStatus = /* @__PURE__ */ ((StripeStatus2) => {
485
491
  StripeStatus2["ACTIVE"] = "active";
486
492
  StripeStatus2["INACTIVE"] = "inactive";
@@ -488,6 +494,12 @@ var StripeStatus = /* @__PURE__ */ ((StripeStatus2) => {
488
494
  StripeStatus2["PAYMENT_METHOD_ADDED"] = "payment_method_added";
489
495
  return StripeStatus2;
490
496
  })(StripeStatus || {});
497
+ var InvoiceStatus = /* @__PURE__ */ ((InvoiceStatus2) => {
498
+ InvoiceStatus2["PAID"] = "paid";
499
+ InvoiceStatus2["PENDING"] = "pending";
500
+ InvoiceStatus2["EXPIRED"] = "expired";
501
+ return InvoiceStatus2;
502
+ })(InvoiceStatus || {});
491
503
 
492
504
  // enums/stripe-currencies.enum.ts
493
505
  var StripeCurrencyCode = /* @__PURE__ */ ((StripeCurrencyCode2) => {
@@ -1389,7 +1401,7 @@ var DEFAULT_CONFIG = {
1389
1401
  fulfillmentPaths: [],
1390
1402
  paymentPathMode: "permissive",
1391
1403
  fulfillmentPathMode: "permissive",
1392
- crossAxisRules: [...DEFAULT_CROSS_AXIS_RULES],
1404
+ crossAxisRules: [],
1393
1405
  transitionConditions: [],
1394
1406
  validInitialStates: [{ payment: "unpaid", fulfillment: "draft" }],
1395
1407
  displayStateMap: [...DEFAULT_DISPLAY_STATE_MAP],
@@ -1406,19 +1418,6 @@ function buildResolvedConfig(config) {
1406
1418
  var DEFAULT_RESOLVED_CONFIG = buildResolvedConfig(DEFAULT_CONFIG);
1407
1419
 
1408
1420
  // order-state-machine/pos-preset.ts
1409
- var POS_CROSS_AXIS_RULES = [
1410
- {
1411
- id: "pos-pay-requires-open-fulfillment",
1412
- label: "Payments only on open fulfillment states",
1413
- description: "POS payments are only valid on orders whose fulfillment is open (draft / pending / on_hold) or auto-fulfilled in lock-step (fulfilled). Returned / cancelled / in-progress fulfillment must use refund flows instead.",
1414
- enabled: true,
1415
- trigger: { axis: "payment", to: ["payment_pending", "paid", "partially_paid"] },
1416
- requires: {
1417
- axis: "fulfillment",
1418
- states: ["draft", "pending", "on_hold", "fulfilled"]
1419
- }
1420
- }
1421
- ];
1422
1421
  var POS_VALID_INITIAL_STATES = [
1423
1422
  { payment: "unpaid", fulfillment: "draft" },
1424
1423
  { payment: "unpaid", fulfillment: "on_hold" },
@@ -1433,7 +1432,7 @@ function buildPosPresetConfig(companyId) {
1433
1432
  _id: "pos-preset",
1434
1433
  companyId: companyId ?? DEFAULT_CONFIG.companyId,
1435
1434
  name: "POS Preset",
1436
- crossAxisRules: [...DEFAULT_CROSS_AXIS_RULES, ...POS_CROSS_AXIS_RULES],
1435
+ crossAxisRules: [],
1437
1436
  validInitialStates: [...POS_VALID_INITIAL_STATES],
1438
1437
  displayStateMap: [...DEFAULT_DISPLAY_STATE_MAP]
1439
1438
  };
@@ -2593,6 +2592,7 @@ var ORDER_STATE_EVENTS = {
2593
2592
  FeesCustomBillingStatus,
2594
2593
  InventoryBaseActionEnum,
2595
2594
  InventorySpecificActionType,
2595
+ InvoiceStatus,
2596
2596
  LibraryItemType,
2597
2597
  MenuProject,
2598
2598
  NAFixedRates,
@@ -2606,7 +2606,6 @@ var ORDER_STATE_EVENTS = {
2606
2606
  OwnerType,
2607
2607
  PATH_MODES,
2608
2608
  PAYMENT_STATES,
2609
- POS_CROSS_AXIS_RULES,
2610
2609
  POS_VALID_INITIAL_STATES,
2611
2610
  PaymentMethod,
2612
2611
  Platform,
@@ -2621,6 +2620,7 @@ var ORDER_STATE_EVENTS = {
2621
2620
  REGION_MAPPING,
2622
2621
  REPORT_NEGATE_PATHS,
2623
2622
  ReceiptSendChannel,
2623
+ ReceiptType,
2624
2624
  ResidualPaymentMethod,
2625
2625
  ResidualStatus,
2626
2626
  STATE_SCHEMA,