@contractspec/example.crm-pipeline 1.57.0 → 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 (259) hide show
  1. package/.turbo/turbo-build.log +148 -164
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +20 -0
  4. package/dist/browser/crm-pipeline.feature.js +75 -0
  5. package/dist/browser/deal/deal.enum.js +18 -0
  6. package/dist/browser/deal/deal.operation.js +396 -0
  7. package/dist/browser/deal/deal.schema.js +141 -0
  8. package/dist/browser/deal/deal.test-spec.js +58 -0
  9. package/dist/browser/deal/index.js +408 -0
  10. package/dist/browser/docs/crm-pipeline.docblock.js +113 -0
  11. package/dist/browser/docs/index.js +113 -0
  12. package/dist/browser/entities/company.entity.js +52 -0
  13. package/dist/browser/entities/contact.entity.js +66 -0
  14. package/dist/browser/entities/deal.entity.js +107 -0
  15. package/dist/browser/entities/index.js +343 -0
  16. package/dist/browser/entities/task.entity.js +99 -0
  17. package/dist/browser/events/contact.event.js +31 -0
  18. package/dist/browser/events/deal.event.js +101 -0
  19. package/dist/browser/events/index.js +158 -0
  20. package/dist/browser/events/task.event.js +28 -0
  21. package/dist/browser/example.js +39 -0
  22. package/dist/browser/handlers/crm.handlers.js +160 -0
  23. package/dist/browser/handlers/deal.handlers.js +293 -0
  24. package/dist/browser/handlers/index.js +456 -0
  25. package/dist/browser/handlers/mock-data.js +165 -0
  26. package/dist/browser/index.js +3279 -0
  27. package/dist/browser/operations/index.js +407 -0
  28. package/dist/browser/presentations/dashboard.presentation.js +52 -0
  29. package/dist/browser/presentations/index.js +284 -0
  30. package/dist/browser/presentations/pipeline.presentation.js +233 -0
  31. package/dist/browser/seeders/index.js +22 -0
  32. package/dist/browser/shared/overlay-types.js +0 -0
  33. package/dist/browser/ui/CrmDashboard.js +1325 -0
  34. package/dist/browser/ui/CrmDealCard.js +50 -0
  35. package/dist/browser/ui/CrmPipelineBoard.js +160 -0
  36. package/dist/browser/ui/hooks/index.js +186 -0
  37. package/dist/browser/ui/hooks/useDealList.js +84 -0
  38. package/dist/browser/ui/hooks/useDealMutations.js +100 -0
  39. package/dist/browser/ui/index.js +1972 -0
  40. package/dist/browser/ui/modals/CreateDealModal.js +211 -0
  41. package/dist/browser/ui/modals/DealActionsModal.js +428 -0
  42. package/dist/browser/ui/modals/index.js +638 -0
  43. package/dist/browser/ui/overlays/demo-overlays.js +55 -0
  44. package/dist/browser/ui/overlays/index.js +55 -0
  45. package/dist/browser/ui/renderers/index.js +827 -0
  46. package/dist/browser/ui/renderers/pipeline.markdown.js +564 -0
  47. package/dist/browser/ui/renderers/pipeline.renderer.js +264 -0
  48. package/dist/crm-pipeline.feature.d.ts +1 -6
  49. package/dist/crm-pipeline.feature.d.ts.map +1 -1
  50. package/dist/crm-pipeline.feature.js +74 -164
  51. package/dist/deal/deal.enum.d.ts +2 -7
  52. package/dist/deal/deal.enum.d.ts.map +1 -1
  53. package/dist/deal/deal.enum.js +16 -22
  54. package/dist/deal/deal.operation.d.ts +444 -450
  55. package/dist/deal/deal.operation.d.ts.map +1 -1
  56. package/dist/deal/deal.operation.js +390 -263
  57. package/dist/deal/deal.schema.d.ts +251 -256
  58. package/dist/deal/deal.schema.d.ts.map +1 -1
  59. package/dist/deal/deal.schema.js +131 -275
  60. package/dist/deal/deal.test-spec.d.ts +2 -7
  61. package/dist/deal/deal.test-spec.d.ts.map +1 -1
  62. package/dist/deal/deal.test-spec.js +56 -62
  63. package/dist/deal/index.d.ts +7 -4
  64. package/dist/deal/index.d.ts.map +1 -0
  65. package/dist/deal/index.js +408 -4
  66. package/dist/docs/crm-pipeline.docblock.d.ts +2 -1
  67. package/dist/docs/crm-pipeline.docblock.d.ts.map +1 -0
  68. package/dist/docs/crm-pipeline.docblock.js +45 -51
  69. package/dist/docs/index.d.ts +2 -1
  70. package/dist/docs/index.d.ts.map +1 -0
  71. package/dist/docs/index.js +114 -1
  72. package/dist/entities/company.entity.d.ts +27 -32
  73. package/dist/entities/company.entity.d.ts.map +1 -1
  74. package/dist/entities/company.entity.js +51 -61
  75. package/dist/entities/contact.entity.d.ts +31 -36
  76. package/dist/entities/contact.entity.d.ts.map +1 -1
  77. package/dist/entities/contact.entity.js +65 -76
  78. package/dist/entities/deal.entity.d.ts +52 -57
  79. package/dist/entities/deal.entity.d.ts.map +1 -1
  80. package/dist/entities/deal.entity.js +104 -116
  81. package/dist/entities/index.d.ts +6 -10
  82. package/dist/entities/index.d.ts.map +1 -1
  83. package/dist/entities/index.js +342 -31
  84. package/dist/entities/task.entity.d.ts +42 -47
  85. package/dist/entities/task.entity.d.ts.map +1 -1
  86. package/dist/entities/task.entity.js +95 -124
  87. package/dist/events/contact.event.d.ts +21 -27
  88. package/dist/events/contact.event.d.ts.map +1 -1
  89. package/dist/events/contact.event.js +29 -42
  90. package/dist/events/deal.event.d.ts +100 -106
  91. package/dist/events/deal.event.d.ts.map +1 -1
  92. package/dist/events/deal.event.js +93 -163
  93. package/dist/events/index.d.ts +4 -4
  94. package/dist/events/index.d.ts.map +1 -0
  95. package/dist/events/index.js +158 -4
  96. package/dist/events/task.event.d.ts +21 -27
  97. package/dist/events/task.event.d.ts.map +1 -1
  98. package/dist/events/task.event.js +26 -42
  99. package/dist/example.d.ts +2 -6
  100. package/dist/example.d.ts.map +1 -1
  101. package/dist/example.js +38 -50
  102. package/dist/handlers/crm.handlers.d.ts +80 -78
  103. package/dist/handlers/crm.handlers.d.ts.map +1 -1
  104. package/dist/handlers/crm.handlers.js +155 -166
  105. package/dist/handlers/deal.handlers.d.ts +58 -63
  106. package/dist/handlers/deal.handlers.d.ts.map +1 -1
  107. package/dist/handlers/deal.handlers.js +279 -105
  108. package/dist/handlers/index.d.ts +10 -4
  109. package/dist/handlers/index.d.ts.map +1 -0
  110. package/dist/handlers/index.js +456 -4
  111. package/dist/handlers/mock-data.d.ts +38 -41
  112. package/dist/handlers/mock-data.d.ts.map +1 -1
  113. package/dist/handlers/mock-data.js +162 -184
  114. package/dist/index.d.ts +13 -42
  115. package/dist/index.d.ts.map +1 -1
  116. package/dist/index.js +3277 -53
  117. package/dist/node/crm-pipeline.feature.js +75 -0
  118. package/dist/node/deal/deal.enum.js +18 -0
  119. package/dist/node/deal/deal.operation.js +396 -0
  120. package/dist/node/deal/deal.schema.js +141 -0
  121. package/dist/node/deal/deal.test-spec.js +58 -0
  122. package/dist/node/deal/index.js +408 -0
  123. package/dist/node/docs/crm-pipeline.docblock.js +113 -0
  124. package/dist/node/docs/index.js +113 -0
  125. package/dist/node/entities/company.entity.js +52 -0
  126. package/dist/node/entities/contact.entity.js +66 -0
  127. package/dist/node/entities/deal.entity.js +107 -0
  128. package/dist/node/entities/index.js +343 -0
  129. package/dist/node/entities/task.entity.js +99 -0
  130. package/dist/node/events/contact.event.js +31 -0
  131. package/dist/node/events/deal.event.js +101 -0
  132. package/dist/node/events/index.js +158 -0
  133. package/dist/node/events/task.event.js +28 -0
  134. package/dist/node/example.js +39 -0
  135. package/dist/node/handlers/crm.handlers.js +160 -0
  136. package/dist/node/handlers/deal.handlers.js +293 -0
  137. package/dist/node/handlers/index.js +456 -0
  138. package/dist/node/handlers/mock-data.js +165 -0
  139. package/dist/node/index.js +3279 -0
  140. package/dist/node/operations/index.js +407 -0
  141. package/dist/node/presentations/dashboard.presentation.js +52 -0
  142. package/dist/node/presentations/index.js +284 -0
  143. package/dist/node/presentations/pipeline.presentation.js +233 -0
  144. package/dist/node/seeders/index.js +22 -0
  145. package/dist/node/shared/overlay-types.js +0 -0
  146. package/dist/node/ui/CrmDashboard.js +1325 -0
  147. package/dist/node/ui/CrmDealCard.js +50 -0
  148. package/dist/node/ui/CrmPipelineBoard.js +160 -0
  149. package/dist/node/ui/hooks/index.js +186 -0
  150. package/dist/node/ui/hooks/useDealList.js +84 -0
  151. package/dist/node/ui/hooks/useDealMutations.js +100 -0
  152. package/dist/node/ui/index.js +1972 -0
  153. package/dist/node/ui/modals/CreateDealModal.js +211 -0
  154. package/dist/node/ui/modals/DealActionsModal.js +428 -0
  155. package/dist/node/ui/modals/index.js +638 -0
  156. package/dist/node/ui/overlays/demo-overlays.js +55 -0
  157. package/dist/node/ui/overlays/index.js +55 -0
  158. package/dist/node/ui/renderers/index.js +827 -0
  159. package/dist/node/ui/renderers/pipeline.markdown.js +564 -0
  160. package/dist/node/ui/renderers/pipeline.renderer.js +264 -0
  161. package/dist/operations/index.d.ts +2 -5
  162. package/dist/operations/index.d.ts.map +1 -0
  163. package/dist/operations/index.js +407 -5
  164. package/dist/presentations/dashboard.presentation.d.ts +2 -7
  165. package/dist/presentations/dashboard.presentation.d.ts.map +1 -1
  166. package/dist/presentations/dashboard.presentation.js +51 -60
  167. package/dist/presentations/index.d.ts +3 -3
  168. package/dist/presentations/index.d.ts.map +1 -0
  169. package/dist/presentations/index.js +284 -3
  170. package/dist/presentations/pipeline.presentation.d.ts +4 -9
  171. package/dist/presentations/pipeline.presentation.d.ts.map +1 -1
  172. package/dist/presentations/pipeline.presentation.js +228 -116
  173. package/dist/seeders/index.d.ts +4 -8
  174. package/dist/seeders/index.d.ts.map +1 -1
  175. package/dist/seeders/index.js +21 -45
  176. package/dist/shared/overlay-types.d.ts +25 -28
  177. package/dist/shared/overlay-types.d.ts.map +1 -1
  178. package/dist/shared/overlay-types.js +1 -0
  179. package/dist/ui/CrmDashboard.d.ts +1 -6
  180. package/dist/ui/CrmDashboard.d.ts.map +1 -1
  181. package/dist/ui/CrmDashboard.js +1318 -296
  182. package/dist/ui/CrmDealCard.d.ts +8 -12
  183. package/dist/ui/CrmDealCard.d.ts.map +1 -1
  184. package/dist/ui/CrmDealCard.js +47 -45
  185. package/dist/ui/CrmPipelineBoard.d.ts +11 -20
  186. package/dist/ui/CrmPipelineBoard.d.ts.map +1 -1
  187. package/dist/ui/CrmPipelineBoard.js +157 -94
  188. package/dist/ui/hooks/index.d.ts +3 -3
  189. package/dist/ui/hooks/index.d.ts.map +1 -0
  190. package/dist/ui/hooks/index.js +185 -4
  191. package/dist/ui/hooks/useDealList.d.ts +28 -32
  192. package/dist/ui/hooks/useDealList.d.ts.map +1 -1
  193. package/dist/ui/hooks/useDealList.js +81 -90
  194. package/dist/ui/hooks/useDealMutations.d.ts +18 -22
  195. package/dist/ui/hooks/useDealMutations.d.ts.map +1 -1
  196. package/dist/ui/hooks/useDealMutations.js +97 -155
  197. package/dist/ui/index.d.ts +8 -14
  198. package/dist/ui/index.d.ts.map +1 -0
  199. package/dist/ui/index.js +1973 -15
  200. package/dist/ui/modals/CreateDealModal.d.ts +19 -29
  201. package/dist/ui/modals/CreateDealModal.d.ts.map +1 -1
  202. package/dist/ui/modals/CreateDealModal.js +209 -180
  203. package/dist/ui/modals/DealActionsModal.d.ts +31 -44
  204. package/dist/ui/modals/DealActionsModal.d.ts.map +1 -1
  205. package/dist/ui/modals/DealActionsModal.js +424 -367
  206. package/dist/ui/modals/index.d.ts +3 -3
  207. package/dist/ui/modals/index.d.ts.map +1 -0
  208. package/dist/ui/modals/index.js +638 -3
  209. package/dist/ui/overlays/demo-overlays.d.ts +10 -8
  210. package/dist/ui/overlays/demo-overlays.d.ts.map +1 -1
  211. package/dist/ui/overlays/demo-overlays.js +54 -66
  212. package/dist/ui/overlays/index.d.ts +2 -2
  213. package/dist/ui/overlays/index.d.ts.map +1 -0
  214. package/dist/ui/overlays/index.js +56 -3
  215. package/dist/ui/renderers/index.d.ts +3 -3
  216. package/dist/ui/renderers/index.d.ts.map +1 -0
  217. package/dist/ui/renderers/index.js +827 -3
  218. package/dist/ui/renderers/pipeline.markdown.d.ts +12 -11
  219. package/dist/ui/renderers/pipeline.markdown.d.ts.map +1 -1
  220. package/dist/ui/renderers/pipeline.markdown.js +560 -114
  221. package/dist/ui/renderers/pipeline.renderer.d.ts +9 -7
  222. package/dist/ui/renderers/pipeline.renderer.d.ts.map +1 -1
  223. package/dist/ui/renderers/pipeline.renderer.js +261 -24
  224. package/package.json +476 -90
  225. package/tsdown.config.js +1 -2
  226. package/.turbo/turbo-build$colon$bundle.log +0 -164
  227. package/dist/crm-pipeline.feature.js.map +0 -1
  228. package/dist/deal/deal.enum.js.map +0 -1
  229. package/dist/deal/deal.operation.js.map +0 -1
  230. package/dist/deal/deal.schema.js.map +0 -1
  231. package/dist/deal/deal.test-spec.js.map +0 -1
  232. package/dist/docs/crm-pipeline.docblock.js.map +0 -1
  233. package/dist/entities/company.entity.js.map +0 -1
  234. package/dist/entities/contact.entity.js.map +0 -1
  235. package/dist/entities/deal.entity.js.map +0 -1
  236. package/dist/entities/index.js.map +0 -1
  237. package/dist/entities/task.entity.js.map +0 -1
  238. package/dist/events/contact.event.js.map +0 -1
  239. package/dist/events/deal.event.js.map +0 -1
  240. package/dist/events/task.event.js.map +0 -1
  241. package/dist/example.js.map +0 -1
  242. package/dist/handlers/crm.handlers.js.map +0 -1
  243. package/dist/handlers/deal.handlers.js.map +0 -1
  244. package/dist/handlers/mock-data.js.map +0 -1
  245. package/dist/index.js.map +0 -1
  246. package/dist/presentations/dashboard.presentation.js.map +0 -1
  247. package/dist/presentations/pipeline.presentation.js.map +0 -1
  248. package/dist/seeders/index.js.map +0 -1
  249. package/dist/ui/CrmDashboard.js.map +0 -1
  250. package/dist/ui/CrmDealCard.js.map +0 -1
  251. package/dist/ui/CrmPipelineBoard.js.map +0 -1
  252. package/dist/ui/hooks/useDealList.js.map +0 -1
  253. package/dist/ui/hooks/useDealMutations.js.map +0 -1
  254. package/dist/ui/modals/CreateDealModal.js.map +0 -1
  255. package/dist/ui/modals/DealActionsModal.js.map +0 -1
  256. package/dist/ui/overlays/demo-overlays.js.map +0 -1
  257. package/dist/ui/renderers/pipeline.markdown.js.map +0 -1
  258. package/dist/ui/renderers/pipeline.renderer.js.map +0 -1
  259. package/tsconfig.tsbuildinfo +0 -1
