@contractspec/example.marketplace 1.56.1 → 1.58.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 (302) hide show
  1. package/dist/browser/docs/index.js +103 -0
  2. package/dist/browser/docs/marketplace.docblock.js +103 -0
  3. package/dist/browser/entities/index.js +721 -0
  4. package/dist/browser/entities/order.js +167 -0
  5. package/dist/browser/entities/payout.js +142 -0
  6. package/dist/browser/entities/product.js +152 -0
  7. package/dist/browser/entities/review.js +129 -0
  8. package/dist/browser/entities/store.js +97 -0
  9. package/dist/browser/example.js +42 -0
  10. package/dist/browser/handlers/index.js +303 -0
  11. package/dist/browser/handlers/marketplace.handlers.js +303 -0
  12. package/dist/browser/index.js +2016 -0
  13. package/dist/browser/marketplace.capability.js +40 -0
  14. package/dist/browser/marketplace.feature.js +137 -0
  15. package/dist/browser/order/index.js +307 -0
  16. package/dist/browser/order/order.enum.js +17 -0
  17. package/dist/browser/order/order.event.js +131 -0
  18. package/dist/browser/order/order.operations.js +172 -0
  19. package/dist/browser/order/order.presentation.js +153 -0
  20. package/dist/browser/order/order.schema.js +79 -0
  21. package/dist/browser/payout/index.js +152 -0
  22. package/dist/browser/payout/payout.enum.js +12 -0
  23. package/dist/browser/payout/payout.event.js +55 -0
  24. package/dist/browser/payout/payout.operations.js +94 -0
  25. package/dist/browser/payout/payout.presentation.js +111 -0
  26. package/dist/browser/payout/payout.schema.js +61 -0
  27. package/dist/browser/product/index.js +249 -0
  28. package/dist/browser/product/product.enum.js +13 -0
  29. package/dist/browser/product/product.event.js +74 -0
  30. package/dist/browser/product/product.operations.js +171 -0
  31. package/dist/browser/product/product.presentation.js +158 -0
  32. package/dist/browser/product/product.schema.js +84 -0
  33. package/dist/browser/review/index.js +206 -0
  34. package/dist/browser/review/review.enum.js +11 -0
  35. package/dist/browser/review/review.event.js +50 -0
  36. package/dist/browser/review/review.operations.js +152 -0
  37. package/dist/browser/review/review.presentation.js +123 -0
  38. package/dist/browser/review/review.schema.js +74 -0
  39. package/dist/browser/seeders/index.js +12 -0
  40. package/dist/browser/store/index.js +142 -0
  41. package/dist/browser/store/store.enum.js +11 -0
  42. package/dist/browser/store/store.event.js +52 -0
  43. package/dist/browser/store/store.operations.js +88 -0
  44. package/dist/browser/store/store.presentation.js +94 -0
  45. package/dist/browser/store/store.schema.js +43 -0
  46. package/dist/browser/tests/operations.test-spec.js +139 -0
  47. package/dist/browser/ui/MarketplaceDashboard.js +418 -0
  48. package/dist/browser/ui/hooks/index.js +59 -0
  49. package/dist/browser/ui/hooks/useMarketplaceData.js +56 -0
  50. package/dist/browser/ui/index.js +668 -0
  51. package/dist/browser/ui/renderers/index.js +248 -0
  52. package/dist/browser/ui/renderers/marketplace.markdown.js +248 -0
  53. package/dist/docs/index.d.ts +2 -1
  54. package/dist/docs/index.d.ts.map +1 -0
  55. package/dist/docs/index.js +104 -1
  56. package/dist/docs/marketplace.docblock.d.ts +2 -1
  57. package/dist/docs/marketplace.docblock.d.ts.map +1 -0
  58. package/dist/docs/marketplace.docblock.js +46 -57
  59. package/dist/entities/index.d.ts +302 -307
  60. package/dist/entities/index.d.ts.map +1 -1
  61. package/dist/entities/index.js +719 -43
  62. package/dist/entities/order.d.ts +77 -82
  63. package/dist/entities/order.d.ts.map +1 -1
  64. package/dist/entities/order.js +162 -167
  65. package/dist/entities/payout.d.ts +64 -69
  66. package/dist/entities/payout.d.ts.map +1 -1
  67. package/dist/entities/payout.js +137 -156
  68. package/dist/entities/product.d.ts +69 -74
  69. package/dist/entities/product.d.ts.map +1 -1
  70. package/dist/entities/product.js +148 -156
  71. package/dist/entities/review.d.ts +55 -60
  72. package/dist/entities/review.d.ts.map +1 -1
  73. package/dist/entities/review.js +124 -146
  74. package/dist/entities/store.d.ts +40 -45
  75. package/dist/entities/store.d.ts.map +1 -1
  76. package/dist/entities/store.js +94 -106
  77. package/dist/example.d.ts +2 -6
  78. package/dist/example.d.ts.map +1 -1
  79. package/dist/example.js +40 -55
  80. package/dist/handlers/index.d.ts +2 -2
  81. package/dist/handlers/index.d.ts.map +1 -0
  82. package/dist/handlers/index.js +304 -3
  83. package/dist/handlers/marketplace.handlers.d.ts +138 -138
  84. package/dist/handlers/marketplace.handlers.d.ts.map +1 -1
  85. package/dist/handlers/marketplace.handlers.js +284 -309
  86. package/dist/index.d.ts +13 -31
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +2017 -32
  89. package/dist/marketplace.capability.d.ts +3 -8
  90. package/dist/marketplace.capability.d.ts.map +1 -1
  91. package/dist/marketplace.capability.js +41 -34
  92. package/dist/marketplace.feature.d.ts +1 -7
  93. package/dist/marketplace.feature.d.ts.map +1 -1
  94. package/dist/marketplace.feature.js +136 -313
  95. package/dist/node/docs/index.js +103 -0
  96. package/dist/node/docs/marketplace.docblock.js +103 -0
  97. package/dist/node/entities/index.js +721 -0
  98. package/dist/node/entities/order.js +167 -0
  99. package/dist/node/entities/payout.js +142 -0
  100. package/dist/node/entities/product.js +152 -0
  101. package/dist/node/entities/review.js +129 -0
  102. package/dist/node/entities/store.js +97 -0
  103. package/dist/node/example.js +42 -0
  104. package/dist/node/handlers/index.js +303 -0
  105. package/dist/node/handlers/marketplace.handlers.js +303 -0
  106. package/dist/node/index.js +2016 -0
  107. package/dist/node/marketplace.capability.js +40 -0
  108. package/dist/node/marketplace.feature.js +137 -0
  109. package/dist/node/order/index.js +307 -0
  110. package/dist/node/order/order.enum.js +17 -0
  111. package/dist/node/order/order.event.js +131 -0
  112. package/dist/node/order/order.operations.js +172 -0
  113. package/dist/node/order/order.presentation.js +153 -0
  114. package/dist/node/order/order.schema.js +79 -0
  115. package/dist/node/payout/index.js +152 -0
  116. package/dist/node/payout/payout.enum.js +12 -0
  117. package/dist/node/payout/payout.event.js +55 -0
  118. package/dist/node/payout/payout.operations.js +94 -0
  119. package/dist/node/payout/payout.presentation.js +111 -0
  120. package/dist/node/payout/payout.schema.js +61 -0
  121. package/dist/node/product/index.js +249 -0
  122. package/dist/node/product/product.enum.js +13 -0
  123. package/dist/node/product/product.event.js +74 -0
  124. package/dist/node/product/product.operations.js +171 -0
  125. package/dist/node/product/product.presentation.js +158 -0
  126. package/dist/node/product/product.schema.js +84 -0
  127. package/dist/node/review/index.js +206 -0
  128. package/dist/node/review/review.enum.js +11 -0
  129. package/dist/node/review/review.event.js +50 -0
  130. package/dist/node/review/review.operations.js +152 -0
  131. package/dist/node/review/review.presentation.js +123 -0
  132. package/dist/node/review/review.schema.js +74 -0
  133. package/dist/node/seeders/index.js +12 -0
  134. package/dist/node/store/index.js +142 -0
  135. package/dist/node/store/store.enum.js +11 -0
  136. package/dist/node/store/store.event.js +52 -0
  137. package/dist/node/store/store.operations.js +88 -0
  138. package/dist/node/store/store.presentation.js +94 -0
  139. package/dist/node/store/store.schema.js +43 -0
  140. package/dist/node/tests/operations.test-spec.js +139 -0
  141. package/dist/node/ui/MarketplaceDashboard.js +418 -0
  142. package/dist/node/ui/hooks/index.js +59 -0
  143. package/dist/node/ui/hooks/useMarketplaceData.js +56 -0
  144. package/dist/node/ui/index.js +668 -0
  145. package/dist/node/ui/renderers/index.js +248 -0
  146. package/dist/node/ui/renderers/marketplace.markdown.js +248 -0
  147. package/dist/order/index.d.ts +8 -5
  148. package/dist/order/index.d.ts.map +1 -0
  149. package/dist/order/index.js +307 -5
  150. package/dist/order/order.enum.d.ts +1 -6
  151. package/dist/order/order.enum.d.ts.map +1 -1
  152. package/dist/order/order.enum.js +16 -20
  153. package/dist/order/order.event.d.ts +133 -139
  154. package/dist/order/order.event.d.ts.map +1 -1
  155. package/dist/order/order.event.js +121 -205
  156. package/dist/order/order.operations.d.ts +291 -297
  157. package/dist/order/order.operations.d.ts.map +1 -1
  158. package/dist/order/order.operations.js +169 -115
  159. package/dist/order/order.presentation.d.ts +3 -8
  160. package/dist/order/order.presentation.d.ts.map +1 -1
  161. package/dist/order/order.presentation.js +149 -81
  162. package/dist/order/order.schema.d.ts +143 -148
  163. package/dist/order/order.schema.d.ts.map +1 -1
  164. package/dist/order/order.schema.js +75 -150
  165. package/dist/payout/index.d.ts +8 -5
  166. package/dist/payout/index.d.ts.map +1 -0
  167. package/dist/payout/index.js +152 -5
  168. package/dist/payout/payout.enum.d.ts +1 -6
  169. package/dist/payout/payout.enum.d.ts.map +1 -1
  170. package/dist/payout/payout.enum.js +11 -15
  171. package/dist/payout/payout.event.d.ts +54 -60
  172. package/dist/payout/payout.event.d.ts.map +1 -1
  173. package/dist/payout/payout.event.js +51 -87
  174. package/dist/payout/payout.operations.d.ts +82 -88
  175. package/dist/payout/payout.operations.d.ts.map +1 -1
  176. package/dist/payout/payout.operations.js +92 -50
  177. package/dist/payout/payout.presentation.d.ts +2 -7
  178. package/dist/payout/payout.presentation.d.ts.map +1 -1
  179. package/dist/payout/payout.presentation.js +108 -56
  180. package/dist/payout/payout.schema.d.ts +139 -144
  181. package/dist/payout/payout.schema.d.ts.map +1 -1
  182. package/dist/payout/payout.schema.js +58 -112
  183. package/dist/product/index.d.ts +8 -5
  184. package/dist/product/index.d.ts.map +1 -0
  185. package/dist/product/index.js +249 -5
  186. package/dist/product/product.enum.d.ts +1 -6
  187. package/dist/product/product.enum.d.ts.map +1 -1
  188. package/dist/product/product.enum.js +12 -16
  189. package/dist/product/product.event.d.ts +63 -69
  190. package/dist/product/product.event.d.ts.map +1 -1
  191. package/dist/product/product.event.js +68 -113
  192. package/dist/product/product.operations.d.ts +225 -231
  193. package/dist/product/product.operations.d.ts.map +1 -1
  194. package/dist/product/product.operations.js +168 -104
  195. package/dist/product/product.presentation.d.ts +3 -8
  196. package/dist/product/product.presentation.d.ts.map +1 -1
  197. package/dist/product/product.presentation.js +154 -81
  198. package/dist/product/product.schema.d.ts +196 -201
  199. package/dist/product/product.schema.d.ts.map +1 -1
  200. package/dist/product/product.schema.js +80 -171
  201. package/dist/review/index.d.ts +8 -5
  202. package/dist/review/index.d.ts.map +1 -0
  203. package/dist/review/index.js +206 -5
  204. package/dist/review/review.enum.d.ts +1 -6
  205. package/dist/review/review.enum.d.ts.map +1 -1
  206. package/dist/review/review.enum.js +10 -14
  207. package/dist/review/review.event.d.ts +46 -52
  208. package/dist/review/review.event.d.ts.map +1 -1
  209. package/dist/review/review.event.js +46 -79
  210. package/dist/review/review.operations.d.ts +190 -196
  211. package/dist/review/review.operations.d.ts.map +1 -1
  212. package/dist/review/review.operations.js +149 -102
  213. package/dist/review/review.presentation.d.ts +2 -7
  214. package/dist/review/review.presentation.d.ts.map +1 -1
  215. package/dist/review/review.presentation.js +120 -56
  216. package/dist/review/review.schema.d.ts +164 -169
  217. package/dist/review/review.schema.d.ts.map +1 -1
  218. package/dist/review/review.schema.js +70 -151
  219. package/dist/seeders/index.d.ts +4 -8
  220. package/dist/seeders/index.d.ts.map +1 -1
  221. package/dist/seeders/index.js +11 -16
  222. package/dist/store/index.d.ts +8 -5
  223. package/dist/store/index.d.ts.map +1 -0
  224. package/dist/store/index.js +142 -5
  225. package/dist/store/store.enum.d.ts +1 -6
  226. package/dist/store/store.enum.d.ts.map +1 -1
  227. package/dist/store/store.enum.js +10 -14
  228. package/dist/store/store.event.d.ts +42 -48
  229. package/dist/store/store.event.d.ts.map +1 -1
  230. package/dist/store/store.event.js +48 -75
  231. package/dist/store/store.operations.d.ts +98 -104
  232. package/dist/store/store.operations.d.ts.map +1 -1
  233. package/dist/store/store.operations.js +86 -58
  234. package/dist/store/store.presentation.d.ts +2 -7
  235. package/dist/store/store.presentation.d.ts.map +1 -1
  236. package/dist/store/store.presentation.js +91 -56
  237. package/dist/store/store.schema.d.ts +70 -75
  238. package/dist/store/store.schema.d.ts.map +1 -1
  239. package/dist/store/store.schema.js +41 -90
  240. package/dist/tests/operations.test-spec.d.ts +5 -10
  241. package/dist/tests/operations.test-spec.d.ts.map +1 -1
  242. package/dist/tests/operations.test-spec.js +134 -146
  243. package/dist/ui/MarketplaceDashboard.d.ts +1 -6
  244. package/dist/ui/MarketplaceDashboard.d.ts.map +1 -1
  245. package/dist/ui/MarketplaceDashboard.js +413 -313
  246. package/dist/ui/hooks/index.d.ts +2 -2
  247. package/dist/ui/hooks/index.d.ts.map +1 -0
  248. package/dist/ui/hooks/index.js +59 -4
  249. package/dist/ui/hooks/useMarketplaceData.d.ts +16 -20
  250. package/dist/ui/hooks/useMarketplaceData.d.ts.map +1 -1
  251. package/dist/ui/hooks/useMarketplaceData.js +53 -60
  252. package/dist/ui/index.d.ts +7 -6
  253. package/dist/ui/index.d.ts.map +1 -0
  254. package/dist/ui/index.js +668 -5
  255. package/dist/ui/renderers/index.d.ts +2 -2
  256. package/dist/ui/renderers/index.d.ts.map +1 -0
  257. package/dist/ui/renderers/index.js +249 -3
  258. package/dist/ui/renderers/marketplace.markdown.d.ts +13 -15
  259. package/dist/ui/renderers/marketplace.markdown.d.ts.map +1 -1
  260. package/dist/ui/renderers/marketplace.markdown.js +241 -236
  261. package/package.json +529 -110
  262. package/dist/docs/marketplace.docblock.js.map +0 -1
  263. package/dist/entities/index.js.map +0 -1
  264. package/dist/entities/order.js.map +0 -1
  265. package/dist/entities/payout.js.map +0 -1
  266. package/dist/entities/product.js.map +0 -1
  267. package/dist/entities/review.js.map +0 -1
  268. package/dist/entities/store.js.map +0 -1
  269. package/dist/example.js.map +0 -1
  270. package/dist/handlers/marketplace.handlers.js.map +0 -1
  271. package/dist/marketplace.capability.js.map +0 -1
  272. package/dist/marketplace.feature.js.map +0 -1
  273. package/dist/order/order.enum.js.map +0 -1
  274. package/dist/order/order.event.js.map +0 -1
  275. package/dist/order/order.operations.js.map +0 -1
  276. package/dist/order/order.presentation.js.map +0 -1
  277. package/dist/order/order.schema.js.map +0 -1
  278. package/dist/payout/payout.enum.js.map +0 -1
  279. package/dist/payout/payout.event.js.map +0 -1
  280. package/dist/payout/payout.operations.js.map +0 -1
  281. package/dist/payout/payout.presentation.js.map +0 -1
  282. package/dist/payout/payout.schema.js.map +0 -1
  283. package/dist/product/product.enum.js.map +0 -1
  284. package/dist/product/product.event.js.map +0 -1
  285. package/dist/product/product.operations.js.map +0 -1
  286. package/dist/product/product.presentation.js.map +0 -1
  287. package/dist/product/product.schema.js.map +0 -1
  288. package/dist/review/review.enum.js.map +0 -1
  289. package/dist/review/review.event.js.map +0 -1
  290. package/dist/review/review.operations.js.map +0 -1
  291. package/dist/review/review.presentation.js.map +0 -1
  292. package/dist/review/review.schema.js.map +0 -1
  293. package/dist/seeders/index.js.map +0 -1
  294. package/dist/store/store.enum.js.map +0 -1
  295. package/dist/store/store.event.js.map +0 -1
  296. package/dist/store/store.operations.js.map +0 -1
  297. package/dist/store/store.presentation.js.map +0 -1
  298. package/dist/store/store.schema.js.map +0 -1
  299. package/dist/tests/operations.test-spec.js.map +0 -1
  300. package/dist/ui/MarketplaceDashboard.js.map +0 -1
  301. package/dist/ui/hooks/useMarketplaceData.js.map +0 -1
  302. package/dist/ui/renderers/marketplace.markdown.js.map +0 -1
