@final-commerce/common 2.5.1-preprod.7 → 2.5.1-preprod.8

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.
@@ -151,6 +151,7 @@ interface OrderInCart {
151
151
 
152
152
  interface OrderCustomStatus {
153
153
  id: string;
154
+ key?: string;
154
155
  label: string;
155
156
  setAt: string;
156
157
  setBy: string | null;
@@ -807,6 +808,84 @@ interface FlowWebApp extends BaseDocument {
807
808
  customDomain?: string;
808
809
  }
809
810
 
811
+ type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
812
+ type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
813
+ interface StatePair {
814
+ payment: PaymentState;
815
+ fulfillment: FulfillmentState;
816
+ }
817
+ type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
818
+ type PathMode = 'strict' | 'permissive';
819
+
820
+ interface PaymentTransitionPath {
821
+ from: PaymentState;
822
+ to: PaymentState;
823
+ conditionSetId?: string;
824
+ _sourceExtensionId?: string;
825
+ }
826
+ interface FulfillmentTransitionPath {
827
+ from: FulfillmentState;
828
+ to: FulfillmentState;
829
+ conditionSetId?: string;
830
+ _sourceExtensionId?: string;
831
+ }
832
+ interface Condition {
833
+ field: string;
834
+ operator: ConditionOperator;
835
+ value: unknown;
836
+ }
837
+ interface ConditionGroup {
838
+ conditions: Condition[];
839
+ }
840
+ interface TransitionConditionSet {
841
+ id: string;
842
+ label: string;
843
+ groups: ConditionGroup[];
844
+ _sourceExtensionId?: string;
845
+ }
846
+ type CrossAxisTrigger = {
847
+ axis: 'payment';
848
+ to: PaymentState | PaymentState[];
849
+ } | {
850
+ axis: 'fulfillment';
851
+ to: FulfillmentState | FulfillmentState[];
852
+ };
853
+ type CrossAxisRequires = {
854
+ axis: 'payment';
855
+ states: PaymentState[];
856
+ } | {
857
+ axis: 'fulfillment';
858
+ states: FulfillmentState[];
859
+ };
860
+ interface CrossAxisRule {
861
+ id: string;
862
+ label: string;
863
+ description?: string;
864
+ enabled: boolean;
865
+ trigger: CrossAxisTrigger;
866
+ requires: CrossAxisRequires;
867
+ _sourceExtensionId?: string;
868
+ }
869
+ interface DisplayStateRule {
870
+ paymentState?: PaymentState | PaymentState[];
871
+ fulfillmentState?: FulfillmentState | FulfillmentState[];
872
+ label: string;
873
+ color?: string;
874
+ icon?: string;
875
+ _sourceExtensionId?: string;
876
+ }
877
+ type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
878
+
879
+ interface OrderStatusDefinition {
880
+ id: string;
881
+ key: string;
882
+ defaultLabel: string;
883
+ color?: string;
884
+ icon?: string;
885
+ fulfillmentState?: FulfillmentState;
886
+ requiresPaymentState?: PaymentState[];
887
+ }
888
+
810
889
  interface FlowWebAppVersion extends BaseDocument {
811
890
  checkoutFlowId: string;
812
891
  version: string;
@@ -815,6 +894,7 @@ interface FlowWebAppVersion extends BaseDocument {
815
894
  fileCount: number;
816
895
  sizeBytes: number;
817
896
  changelog?: string;
897
+ orderStatuses?: OrderStatusDefinition[];
818
898
  }
819
899
 
820
900
  interface NonRevenueItem$1 {
@@ -976,74 +1056,6 @@ interface Transaction extends BaseEntity {
976
1056
  minorUnits?: number;
977
1057
  }
978
1058
 
979
- type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
980
- type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
981
- interface StatePair {
982
- payment: PaymentState;
983
- fulfillment: FulfillmentState;
984
- }
985
- type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
986
- type PathMode = 'strict' | 'permissive';
987
-
988
- interface PaymentTransitionPath {
989
- from: PaymentState;
990
- to: PaymentState;
991
- conditionSetId?: string;
992
- _sourceExtensionId?: string;
993
- }
994
- interface FulfillmentTransitionPath {
995
- from: FulfillmentState;
996
- to: FulfillmentState;
997
- conditionSetId?: string;
998
- _sourceExtensionId?: string;
999
- }
1000
- interface Condition {
1001
- field: string;
1002
- operator: ConditionOperator;
1003
- value: unknown;
1004
- }
1005
- interface ConditionGroup {
1006
- conditions: Condition[];
1007
- }
1008
- interface TransitionConditionSet {
1009
- id: string;
1010
- label: string;
1011
- groups: ConditionGroup[];
1012
- _sourceExtensionId?: string;
1013
- }
1014
- type CrossAxisTrigger = {
1015
- axis: 'payment';
1016
- to: PaymentState | PaymentState[];
1017
- } | {
1018
- axis: 'fulfillment';
1019
- to: FulfillmentState | FulfillmentState[];
1020
- };
1021
- type CrossAxisRequires = {
1022
- axis: 'payment';
1023
- states: PaymentState[];
1024
- } | {
1025
- axis: 'fulfillment';
1026
- states: FulfillmentState[];
1027
- };
1028
- interface CrossAxisRule {
1029
- id: string;
1030
- label: string;
1031
- description?: string;
1032
- enabled: boolean;
1033
- trigger: CrossAxisTrigger;
1034
- requires: CrossAxisRequires;
1035
- _sourceExtensionId?: string;
1036
- }
1037
- interface DisplayStateRule {
1038
- paymentState?: PaymentState | PaymentState[];
1039
- fulfillmentState?: FulfillmentState | FulfillmentState[];
1040
- label: string;
1041
- color?: string;
1042
- icon?: string;
1043
- _sourceExtensionId?: string;
1044
- }
1045
- type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
1046
-
1047
1059
  interface OrderStateConfig extends BaseEntity {
1048
1060
  version: number;
1049
1061
  name: string;
@@ -2314,6 +2326,7 @@ interface SelectionFlowContext {
2314
2326
  flowVersionUrl: string | null;
2315
2327
  flowSettings: Record<string, string> | null;
2316
2328
  flowSettingsKey: Record<string, string> | null;
2329
+ orderStatuses?: OrderStatusDefinition[] | null;
2317
2330
  }
2318
2331
  interface SelectionContext {
2319
2332
  user: ActiveUser;
@@ -151,6 +151,7 @@ interface OrderInCart {
151
151
 
152
152
  interface OrderCustomStatus {
153
153
  id: string;
154
+ key?: string;
154
155
  label: string;
155
156
  setAt: string;
156
157
  setBy: string | null;
@@ -807,6 +808,84 @@ interface FlowWebApp extends BaseDocument {
807
808
  customDomain?: string;
808
809
  }
809
810
 
811
+ type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
812
+ type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
813
+ interface StatePair {
814
+ payment: PaymentState;
815
+ fulfillment: FulfillmentState;
816
+ }
817
+ type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
818
+ type PathMode = 'strict' | 'permissive';
819
+
820
+ interface PaymentTransitionPath {
821
+ from: PaymentState;
822
+ to: PaymentState;
823
+ conditionSetId?: string;
824
+ _sourceExtensionId?: string;
825
+ }
826
+ interface FulfillmentTransitionPath {
827
+ from: FulfillmentState;
828
+ to: FulfillmentState;
829
+ conditionSetId?: string;
830
+ _sourceExtensionId?: string;
831
+ }
832
+ interface Condition {
833
+ field: string;
834
+ operator: ConditionOperator;
835
+ value: unknown;
836
+ }
837
+ interface ConditionGroup {
838
+ conditions: Condition[];
839
+ }
840
+ interface TransitionConditionSet {
841
+ id: string;
842
+ label: string;
843
+ groups: ConditionGroup[];
844
+ _sourceExtensionId?: string;
845
+ }
846
+ type CrossAxisTrigger = {
847
+ axis: 'payment';
848
+ to: PaymentState | PaymentState[];
849
+ } | {
850
+ axis: 'fulfillment';
851
+ to: FulfillmentState | FulfillmentState[];
852
+ };
853
+ type CrossAxisRequires = {
854
+ axis: 'payment';
855
+ states: PaymentState[];
856
+ } | {
857
+ axis: 'fulfillment';
858
+ states: FulfillmentState[];
859
+ };
860
+ interface CrossAxisRule {
861
+ id: string;
862
+ label: string;
863
+ description?: string;
864
+ enabled: boolean;
865
+ trigger: CrossAxisTrigger;
866
+ requires: CrossAxisRequires;
867
+ _sourceExtensionId?: string;
868
+ }
869
+ interface DisplayStateRule {
870
+ paymentState?: PaymentState | PaymentState[];
871
+ fulfillmentState?: FulfillmentState | FulfillmentState[];
872
+ label: string;
873
+ color?: string;
874
+ icon?: string;
875
+ _sourceExtensionId?: string;
876
+ }
877
+ type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
878
+
879
+ interface OrderStatusDefinition {
880
+ id: string;
881
+ key: string;
882
+ defaultLabel: string;
883
+ color?: string;
884
+ icon?: string;
885
+ fulfillmentState?: FulfillmentState;
886
+ requiresPaymentState?: PaymentState[];
887
+ }
888
+
810
889
  interface FlowWebAppVersion extends BaseDocument {
811
890
  checkoutFlowId: string;
812
891
  version: string;
@@ -815,6 +894,7 @@ interface FlowWebAppVersion extends BaseDocument {
815
894
  fileCount: number;
816
895
  sizeBytes: number;
817
896
  changelog?: string;
897
+ orderStatuses?: OrderStatusDefinition[];
818
898
  }
819
899
 
820
900
  interface NonRevenueItem$1 {
@@ -976,74 +1056,6 @@ interface Transaction extends BaseEntity {
976
1056
  minorUnits?: number;
977
1057
  }
978
1058
 
979
- type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
980
- type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
981
- interface StatePair {
982
- payment: PaymentState;
983
- fulfillment: FulfillmentState;
984
- }
985
- type ConditionOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn' | 'isEmpty' | 'isNotEmpty';
986
- type PathMode = 'strict' | 'permissive';
987
-
988
- interface PaymentTransitionPath {
989
- from: PaymentState;
990
- to: PaymentState;
991
- conditionSetId?: string;
992
- _sourceExtensionId?: string;
993
- }
994
- interface FulfillmentTransitionPath {
995
- from: FulfillmentState;
996
- to: FulfillmentState;
997
- conditionSetId?: string;
998
- _sourceExtensionId?: string;
999
- }
1000
- interface Condition {
1001
- field: string;
1002
- operator: ConditionOperator;
1003
- value: unknown;
1004
- }
1005
- interface ConditionGroup {
1006
- conditions: Condition[];
1007
- }
1008
- interface TransitionConditionSet {
1009
- id: string;
1010
- label: string;
1011
- groups: ConditionGroup[];
1012
- _sourceExtensionId?: string;
1013
- }
1014
- type CrossAxisTrigger = {
1015
- axis: 'payment';
1016
- to: PaymentState | PaymentState[];
1017
- } | {
1018
- axis: 'fulfillment';
1019
- to: FulfillmentState | FulfillmentState[];
1020
- };
1021
- type CrossAxisRequires = {
1022
- axis: 'payment';
1023
- states: PaymentState[];
1024
- } | {
1025
- axis: 'fulfillment';
1026
- states: FulfillmentState[];
1027
- };
1028
- interface CrossAxisRule {
1029
- id: string;
1030
- label: string;
1031
- description?: string;
1032
- enabled: boolean;
1033
- trigger: CrossAxisTrigger;
1034
- requires: CrossAxisRequires;
1035
- _sourceExtensionId?: string;
1036
- }
1037
- interface DisplayStateRule {
1038
- paymentState?: PaymentState | PaymentState[];
1039
- fulfillmentState?: FulfillmentState | FulfillmentState[];
1040
- label: string;
1041
- color?: string;
1042
- icon?: string;
1043
- _sourceExtensionId?: string;
1044
- }
1045
- type TransitionBlockedBy = 'financial_invariant' | 'cross_axis_rule' | 'path' | 'condition';
1046
-
1047
1059
  interface OrderStateConfig extends BaseEntity {
1048
1060
  version: number;
1049
1061
  name: string;
@@ -2314,6 +2326,7 @@ interface SelectionFlowContext {
2314
2326
  flowVersionUrl: string | null;
2315
2327
  flowSettings: Record<string, string> | null;
2316
2328
  flowSettingsKey: Record<string, string> | null;
2329
+ orderStatuses?: OrderStatusDefinition[] | null;
2317
2330
  }
2318
2331
  interface SelectionContext {
2319
2332
  user: ActiveUser;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@final-commerce/common",
3
- "version": "2.5.1-preprod.7",
3
+ "version": "2.5.1-preprod.8",
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": {