@contractspec/example.marketplace 0.0.0-canary-20260113170453

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 (188) 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 +7 -0
  33. package/dist/example.d.ts.map +1 -0
  34. package/dist/example.js +58 -0
  35. package/dist/example.js.map +1 -0
  36. package/dist/handlers/index.d.ts +2 -0
  37. package/dist/handlers/index.js +3 -0
  38. package/dist/handlers/marketplace.handlers.d.ts +155 -0
  39. package/dist/handlers/marketplace.handlers.d.ts.map +1 -0
  40. package/dist/handlers/marketplace.handlers.js +329 -0
  41. package/dist/handlers/marketplace.handlers.js.map +1 -0
  42. package/dist/index.d.ts +31 -0
  43. package/dist/index.js +32 -0
  44. package/dist/marketplace.capability.d.ts +9 -0
  45. package/dist/marketplace.capability.d.ts.map +1 -0
  46. package/dist/marketplace.capability.js +34 -0
  47. package/dist/marketplace.capability.js.map +1 -0
  48. package/dist/marketplace.feature.d.ts +12 -0
  49. package/dist/marketplace.feature.d.ts.map +1 -0
  50. package/dist/marketplace.feature.js +315 -0
  51. package/dist/marketplace.feature.js.map +1 -0
  52. package/dist/order/index.d.ts +5 -0
  53. package/dist/order/index.js +6 -0
  54. package/dist/order/order.enum.d.ts +10 -0
  55. package/dist/order/order.enum.d.ts.map +1 -0
  56. package/dist/order/order.enum.js +22 -0
  57. package/dist/order/order.enum.js.map +1 -0
  58. package/dist/order/order.event.d.ts +145 -0
  59. package/dist/order/order.event.d.ts.map +1 -0
  60. package/dist/order/order.event.js +216 -0
  61. package/dist/order/order.event.js.map +1 -0
  62. package/dist/order/order.operations.d.ts +368 -0
  63. package/dist/order/order.operations.d.ts.map +1 -0
  64. package/dist/order/order.operations.js +119 -0
  65. package/dist/order/order.operations.js.map +1 -0
  66. package/dist/order/order.presentation.d.ts +9 -0
  67. package/dist/order/order.presentation.d.ts.map +1 -0
  68. package/dist/order/order.presentation.js +86 -0
  69. package/dist/order/order.presentation.js.map +1 -0
  70. package/dist/order/order.schema.d.ts +165 -0
  71. package/dist/order/order.schema.d.ts.map +1 -0
  72. package/dist/order/order.schema.js +155 -0
  73. package/dist/order/order.schema.js.map +1 -0
  74. package/dist/payout/index.d.ts +5 -0
  75. package/dist/payout/index.js +6 -0
  76. package/dist/payout/payout.enum.d.ts +10 -0
  77. package/dist/payout/payout.enum.d.ts.map +1 -0
  78. package/dist/payout/payout.enum.js +17 -0
  79. package/dist/payout/payout.enum.js.map +1 -0
  80. package/dist/payout/payout.event.d.ts +63 -0
  81. package/dist/payout/payout.event.d.ts.map +1 -0
  82. package/dist/payout/payout.event.js +92 -0
  83. package/dist/payout/payout.event.js.map +1 -0
  84. package/dist/payout/payout.operations.d.ts +97 -0
  85. package/dist/payout/payout.operations.d.ts.map +1 -0
  86. package/dist/payout/payout.operations.js +53 -0
  87. package/dist/payout/payout.operations.js.map +1 -0
  88. package/dist/payout/payout.presentation.d.ts +8 -0
  89. package/dist/payout/payout.presentation.d.ts.map +1 -0
  90. package/dist/payout/payout.presentation.js +60 -0
  91. package/dist/payout/payout.presentation.js.map +1 -0
  92. package/dist/payout/payout.schema.d.ts +157 -0
  93. package/dist/payout/payout.schema.d.ts.map +1 -0
  94. package/dist/payout/payout.schema.js +116 -0
  95. package/dist/payout/payout.schema.js.map +1 -0
  96. package/dist/product/index.d.ts +5 -0
  97. package/dist/product/index.js +6 -0
  98. package/dist/product/product.enum.d.ts +10 -0
  99. package/dist/product/product.enum.d.ts.map +1 -0
  100. package/dist/product/product.enum.js +18 -0
  101. package/dist/product/product.enum.js.map +1 -0
  102. package/dist/product/product.event.d.ts +73 -0
  103. package/dist/product/product.event.d.ts.map +1 -0
  104. package/dist/product/product.event.js +120 -0
  105. package/dist/product/product.event.js.map +1 -0
  106. package/dist/product/product.operations.d.ts +273 -0
  107. package/dist/product/product.operations.d.ts.map +1 -0
  108. package/dist/product/product.operations.js +108 -0
  109. package/dist/product/product.operations.js.map +1 -0
  110. package/dist/product/product.presentation.d.ts +9 -0
  111. package/dist/product/product.presentation.d.ts.map +1 -0
  112. package/dist/product/product.presentation.js +86 -0
  113. package/dist/product/product.presentation.js.map +1 -0
  114. package/dist/product/product.schema.d.ts +218 -0
  115. package/dist/product/product.schema.d.ts.map +1 -0
  116. package/dist/product/product.schema.js +176 -0
  117. package/dist/product/product.schema.js.map +1 -0
  118. package/dist/review/index.d.ts +5 -0
  119. package/dist/review/index.js +6 -0
  120. package/dist/review/review.enum.d.ts +10 -0
  121. package/dist/review/review.enum.d.ts.map +1 -0
  122. package/dist/review/review.enum.js +16 -0
  123. package/dist/review/review.enum.js.map +1 -0
  124. package/dist/review/review.event.d.ts +55 -0
  125. package/dist/review/review.event.d.ts.map +1 -0
  126. package/dist/review/review.event.js +84 -0
  127. package/dist/review/review.event.js.map +1 -0
  128. package/dist/review/review.operations.d.ts +237 -0
  129. package/dist/review/review.operations.d.ts.map +1 -0
  130. package/dist/review/review.operations.js +106 -0
  131. package/dist/review/review.operations.js.map +1 -0
  132. package/dist/review/review.presentation.d.ts +8 -0
  133. package/dist/review/review.presentation.d.ts.map +1 -0
  134. package/dist/review/review.presentation.js +60 -0
  135. package/dist/review/review.presentation.js.map +1 -0
  136. package/dist/review/review.schema.d.ts +190 -0
  137. package/dist/review/review.schema.d.ts.map +1 -0
  138. package/dist/review/review.schema.js +156 -0
  139. package/dist/review/review.schema.js.map +1 -0
  140. package/dist/seeders/index.d.ts +10 -0
  141. package/dist/seeders/index.d.ts.map +1 -0
  142. package/dist/seeders/index.js +18 -0
  143. package/dist/seeders/index.js.map +1 -0
  144. package/dist/store/index.d.ts +5 -0
  145. package/dist/store/index.js +6 -0
  146. package/dist/store/store.enum.d.ts +10 -0
  147. package/dist/store/store.enum.d.ts.map +1 -0
  148. package/dist/store/store.enum.js +16 -0
  149. package/dist/store/store.enum.js.map +1 -0
  150. package/dist/store/store.event.d.ts +51 -0
  151. package/dist/store/store.event.d.ts.map +1 -0
  152. package/dist/store/store.event.js +80 -0
  153. package/dist/store/store.event.js.map +1 -0
  154. package/dist/store/store.operations.d.ts +131 -0
  155. package/dist/store/store.operations.d.ts.map +1 -0
  156. package/dist/store/store.operations.js +61 -0
  157. package/dist/store/store.operations.js.map +1 -0
  158. package/dist/store/store.presentation.d.ts +8 -0
  159. package/dist/store/store.presentation.d.ts.map +1 -0
  160. package/dist/store/store.presentation.js +60 -0
  161. package/dist/store/store.presentation.js.map +1 -0
  162. package/dist/store/store.schema.d.ts +84 -0
  163. package/dist/store/store.schema.d.ts.map +1 -0
  164. package/dist/store/store.schema.js +93 -0
  165. package/dist/store/store.schema.js.map +1 -0
  166. package/dist/tests/operations.test-spec.d.ts +11 -0
  167. package/dist/tests/operations.test-spec.d.ts.map +1 -0
  168. package/dist/tests/operations.test-spec.js +152 -0
  169. package/dist/tests/operations.test-spec.js.map +1 -0
  170. package/dist/ui/MarketplaceDashboard.d.ts +7 -0
  171. package/dist/ui/MarketplaceDashboard.d.ts.map +1 -0
  172. package/dist/ui/MarketplaceDashboard.js +319 -0
  173. package/dist/ui/MarketplaceDashboard.js.map +1 -0
  174. package/dist/ui/hooks/index.d.ts +2 -0
  175. package/dist/ui/hooks/index.js +5 -0
  176. package/dist/ui/hooks/useMarketplaceData.d.ts +23 -0
  177. package/dist/ui/hooks/useMarketplaceData.d.ts.map +1 -0
  178. package/dist/ui/hooks/useMarketplaceData.js +64 -0
  179. package/dist/ui/hooks/useMarketplaceData.js.map +1 -0
  180. package/dist/ui/index.d.ts +6 -0
  181. package/dist/ui/index.js +6 -0
  182. package/dist/ui/renderers/index.d.ts +2 -0
  183. package/dist/ui/renderers/index.js +3 -0
  184. package/dist/ui/renderers/marketplace.markdown.d.ts +28 -0
  185. package/dist/ui/renderers/marketplace.markdown.d.ts.map +1 -0
  186. package/dist/ui/renderers/marketplace.markdown.js +244 -0
  187. package/dist/ui/renderers/marketplace.markdown.js.map +1 -0
  188. package/package.json +149 -0