@@ -1,286 +1,142 @@
1
- import { DealStatusEnum, DealStatusFilterEnum } from "./deal.enum.js";
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
1
+ // @bun
2
+ // src/deal/deal.enum.ts
3
+ import { defineEnum } from "@contractspec/lib.schema";
4
+ var DealStatusEnum = defineEnum("DealStatus", [
5
+ "OPEN",
6
+ "WON",
7
+ "LOST",
8
+ "STALE"
9
+ ]);
10
+ var DealStatusFilterEnum = defineEnum("DealStatusFilter", [
11
+ "OPEN",
12
+ "WON",
13
+ "LOST",
14
+ "all"
15
+ ]);
3
16
 
4
- //#region src/deal/deal.schema.ts
5
- /**
6
- * A deal in the CRM pipeline.
7
- */
8
- const DealModel = defineSchemaModel({
9
- name: "Deal",
10
- description: "A deal in the CRM pipeline",
11
- fields: {
12
- id: {
13
- type: ScalarTypeEnum.String_unsecure(),
14
- isOptional: false
15
- },
16
- name: {
17
- type: ScalarTypeEnum.String_unsecure(),
18
- isOptional: false
19
- },
20
- value: {
21
- type: ScalarTypeEnum.Float_unsecure(),
22
- isOptional: false
23
- },
24
- currency: {
25
- type: ScalarTypeEnum.String_unsecure(),
26
- isOptional: false
27
- },
28
- pipelineId: {
29
- type: ScalarTypeEnum.String_unsecure(),
30
- isOptional: false
31
- },
32
- stageId: {
33
- type: ScalarTypeEnum.String_unsecure(),
34
- isOptional: false
35
- },
36
- status: {
37
- type: DealStatusEnum,
38
- isOptional: false
39
- },
40
- contactId: {
41
- type: ScalarTypeEnum.String_unsecure(),
42
- isOptional: true
43
- },
44
- companyId: {
45
- type: ScalarTypeEnum.String_unsecure(),
46
- isOptional: true
47
- },
48
- ownerId: {
49
- type: ScalarTypeEnum.String_unsecure(),
50
- isOptional: false
51
- },
52
- expectedCloseDate: {
53
- type: ScalarTypeEnum.DateTime(),
54
- isOptional: true
55
- },
56
- createdAt: {
57
- type: ScalarTypeEnum.DateTime(),
58
- isOptional: false
59
- },
60
- updatedAt: {
61
- type: ScalarTypeEnum.DateTime(),
62
- isOptional: false
63
- }
64
- }
17
+ // src/deal/deal.schema.ts
18
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
19
+ var DealModel = defineSchemaModel({
20
+ name: "Deal",
21
+ description: "A deal in the CRM pipeline",
22
+ fields: {
23
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
25
+ value: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
26
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
27
+ pipelineId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
28
+ stageId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
29
+ status: { type: DealStatusEnum, isOptional: false },
30
+ contactId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
31
+ companyId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
32
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
33
+ expectedCloseDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
34
+ createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },
35
+ updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false }
36
+ }
65
37
  });
