@contractspec/example.marketplace 1.44.0

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.
Files changed (152) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +141 -0
  3. package/dist/docs/index.d.ts +1 -0
  4. package/dist/docs/index.js +1 -0
  5. package/dist/docs/marketplace.docblock.d.ts +1 -0
  6. package/dist/docs/marketplace.docblock.js +115 -0
  7. package/dist/docs/marketplace.docblock.js.map +1 -0
  8. package/dist/entities/index.d.ts +309 -0
  9. package/dist/entities/index.d.ts.map +1 -0
  10. package/dist/entities/index.js +46 -0
  11. package/dist/entities/index.js.map +1 -0
  12. package/dist/entities/order.d.ts +105 -0
  13. package/dist/entities/order.d.ts.map +1 -0
  14. package/dist/entities/order.js +173 -0
  15. package/dist/entities/order.js.map +1 -0
  16. package/dist/entities/payout.d.ts +92 -0
  17. package/dist/entities/payout.d.ts.map +1 -0
  18. package/dist/entities/payout.js +162 -0
  19. package/dist/entities/payout.js.map +1 -0
  20. package/dist/entities/product.d.ts +93 -0
  21. package/dist/entities/product.d.ts.map +1 -0
  22. package/dist/entities/product.js +161 -0
  23. package/dist/entities/product.js.map +1 -0
  24. package/dist/entities/review.d.ts +83 -0
  25. package/dist/entities/review.d.ts.map +1 -0
  26. package/dist/entities/review.js +152 -0
  27. package/dist/entities/review.js.map +1 -0
  28. package/dist/entities/store.d.ts +60 -0
  29. package/dist/entities/store.d.ts.map +1 -0
  30. package/dist/entities/store.js +110 -0
  31. package/dist/entities/store.js.map +1 -0
  32. package/dist/example.d.ts +40 -0
  33. package/dist/example.d.ts.map +1 -0
  34. package/dist/example.js +51 -0
  35. package/dist/example.js.map +1 -0
  36. package/dist/index.d.ts +26 -0
  37. package/dist/index.js +27 -0
  38. package/dist/marketplace.feature.d.ts +12 -0
  39. package/dist/marketplace.feature.d.ts.map +1 -0
  40. package/dist/marketplace.feature.js +310 -0
  41. package/dist/marketplace.feature.js.map +1 -0
  42. package/dist/order/index.d.ts +5 -0
  43. package/dist/order/index.js +6 -0
  44. package/dist/order/order.enum.d.ts +10 -0
  45. package/dist/order/order.enum.d.ts.map +1 -0
  46. package/dist/order/order.enum.js +22 -0
  47. package/dist/order/order.enum.js.map +1 -0
  48. package/dist/order/order.event.d.ts +145 -0
  49. package/dist/order/order.event.d.ts.map +1 -0
  50. package/dist/order/order.event.js +216 -0
  51. package/dist/order/order.event.js.map +1 -0
  52. package/dist/order/order.operations.d.ts +368 -0
  53. package/dist/order/order.operations.d.ts.map +1 -0
  54. package/dist/order/order.operations.js +119 -0
  55. package/dist/order/order.operations.js.map +1 -0
  56. package/dist/order/order.presentation.d.ts +9 -0
  57. package/dist/order/order.presentation.d.ts.map +1 -0
  58. package/dist/order/order.presentation.js +86 -0
  59. package/dist/order/order.presentation.js.map +1 -0
  60. package/dist/order/order.schema.d.ts +165 -0
  61. package/dist/order/order.schema.d.ts.map +1 -0
  62. package/dist/order/order.schema.js +155 -0
  63. package/dist/order/order.schema.js.map +1 -0
  64. package/dist/payout/index.d.ts +5 -0
  65. package/dist/payout/index.js +6 -0
  66. package/dist/payout/payout.enum.d.ts +10 -0
  67. package/dist/payout/payout.enum.d.ts.map +1 -0
  68. package/dist/payout/payout.enum.js +17 -0
  69. package/dist/payout/payout.enum.js.map +1 -0
  70. package/dist/payout/payout.event.d.ts +63 -0
  71. package/dist/payout/payout.event.d.ts.map +1 -0
  72. package/dist/payout/payout.event.js +92 -0
  73. package/dist/payout/payout.event.js.map +1 -0
  74. package/dist/payout/payout.operations.d.ts +97 -0
  75. package/dist/payout/payout.operations.d.ts.map +1 -0
  76. package/dist/payout/payout.operations.js +53 -0
  77. package/dist/payout/payout.operations.js.map +1 -0
  78. package/dist/payout/payout.presentation.d.ts +8 -0
  79. package/dist/payout/payout.presentation.d.ts.map +1 -0
  80. package/dist/payout/payout.presentation.js +60 -0
  81. package/dist/payout/payout.presentation.js.map +1 -0
  82. package/dist/payout/payout.schema.d.ts +157 -0
  83. package/dist/payout/payout.schema.d.ts.map +1 -0
  84. package/dist/payout/payout.schema.js +116 -0
  85. package/dist/payout/payout.schema.js.map +1 -0
  86. package/dist/product/index.d.ts +5 -0
  87. package/dist/product/index.js +6 -0
  88. package/dist/product/product.enum.d.ts +10 -0
  89. package/dist/product/product.enum.d.ts.map +1 -0
  90. package/dist/product/product.enum.js +18 -0
  91. package/dist/product/product.enum.js.map +1 -0
  92. package/dist/product/product.event.d.ts +73 -0
  93. package/dist/product/product.event.d.ts.map +1 -0
  94. package/dist/product/product.event.js +120 -0
  95. package/dist/product/product.event.js.map +1 -0
  96. package/dist/product/product.operations.d.ts +273 -0
  97. package/dist/product/product.operations.d.ts.map +1 -0
  98. package/dist/product/product.operations.js +108 -0
  99. package/dist/product/product.operations.js.map +1 -0
  100. package/dist/product/product.presentation.d.ts +9 -0
  101. package/dist/product/product.presentation.d.ts.map +1 -0
  102. package/dist/product/product.presentation.js +86 -0
  103. package/dist/product/product.presentation.js.map +1 -0
  104. package/dist/product/product.schema.d.ts +218 -0
  105. package/dist/product/product.schema.d.ts.map +1 -0
  106. package/dist/product/product.schema.js +176 -0
  107. package/dist/product/product.schema.js.map +1 -0
  108. package/dist/review/index.d.ts +5 -0
  109. package/dist/review/index.js +6 -0
  110. package/dist/review/review.enum.d.ts +10 -0
  111. package/dist/review/review.enum.d.ts.map +1 -0
  112. package/dist/review/review.enum.js +16 -0
  113. package/dist/review/review.enum.js.map +1 -0
  114. package/dist/review/review.event.d.ts +55 -0
  115. package/dist/review/review.event.d.ts.map +1 -0
  116. package/dist/review/review.event.js +84 -0
  117. package/dist/review/review.event.js.map +1 -0
  118. package/dist/review/review.operations.d.ts +237 -0
  119. package/dist/review/review.operations.d.ts.map +1 -0
  120. package/dist/review/review.operations.js +106 -0
  121. package/dist/review/review.operations.js.map +1 -0
  122. package/dist/review/review.presentation.d.ts +8 -0
  123. package/dist/review/review.presentation.d.ts.map +1 -0
  124. package/dist/review/review.presentation.js +60 -0
  125. package/dist/review/review.presentation.js.map +1 -0
  126. package/dist/review/review.schema.d.ts +190 -0
  127. package/dist/review/review.schema.d.ts.map +1 -0
  128. package/dist/review/review.schema.js +156 -0
  129. package/dist/review/review.schema.js.map +1 -0
  130. package/dist/store/index.d.ts +5 -0
  131. package/dist/store/index.js +6 -0
  132. package/dist/store/store.enum.d.ts +10 -0
  133. package/dist/store/store.enum.d.ts.map +1 -0
  134. package/dist/store/store.enum.js +16 -0
  135. package/dist/store/store.enum.js.map +1 -0
  136. package/dist/store/store.event.d.ts +51 -0
  137. package/dist/store/store.event.d.ts.map +1 -0
  138. package/dist/store/store.event.js +80 -0
  139. package/dist/store/store.event.js.map +1 -0
  140. package/dist/store/store.operations.d.ts +131 -0
  141. package/dist/store/store.operations.d.ts.map +1 -0
  142. package/dist/store/store.operations.js +61 -0
  143. package/dist/store/store.operations.js.map +1 -0
  144. package/dist/store/store.presentation.d.ts +8 -0
  145. package/dist/store/store.presentation.d.ts.map +1 -0
  146. package/dist/store/store.presentation.js +60 -0
  147. package/dist/store/store.presentation.js.map +1 -0
  148. package/dist/store/store.schema.d.ts +84 -0
  149. package/dist/store/store.schema.d.ts.map +1 -0
  150. package/dist/store/store.schema.js +93 -0
  151. package/dist/store/store.schema.js.map +1 -0
  152. package/package.json +141 -0