@@ -0,0 +1,63 @@
1
+ import * as _contractspec_lib_contracts23 from "@contractspec/lib.contracts";
2
+ import * as _contractspec_lib_schema336 from "@contractspec/lib.schema";
3
+
4
+ //#region src/payout/payout.event.d.ts
5
+ declare const PayoutCreatedEvent: _contractspec_lib_contracts23.EventSpec<_contractspec_lib_schema336.SchemaModel<{
6
+ payoutId: {
7
+ type: _contractspec_lib_schema336.FieldType<string, string>;
8
+ isOptional: false;
9
+ };
10
+ payoutNumber: {
11
+ type: _contractspec_lib_schema336.FieldType<string, string>;
12
+ isOptional: false;
13
+ };
14
+ storeId: {
15
+ type: _contractspec_lib_schema336.FieldType<string, string>;
16
+ isOptional: false;
17
+ };
18
+ netAmount: {
19
+ type: _contractspec_lib_schema336.FieldType<number, number>;
20
+ isOptional: false;
21
+ };
22
+ currency: {
23
+ type: _contractspec_lib_schema336.FieldType<string, string>;
24
+ isOptional: false;
25
+ };
26
+ orderCount: {
27
+ type: _contractspec_lib_schema336.FieldType<number, number>;
28
+ isOptional: false;
29
+ };
30
+ timestamp: {
31
+ type: _contractspec_lib_schema336.FieldType<Date, string>;
32
+ isOptional: false;
33
+ };
34
+ }>>;
35
+ declare const PayoutPaidEvent: _contractspec_lib_contracts23.EventSpec<_contractspec_lib_schema336.SchemaModel<{
36
+ payoutId: {
37
+ type: _contractspec_lib_schema336.FieldType<string, string>;
38
+ isOptional: false;
39
+ };
40
+ payoutNumber: {
41
+ type: _contractspec_lib_schema336.FieldType<string, string>;
42
+ isOptional: false;
43
+ };
44
+ storeId: {
45
+ type: _contractspec_lib_schema336.FieldType<string, string>;
46
+ isOptional: false;
47
+ };
48
+ netAmount: {
49
+ type: _contractspec_lib_schema336.FieldType<number, number>;
50
+ isOptional: false;
51
+ };
52
+ paymentReference: {
53
+ type: _contractspec_lib_schema336.FieldType<string, string>;
54
+ isOptional: true;
55
+ };
56
+ timestamp: {
57
+ type: _contractspec_lib_schema336.FieldType<Date, string>;
58
+ isOptional: false;
59
+ };
60
+ }>>;
61
+ //#endregion
62
+ export { PayoutCreatedEvent, PayoutPaidEvent };
63
+ //# sourceMappingURL=payout.event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.event.d.ts","names":[],"sources":["../../src/payout/payout.event.ts"],"sourcesContent":[],"mappings":";;;;cA+Ba,oBAAkB,6BAAA,CAAA,sCAAA;;UAU7B,2BAAA,CAAA;;EAVW,CAAA;EAUX,YAAA,EAAA;;;;;;;;;IAV6B,IAAA,uCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAYlB,CAAA;EAUX,QAAA,EAAA;;;;;;;;EAV0B,SAAA,EAAA;IAAA,IAAA,uCAAA,KAAA,EAAA,MAAA,CAAA;;;;cAAf,iBAAe,6BAAA,CAAA,sCAAA;;UAU1B,2BAAA,CAAA"}
@@ -0,0 +1,92 @@
1
+ import { defineEvent } from "@contractspec/lib.contracts";
2
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+
4
+ //#region src/payout/payout.event.ts
5
+ const PayoutCreatedPayload = defineSchemaModel({
6
+ name: "PayoutCreatedEventPayload",
7
+ fields: {
8
+ payoutId: {
9
+ type: ScalarTypeEnum.String_unsecure(),
10
+ isOptional: false
11
+ },
12
+ payoutNumber: {
13
+ type: ScalarTypeEnum.String_unsecure(),
14
+ isOptional: false
15
+ },
16
+ storeId: {
17
+ type: ScalarTypeEnum.String_unsecure(),
18
+ isOptional: false
19
+ },
20
+ netAmount: {
21
+ type: ScalarTypeEnum.Float_unsecure(),
22
+ isOptional: false
23
+ },
24
+ currency: {
25
+ type: ScalarTypeEnum.String_unsecure(),
26
+ isOptional: false
27
+ },
28
+ orderCount: {
29
+ type: ScalarTypeEnum.Int_unsecure(),
30
+ isOptional: false
31
+ },
32
+ timestamp: {
33
+ type: ScalarTypeEnum.DateTime(),
34
+ isOptional: false
35
+ }
36
+ }
37
+ });
38
+ const PayoutPaidPayload = defineSchemaModel({
39
+ name: "PayoutPaidEventPayload",
40
+ fields: {
41
+ payoutId: {
42
+ type: ScalarTypeEnum.String_unsecure(),
43
+ isOptional: false
44
+ },
45
+ payoutNumber: {
46
+ type: ScalarTypeEnum.String_unsecure(),
47
+ isOptional: false
48
+ },
49
+ storeId: {
50
+ type: ScalarTypeEnum.String_unsecure(),
51
+ isOptional: false
52
+ },
53
+ netAmount: {
54
+ type: ScalarTypeEnum.Float_unsecure(),
55
+ isOptional: false
56
+ },
57
+ paymentReference: {
58
+ type: ScalarTypeEnum.String_unsecure(),
59
+ isOptional: true
60
+ },
61
+ timestamp: {
62
+ type: ScalarTypeEnum.DateTime(),
63
+ isOptional: false
64
+ }
65
+ }
66
+ });
67
+ const PayoutCreatedEvent = defineEvent({
68
+ meta: {
69
+ key: "marketplace.payout.created",
70
+ version: "1.0.0",
71
+ description: "A payout has been created.",
72
+ stability: "experimental",
73
+ owners: ["@marketplace-team"],
74
+ tags: ["marketplace", "payout"]
75
+ },
76
+ payload: PayoutCreatedPayload
77
+ });
78
+ const PayoutPaidEvent = defineEvent({
79
+ meta: {
80
+ key: "marketplace.payout.paid",
81
+ version: "1.0.0",
82
+ description: "A payout has been sent.",
83
+ stability: "experimental",
84
+ owners: ["@marketplace-team"],
85
+ tags: ["marketplace", "payout"]
86
+ },
87
+ payload: PayoutPaidPayload
88
+ });
89
+
90
+ //#endregion
91
+ export { PayoutCreatedEvent, PayoutPaidEvent };
92
+ //# sourceMappingURL=payout.event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.event.js","names":[],"sources":["../../src/payout/payout.event.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\nimport { defineEvent } from '@contractspec/lib.contracts';\n\nconst PayoutCreatedPayload = defineSchemaModel({\n name: 'PayoutCreatedEventPayload',\n fields: {\n payoutId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n payoutNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n netAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orderCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst PayoutPaidPayload = defineSchemaModel({\n name: 'PayoutPaidEventPayload',\n fields: {\n payoutId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n payoutNumber: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n storeId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n netAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n paymentReference: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const PayoutCreatedEvent = defineEvent({\n meta: {\n key: 'marketplace.payout.created',\n version: '1.0.0',\n description: 'A payout has been created.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'payout'],\n },\n payload: PayoutCreatedPayload,\n});\n\nexport const PayoutPaidEvent = defineEvent({\n meta: {\n key: 'marketplace.payout.paid',\n version: '1.0.0',\n description: 'A payout has been sent.',\n stability: 'experimental',\n owners: ['@marketplace-team'],\n tags: ['marketplace', 'payout'],\n },\n payload: PayoutPaidPayload,\n});\n"],"mappings":";;;;AAGA,MAAM,uBAAuB,kBAAkB;CAC7C,MAAM;CACN,QAAQ;EACN,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,WAAW;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACvE,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,YAAY;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACtE,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAM,oBAAoB,kBAAkB;CAC1C,MAAM;CACN,QAAQ;EACN,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAC3E,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACtE,WAAW;GAAE,MAAM,eAAe,gBAAgB;GAAE,YAAY;GAAO;EACvE,kBAAkB;GAChB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,WAAW;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,qBAAqB,YAAY;CAC5C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,eAAe,SAAS;EAChC;CACD,SAAS;CACV,CAAC;AAEF,MAAa,kBAAkB,YAAY;CACzC,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,WAAW;EACX,QAAQ,CAAC,oBAAoB;EAC7B,MAAM,CAAC,eAAe,SAAS;EAChC;CACD,SAAS;CACV,CAAC"}
@@ -0,0 +1,97 @@
1
+ import * as _contractspec_lib_contracts25 from "@contractspec/lib.contracts";
2
+ import * as _contractspec_lib_schema351 from "@contractspec/lib.schema";
3
+
4
+ //#region src/payout/payout.operations.d.ts
5
+ /**
6
+ * List payouts for a store.
7
+ */
8
+ declare const ListPayoutsContract: _contractspec_lib_contracts25.OperationSpec<_contractspec_lib_schema351.SchemaModel<{
9
+ storeId: {
10
+ type: _contractspec_lib_schema351.FieldType<string, string>;
11
+ isOptional: false;
12
+ };
13
+ status: {
14
+ type: _contractspec_lib_schema351.EnumType<[string, string, string, string, string]>;
15
+ isOptional: true;
16
+ };
17
+ limit: {
18
+ type: _contractspec_lib_schema351.FieldType<number, number>;
19
+ isOptional: true;
20
+ defaultValue: number;
21
+ };
22
+ offset: {
23
+ type: _contractspec_lib_schema351.FieldType<number, number>;
24
+ isOptional: true;
25
+ defaultValue: number;
26
+ };
27
+ }>, _contractspec_lib_schema351.SchemaModel<{
28
+ payouts: {
29
+ type: _contractspec_lib_schema351.SchemaModel<{
30
+ id: {
31
+ type: _contractspec_lib_schema351.FieldType<string, string>;
32
+ isOptional: false;
33
+ };
34
+ payoutNumber: {
35
+ type: _contractspec_lib_schema351.FieldType<string, string>;
36
+ isOptional: false;
37
+ };
38
+ storeId: {
39
+ type: _contractspec_lib_schema351.FieldType<string, string>;
40
+ isOptional: false;
41
+ };
42
+ status: {
43
+ type: _contractspec_lib_schema351.EnumType<[string, string, string, string, string]>;
44
+ isOptional: false;
45
+ };
46
+ grossAmount: {
47
+ type: _contractspec_lib_schema351.FieldType<number, number>;
48
+ isOptional: false;
49
+ };
50
+ platformFees: {
51
+ type: _contractspec_lib_schema351.FieldType<number, number>;
52
+ isOptional: false;
53
+ };
54
+ netAmount: {
55
+ type: _contractspec_lib_schema351.FieldType<number, number>;
56
+ isOptional: false;
57
+ };
58
+ currency: {
59
+ type: _contractspec_lib_schema351.FieldType<string, string>;
60
+ isOptional: false;
61
+ };
62
+ periodStart: {
63
+ type: _contractspec_lib_schema351.FieldType<Date, string>;
64
+ isOptional: false;
65
+ };
66
+ periodEnd: {
67
+ type: _contractspec_lib_schema351.FieldType<Date, string>;
68
+ isOptional: false;
69
+ };
70
+ orderCount: {
71
+ type: _contractspec_lib_schema351.FieldType<number, number>;
72
+ isOptional: false;
73
+ };
74
+ createdAt: {
75
+ type: _contractspec_lib_schema351.FieldType<Date, string>;
76
+ isOptional: false;
77
+ };
78
+ paidAt: {
79
+ type: _contractspec_lib_schema351.FieldType<Date, string>;
80
+ isOptional: true;
81
+ };
82
+ }>;
83
+ isArray: true;
84
+ isOptional: false;
85
+ };
86
+ total: {
87
+ type: _contractspec_lib_schema351.FieldType<number, number>;
88
+ isOptional: false;
89
+ };
90
+ totalPending: {
91
+ type: _contractspec_lib_schema351.FieldType<number, number>;
92
+ isOptional: false;
93
+ };
94
+ }>, undefined>;
95
+ //#endregion
96
+ export { ListPayoutsContract };
97
+ //# sourceMappingURL=payout.operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout.operations.d.ts","names":[],"sources":["../../src/payout/payout.operations.ts"],"sourcesContent":[],"mappings":";;;;;;;cAQa,mDAAmB,0CAAA;EAAnB,OAAA,EAAA;IA8BX,IAAA,EAAA,2BAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;8CA9B8B,CAAA,CAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA;IAAA,UAAA,EAAA,IAAA;;;;;;;;;;;;;;;;cAAA,2BAAA,CAAA;;;;;yBAAA;MAAA,CAAA"}
@@ -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.0.0",
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.0.0',\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 * as _contractspec_lib_contracts3 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/payout/payout.presentation.d.ts
4
+ declare const PayoutListPresentation: _contractspec_lib_contracts3.PresentationSpec;
5
+ declare const PayoutDetailPresentation: _contractspec_lib_contracts3.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":";;;cAGa,wBAuBX,4BAAA,CAvBiC;cAyBtB,0BAuBX,4BAAA,CAvBmC"}
@@ -0,0 +1,60 @@
1
+ import { PayoutModel } from "./payout.schema.js";
2
+ import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/payout/payout.presentation.ts
5
+ const PayoutListPresentation = definePresentation({
6
+ meta: {
7
+ key: "marketplace.payout.list",
8
+ version: "1.0.0",
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 = definePresentation({
32
+ meta: {
33
+ key: "marketplace.payout.detail",
34
+ version: "1.0.0",
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":[],"sources":["../../src/payout/payout.presentation.ts"],"sourcesContent":["import { definePresentation, StabilityEnum } from '@contractspec/lib.contracts';\nimport { PayoutModel } from './payout.schema';\n\nexport const PayoutListPresentation = definePresentation({\n meta: {\n key: 'marketplace.payout.list',\n version: '1.0.0',\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 = definePresentation({\n meta: {\n key: 'marketplace.payout.detail',\n version: '1.0.0',\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":";;;;AAGA,MAAa,yBAAyB,mBAAmB;CACvD,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,CAAC;AAEF,MAAa,2BAA2B,mBAAmB;CACzD,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,CAAC"}
@@ -0,0 +1,157 @@
1
+ import * as _contractspec_lib_schema0 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_schema0.SchemaModel<{
8
+ id: {
9
+ type: _contractspec_lib_schema0.FieldType<string, string>;
10
+ isOptional: false;
11
+ };
12
+ payoutNumber: {
13
+ type: _contractspec_lib_schema0.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ storeId: {
17
+ type: _contractspec_lib_schema0.FieldType<string, string>;
18
+ isOptional: false;
19
+ };
20
+ status: {
21
+ type: _contractspec_lib_schema0.EnumType<[string, string, string, string, string]>;
22
+ isOptional: false;
23
+ };
24
+ grossAmount: {
25
+ type: _contractspec_lib_schema0.FieldType<number, number>;
26
+ isOptional: false;
27
+ };
28
+ platformFees: {
29
+ type: _contractspec_lib_schema0.FieldType<number, number>;
30
+ isOptional: false;
31
+ };
32
+ netAmount: {
33
+ type: _contractspec_lib_schema0.FieldType<number, number>;
34
+ isOptional: false;
35
+ };
36
+ currency: {
37
+ type: _contractspec_lib_schema0.FieldType<string, string>;
38
+ isOptional: false;
39
+ };
40
+ periodStart: {
41
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
42
+ isOptional: false;
43
+ };
44
+ periodEnd: {
45
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
46
+ isOptional: false;
47
+ };
48
+ orderCount: {
49
+ type: _contractspec_lib_schema0.FieldType<number, number>;
50
+ isOptional: false;
51
+ };
52
+ createdAt: {
53
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
54
+ isOptional: false;
55
+ };
56
+ paidAt: {
57
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
58
+ isOptional: true;
59
+ };
60
+ }>;
61
+ /**
62
+ * Input for listing payouts.
63
+ */
64
+ declare const ListPayoutsInputModel: _contractspec_lib_schema0.SchemaModel<{
65
+ storeId: {
66
+ type: _contractspec_lib_schema0.FieldType<string, string>;
67
+ isOptional: false;
68
+ };
69
+ status: {
70
+ type: _contractspec_lib_schema0.EnumType<[string, string, string, string, string]>;
71
+ isOptional: true;
72
+ };
73
+ limit: {
74
+ type: _contractspec_lib_schema0.FieldType<number, number>;
75
+ isOptional: true;
76
+ defaultValue: number;
77
+ };
78
+ offset: {
79
+ type: _contractspec_lib_schema0.FieldType<number, number>;
80
+ isOptional: true;
81
+ defaultValue: number;
82
+ };
83
+ }>;
84
+ /**
85
+ * Output for listing payouts.
86
+ */
87
+ declare const ListPayoutsOutputModel: _contractspec_lib_schema0.SchemaModel<{
88
+ payouts: {
89
+ type: _contractspec_lib_schema0.SchemaModel<{
90
+ id: {
91
+ type: _contractspec_lib_schema0.FieldType<string, string>;
92
+ isOptional: false;
93
+ };
94
+ payoutNumber: {
95
+ type: _contractspec_lib_schema0.FieldType<string, string>;
96
+ isOptional: false;
97
+ };
98
+ storeId: {
99
+ type: _contractspec_lib_schema0.FieldType<string, string>;
100
+ isOptional: false;
101
+ };
102
+ status: {
103
+ type: _contractspec_lib_schema0.EnumType<[string, string, string, string, string]>;
104
+ isOptional: false;
105
+ };
106
+ grossAmount: {
107
+ type: _contractspec_lib_schema0.FieldType<number, number>;
108
+ isOptional: false;
109
+ };
110
+ platformFees: {
111
+ type: _contractspec_lib_schema0.FieldType<number, number>;
112
+ isOptional: false;
113
+ };
114
+ netAmount: {
115
+ type: _contractspec_lib_schema0.FieldType<number, number>;
116
+ isOptional: false;
117
+ };
118
+ currency: {
119
+ type: _contractspec_lib_schema0.FieldType<string, string>;
120
+ isOptional: false;
121
+ };
122
+ periodStart: {
123
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
124
+ isOptional: false;
125
+ };
126
+ periodEnd: {
127
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
128
+ isOptional: false;
129
+ };
130
+ orderCount: {
131
+ type: _contractspec_lib_schema0.FieldType<number, number>;
132
+ isOptional: false;
133
+ };
134
+ createdAt: {
135
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
136
+ isOptional: false;
137
+ };
138
+ paidAt: {
139
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
140
+ isOptional: true;
141
+ };
142
+ }>;
143
+ isArray: true;
144
+ isOptional: false;
145
+ };
146
+ total: {
147
+ type: _contractspec_lib_schema0.FieldType<number, number>;
148
+ isOptional: false;
149
+ };
150
+ totalPending: {
151
+ type: _contractspec_lib_schema0.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,4BAlBsB,WAkBtB,CAAA;EAAA,EAAA,EAAA;UAAA,yBAAA,CAAA;;;;;;;;;;;;;;;;6CAlBsB,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAuBX,CAAA;EAgBX,YAAA,EAAA;;;;;IAhBgC,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAqBrB,UAAA,EAAA,KAAA;EAOX,CAAA;;;;;;;;;;;;;;;;;;;;;EAPiC,MAAA,EAAA;;;;;;;;cArBtB,iDAAqB;;UAgBhC,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cAKW,kDAAsB;;;;cAOjC,yBAAA,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