66
- /**
67
- * Input for creating a deal.
68
- */
69
- const CreateDealInputModel = defineSchemaModel({
70
- name: "CreateDealInput",
71
- description: "Input for creating a deal",
72
- fields: {
73
- name: {
74
- type: ScalarTypeEnum.NonEmptyString(),
75
- isOptional: false
76
- },
77
- value: {
78
- type: ScalarTypeEnum.Float_unsecure(),
79
- isOptional: false
80
- },
81
- currency: {
82
- type: ScalarTypeEnum.String_unsecure(),
83
- isOptional: true
84
- },
85
- pipelineId: {
86
- type: ScalarTypeEnum.String_unsecure(),
87
- isOptional: false
88
- },
89
- stageId: {
90
- type: ScalarTypeEnum.String_unsecure(),
91
- isOptional: false
92
- },
93
- contactId: {
94
- type: ScalarTypeEnum.String_unsecure(),
95
- isOptional: true
96
- },
97
- companyId: {
98
- type: ScalarTypeEnum.String_unsecure(),
99
- isOptional: true
100
- },
101
- expectedCloseDate: {
102
- type: ScalarTypeEnum.DateTime(),
103
- isOptional: true
104
- }
105
- }
38
+ var CreateDealInputModel = defineSchemaModel({
39
+ name: "CreateDealInput",
40
+ description: "Input for creating a deal",
41
+ fields: {
42
+ name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
43
+ value: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
44
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
45
+ pipelineId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
46
+ stageId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
47
+ contactId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
48
+ companyId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
49
+ expectedCloseDate: { type: ScalarTypeEnum.DateTime(), isOptional: true }
50
+ }
106
51
  });
107
- /**
108
- * Input for moving a deal to another stage.
109
- */
110
- const MoveDealInputModel = defineSchemaModel({
111
- name: "MoveDealInput",
112
- description: "Input for moving a deal to another stage",
113
- fields: {
114
- dealId: {
115
- type: ScalarTypeEnum.String_unsecure(),
116
- isOptional: false
117
- },
118
- stageId: {
119
- type: ScalarTypeEnum.String_unsecure(),
120
- isOptional: false
121
- },
122
- position: {
123
- type: ScalarTypeEnum.Int_unsecure(),
124
- isOptional: true
125
- }
126
- }
52
+ var MoveDealInputModel = defineSchemaModel({
53
+ name: "MoveDealInput",
54
+ description: "Input for moving a deal to another stage",
55
+ fields: {
56
+ dealId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
57
+ stageId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
58
+ position: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
59
+ }
127
60
  });
128
- /**
129
- * Payload for deal moved event.
130
- */
131
- const DealMovedPayloadModel = defineSchemaModel({
132
- name: "DealMovedPayload",
133
- fields: {
134
- dealId: {
135
- type: ScalarTypeEnum.String_unsecure(),
136
- isOptional: false
137
- },
138
- fromStage: {
139
- type: ScalarTypeEnum.String_unsecure(),
140
- isOptional: false
141
- },
142
- toStage: {
143
- type: ScalarTypeEnum.String_unsecure(),
144
- isOptional: false
145
- }
146
- }
61
+ var DealMovedPayloadModel = defineSchemaModel({
62
+ name: "DealMovedPayload",
63
+ fields: {
64
+ dealId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
65
+ fromStage: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
66
+ toStage: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
67
+ }
147
68
  });
148
- /**
149
- * Input for marking a deal as won.
150
- */
151
- const WinDealInputModel = defineSchemaModel({
152
- name: "WinDealInput",
153
- description: "Input for marking a deal as won",
154
- fields: {
155
- dealId: {
156
- type: ScalarTypeEnum.String_unsecure(),
157
- isOptional: false
158
- },
159
- wonSource: {
160
- type: ScalarTypeEnum.String_unsecure(),
161
- isOptional: true
162
- },
163
- notes: {
164
- type: ScalarTypeEnum.String_unsecure(),
165
- isOptional: true
166
- }
167
- }
69
+ var WinDealInputModel = defineSchemaModel({
70
+ name: "WinDealInput",
71
+ description: "Input for marking a deal as won",
72
+ fields: {
73
+ dealId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
74
+ wonSource: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
75
+ notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
76
+ }
168
77
  });
169
- /**
170
- * Payload for deal won event.
171
- */
172
- const DealWonPayloadModel = defineSchemaModel({
173
- name: "DealWonPayload",
174
- fields: {
175
- dealId: {
176
- type: ScalarTypeEnum.String_unsecure(),
177
- isOptional: false
178
- },
179
- value: {
180
- type: ScalarTypeEnum.Float_unsecure(),
181
- isOptional: false
182
- }
183
- }
78
+ var DealWonPayloadModel = defineSchemaModel({
79
+ name: "DealWonPayload",
80
+ fields: {
81
+ dealId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
82
+ value: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
83
+ }
184
84
  });
185
- /**
186
- * Input for marking a deal as lost.
187
- */
188
- const LoseDealInputModel = defineSchemaModel({
189
- name: "LoseDealInput",
190
- description: "Input for marking a deal as lost",
191
- fields: {
192
- dealId: {
193
- type: ScalarTypeEnum.String_unsecure(),
194
- isOptional: false
195
- },
196
- lostReason: {
197
- type: ScalarTypeEnum.String_unsecure(),
198
- isOptional: false
199
- },
200
- notes: {
201
- type: ScalarTypeEnum.String_unsecure(),
202
- isOptional: true
203
- }
204
- }
85
+ var LoseDealInputModel = defineSchemaModel({
86
+ name: "LoseDealInput",
87
+ description: "Input for marking a deal as lost",
88
+ fields: {
89
+ dealId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
90
+ lostReason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
91
+ notes: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
92
+ }
205
93
  });
206
- /**
207
- * Payload for deal lost event.
208
- */
209
- const DealLostPayloadModel = defineSchemaModel({
210
- name: "DealLostPayload",
211
- fields: {
212
- dealId: {
213
- type: ScalarTypeEnum.String_unsecure(),
214
- isOptional: false
215
- },
216
- reason: {
217
- type: ScalarTypeEnum.String_unsecure(),
218
- isOptional: false
219
- }
220
- }
94
+ var DealLostPayloadModel = defineSchemaModel({
95
+ name: "DealLostPayload",
96
+ fields: {
97
+ dealId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
98
+ reason: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
99
+ }
221
100
  });
222
- /**
223
- * Input for listing deals.
224
- */
225
- const ListDealsInputModel = defineSchemaModel({
226
- name: "ListDealsInput",
227
- description: "Input for listing deals",
228
- fields: {
229
- pipelineId: {
230
- type: ScalarTypeEnum.String_unsecure(),
231
- isOptional: true
232
- },
233
- stageId: {
234
- type: ScalarTypeEnum.String_unsecure(),
235
- isOptional: true
236
- },
237
- status: {
238
- type: DealStatusFilterEnum,
239
- isOptional: true
240
- },
241
- ownerId: {
242
- type: ScalarTypeEnum.String_unsecure(),
243
- isOptional: true
244
- },
245
- search: {
246
- type: ScalarTypeEnum.String_unsecure(),
247
- isOptional: true
248
- },
249
- limit: {
250
- type: ScalarTypeEnum.Int_unsecure(),
251
- isOptional: true,
252
- defaultValue: 20
253
- },
254
- offset: {
255
- type: ScalarTypeEnum.Int_unsecure(),
256
- isOptional: true,
257
- defaultValue: 0
258
- }
259
- }
101
+ var ListDealsInputModel = defineSchemaModel({
102
+ name: "ListDealsInput",
103
+ description: "Input for listing deals",
104
+ fields: {
105
+ pipelineId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
106
+ stageId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
107
+ status: { type: DealStatusFilterEnum, isOptional: true },
108
+ ownerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
109
+ search: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
110
+ limit: {
111
+ type: ScalarTypeEnum.Int_unsecure(),
112
+ isOptional: true,
113
+ defaultValue: 20
114
+ },
115
+ offset: {
116
+ type: ScalarTypeEnum.Int_unsecure(),
117
+ isOptional: true,
118
+ defaultValue: 0
119
+ }
120
+ }
260
121
  });
261
- /**
262
- * Output for listing deals.
263
- */
264
- const ListDealsOutputModel = defineSchemaModel({
265
- name: "ListDealsOutput",
266
- description: "Output for listing deals",
267
- fields: {
268
- deals: {
269
- type: DealModel,
270
- isArray: true,
271
- isOptional: false
272
- },
273
- total: {
274
- type: ScalarTypeEnum.Int_unsecure(),
275
- isOptional: false
276
- },
277
- totalValue: {
278
- type: ScalarTypeEnum.Float_unsecure(),
279
- isOptional: false
280
- }
281
- }
122
+ var ListDealsOutputModel = defineSchemaModel({
123
+ name: "ListDealsOutput",
124
+ description: "Output for listing deals",
125
+ fields: {
126
+ deals: { type: DealModel, isArray: true, isOptional: false },
127
+ total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },
128
+ totalValue: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
129
+ }
282
130
  });
283
-
284
- //#endregion
285
- export { CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealWonPayloadModel, ListDealsInputModel, ListDealsOutputModel, LoseDealInputModel, MoveDealInputModel, WinDealInputModel };
286
- //# sourceMappingURL=deal.schema.js.map
131
+ export {
132
+ WinDealInputModel,
133
+ MoveDealInputModel,
134
+ LoseDealInputModel,
135
+ ListDealsOutputModel,
136
+ ListDealsInputModel,
137
+ DealWonPayloadModel,
138
+ DealMovedPayloadModel,
139
+ DealModel,
140
+ DealLostPayloadModel,
141
+ CreateDealInputModel
142
+ };
@@ -1,8 +1,3 @@
1
- import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
-
3
- //#region src/deal/deal.test-spec.d.ts
4
- declare const dealListTest: _contractspec_lib_contracts0.TestSpec;
5
- declare const dealMoveTest: _contractspec_lib_contracts0.TestSpec;
6
- //#endregion
7
- export { dealListTest, dealMoveTest };
1
+ export declare const dealListTest: import("@contractspec/lib.contracts").TestSpec;
2
+ export declare const dealMoveTest: import("@contractspec/lib.contracts").TestSpec;
8
3
  //# sourceMappingURL=deal.test-spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deal.test-spec.d.ts","names":[],"sources":["../../src/deal/deal.test-spec.ts"],"mappings":";;;cAEa,YAAA,EAyBX,4BAAA,CAzBuB,QAAA;AAAA,cA2BZ,YAAA,EAyBX,4BAAA,CAzBuB,QAAA"}
1
+ {"version":3,"file":"deal.test-spec.d.ts","sourceRoot":"","sources":["../../src/deal/deal.test-spec.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,gDAyBvB,CAAC;AAEH,eAAO,MAAM,YAAY,gDAyBvB,CAAC"}
@@ -1,65 +1,59 @@
1
+ // @bun
2
+ // src/deal/deal.test-spec.ts
1
3
  import { defineTestSpec } from "@contractspec/lib.contracts";
2
-
3
- //#region src/deal/deal.test-spec.ts
4
- const dealListTest = defineTestSpec({
5
- meta: {
6
- key: "test.crm.deal.list",
7
- version: "1.0.0",
8
- owners: ["@example.crm-pipeline"],
9
- description: "Test for listing deals",
10
- stability: "stable",
11
- tags: ["test"]
12
- },
13
- target: {
14
- type: "operation",
15
- operation: {
16
- key: "crm.deal.list",
17
- version: "1.0.0"
18
- }
19
- },
20
- scenarios: [{
21
- key: "success",
22
- when: { operation: { key: "crm.deal.list" } },
23
- then: [{
24
- type: "expectOutput",
25
- match: {}
26
- }]
27
- }, {
28
- key: "error",
29
- when: { operation: { key: "crm.deal.list" } },
30
- then: [{ type: "expectError" }]
31
- }]
4
+ var dealListTest = defineTestSpec({
5
+ meta: {
6
+ key: "test.crm.deal.list",
7
+ version: "1.0.0",
8
+ owners: ["@example.crm-pipeline"],
9
+ description: "Test for listing deals",
10
+ stability: "stable",
11
+ tags: ["test"]
12
+ },
13
+ target: {
14
+ type: "operation",
15
+ operation: { key: "crm.deal.list", version: "1.0.0" }
16
+ },
17
+ scenarios: [
18
+ {
19
+ key: "success",
20
+ when: { operation: { key: "crm.deal.list" } },
21
+ then: [{ type: "expectOutput", match: {} }]
22
+ },
23
+ {
24
+ key: "error",
25
+ when: { operation: { key: "crm.deal.list" } },
26
+ then: [{ type: "expectError" }]
27
+ }
28
+ ]
32
29
  });
33
- const dealMoveTest = defineTestSpec({
34
- meta: {
35
- key: "test.crm.deal.move",
36
- version: "1.0.0",
37
- owners: ["@example.crm-pipeline"],
38
- description: "Test for moving deal",
39
- stability: "stable",
40
- tags: ["test"]
41
- },
42
- target: {
43
- type: "operation",
44
- operation: {
45
- key: "crm.deal.move",
46
- version: "1.0.0"
47
- }
48
- },
49
- scenarios: [{
50
- key: "success",
51
- when: { operation: { key: "crm.deal.move" } },
52
- then: [{
53
- type: "expectOutput",
54
- match: {}
55
- }]
56
- }, {
57
- key: "error",
58
- when: { operation: { key: "crm.deal.move" } },
59
- then: [{ type: "expectError" }]
60
- }]
30
+ var dealMoveTest = defineTestSpec({
31
+ meta: {
32
+ key: "test.crm.deal.move",
33
+ version: "1.0.0",
34
+ owners: ["@example.crm-pipeline"],
35
+ description: "Test for moving deal",
36
+ stability: "stable",
37
+ tags: ["test"]
38
+ },
39
+ target: {
40
+ type: "operation",
41
+ operation: { key: "crm.deal.move", version: "1.0.0" }
42
+ },
43
+ scenarios: [
44
+ {
45
+ key: "success",
46
+ when: { operation: { key: "crm.deal.move" } },
47
+ then: [{ type: "expectOutput", match: {} }]
48
+ },
49
+ {
50
+ key: "error",
51
+ when: { operation: { key: "crm.deal.move" } },
52
+ then: [{ type: "expectError" }]
53
+ }
54
+ ]
61
55
  });
62
-
63
- //#endregion
64
- export { dealListTest, dealMoveTest };
65
- //# sourceMappingURL=deal.test-spec.js.map
56
+ export {
57
+ dealMoveTest,
58
+ dealListTest
59
+ };
@@ -1,4 +1,7 @@
1
- import { DealStatusEnum, DealStatusFilterEnum } from "./deal.enum.js";
2
- import { CreateDealContract, ListDealsContract, LoseDealContract, MoveDealContract, WinDealContract } from "./deal.operation.js";
3
- import { CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealWonPayloadModel, ListDealsInputModel, ListDealsOutputModel, LoseDealInputModel, MoveDealInputModel, WinDealInputModel } from "./deal.schema.js";
4
- export { CreateDealContract, CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealStatusEnum, DealStatusFilterEnum, DealWonPayloadModel, ListDealsContract, ListDealsInputModel, ListDealsOutputModel, LoseDealContract, LoseDealInputModel, MoveDealContract, MoveDealInputModel, WinDealContract, WinDealInputModel };
1
+ /**
2
+ * Deal domain - Deal management in CRM pipeline.
3
+ */
4
+ export { DealStatusEnum, DealStatusFilterEnum } from './deal.enum';
5
+ export { DealModel, CreateDealInputModel, MoveDealInputModel, DealMovedPayloadModel, WinDealInputModel, DealWonPayloadModel, LoseDealInputModel, DealLostPayloadModel, ListDealsInputModel, ListDealsOutputModel, } from './deal.schema';
6
+ export { CreateDealContract, MoveDealContract, WinDealContract, LoseDealContract, ListDealsContract, } from './deal.operation';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/deal/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,EACL,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,kBAAkB,CAAC"}