@@ -0,0 +1,53 @@
1
+ import { ListPayoutsInputModel, ListPayoutsOutputModel } from "./payout.schema.js";
2
+ import { defineQuery } from "@contractspec/lib.contracts/operations";
3
+
4
+ //#region src/payout/payout.operations.ts
5
+ const OWNERS = ["@example.marketplace"];
6
+ /**
7
+ * List payouts for a store.
8
+ */
9
+ const ListPayoutsContract = defineQuery({
10
+ meta: {
11
+ key: "marketplace.payout.list",
12
+ version: 1,
13
+ stability: "stable",
14
+ owners: [...OWNERS],
15
+ tags: [
16
+ "marketplace",
17
+ "payout",
18
+ "list"
19
+ ],
20
+ description: "List payouts for a store.",
21
+ goal: "View payout history.",
22
+ context: "Seller dashboard."
23
+ },
24
+ io: {
25
+ input: ListPayoutsInputModel,
26
+ output: ListPayoutsOutputModel
27
+ },
28
+ policy: { auth: "user" },
29
+ acceptance: {
30
+ scenarios: [{
31
+ key: "list-payouts-happy-path",
32
+ given: ["Store has payout history"],
33
+ when: ["Seller lists payouts"],
34
+ then: ["List of payouts is returned"]
35
+ }],
36
+ examples: [{
37
+ key: "list-recent",
38
+ input: {
39
+ limit: 10,
40
+ offset: 0
41
+ },
42
+ output: {
43
+ items: [],
44
+ total: 5,
45
+ hasMore: false
46
+ }
47
+ }]
48
+ }
49
+ });
50
+
51
+ //#endregion
52
+ export { ListPayoutsContract };
53
+ //# sourceMappingURL=payout.operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.operations.js","names":[],"sources":["../../src/payout/payout.operations.ts"],"sourcesContent":["import { defineQuery } from '@contractspec/lib.contracts/operations';\nimport { ListPayoutsInputModel, ListPayoutsOutputModel } from './payout.schema';\n\nconst OWNERS = ['@example.marketplace'] as const;\n\n/**\n * List payouts for a store.\n */\nexport const ListPayoutsContract = defineQuery({\n meta: {\n key: 'marketplace.payout.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['marketplace', 'payout', 'list'],\n description: 'List payouts for a store.',\n goal: 'View payout history.',\n context: 'Seller dashboard.',\n },\n io: { input: ListPayoutsInputModel, output: ListPayoutsOutputModel },\n policy: { auth: 'user' },\n acceptance: {\n scenarios: [\n {\n key: 'list-payouts-happy-path',\n given: ['Store has payout history'],\n when: ['Seller lists payouts'],\n then: ['List of payouts is returned'],\n },\n ],\n examples: [\n {\n key: 'list-recent',\n input: { limit: 10, offset: 0 },\n output: { items: [], total: 5, hasMore: false },\n },\n ],\n },\n});\n"],"mappings":";;;;AAGA,MAAM,SAAS,CAAC,uBAAuB;;;;AAKvC,MAAa,sBAAsB,YAAY;CAC7C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAe;GAAU;GAAO;EACvC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EAAE,OAAO;EAAuB,QAAQ;EAAwB;CACpE,QAAQ,EAAE,MAAM,QAAQ;CACxB,YAAY;EACV,WAAW,CACT;GACE,KAAK;GACL,OAAO,CAAC,2BAA2B;GACnC,MAAM,CAAC,uBAAuB;GAC9B,MAAM,CAAC,8BAA8B;GACtC,CACF;EACD,UAAU,CACR;GACE,KAAK;GACL,OAAO;IAAE,OAAO;IAAI,QAAQ;IAAG;GAC/B,QAAQ;IAAE,OAAO,EAAE;IAAE,OAAO;IAAG,SAAS;IAAO;GAChD,CACF;EACF;CACF,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { PresentationSpec } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/payout/payout.presentation.d.ts
4
+ declare const PayoutListPresentation: PresentationSpec;
5
+ declare const PayoutDetailPresentation: PresentationSpec;
6
+ //#endregion
7
+ export { PayoutDetailPresentation, PayoutListPresentation };
8
+ //# sourceMappingURL=payout.presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.presentation.d.ts","names":[],"sources":["../../src/payout/payout.presentation.ts"],"sourcesContent":[],"mappings":";;;cAIa,wBAAwB;cAyBxB,0BAA0B"}
@@ -0,0 +1,60 @@
1
+ import { PayoutModel } from "./payout.schema.js";
2
+ import { StabilityEnum } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/payout/payout.presentation.ts
5
+ const PayoutListPresentation = {
6
+ meta: {
7
+ key: "marketplace.payout.list",
8
+ version: 1,
9
+ title: "Payout List",
10
+ description: "List of payouts for sellers",
11
+ domain: "marketplace",
12
+ owners: ["@marketplace-team"],
13
+ tags: [
14
+ "marketplace",
15
+ "payout",
16
+ "list"
17
+ ],
18
+ stability: StabilityEnum.Experimental,
19
+ goal: "Show sellers their historical and pending payouts.",
20
+ context: "Financial dashboard for sellers."
21
+ },
22
+ source: {
23
+ type: "component",
24
+ framework: "react",
25
+ componentKey: "PayoutList",
26
+ props: PayoutModel
27
+ },
28
+ targets: ["react", "markdown"],
29
+ policy: { flags: ["marketplace.payouts.enabled"] }
30
+ };
31
+ const PayoutDetailPresentation = {
32
+ meta: {
33
+ key: "marketplace.payout.detail",
34
+ version: 1,
35
+ title: "Payout Details",
36
+ description: "Payout detail with breakdown",
37
+ domain: "marketplace",
38
+ owners: ["@marketplace-team"],
39
+ tags: [
40
+ "marketplace",
41
+ "payout",
42
+ "detail"
43
+ ],
44
+ stability: StabilityEnum.Experimental,
45
+ goal: "Show the breakdown of a specific payout including fees and orders.",
46
+ context: "Accessed from the payout list."
47
+ },
48
+ source: {
49
+ type: "component",
50
+ framework: "react",
51
+ componentKey: "PayoutDetail",
52
+ props: PayoutModel
53
+ },
54
+ targets: ["react", "markdown"],
55
+ policy: { flags: ["marketplace.payouts.enabled"] }
56
+ };
57
+
58
+ //#endregion
59
+ export { PayoutDetailPresentation, PayoutListPresentation };
60
+ //# sourceMappingURL=payout.presentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.presentation.js","names":["PayoutListPresentation: PresentationSpec","PayoutDetailPresentation: PresentationSpec"],"sources":["../../src/payout/payout.presentation.ts"],"sourcesContent":["import type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\nimport { PayoutModel } from './payout.schema';\n\nexport const PayoutListPresentation: PresentationSpec = {\n meta: {\n key: 'marketplace.payout.list',\n version: 1,\n title: 'Payout List',\n description: 'List of payouts for sellers',\n domain: 'marketplace',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'payout', 'list'],\n stability: StabilityEnum.Experimental,\n goal: 'Show sellers their historical and pending payouts.',\n context: 'Financial dashboard for sellers.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'PayoutList',\n props: PayoutModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['marketplace.payouts.enabled'],\n },\n};\n\nexport const PayoutDetailPresentation: PresentationSpec = {\n meta: {\n key: 'marketplace.payout.detail',\n version: 1,\n title: 'Payout Details',\n description: 'Payout detail with breakdown',\n domain: 'marketplace',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'payout', 'detail'],\n stability: StabilityEnum.Experimental,\n goal: 'Show the breakdown of a specific payout including fees and orders.',\n context: 'Accessed from the payout list.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'PayoutDetail',\n props: PayoutModel,\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['marketplace.payouts.enabled'],\n },\n};\n"],"mappings":";;;;AAIA,MAAaA,yBAA2C;CACtD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAU;GAAO;EACvC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,8BAA8B,EACvC;CACF;AAED,MAAaC,2BAA6C;CACxD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,oBAAoB;EAC7B,MAAM;GAAC;GAAe;GAAU;GAAS;EACzC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,8BAA8B,EACvC;CACF"}
@@ -0,0 +1,157 @@
1
+ import * as _contractspec_lib_schema904 from "@contractspec/lib.schema";
2
+
3
+ //#region src/payout/payout.schema.d.ts
4
+ /**
5
+ * A payout to seller.
6
+ */
7
+ declare const PayoutModel: _contractspec_lib_schema904.SchemaModel<{
8
+ id: {
9
+ type: _contractspec_lib_schema904.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ payoutNumber: {
13
+ type: _contractspec_lib_schema904.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ storeId: {
17
+ type: _contractspec_lib_schema904.FieldType<string, string>;
18
+ isOptional: false;
19
+ };
20
+ status: {
21
+ type: _contractspec_lib_schema904.EnumType<[string, string, string, string, string]>;
22
+ isOptional: false;
23
+ };
24
+ grossAmount: {
25
+ type: _contractspec_lib_schema904.FieldType<number, number>;
26
+ isOptional: false;
27
+ };
28
+ platformFees: {
29
+ type: _contractspec_lib_schema904.FieldType<number, number>;
30
+ isOptional: false;
31
+ };
32
+ netAmount: {
33
+ type: _contractspec_lib_schema904.FieldType<number, number>;
34
+ isOptional: false;
35
+ };
36
+ currency: {
37
+ type: _contractspec_lib_schema904.FieldType<string, string>;
38
+ isOptional: false;
39
+ };
40
+ periodStart: {
41
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
42
+ isOptional: false;
43
+ };
44
+ periodEnd: {
45
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
46
+ isOptional: false;
47
+ };
48
+ orderCount: {
49
+ type: _contractspec_lib_schema904.FieldType<number, number>;
50
+ isOptional: false;
51
+ };
52
+ createdAt: {
53
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
54
+ isOptional: false;
55
+ };
56
+ paidAt: {
57
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
58
+ isOptional: true;
59
+ };
60
+ }>;
61
+ /**
62
+ * Input for listing payouts.
63
+ */
64
+ declare const ListPayoutsInputModel: _contractspec_lib_schema904.SchemaModel<{
65
+ storeId: {
66
+ type: _contractspec_lib_schema904.FieldType<string, string>;
67
+ isOptional: false;
68
+ };
69
+ status: {
70
+ type: _contractspec_lib_schema904.EnumType<[string, string, string, string, string]>;
71
+ isOptional: true;
72
+ };
73
+ limit: {
74
+ type: _contractspec_lib_schema904.FieldType<number, number>;
75
+ isOptional: true;
76
+ defaultValue: number;
77
+ };
78
+ offset: {
79
+ type: _contractspec_lib_schema904.FieldType<number, number>;
80
+ isOptional: true;
81
+ defaultValue: number;
82
+ };
83
+ }>;
84
+ /**
85
+ * Output for listing payouts.
86
+ */
87
+ declare const ListPayoutsOutputModel: _contractspec_lib_schema904.SchemaModel<{
88
+ payouts: {
89
+ type: _contractspec_lib_schema904.SchemaModel<{
90
+ id: {
91
+ type: _contractspec_lib_schema904.FieldType<string, string>;
92
+ isOptional: false;
93
+ };
94
+ payoutNumber: {
95
+ type: _contractspec_lib_schema904.FieldType<string, string>;
96
+ isOptional: false;
97
+ };
98
+ storeId: {
99
+ type: _contractspec_lib_schema904.FieldType<string, string>;
100
+ isOptional: false;
101
+ };
102
+ status: {
103
+ type: _contractspec_lib_schema904.EnumType<[string, string, string, string, string]>;
104
+ isOptional: false;
105
+ };
106
+ grossAmount: {
107
+ type: _contractspec_lib_schema904.FieldType<number, number>;
108
+ isOptional: false;
109
+ };
110
+ platformFees: {
111
+ type: _contractspec_lib_schema904.FieldType<number, number>;
112
+ isOptional: false;
113
+ };
114
+ netAmount: {
115
+ type: _contractspec_lib_schema904.FieldType<number, number>;
116
+ isOptional: false;
117
+ };
118
+ currency: {
119
+ type: _contractspec_lib_schema904.FieldType<string, string>;
120
+ isOptional: false;
121
+ };
122
+ periodStart: {
123
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
124
+ isOptional: false;
125
+ };
126
+ periodEnd: {
127
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
128
+ isOptional: false;
129
+ };
130
+ orderCount: {
131
+ type: _contractspec_lib_schema904.FieldType<number, number>;
132
+ isOptional: false;
133
+ };
134
+ createdAt: {
135
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
136
+ isOptional: false;
137
+ };
138
+ paidAt: {
139
+ type: _contractspec_lib_schema904.FieldType<Date, string>;
140
+ isOptional: true;
141
+ };
142
+ }>;
143
+ isArray: true;
144
+ isOptional: false;
145
+ };
146
+ total: {
147
+ type: _contractspec_lib_schema904.FieldType<number, number>;
148
+ isOptional: false;
149
+ };
150
+ totalPending: {
151
+ type: _contractspec_lib_schema904.FieldType<number, number>;
152
+ isOptional: false;
153
+ };
154
+ }>;
155
+ //#endregion
156
+ export { ListPayoutsInputModel, ListPayoutsOutputModel, PayoutModel };
157
+ //# sourceMappingURL=payout.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.schema.d.ts","names":[],"sources":["../../src/payout/payout.schema.ts"],"sourcesContent":[],"mappings":";;;;;;AAMa,cAAA,WAkBX,8BAlBsB,WAkBtB,CAAA;EAAA,EAAA,EAAA;UAAA,2BAAA,CAAA;;;;;;;;;;;;;;;;+CAlBsB,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAuBX,CAAA;EAgBX,YAAA,EAAA;;;;;IAhBgC,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAqBrB,UAAA,EAAA,KAAA;EAOX,CAAA;;;;;;;;;;;;;;;;;;;;;EAPiC,MAAA,EAAA;;;;;;;;cArBtB,mDAAqB;;UAgBhC,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cAKW,oDAAsB;;;;cAOjC,2BAAA,CAAA"}
@@ -0,0 +1,116 @@
1
+ import { PayoutStatusEnum } from "./payout.enum.js";
2
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+
4
+ //#region src/payout/payout.schema.ts
5
+ /**
6
+ * A payout to seller.
7
+ */
8
+ const PayoutModel = defineSchemaModel({
9
+ name: "PayoutModel",
10
+ description: "A payout to seller",
11
+ fields: {
12
+ id: {
13
+ type: ScalarTypeEnum.String_unsecure(),
14
+ isOptional: false
15
+ },
16
+ payoutNumber: {
17
+ type: ScalarTypeEnum.String_unsecure(),
18
+ isOptional: false
19
+ },
20
+ storeId: {
21
+ type: ScalarTypeEnum.String_unsecure(),
22
+ isOptional: false
23
+ },
24
+ status: {
25
+ type: PayoutStatusEnum,
26
+ isOptional: false
27
+ },
28
+ grossAmount: {
29
+ type: ScalarTypeEnum.Float_unsecure(),
30
+ isOptional: false
31
+ },
32
+ platformFees: {
33
+ type: ScalarTypeEnum.Float_unsecure(),
34
+ isOptional: false
35
+ },
36
+ netAmount: {
37
+ type: ScalarTypeEnum.Float_unsecure(),
38
+ isOptional: false
39
+ },
40
+ currency: {
41
+ type: ScalarTypeEnum.String_unsecure(),
42
+ isOptional: false
43
+ },
44
+ periodStart: {
45
+ type: ScalarTypeEnum.DateTime(),
46
+ isOptional: false
47
+ },
48
+ periodEnd: {
49
+ type: ScalarTypeEnum.DateTime(),
50
+ isOptional: false
51
+ },
52
+ orderCount: {
53
+ type: ScalarTypeEnum.Int_unsecure(),
54
+ isOptional: false
55
+ },
56
+ createdAt: {
57
+ type: ScalarTypeEnum.DateTime(),
58
+ isOptional: false
59
+ },
60
+ paidAt: {
61
+ type: ScalarTypeEnum.DateTime(),
62
+ isOptional: true
63
+ }
64
+ }
65
+ });
66
+ /**
67
+ * Input for listing payouts.
68
+ */
69
+ const ListPayoutsInputModel = defineSchemaModel({
70
+ name: "ListPayoutsInput",
71
+ fields: {
72
+ storeId: {
73
+ type: ScalarTypeEnum.String_unsecure(),
74
+ isOptional: false
75
+ },
76
+ status: {
77
+ type: PayoutStatusEnum,
78
+ isOptional: true
79
+ },
80
+ limit: {
81
+ type: ScalarTypeEnum.Int_unsecure(),
82
+ isOptional: true,
83
+ defaultValue: 20
84
+ },
85
+ offset: {
86
+ type: ScalarTypeEnum.Int_unsecure(),
87
+ isOptional: true,
88
+ defaultValue: 0
89
+ }
90
+ }
91
+ });
92
+ /**
93
+ * Output for listing payouts.
94
+ */
95
+ const ListPayoutsOutputModel = defineSchemaModel({
96
+ name: "ListPayoutsOutput",
97
+ fields: {
98
+ payouts: {
99
+ type: PayoutModel,
100
+ isArray: true,
101
+ isOptional: false
102
+ },
103
+ total: {
104
+ type: ScalarTypeEnum.Int_unsecure(),
105
+ isOptional: false
106
+ },
107
+ totalPending: {
108
+ type: ScalarTypeEnum.Float_unsecure(),
109
+ isOptional: false
110
+ }
111
+ }
112
+ });
113
+
114
+ //#endregion
115
+ export { ListPayoutsInputModel, ListPayoutsOutputModel, PayoutModel };
116
+ //# sourceMappingURL=payout.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.schema.js","names":[],"sources":["../../src/payout/payout.schema.ts"],"sourcesContent":["import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';\nimport { PayoutStatusEnum } from './payout.enum';\n\n/**\n * A payout to seller.\n */\nexport const PayoutModel = defineSchemaModel({\n name: 'PayoutModel',\n description: 'A payout to seller',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n payoutNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: PayoutStatusEnum, isOptional: false },\n grossAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n platformFees: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n netAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n periodStart: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n periodEnd: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n orderCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n paidAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\n/**\n * Input for listing payouts.\n */\nexport const ListPayoutsInputModel = defineSchemaModel({\n name: 'ListPayoutsInput',\n fields: {\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: PayoutStatusEnum, isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 20,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\n/**\n * Output for listing payouts.\n */\nexport const ListPayoutsOutputModel = defineSchemaModel({\n name: 'ListPayoutsOutput',\n fields: {\n payouts: { type: PayoutModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalPending: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n },\n});\n"],"mappings":";;;;;;;AAMA,MAAa,cAAc,kBAAkB;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM;GAAkB,YAAY;GAAO;EACrD,aAAa;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACzE,cAAc;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAC1E,WAAW;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACvE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,aAAa;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACnE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACjE,YAAY;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACtE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EACjE,QAAQ;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAC9D;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,kBAAkB;CACrD,MAAM;CACN,QAAQ;EACN,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,QAAQ;GAAE,MAAM;GAAkB,YAAY;GAAM;EACpD,OAAO;GACL,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACD,QAAQ;GACN,MAAM,eAAe,cAAc;GACnC,YAAY;GACZ,cAAc;GACf;EACF;CACF,CAAC;;;;AAKF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,QAAQ;EACN,SAAS;GAAE,MAAM;GAAa,SAAS;GAAM,YAAY;GAAO;EAChE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACjE,cAAc;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EAC3E;CACF,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ProductStatusEnum } from "./product.enum.js";
2
+ import { CreateProductInputModel, ListProductsInputModel, ListProductsOutputModel, ProductModel } from "./product.schema.js";
3
+ import { CreateProductContract, ListProductsContract } from "./product.operations.js";
4
+ import { InventoryUpdatedEvent, ProductCreatedEvent, ProductPublishedEvent } from "./product.event.js";
5
+ export { CreateProductContract, CreateProductInputModel, InventoryUpdatedEvent, ListProductsContract, ListProductsInputModel, ListProductsOutputModel, ProductCreatedEvent, ProductModel, ProductPublishedEvent, ProductStatusEnum };
@@ -0,0 +1,6 @@
1
+ import { ProductStatusEnum } from "./product.enum.js";
2
+ import { CreateProductInputModel, ListProductsInputModel, ListProductsOutputModel, ProductModel } from "./product.schema.js";
3
+ import { CreateProductContract, ListProductsContract } from "./product.operations.js";
4
+ import { InventoryUpdatedEvent, ProductCreatedEvent, ProductPublishedEvent } from "./product.event.js";
5
+
6
+ export { CreateProductContract, CreateProductInputModel, InventoryUpdatedEvent, ListProductsContract, ListProductsInputModel, ListProductsOutputModel, ProductCreatedEvent, ProductModel, ProductPublishedEvent, ProductStatusEnum };
@@ -0,0 +1,10 @@
1
+ import * as _contractspec_lib_schema991 from "@contractspec/lib.schema";
2
+
3
+ //#region src/product/product.enum.d.ts
4
+ /**
5
+ * Product status enum.
6
+ */
7
+ declare const ProductStatusEnum: _contractspec_lib_schema991.EnumType<[string, string, string, string, string, string]>;
8
+ //#endregion
9
+ export { ProductStatusEnum };
10
+ //# sourceMappingURL=product.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.enum.d.ts","names":[],"sources":["../../src/product/product.enum.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,iBAOX,EAAA,2BAAA,CAP4B,QAAA,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { defineEnum } from "@contractspec/lib.schema";
2
+
3
+ //#region src/product/product.enum.ts
4
+ /**
5
+ * Product status enum.
6
+ */
7
+ const ProductStatusEnum = defineEnum("ProductStatus", [
8
+ "DRAFT",
9
+ "PENDING_REVIEW",
10
+ "ACTIVE",
11
+ "OUT_OF_STOCK",
12
+ "DISCONTINUED",
13
+ "REJECTED"
14
+ ]);
15
+
16
+ //#endregion
17
+ export { ProductStatusEnum };
18
+ //# sourceMappingURL=product.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.enum.js","names":[],"sources":["../../src/product/product.enum.ts"],"sourcesContent":["import { defineEnum } from '@contractspec/lib.schema';\n\n/**\n * Product status enum.\n */\nexport const ProductStatusEnum = defineEnum('ProductStatus', [\n 'DRAFT',\n 'PENDING_REVIEW',\n 'ACTIVE',\n 'OUT_OF_STOCK',\n 'DISCONTINUED',\n 'REJECTED',\n]);\n"],"mappings":";;;;;;AAKA,MAAa,oBAAoB,WAAW,iBAAiB;CAC3D;CACA;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -0,0 +1,73 @@
1
+ import * as _contractspec_lib_schema798 from "@contractspec/lib.schema";
2
+ import * as _contractspec_lib_contracts8 from "@contractspec/lib.contracts";
3
+
4
+ //#region src/product/product.event.d.ts
5
+ declare const ProductCreatedEvent: _contractspec_lib_contracts8.EventSpec<_contractspec_lib_schema798.SchemaModel<{
6
+ productId: {
7
+ type: _contractspec_lib_schema798.FieldType<string, string>;
8
+ isOptional: false;
9
+ };
10
+ storeId: {
11
+ type: _contractspec_lib_schema798.FieldType<string, string>;
12
+ isOptional: false;
13
+ };
14
+ name: {
15
+ type: _contractspec_lib_schema798.FieldType<string, string>;
16
+ isOptional: false;
17
+ };
18
+ price: {
19
+ type: _contractspec_lib_schema798.FieldType<number, number>;
20
+ isOptional: false;
21
+ };
22
+ currency: {
23
+ type: _contractspec_lib_schema798.FieldType<string, string>;
24
+ isOptional: false;
25
+ };
26
+ timestamp: {
27
+ type: _contractspec_lib_schema798.FieldType<Date, string>;
28
+ isOptional: false;
29
+ };
30
+ }>>;
31
+ declare const ProductPublishedEvent: _contractspec_lib_contracts8.EventSpec<_contractspec_lib_schema798.SchemaModel<{
32
+ productId: {
33
+ type: _contractspec_lib_schema798.FieldType<string, string>;
34
+ isOptional: false;
35
+ };
36
+ storeId: {
37
+ type: _contractspec_lib_schema798.FieldType<string, string>;
38
+ isOptional: false;
39
+ };
40
+ timestamp: {
41
+ type: _contractspec_lib_schema798.FieldType<Date, string>;
42
+ isOptional: false;
43
+ };
44
+ }>>;
45
+ declare const InventoryUpdatedEvent: _contractspec_lib_contracts8.EventSpec<_contractspec_lib_schema798.SchemaModel<{
46
+ productId: {
47
+ type: _contractspec_lib_schema798.FieldType<string, string>;
48
+ isOptional: false;
49
+ };
50
+ variantId: {
51
+ type: _contractspec_lib_schema798.FieldType<string, string>;
52
+ isOptional: true;
53
+ };
54
+ previousQuantity: {
55
+ type: _contractspec_lib_schema798.FieldType<number, number>;
56
+ isOptional: false;
57
+ };
58
+ newQuantity: {
59
+ type: _contractspec_lib_schema798.FieldType<number, number>;
60
+ isOptional: false;
61
+ };
62
+ reason: {
63
+ type: _contractspec_lib_schema798.FieldType<string, string>;
64
+ isOptional: false;
65
+ };
66
+ timestamp: {
67
+ type: _contractspec_lib_schema798.FieldType<Date, string>;
68
+ isOptional: false;
69
+ };
70
+ }>>;
71
+ //#endregion
72
+ export { InventoryUpdatedEvent, ProductCreatedEvent, ProductPublishedEvent };
73
+ //# sourceMappingURL=product.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.event.d.ts","names":[],"sources":["../../src/product/product.event.ts"],"sourcesContent":[],"mappings":";;;;cAuCa,qBAAmB,4BAAA,CAAA,sCAAA;;UAU9B,2BAAA,CAAA;;EAVW,CAAA;EAUX,OAAA,EAAA;;;;;;;;EAV8B,KAAA,EAAA;IAAA,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAYnB,UAAA,EAAA,KAAA;EAUX,CAAA;;;;;EAVgC,SAAA,EAAA;IAAA,IAAA,uCAAA,KAAA,EAAA,MAAA,CAAA;IAYrB,UAAA,EAAA,KAAA;EAUX,CAAA;;cAtBW,uBAAqB,4BAAA,CAAA,sCAAA;;UAUhC,2BAAA,CAAA;;;;IAEgC,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;cAArB,uBAAqB,4BAAA,CAAA,sCAAA;;UAUhC,2BAAA,CAAA"}
@@ -0,0 +1,120 @@
1
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineEvent } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/product/product.event.ts
5
+ const ProductCreatedPayload = defineSchemaModel({
6
+ name: "ProductCreatedEventPayload",
7
+ fields: {
8
+ productId: {
9
+ type: ScalarTypeEnum.String_unsecure(),
10
+ isOptional: false
11
+ },
12
+ storeId: {
13
+ type: ScalarTypeEnum.String_unsecure(),
14
+ isOptional: false
15
+ },
16
+ name: {
17
+ type: ScalarTypeEnum.String_unsecure(),
18
+ isOptional: false
19
+ },
20
+ price: {
21
+ type: ScalarTypeEnum.Float_unsecure(),
22
+ isOptional: false
23
+ },
24
+ currency: {
25
+ type: ScalarTypeEnum.String_unsecure(),
26
+ isOptional: false
27
+ },
28
+ timestamp: {
29
+ type: ScalarTypeEnum.DateTime(),
30
+ isOptional: false
31
+ }
32
+ }
33
+ });
34
+ const ProductPublishedPayload = defineSchemaModel({
35
+ name: "ProductPublishedEventPayload",
36
+ fields: {
37
+ productId: {
38
+ type: ScalarTypeEnum.String_unsecure(),
39
+ isOptional: false
40
+ },
41
+ storeId: {
42
+ type: ScalarTypeEnum.String_unsecure(),
43
+ isOptional: false
44
+ },
45
+ timestamp: {
46
+ type: ScalarTypeEnum.DateTime(),
47
+ isOptional: false
48
+ }
49
+ }
50
+ });
51
+ const InventoryUpdatedPayload = defineSchemaModel({
52
+ name: "InventoryUpdatedEventPayload",
53
+ fields: {
54
+ productId: {
55
+ type: ScalarTypeEnum.String_unsecure(),
56
+ isOptional: false
57
+ },
58
+ variantId: {
59
+ type: ScalarTypeEnum.String_unsecure(),
60
+ isOptional: true
61
+ },
62
+ previousQuantity: {
63
+ type: ScalarTypeEnum.Int_unsecure(),
64
+ isOptional: false
65
+ },
66
+ newQuantity: {
67
+ type: ScalarTypeEnum.Int_unsecure(),
68
+ isOptional: false
69
+ },
70
+ reason: {
71
+ type: ScalarTypeEnum.String_unsecure(),
72
+ isOptional: false
73
+ },
74
+ timestamp: {
75
+ type: ScalarTypeEnum.DateTime(),
76
+ isOptional: false
77
+ }
78
+ }
79
+ });
80
+ const ProductCreatedEvent = defineEvent({
81
+ meta: {
82
+ key: "marketplace.product.created",
83
+ version: 1,
84
+ description: "A new product has been created.",
85
+ stability: "experimental",
86
+ owners: ["@marketplace-team"],
87
+ tags: ["marketplace", "product"]
88
+ },
89
+ payload: ProductCreatedPayload
90
+ });
91
+ const ProductPublishedEvent = defineEvent({
92
+ meta: {
93
+ key: "marketplace.product.published",
94
+ version: 1,
95
+ description: "A product has been published.",
96
+ stability: "experimental",
97
+ owners: ["@marketplace-team"],
98
+ tags: ["marketplace", "product"]
99
+ },
100
+ payload: ProductPublishedPayload
101
+ });
102
+ const InventoryUpdatedEvent = defineEvent({
103
+ meta: {
104
+ key: "marketplace.inventory.updated",
105
+ version: 1,
106
+ description: "Product inventory has been updated.",
107
+ stability: "experimental",
108
+ owners: ["@marketplace-team"],
109
+ tags: [
110
+ "marketplace",
111
+ "product",
112
+ "inventory"
113
+ ]
114
+ },
115
+ payload: InventoryUpdatedPayload
116
+ });
117
+
118
+ //#endregion
119
+ export { InventoryUpdatedEvent, ProductCreatedEvent, ProductPublishedEvent };
120
+ //# sourceMappingURL=product.event.js.map