@@ -1,105 +1,100 @@
1
- import * as _contractspec_lib_schema294 from "@contractspec/lib.schema";
2
-
3
- //#region src/entities/order.d.ts
4
1
  /**
5
2
  * Order status enum.
6
3
  */
7
- declare const OrderStatusEnum: _contractspec_lib_schema294.EntityEnumDef;
4
+ export declare const OrderStatusEnum: import("@contractspec/lib.schema").EntityEnumDef;
8
5
  /**
9
6
  * Payment status enum.
10
7
  */
11
- declare const PaymentStatusEnum: _contractspec_lib_schema294.EntityEnumDef;
8
+ export declare const PaymentStatusEnum: import("@contractspec/lib.schema").EntityEnumDef;
12
9
  /**
13
10
  * Order entity - a purchase transaction.
14
11
  */
15
- declare const OrderEntity: _contractspec_lib_schema294.EntitySpec<{
16
- id: _contractspec_lib_schema294.EntityScalarField;
17
- orderNumber: _contractspec_lib_schema294.EntityScalarField;
18
- buyerId: _contractspec_lib_schema294.EntityScalarField;
19
- storeId: _contractspec_lib_schema294.EntityScalarField;
20
- status: _contractspec_lib_schema294.EntityEnumField;
21
- paymentStatus: _contractspec_lib_schema294.EntityEnumField;
22
- subtotal: _contractspec_lib_schema294.EntityScalarField;
23
- shippingTotal: _contractspec_lib_schema294.EntityScalarField;
24
- taxTotal: _contractspec_lib_schema294.EntityScalarField;
25
- discountTotal: _contractspec_lib_schema294.EntityScalarField;
26
- total: _contractspec_lib_schema294.EntityScalarField;
27
- currency: _contractspec_lib_schema294.EntityScalarField;
28
- platformFee: _contractspec_lib_schema294.EntityScalarField;
29
- sellerPayout: _contractspec_lib_schema294.EntityScalarField;
30
- shippingAddress: _contractspec_lib_schema294.EntityScalarField;
31
- billingAddress: _contractspec_lib_schema294.EntityScalarField;
32
- shippingMethod: _contractspec_lib_schema294.EntityScalarField;
33
- trackingNumber: _contractspec_lib_schema294.EntityScalarField;
34
- trackingUrl: _contractspec_lib_schema294.EntityScalarField;
35
- paymentMethod: _contractspec_lib_schema294.EntityScalarField;
36
- paymentIntentId: _contractspec_lib_schema294.EntityScalarField;
37
- buyerNote: _contractspec_lib_schema294.EntityScalarField;
38
- sellerNote: _contractspec_lib_schema294.EntityScalarField;
39
- internalNote: _contractspec_lib_schema294.EntityScalarField;
40
- createdAt: _contractspec_lib_schema294.EntityScalarField;
41
- updatedAt: _contractspec_lib_schema294.EntityScalarField;
42
- paidAt: _contractspec_lib_schema294.EntityScalarField;
43
- shippedAt: _contractspec_lib_schema294.EntityScalarField;
44
- deliveredAt: _contractspec_lib_schema294.EntityScalarField;
45
- completedAt: _contractspec_lib_schema294.EntityScalarField;
46
- cancelledAt: _contractspec_lib_schema294.EntityScalarField;
47
- store: _contractspec_lib_schema294.EntityRelationField;
48
- items: _contractspec_lib_schema294.EntityRelationField;
49
- refunds: _contractspec_lib_schema294.EntityRelationField;
12
+ export declare const OrderEntity: import("@contractspec/lib.schema").EntitySpec<{
13
+ id: import("@contractspec/lib.schema").EntityScalarField;
14
+ orderNumber: import("@contractspec/lib.schema").EntityScalarField;
15
+ buyerId: import("@contractspec/lib.schema").EntityScalarField;
16
+ storeId: import("@contractspec/lib.schema").EntityScalarField;
17
+ status: import("@contractspec/lib.schema").EntityEnumField;
18
+ paymentStatus: import("@contractspec/lib.schema").EntityEnumField;
19
+ subtotal: import("@contractspec/lib.schema").EntityScalarField;
20
+ shippingTotal: import("@contractspec/lib.schema").EntityScalarField;
21
+ taxTotal: import("@contractspec/lib.schema").EntityScalarField;
22
+ discountTotal: import("@contractspec/lib.schema").EntityScalarField;
23
+ total: import("@contractspec/lib.schema").EntityScalarField;
24
+ currency: import("@contractspec/lib.schema").EntityScalarField;
25
+ platformFee: import("@contractspec/lib.schema").EntityScalarField;
26
+ sellerPayout: import("@contractspec/lib.schema").EntityScalarField;
27
+ shippingAddress: import("@contractspec/lib.schema").EntityScalarField;
28
+ billingAddress: import("@contractspec/lib.schema").EntityScalarField;
29
+ shippingMethod: import("@contractspec/lib.schema").EntityScalarField;
30
+ trackingNumber: import("@contractspec/lib.schema").EntityScalarField;
31
+ trackingUrl: import("@contractspec/lib.schema").EntityScalarField;
32
+ paymentMethod: import("@contractspec/lib.schema").EntityScalarField;
33
+ paymentIntentId: import("@contractspec/lib.schema").EntityScalarField;
34
+ buyerNote: import("@contractspec/lib.schema").EntityScalarField;
35
+ sellerNote: import("@contractspec/lib.schema").EntityScalarField;
36
+ internalNote: import("@contractspec/lib.schema").EntityScalarField;
37
+ createdAt: import("@contractspec/lib.schema").EntityScalarField;
38
+ updatedAt: import("@contractspec/lib.schema").EntityScalarField;
39
+ paidAt: import("@contractspec/lib.schema").EntityScalarField;
40
+ shippedAt: import("@contractspec/lib.schema").EntityScalarField;
41
+ deliveredAt: import("@contractspec/lib.schema").EntityScalarField;
42
+ completedAt: import("@contractspec/lib.schema").EntityScalarField;
43
+ cancelledAt: import("@contractspec/lib.schema").EntityScalarField;
44
+ store: import("@contractspec/lib.schema").EntityRelationField;
45
+ items: import("@contractspec/lib.schema").EntityRelationField;
46
+ refunds: import("@contractspec/lib.schema").EntityRelationField;
50
47
  }>;
51
48
  /**
52
49
  * Order item entity - individual items in an order.
53
50
  */
54
- declare const OrderItemEntity: _contractspec_lib_schema294.EntitySpec<{
55
- id: _contractspec_lib_schema294.EntityScalarField;
56
- orderId: _contractspec_lib_schema294.EntityScalarField;
57
- productId: _contractspec_lib_schema294.EntityScalarField;
58
- variantId: _contractspec_lib_schema294.EntityScalarField;
59
- productName: _contractspec_lib_schema294.EntityScalarField;
60
- variantName: _contractspec_lib_schema294.EntityScalarField;
61
- sku: _contractspec_lib_schema294.EntityScalarField;
62
- unitPrice: _contractspec_lib_schema294.EntityScalarField;
63
- quantity: _contractspec_lib_schema294.EntityScalarField;
64
- subtotal: _contractspec_lib_schema294.EntityScalarField;
65
- quantityFulfilled: _contractspec_lib_schema294.EntityScalarField;
66
- quantityRefunded: _contractspec_lib_schema294.EntityScalarField;
67
- createdAt: _contractspec_lib_schema294.EntityScalarField;
68
- updatedAt: _contractspec_lib_schema294.EntityScalarField;
69
- order: _contractspec_lib_schema294.EntityRelationField;
70
- product: _contractspec_lib_schema294.EntityRelationField;
51
+ export declare const OrderItemEntity: import("@contractspec/lib.schema").EntitySpec<{
52
+ id: import("@contractspec/lib.schema").EntityScalarField;
53
+ orderId: import("@contractspec/lib.schema").EntityScalarField;
54
+ productId: import("@contractspec/lib.schema").EntityScalarField;
55
+ variantId: import("@contractspec/lib.schema").EntityScalarField;
56
+ productName: import("@contractspec/lib.schema").EntityScalarField;
57
+ variantName: import("@contractspec/lib.schema").EntityScalarField;
58
+ sku: import("@contractspec/lib.schema").EntityScalarField;
59
+ unitPrice: import("@contractspec/lib.schema").EntityScalarField;
60
+ quantity: import("@contractspec/lib.schema").EntityScalarField;
61
+ subtotal: import("@contractspec/lib.schema").EntityScalarField;
62
+ quantityFulfilled: import("@contractspec/lib.schema").EntityScalarField;
63
+ quantityRefunded: import("@contractspec/lib.schema").EntityScalarField;
64
+ createdAt: import("@contractspec/lib.schema").EntityScalarField;
65
+ updatedAt: import("@contractspec/lib.schema").EntityScalarField;
66
+ order: import("@contractspec/lib.schema").EntityRelationField;
67
+ product: import("@contractspec/lib.schema").EntityRelationField;
71
68
  }>;
72
69
  /**
73
70
  * Refund entity - refund records for orders.
74
71
  */
75
- declare const RefundEntity: _contractspec_lib_schema294.EntitySpec<{
76
- id: _contractspec_lib_schema294.EntityScalarField;
77
- orderId: _contractspec_lib_schema294.EntityScalarField;
78
- amount: _contractspec_lib_schema294.EntityScalarField;
79
- currency: _contractspec_lib_schema294.EntityScalarField;
80
- reason: _contractspec_lib_schema294.EntityScalarField;
81
- notes: _contractspec_lib_schema294.EntityScalarField;
82
- status: _contractspec_lib_schema294.EntityScalarField;
83
- refundId: _contractspec_lib_schema294.EntityScalarField;
84
- issuedBy: _contractspec_lib_schema294.EntityScalarField;
85
- createdAt: _contractspec_lib_schema294.EntityScalarField;
86
- processedAt: _contractspec_lib_schema294.EntityScalarField;
87
- order: _contractspec_lib_schema294.EntityRelationField;
88
- items: _contractspec_lib_schema294.EntityRelationField;
72
+ export declare const RefundEntity: import("@contractspec/lib.schema").EntitySpec<{
73
+ id: import("@contractspec/lib.schema").EntityScalarField;
74
+ orderId: import("@contractspec/lib.schema").EntityScalarField;
75
+ amount: import("@contractspec/lib.schema").EntityScalarField;
76
+ currency: import("@contractspec/lib.schema").EntityScalarField;
77
+ reason: import("@contractspec/lib.schema").EntityScalarField;
78
+ notes: import("@contractspec/lib.schema").EntityScalarField;
79
+ status: import("@contractspec/lib.schema").EntityScalarField;
80
+ refundId: import("@contractspec/lib.schema").EntityScalarField;
81
+ issuedBy: import("@contractspec/lib.schema").EntityScalarField;
82
+ createdAt: import("@contractspec/lib.schema").EntityScalarField;
83
+ processedAt: import("@contractspec/lib.schema").EntityScalarField;
84
+ order: import("@contractspec/lib.schema").EntityRelationField;
85
+ items: import("@contractspec/lib.schema").EntityRelationField;
89
86
  }>;
90
87
  /**
91
88
  * Refund item entity - items being refunded.
92
89
  */
93
- declare const RefundItemEntity: _contractspec_lib_schema294.EntitySpec<{
94
- id: _contractspec_lib_schema294.EntityScalarField;
95
- refundId: _contractspec_lib_schema294.EntityScalarField;
96
- orderItemId: _contractspec_lib_schema294.EntityScalarField;
97
- quantity: _contractspec_lib_schema294.EntityScalarField;
98
- amount: _contractspec_lib_schema294.EntityScalarField;
99
- createdAt: _contractspec_lib_schema294.EntityScalarField;
100
- refund: _contractspec_lib_schema294.EntityRelationField;
101
- orderItem: _contractspec_lib_schema294.EntityRelationField;
90
+ export declare const RefundItemEntity: import("@contractspec/lib.schema").EntitySpec<{
91
+ id: import("@contractspec/lib.schema").EntityScalarField;
92
+ refundId: import("@contractspec/lib.schema").EntityScalarField;
93
+ orderItemId: import("@contractspec/lib.schema").EntityScalarField;
94
+ quantity: import("@contractspec/lib.schema").EntityScalarField;
95
+ amount: import("@contractspec/lib.schema").EntityScalarField;
96
+ createdAt: import("@contractspec/lib.schema").EntityScalarField;
97
+ refund: import("@contractspec/lib.schema").EntityRelationField;
98
+ orderItem: import("@contractspec/lib.schema").EntityRelationField;
102
99
  }>;
103
- //#endregion
104
- export { OrderEntity, OrderItemEntity, OrderStatusEnum, PaymentStatusEnum, RefundEntity, RefundItemEntity };
105
100
  //# sourceMappingURL=order.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"order.d.ts","names":[],"sources":["../../src/entities/order.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,eAgBX,EAAA,2BAAA,CAhB0B,aAgB1B;AAKF;AAiBA;;cAjBa,mBAYX,2BAAA,CAZ4B;;;;cAiBjB,yCAAW;MAsEtB,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;4DAtEsB;EAAA,WAAA,+CAAA;EA2EX,WAAA,+CAoCX;EAAA,KAAA,iDAAA;;;;;;;cApCW,6CAAe;MAoC1B,2BAAA,CAAA;;;;;;;;yDApC0B;EAAA,QAAA,+CAAA;EAyCf,iBAsCX,+CAAA;EAAA,gBAAA,+CAAA;;;;;;;;;cAtCW,0CAAY;MAsCvB,2BAAA,CAAA;;;yDAtCuB;EAAA,MAAA,+CAAA;EA2CZ,KAAA,+CAsBX;EAAA,MAAA,+CAAA;;;;;;;;;;;cAtBW,8CAAgB;MAsB3B,2BAAA,CAAA"}
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../src/entities/order.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,eAAO,MAAM,eAAe,kDAgB1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,kDAY5B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsEtB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;EAoC1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;EAsCvB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAsB3B,CAAC"}
@@ -1,173 +1,168 @@
1
- import { defineEntity, defineEntityEnum, field, index } from "@contractspec/lib.schema";
2
-
3
- //#region src/entities/order.ts
4
- /**
5
- * Order status enum.
6
- */
7
- const OrderStatusEnum = defineEntityEnum({
8
- name: "OrderStatus",
9
- values: [
10
- "PENDING",
11
- "PAID",
12
- "PROCESSING",
13
- "SHIPPED",
14
- "DELIVERED",
15
- "COMPLETED",
16
- "CANCELLED",
17
- "REFUNDED",
18
- "PARTIALLY_REFUNDED",
19
- "DISPUTED"
20
- ],
21
- schema: "marketplace",
22
- description: "Status of an order."
1
+ // @bun
2
+ // src/entities/order.ts
3
+ import {
4
+ defineEntity,
5
+ defineEntityEnum,
6
+ field,
7
+ index
8
+ } from "@contractspec/lib.schema";
9
+ var OrderStatusEnum = defineEntityEnum({
10
+ name: "OrderStatus",
11
+ values: [
12
+ "PENDING",
13
+ "PAID",
14
+ "PROCESSING",
15
+ "SHIPPED",
16
+ "DELIVERED",
17
+ "COMPLETED",
18
+ "CANCELLED",
19
+ "REFUNDED",
20
+ "PARTIALLY_REFUNDED",
21
+ "DISPUTED"
22
+ ],
23
+ schema: "marketplace",
24
+ description: "Status of an order."
23
25
  });
24
- /**
25
- * Payment status enum.
26
- */
27
- const PaymentStatusEnum = defineEntityEnum({
28
- name: "PaymentStatus",
29
- values: [
30
- "PENDING",
31
- "AUTHORIZED",
32
- "CAPTURED",
33
- "FAILED",
34
- "REFUNDED",
35
- "VOIDED"
36
- ],
37
- schema: "marketplace",
38
- description: "Status of payment."
26
+ var PaymentStatusEnum = defineEntityEnum({
27
+ name: "PaymentStatus",
28
+ values: [
29
+ "PENDING",
30
+ "AUTHORIZED",
31
+ "CAPTURED",
32
+ "FAILED",
33
+ "REFUNDED",
34
+ "VOIDED"
35
+ ],
36
+ schema: "marketplace",
37
+ description: "Status of payment."
39
38
  });
40
- /**
41
- * Order entity - a purchase transaction.
42
- */
43
- const OrderEntity = defineEntity({
44
- name: "Order",
45
- description: "A purchase order on the marketplace.",
46
- schema: "marketplace",
47
- map: "order",
48
- fields: {
49
- id: field.id({ description: "Unique order ID" }),
50
- orderNumber: field.string({ description: "Human-readable order number" }),
51
- buyerId: field.foreignKey({ description: "Buyer user ID" }),
52
- storeId: field.foreignKey({ description: "Seller store ID" }),
53
- status: field.enum("OrderStatus", { default: "PENDING" }),
54
- paymentStatus: field.enum("PaymentStatus", { default: "PENDING" }),
55
- subtotal: field.decimal({ description: "Sum of item prices" }),
56
- shippingTotal: field.decimal({ default: 0 }),
57
- taxTotal: field.decimal({ default: 0 }),
58
- discountTotal: field.decimal({ default: 0 }),
59
- total: field.decimal({ description: "Final total" }),
60
- currency: field.string({ default: "\"USD\"" }),
61
- platformFee: field.decimal({ description: "Platform commission amount" }),
62
- sellerPayout: field.decimal({ description: "Amount due to seller" }),
63
- shippingAddress: field.json({ isOptional: true }),
64
- billingAddress: field.json({ isOptional: true }),
65
- shippingMethod: field.string({ isOptional: true }),
66
- trackingNumber: field.string({ isOptional: true }),
67
- trackingUrl: field.string({ isOptional: true }),
68
- paymentMethod: field.string({ isOptional: true }),
69
- paymentIntentId: field.string({ isOptional: true }),
70
- buyerNote: field.string({ isOptional: true }),
71
- sellerNote: field.string({ isOptional: true }),
72
- internalNote: field.string({ isOptional: true }),
73
- createdAt: field.createdAt(),
74
- updatedAt: field.updatedAt(),
75
- paidAt: field.dateTime({ isOptional: true }),
76
- shippedAt: field.dateTime({ isOptional: true }),
77
- deliveredAt: field.dateTime({ isOptional: true }),
78
- completedAt: field.dateTime({ isOptional: true }),
79
- cancelledAt: field.dateTime({ isOptional: true }),
80
- store: field.belongsTo("Store", ["storeId"], ["id"]),
81
- items: field.hasMany("OrderItem"),
82
- refunds: field.hasMany("Refund")
83
- },
84
- indexes: [
85
- index.unique(["orderNumber"]),
86
- index.on(["buyerId", "status"]),
87
- index.on(["storeId", "status"]),
88
- index.on(["status", "createdAt"]),
89
- index.on(["paymentStatus"]),
90
- index.on(["createdAt"])
91
- ],
92
- enums: [OrderStatusEnum, PaymentStatusEnum]
39
+ var OrderEntity = defineEntity({
40
+ name: "Order",
41
+ description: "A purchase order on the marketplace.",
42
+ schema: "marketplace",
43
+ map: "order",
44
+ fields: {
45
+ id: field.id({ description: "Unique order ID" }),
46
+ orderNumber: field.string({ description: "Human-readable order number" }),
47
+ buyerId: field.foreignKey({ description: "Buyer user ID" }),
48
+ storeId: field.foreignKey({ description: "Seller store ID" }),
49
+ status: field.enum("OrderStatus", { default: "PENDING" }),
50
+ paymentStatus: field.enum("PaymentStatus", { default: "PENDING" }),
51
+ subtotal: field.decimal({ description: "Sum of item prices" }),
52
+ shippingTotal: field.decimal({ default: 0 }),
53
+ taxTotal: field.decimal({ default: 0 }),
54
+ discountTotal: field.decimal({ default: 0 }),
55
+ total: field.decimal({ description: "Final total" }),
56
+ currency: field.string({ default: '"USD"' }),
57
+ platformFee: field.decimal({ description: "Platform commission amount" }),
58
+ sellerPayout: field.decimal({ description: "Amount due to seller" }),
59
+ shippingAddress: field.json({ isOptional: true }),
60
+ billingAddress: field.json({ isOptional: true }),
61
+ shippingMethod: field.string({ isOptional: true }),
62
+ trackingNumber: field.string({ isOptional: true }),
63
+ trackingUrl: field.string({ isOptional: true }),
64
+ paymentMethod: field.string({ isOptional: true }),
65
+ paymentIntentId: field.string({ isOptional: true }),
66
+ buyerNote: field.string({ isOptional: true }),
67
+ sellerNote: field.string({ isOptional: true }),
68
+ internalNote: field.string({ isOptional: true }),
69
+ createdAt: field.createdAt(),
70
+ updatedAt: field.updatedAt(),
71
+ paidAt: field.dateTime({ isOptional: true }),
72
+ shippedAt: field.dateTime({ isOptional: true }),
73
+ deliveredAt: field.dateTime({ isOptional: true }),
74
+ completedAt: field.dateTime({ isOptional: true }),
75
+ cancelledAt: field.dateTime({ isOptional: true }),
76
+ store: field.belongsTo("Store", ["storeId"], ["id"]),
77
+ items: field.hasMany("OrderItem"),
78
+ refunds: field.hasMany("Refund")
79
+ },
80
+ indexes: [
81
+ index.unique(["orderNumber"]),
82
+ index.on(["buyerId", "status"]),
83
+ index.on(["storeId", "status"]),
84
+ index.on(["status", "createdAt"]),
85
+ index.on(["paymentStatus"]),
86
+ index.on(["createdAt"])
87
+ ],
88
+ enums: [OrderStatusEnum, PaymentStatusEnum]
93
89
  });
94
- /**
95
- * Order item entity - individual items in an order.
96
- */
97
- const OrderItemEntity = defineEntity({
98
- name: "OrderItem",
99
- description: "An item within an order.",
100
- schema: "marketplace",
101
- map: "order_item",
102
- fields: {
103
- id: field.id(),
104
- orderId: field.foreignKey(),
105
- productId: field.foreignKey(),
106
- variantId: field.string({ isOptional: true }),
107
- productName: field.string(),
108
- variantName: field.string({ isOptional: true }),
109
- sku: field.string({ isOptional: true }),
110
- unitPrice: field.decimal(),
111
- quantity: field.int(),
112
- subtotal: field.decimal(),
113
- quantityFulfilled: field.int({ default: 0 }),
114
- quantityRefunded: field.int({ default: 0 }),
115
- createdAt: field.createdAt(),
116
- updatedAt: field.updatedAt(),
117
- order: field.belongsTo("Order", ["orderId"], ["id"], { onDelete: "Cascade" }),
118
- product: field.belongsTo("Product", ["productId"], ["id"])
119
- },
120
- indexes: [index.on(["orderId"]), index.on(["productId"])]
90
+ var OrderItemEntity = defineEntity({
91
+ name: "OrderItem",
92
+ description: "An item within an order.",
93
+ schema: "marketplace",
94
+ map: "order_item",
95
+ fields: {
96
+ id: field.id(),
97
+ orderId: field.foreignKey(),
98
+ productId: field.foreignKey(),
99
+ variantId: field.string({ isOptional: true }),
100
+ productName: field.string(),
101
+ variantName: field.string({ isOptional: true }),
102
+ sku: field.string({ isOptional: true }),
103
+ unitPrice: field.decimal(),
104
+ quantity: field.int(),
105
+ subtotal: field.decimal(),
106
+ quantityFulfilled: field.int({ default: 0 }),
107
+ quantityRefunded: field.int({ default: 0 }),
108
+ createdAt: field.createdAt(),
109
+ updatedAt: field.updatedAt(),
110
+ order: field.belongsTo("Order", ["orderId"], ["id"], {
111
+ onDelete: "Cascade"
112
+ }),
113
+ product: field.belongsTo("Product", ["productId"], ["id"])
114
+ },
115
+ indexes: [index.on(["orderId"]), index.on(["productId"])]
121
116
  });
122
- /**
123
- * Refund entity - refund records for orders.
124
- */
125
- const RefundEntity = defineEntity({
126
- name: "Refund",
127
- description: "A refund for an order.",
128
- schema: "marketplace",
129
- map: "refund",
130
- fields: {
131
- id: field.id(),
132
- orderId: field.foreignKey(),
133
- amount: field.decimal(),
134
- currency: field.string(),
135
- reason: field.string(),
136
- notes: field.string({ isOptional: true }),
137
- status: field.string({ default: "\"PENDING\"" }),
138
- refundId: field.string({
139
- isOptional: true,
140
- description: "Payment provider refund ID"
141
- }),
142
- issuedBy: field.foreignKey({ description: "User who issued the refund" }),
143
- createdAt: field.createdAt(),
144
- processedAt: field.dateTime({ isOptional: true }),
145
- order: field.belongsTo("Order", ["orderId"], ["id"]),
146
- items: field.hasMany("RefundItem")
147
- },
148
- indexes: [index.on(["orderId"]), index.on(["status"])]
117
+ var RefundEntity = defineEntity({
118
+ name: "Refund",
119
+ description: "A refund for an order.",
120
+ schema: "marketplace",
121
+ map: "refund",
122
+ fields: {
123
+ id: field.id(),
124
+ orderId: field.foreignKey(),
125
+ amount: field.decimal(),
126
+ currency: field.string(),
127
+ reason: field.string(),
128
+ notes: field.string({ isOptional: true }),
129
+ status: field.string({ default: '"PENDING"' }),
130
+ refundId: field.string({
131
+ isOptional: true,
132
+ description: "Payment provider refund ID"
133
+ }),
134
+ issuedBy: field.foreignKey({ description: "User who issued the refund" }),
135
+ createdAt: field.createdAt(),
136
+ processedAt: field.dateTime({ isOptional: true }),
137
+ order: field.belongsTo("Order", ["orderId"], ["id"]),
138
+ items: field.hasMany("RefundItem")
139
+ },
140
+ indexes: [index.on(["orderId"]), index.on(["status"])]
149
141
  });
150
- /**
151
- * Refund item entity - items being refunded.
152
- */
153
- const RefundItemEntity = defineEntity({
154
- name: "RefundItem",
155
- description: "An item within a refund.",
156
- schema: "marketplace",
157
- map: "refund_item",
158
- fields: {
159
- id: field.id(),
160
- refundId: field.foreignKey(),
161
- orderItemId: field.foreignKey(),
162
- quantity: field.int(),
163
- amount: field.decimal(),
164
- createdAt: field.createdAt(),
165
- refund: field.belongsTo("Refund", ["refundId"], ["id"], { onDelete: "Cascade" }),
166
- orderItem: field.belongsTo("OrderItem", ["orderItemId"], ["id"])
167
- },
168
- indexes: [index.on(["refundId"]), index.on(["orderItemId"])]
142
+ var RefundItemEntity = defineEntity({
143
+ name: "RefundItem",
144
+ description: "An item within a refund.",
145
+ schema: "marketplace",
146
+ map: "refund_item",
147
+ fields: {
148
+ id: field.id(),
149
+ refundId: field.foreignKey(),
150
+ orderItemId: field.foreignKey(),
151
+ quantity: field.int(),
152
+ amount: field.decimal(),
153
+ createdAt: field.createdAt(),
154
+ refund: field.belongsTo("Refund", ["refundId"], ["id"], {
155
+ onDelete: "Cascade"
156
+ }),
157
+ orderItem: field.belongsTo("OrderItem", ["orderItemId"], ["id"])
158
+ },
159
+ indexes: [index.on(["refundId"]), index.on(["orderItemId"])]
169
160
  });
170
-
171
- //#endregion
172
- export { OrderEntity, OrderItemEntity, OrderStatusEnum, PaymentStatusEnum, RefundEntity, RefundItemEntity };
173
- //# sourceMappingURL=order.js.map
161
+ export {
162
+ RefundItemEntity,
163
+ RefundEntity,
164
+ PaymentStatusEnum,
165
+ OrderStatusEnum,
166
+ OrderItemEntity,
167
+ OrderEntity
168
+ };