@contractspec/example.crm-pipeline 1.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +97 -0
  2. package/.turbo/turbo-build.log +98 -0
  3. package/CHANGELOG.md +246 -0
  4. package/LICENSE +21 -0
  5. package/README.md +139 -0
  6. package/dist/crm-pipeline.feature.d.ts +12 -0
  7. package/dist/crm-pipeline.feature.d.ts.map +1 -0
  8. package/dist/crm-pipeline.feature.js +159 -0
  9. package/dist/crm-pipeline.feature.js.map +1 -0
  10. package/dist/deal/deal.enum.d.ts +14 -0
  11. package/dist/deal/deal.enum.d.ts.map +1 -0
  12. package/dist/deal/deal.enum.js +25 -0
  13. package/dist/deal/deal.enum.js.map +1 -0
  14. package/dist/deal/deal.operation.d.ts +513 -0
  15. package/dist/deal/deal.operation.d.ts.map +1 -0
  16. package/dist/deal/deal.operation.js +270 -0
  17. package/dist/deal/deal.operation.js.map +1 -0
  18. package/dist/deal/deal.schema.d.ts +300 -0
  19. package/dist/deal/deal.schema.d.ts.map +1 -0
  20. package/dist/deal/deal.schema.js +286 -0
  21. package/dist/deal/deal.schema.js.map +1 -0
  22. package/dist/deal/index.d.ts +4 -0
  23. package/dist/deal/index.js +5 -0
  24. package/dist/docs/crm-pipeline.docblock.d.ts +1 -0
  25. package/dist/docs/crm-pipeline.docblock.js +100 -0
  26. package/dist/docs/crm-pipeline.docblock.js.map +1 -0
  27. package/dist/docs/index.d.ts +1 -0
  28. package/dist/docs/index.js +1 -0
  29. package/dist/entities/company.entity.d.ts +40 -0
  30. package/dist/entities/company.entity.d.ts.map +1 -0
  31. package/dist/entities/company.entity.js +63 -0
  32. package/dist/entities/company.entity.js.map +1 -0
  33. package/dist/entities/contact.entity.d.ts +44 -0
  34. package/dist/entities/contact.entity.d.ts.map +1 -0
  35. package/dist/entities/contact.entity.js +78 -0
  36. package/dist/entities/contact.entity.js.map +1 -0
  37. package/dist/entities/deal.entity.d.ts +73 -0
  38. package/dist/entities/deal.entity.d.ts.map +1 -0
  39. package/dist/entities/deal.entity.js +120 -0
  40. package/dist/entities/deal.entity.js.map +1 -0
  41. package/dist/entities/index.d.ts +15 -0
  42. package/dist/entities/index.d.ts.map +1 -0
  43. package/dist/entities/index.js +33 -0
  44. package/dist/entities/index.js.map +1 -0
  45. package/dist/entities/task.entity.d.ts +65 -0
  46. package/dist/entities/task.entity.d.ts.map +1 -0
  47. package/dist/entities/task.entity.js +129 -0
  48. package/dist/entities/task.entity.js.map +1 -0
  49. package/dist/events/contact.event.d.ts +29 -0
  50. package/dist/events/contact.event.d.ts.map +1 -0
  51. package/dist/events/contact.event.js +45 -0
  52. package/dist/events/contact.event.js.map +1 -0
  53. package/dist/events/deal.event.d.ts +111 -0
  54. package/dist/events/deal.event.d.ts.map +1 -0
  55. package/dist/events/deal.event.js +172 -0
  56. package/dist/events/deal.event.js.map +1 -0
  57. package/dist/events/index.d.ts +4 -0
  58. package/dist/events/index.js +5 -0
  59. package/dist/events/task.event.d.ts +29 -0
  60. package/dist/events/task.event.d.ts.map +1 -0
  61. package/dist/events/task.event.js +45 -0
  62. package/dist/events/task.event.js.map +1 -0
  63. package/dist/example.d.ts +37 -0
  64. package/dist/example.d.ts.map +1 -0
  65. package/dist/example.js +46 -0
  66. package/dist/example.js.map +1 -0
  67. package/dist/handlers/deal.handlers.d.ts +94 -0
  68. package/dist/handlers/deal.handlers.d.ts.map +1 -0
  69. package/dist/handlers/deal.handlers.js +120 -0
  70. package/dist/handlers/deal.handlers.js.map +1 -0
  71. package/dist/handlers/index.d.ts +3 -0
  72. package/dist/handlers/index.js +4 -0
  73. package/dist/handlers/mock-data.d.ts +49 -0
  74. package/dist/handlers/mock-data.d.ts.map +1 -0
  75. package/dist/handlers/mock-data.js +188 -0
  76. package/dist/handlers/mock-data.js.map +1 -0
  77. package/dist/index.d.ts +34 -0
  78. package/dist/index.d.ts.map +1 -0
  79. package/dist/index.js +43 -0
  80. package/dist/index.js.map +1 -0
  81. package/dist/operations/index.d.ts +5 -0
  82. package/dist/operations/index.js +6 -0
  83. package/dist/presentations/dashboard.presentation.d.ts +15 -0
  84. package/dist/presentations/dashboard.presentation.d.ts.map +1 -0
  85. package/dist/presentations/dashboard.presentation.js +59 -0
  86. package/dist/presentations/dashboard.presentation.js.map +1 -0
  87. package/dist/presentations/index.d.ts +3 -0
  88. package/dist/presentations/index.js +4 -0
  89. package/dist/presentations/pipeline.presentation.d.ts +23 -0
  90. package/dist/presentations/pipeline.presentation.d.ts.map +1 -0
  91. package/dist/presentations/pipeline.presentation.js +119 -0
  92. package/dist/presentations/pipeline.presentation.js.map +1 -0
  93. package/example.ts +1 -0
  94. package/package.json +105 -0
  95. package/src/crm-pipeline.feature.ts +96 -0
  96. package/src/deal/deal.enum.ts +21 -0
  97. package/src/deal/deal.operation.ts +291 -0
  98. package/src/deal/deal.schema.ts +154 -0
  99. package/src/deal/index.ts +26 -0
  100. package/src/docs/crm-pipeline.docblock.ts +98 -0
  101. package/src/docs/index.ts +1 -0
  102. package/src/entities/company.entity.ts +77 -0
  103. package/src/entities/contact.entity.ts +93 -0
  104. package/src/entities/deal.entity.ts +160 -0
  105. package/src/entities/index.ts +45 -0
  106. package/src/entities/task.entity.ts +137 -0
  107. package/src/events/contact.event.ts +31 -0
  108. package/src/events/deal.event.ts +104 -0
  109. package/src/events/index.ts +3 -0
  110. package/src/events/task.event.ts +28 -0
  111. package/src/example.ts +30 -0
  112. package/src/handlers/deal.handlers.ts +253 -0
  113. package/src/handlers/index.ts +27 -0
  114. package/src/handlers/mock-data.ts +198 -0
  115. package/src/index.ts +31 -0
  116. package/src/operations/index.ts +20 -0
  117. package/src/presentations/dashboard.presentation.ts +60 -0
  118. package/src/presentations/index.ts +2 -0
  119. package/src/presentations/pipeline.presentation.ts +118 -0
  120. package/tsconfig.json +10 -0
  121. package/tsconfig.tsbuildinfo +1 -0
  122. package/tsdown.config.js +7 -0
@@ -0,0 +1,120 @@
1
+ import { MOCK_DEALS, MOCK_STAGES } from "./mock-data.js";
2
+
3
+ //#region src/handlers/deal.handlers.ts
4
+ /**
5
+ * Mock handlers for Deal contracts
6
+ */
7
+ /**
8
+ * Mock handler for ListDealsContract
9
+ */
10
+ async function mockListDealsHandler(input) {
11
+ const { pipelineId, stageId, status, ownerId, search, limit = 20, offset = 0 } = input;
12
+ let filtered = [...MOCK_DEALS];
13
+ if (pipelineId) filtered = filtered.filter((d) => d.pipelineId === pipelineId);
14
+ if (stageId) filtered = filtered.filter((d) => d.stageId === stageId);
15
+ if (status && status !== "all") filtered = filtered.filter((d) => d.status === status);
16
+ if (ownerId) filtered = filtered.filter((d) => d.ownerId === ownerId);
17
+ if (search) {
18
+ const q = search.toLowerCase();
19
+ filtered = filtered.filter((d) => d.name.toLowerCase().includes(q));
20
+ }
21
+ filtered.sort((a, b) => b.value - a.value);
22
+ const total = filtered.length;
23
+ const totalValue = filtered.reduce((sum, d) => sum + d.value, 0);
24
+ return {
25
+ deals: filtered.slice(offset, offset + limit),
26
+ total,
27
+ totalValue
28
+ };
29
+ }
30
+ /**
31
+ * Mock handler for CreateDealContract
32
+ */
33
+ async function mockCreateDealHandler(input, context) {
34
+ const now = /* @__PURE__ */ new Date();
35
+ const deal = {
36
+ id: `deal-${Date.now()}`,
37
+ name: input.name,
38
+ value: input.value,
39
+ currency: input.currency ?? "USD",
40
+ pipelineId: input.pipelineId,
41
+ stageId: input.stageId,
42
+ status: "OPEN",
43
+ contactId: input.contactId,
44
+ companyId: input.companyId,
45
+ ownerId: context.ownerId,
46
+ expectedCloseDate: input.expectedCloseDate,
47
+ createdAt: now,
48
+ updatedAt: now
49
+ };
50
+ MOCK_DEALS.push(deal);
51
+ return deal;
52
+ }
53
+ /**
54
+ * Mock handler for MoveDealContract
55
+ */
56
+ async function mockMoveDealHandler(input) {
57
+ const dealIndex = MOCK_DEALS.findIndex((d) => d.id === input.dealId);
58
+ if (dealIndex === -1) throw new Error("NOT_FOUND");
59
+ const deal = MOCK_DEALS[dealIndex];
60
+ if (!deal) throw new Error("NOT_FOUND");
61
+ if (!MOCK_STAGES.find((s) => s.id === input.stageId)) throw new Error("INVALID_STAGE");
62
+ const updatedDeal = {
63
+ ...deal,
64
+ stageId: input.stageId,
65
+ updatedAt: /* @__PURE__ */ new Date()
66
+ };
67
+ MOCK_DEALS[dealIndex] = updatedDeal;
68
+ return updatedDeal;
69
+ }
70
+ /**
71
+ * Mock handler for WinDealContract
72
+ */
73
+ async function mockWinDealHandler(input) {
74
+ const dealIndex = MOCK_DEALS.findIndex((d) => d.id === input.dealId);
75
+ if (dealIndex === -1) throw new Error("NOT_FOUND");
76
+ const deal = MOCK_DEALS[dealIndex];
77
+ if (!deal) throw new Error("NOT_FOUND");
78
+ const updatedDeal = {
79
+ ...deal,
80
+ status: "WON",
81
+ updatedAt: /* @__PURE__ */ new Date()
82
+ };
83
+ MOCK_DEALS[dealIndex] = updatedDeal;
84
+ return updatedDeal;
85
+ }
86
+ /**
87
+ * Mock handler for LoseDealContract
88
+ */
89
+ async function mockLoseDealHandler(input) {
90
+ const dealIndex = MOCK_DEALS.findIndex((d) => d.id === input.dealId);
91
+ if (dealIndex === -1) throw new Error("NOT_FOUND");
92
+ const deal = MOCK_DEALS[dealIndex];
93
+ if (!deal) throw new Error("NOT_FOUND");
94
+ const updatedDeal = {
95
+ ...deal,
96
+ status: "LOST",
97
+ updatedAt: /* @__PURE__ */ new Date()
98
+ };
99
+ MOCK_DEALS[dealIndex] = updatedDeal;
100
+ return updatedDeal;
101
+ }
102
+ /**
103
+ * Get deals grouped by stage for Kanban view
104
+ */
105
+ async function mockGetDealsByStageHandler(input) {
106
+ const deals = MOCK_DEALS.filter((d) => d.pipelineId === input.pipelineId && d.status === "OPEN");
107
+ const grouped = {};
108
+ for (const stage of MOCK_STAGES) grouped[stage.id] = deals.filter((d) => d.stageId === stage.id);
109
+ return grouped;
110
+ }
111
+ /**
112
+ * Get pipeline stages
113
+ */
114
+ async function mockGetPipelineStagesHandler(input) {
115
+ return MOCK_STAGES.filter((s) => s.pipelineId === input.pipelineId);
116
+ }
117
+
118
+ //#endregion
119
+ export { mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler };
120
+ //# sourceMappingURL=deal.handlers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deal.handlers.js","names":["deal: Deal","updatedDeal: Deal","grouped: Record<string, Deal[]>"],"sources":["../../src/handlers/deal.handlers.ts"],"sourcesContent":["/**\n * Mock handlers for Deal contracts\n */\nimport { MOCK_DEALS, MOCK_STAGES } from './mock-data';\n\n// Types inferred from contract schemas\nexport interface Deal {\n id: string;\n name: string;\n value: number;\n currency: string;\n pipelineId: string;\n stageId: string;\n status: 'OPEN' | 'WON' | 'LOST' | 'STALE';\n contactId?: string;\n companyId?: string;\n ownerId: string;\n expectedCloseDate?: Date;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface CreateDealInput {\n name: string;\n value: number;\n currency?: string;\n pipelineId: string;\n stageId: string;\n contactId?: string;\n companyId?: string;\n expectedCloseDate?: Date;\n}\n\nexport interface MoveDealInput {\n dealId: string;\n stageId: string;\n position?: number;\n}\n\nexport interface WinDealInput {\n dealId: string;\n wonSource?: string;\n notes?: string;\n}\n\nexport interface LoseDealInput {\n dealId: string;\n lostReason: string;\n notes?: string;\n}\n\nexport interface ListDealsInput {\n pipelineId?: string;\n stageId?: string;\n status?: 'OPEN' | 'WON' | 'LOST' | 'all';\n ownerId?: string;\n search?: string;\n limit?: number;\n offset?: number;\n}\n\nexport interface ListDealsOutput {\n deals: Deal[];\n total: number;\n totalValue: number;\n}\n\n/**\n * Mock handler for ListDealsContract\n */\nexport async function mockListDealsHandler(\n input: ListDealsInput\n): Promise<ListDealsOutput> {\n const {\n pipelineId,\n stageId,\n status,\n ownerId,\n search,\n limit = 20,\n offset = 0,\n } = input;\n\n let filtered = [...MOCK_DEALS];\n\n if (pipelineId) {\n filtered = filtered.filter((d) => d.pipelineId === pipelineId);\n }\n\n if (stageId) {\n filtered = filtered.filter((d) => d.stageId === stageId);\n }\n\n if (status && status !== 'all') {\n filtered = filtered.filter((d) => d.status === status);\n }\n\n if (ownerId) {\n filtered = filtered.filter((d) => d.ownerId === ownerId);\n }\n\n if (search) {\n const q = search.toLowerCase();\n filtered = filtered.filter((d) => d.name.toLowerCase().includes(q));\n }\n\n // Sort by value descending\n filtered.sort((a, b) => b.value - a.value);\n\n const total = filtered.length;\n const totalValue = filtered.reduce((sum, d) => sum + d.value, 0);\n const deals = filtered.slice(offset, offset + limit);\n\n return {\n deals,\n total,\n totalValue,\n };\n}\n\n/**\n * Mock handler for CreateDealContract\n */\nexport async function mockCreateDealHandler(\n input: CreateDealInput,\n context: { ownerId: string }\n): Promise<Deal> {\n const now = new Date();\n\n const deal: Deal = {\n id: `deal-${Date.now()}`,\n name: input.name,\n value: input.value,\n currency: input.currency ?? 'USD',\n pipelineId: input.pipelineId,\n stageId: input.stageId,\n status: 'OPEN',\n contactId: input.contactId,\n companyId: input.companyId,\n ownerId: context.ownerId,\n expectedCloseDate: input.expectedCloseDate,\n createdAt: now,\n updatedAt: now,\n };\n\n MOCK_DEALS.push(deal);\n\n return deal;\n}\n\n/**\n * Mock handler for MoveDealContract\n */\nexport async function mockMoveDealHandler(input: MoveDealInput): Promise<Deal> {\n const dealIndex = MOCK_DEALS.findIndex((d) => d.id === input.dealId);\n if (dealIndex === -1) {\n throw new Error('NOT_FOUND');\n }\n const deal = MOCK_DEALS[dealIndex];\n if (!deal) {\n throw new Error('NOT_FOUND');\n }\n\n const stage = MOCK_STAGES.find((s) => s.id === input.stageId);\n if (!stage) {\n throw new Error('INVALID_STAGE');\n }\n\n const updatedDeal: Deal = {\n ...deal,\n stageId: input.stageId,\n updatedAt: new Date(),\n };\n\n MOCK_DEALS[dealIndex] = updatedDeal;\n\n return updatedDeal;\n}\n\n/**\n * Mock handler for WinDealContract\n */\nexport async function mockWinDealHandler(input: WinDealInput): Promise<Deal> {\n const dealIndex = MOCK_DEALS.findIndex((d) => d.id === input.dealId);\n if (dealIndex === -1) {\n throw new Error('NOT_FOUND');\n }\n const deal = MOCK_DEALS[dealIndex];\n if (!deal) {\n throw new Error('NOT_FOUND');\n }\n\n const updatedDeal: Deal = {\n ...deal,\n status: 'WON' as const,\n updatedAt: new Date(),\n };\n\n MOCK_DEALS[dealIndex] = updatedDeal;\n\n return updatedDeal;\n}\n\n/**\n * Mock handler for LoseDealContract\n */\nexport async function mockLoseDealHandler(input: LoseDealInput): Promise<Deal> {\n const dealIndex = MOCK_DEALS.findIndex((d) => d.id === input.dealId);\n if (dealIndex === -1) {\n throw new Error('NOT_FOUND');\n }\n const deal = MOCK_DEALS[dealIndex];\n if (!deal) {\n throw new Error('NOT_FOUND');\n }\n\n const updatedDeal: Deal = {\n ...deal,\n status: 'LOST' as const,\n updatedAt: new Date(),\n };\n\n MOCK_DEALS[dealIndex] = updatedDeal;\n\n return updatedDeal;\n}\n\n/**\n * Get deals grouped by stage for Kanban view\n */\nexport async function mockGetDealsByStageHandler(input: {\n pipelineId: string;\n}): Promise<Record<string, Deal[]>> {\n const deals = MOCK_DEALS.filter(\n (d) => d.pipelineId === input.pipelineId && d.status === 'OPEN'\n );\n\n const grouped: Record<string, Deal[]> = {};\n for (const stage of MOCK_STAGES) {\n grouped[stage.id] = deals.filter((d) => d.stageId === stage.id);\n }\n\n return grouped;\n}\n\n/**\n * Get pipeline stages\n */\nexport async function mockGetPipelineStagesHandler(input: {\n pipelineId: string;\n}) {\n return MOCK_STAGES.filter((s) => s.pipelineId === input.pipelineId);\n}\n"],"mappings":";;;;;;;;;AAsEA,eAAsB,qBACpB,OAC0B;CAC1B,MAAM,EACJ,YACA,SACA,QACA,SACA,QACA,QAAQ,IACR,SAAS,MACP;CAEJ,IAAI,WAAW,CAAC,GAAG,WAAW;AAE9B,KAAI,WACF,YAAW,SAAS,QAAQ,MAA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ListDealsOutput, LoseDealInput, MoveDealInput, WinDealInput, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler } from "./deal.handlers.js";
3
+ export { type CreateDealInput, type Deal, type ListDealsInput, type ListDealsOutput, type LoseDealInput, MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage, type MoveDealInput, type WinDealInput, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler };
@@ -0,0 +1,4 @@
1
+ import { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES } from "./mock-data.js";
2
+ import { mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler } from "./deal.handlers.js";
3
+
4
+ export { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler };
@@ -0,0 +1,49 @@
1
+ //#region src/handlers/mock-data.d.ts
2
+ /**
3
+ * Mock data for crm-pipeline handlers
4
+ */
5
+ interface MockDeal {
6
+ id: string;
7
+ name: string;
8
+ value: number;
9
+ currency: string;
10
+ pipelineId: string;
11
+ stageId: string;
12
+ status: 'OPEN' | 'WON' | 'LOST' | 'STALE';
13
+ contactId?: string;
14
+ companyId?: string;
15
+ ownerId: string;
16
+ expectedCloseDate?: Date;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ }
20
+ interface MockStage {
21
+ id: string;
22
+ name: string;
23
+ position: number;
24
+ pipelineId: string;
25
+ }
26
+ declare const MOCK_STAGES: MockStage[];
27
+ declare const MOCK_DEALS: MockDeal[];
28
+ declare const MOCK_COMPANIES: {
29
+ id: string;
30
+ name: string;
31
+ domain: string;
32
+ industry: string;
33
+ size: string;
34
+ website: string;
35
+ createdAt: Date;
36
+ }[];
37
+ declare const MOCK_CONTACTS: {
38
+ id: string;
39
+ firstName: string;
40
+ lastName: string;
41
+ email: string;
42
+ phone: string;
43
+ title: string;
44
+ companyId: string;
45
+ createdAt: Date;
46
+ }[];
47
+ //#endregion
48
+ export { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage };
49
+ //# sourceMappingURL=mock-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-data.d.ts","names":[],"sources":["../../src/handlers/mock-data.ts"],"sourcesContent":[],"mappings":";;AAMA;;AAYa,UAZI,QAAA,CAYJ;EACA,EAAA,EAAA,MAAA;EAAI,IAAA,EAAA,MAAA;EAGA,KAAA,EAAA,MAAS;EASb,QAAA,EAAA,MAMZ;EAIY,UAAA,EAAA,MAyFZ;EAIY,OAAA,EAAA,MAAA;EAgCA,MAAA,EAAA,MAAA,GA+BZ,KAAA,GAAA,MAAA,GAAA,OAAA;;;;sBApLqB;aACT;aACA;;UAGI,SAAA;;;;;;cASJ,aAAa;cAUb,YAAY;cA6FZ;;;;;;;aA4BZ;;cAIY;;;;;;;;aA+BZ"}
@@ -0,0 +1,188 @@
1
+ //#region src/handlers/mock-data.ts
2
+ const MOCK_STAGES = [
3
+ {
4
+ id: "stage-1",
5
+ name: "Lead",
6
+ position: 1,
7
+ pipelineId: "pipeline-1"
8
+ },
9
+ {
10
+ id: "stage-2",
11
+ name: "Qualified",
12
+ position: 2,
13
+ pipelineId: "pipeline-1"
14
+ },
15
+ {
16
+ id: "stage-3",
17
+ name: "Proposal",
18
+ position: 3,
19
+ pipelineId: "pipeline-1"
20
+ },
21
+ {
22
+ id: "stage-4",
23
+ name: "Negotiation",
24
+ position: 4,
25
+ pipelineId: "pipeline-1"
26
+ },
27
+ {
28
+ id: "stage-5",
29
+ name: "Closed",
30
+ position: 5,
31
+ pipelineId: "pipeline-1"
32
+ }
33
+ ];
34
+ const MOCK_DEALS = [
35
+ {
36
+ id: "deal-1",
37
+ name: "Enterprise License - Acme Corp",
38
+ value: 75e3,
39
+ currency: "USD",
40
+ pipelineId: "pipeline-1",
41
+ stageId: "stage-3",
42
+ status: "OPEN",
43
+ contactId: "contact-1",
44
+ companyId: "company-1",
45
+ ownerId: "user-1",
46
+ expectedCloseDate: /* @__PURE__ */ new Date("2024-05-15T00:00:00Z"),
47
+ createdAt: /* @__PURE__ */ new Date("2024-02-01T10:00:00Z"),
48
+ updatedAt: /* @__PURE__ */ new Date("2024-04-10T14:30:00Z")
49
+ },
50
+ {
51
+ id: "deal-2",
52
+ name: "Startup Plan - TechStart Inc",
53
+ value: 12e3,
54
+ currency: "USD",
55
+ pipelineId: "pipeline-1",
56
+ stageId: "stage-2",
57
+ status: "OPEN",
58
+ contactId: "contact-2",
59
+ companyId: "company-2",
60
+ ownerId: "user-2",
61
+ expectedCloseDate: /* @__PURE__ */ new Date("2024-04-30T00:00:00Z"),
62
+ createdAt: /* @__PURE__ */ new Date("2024-03-15T09:00:00Z"),
63
+ updatedAt: /* @__PURE__ */ new Date("2024-04-08T11:15:00Z")
64
+ },
65
+ {
66
+ id: "deal-3",
67
+ name: "Professional Services - Global Ltd",
68
+ value: 45e3,
69
+ currency: "USD",
70
+ pipelineId: "pipeline-1",
71
+ stageId: "stage-4",
72
+ status: "OPEN",
73
+ contactId: "contact-3",
74
+ companyId: "company-3",
75
+ ownerId: "user-1",
76
+ expectedCloseDate: /* @__PURE__ */ new Date("2024-04-20T00:00:00Z"),
77
+ createdAt: /* @__PURE__ */ new Date("2024-01-20T08:00:00Z"),
78
+ updatedAt: /* @__PURE__ */ new Date("2024-04-12T16:45:00Z")
79
+ },
80
+ {
81
+ id: "deal-4",
82
+ name: "Annual Contract - SmallBiz Co",
83
+ value: 8500,
84
+ currency: "USD",
85
+ pipelineId: "pipeline-1",
86
+ stageId: "stage-1",
87
+ status: "OPEN",
88
+ contactId: "contact-4",
89
+ companyId: "company-4",
90
+ ownerId: "user-3",
91
+ createdAt: /* @__PURE__ */ new Date("2024-04-05T12:00:00Z"),
92
+ updatedAt: /* @__PURE__ */ new Date("2024-04-05T12:00:00Z")
93
+ },
94
+ {
95
+ id: "deal-5",
96
+ name: "Custom Integration - MegaCorp",
97
+ value: 125e3,
98
+ currency: "USD",
99
+ pipelineId: "pipeline-1",
100
+ stageId: "stage-5",
101
+ status: "WON",
102
+ contactId: "contact-5",
103
+ companyId: "company-5",
104
+ ownerId: "user-1",
105
+ expectedCloseDate: /* @__PURE__ */ new Date("2024-03-31T00:00:00Z"),
106
+ createdAt: /* @__PURE__ */ new Date("2023-11-10T10:00:00Z"),
107
+ updatedAt: /* @__PURE__ */ new Date("2024-03-28T09:00:00Z")
108
+ },
109
+ {
110
+ id: "deal-6",
111
+ name: "Pilot Project - NewCo",
112
+ value: 5e3,
113
+ currency: "USD",
114
+ pipelineId: "pipeline-1",
115
+ stageId: "stage-2",
116
+ status: "LOST",
117
+ contactId: "contact-6",
118
+ companyId: "company-6",
119
+ ownerId: "user-2",
120
+ createdAt: /* @__PURE__ */ new Date("2024-01-15T14:00:00Z"),
121
+ updatedAt: /* @__PURE__ */ new Date("2024-02-28T10:30:00Z")
122
+ }
123
+ ];
124
+ const MOCK_COMPANIES = [
125
+ {
126
+ id: "company-1",
127
+ name: "Acme Corporation",
128
+ domain: "acme.com",
129
+ industry: "Technology",
130
+ size: "1000-5000",
131
+ website: "https://acme.com",
132
+ createdAt: /* @__PURE__ */ new Date("2024-01-01T00:00:00Z")
133
+ },
134
+ {
135
+ id: "company-2",
136
+ name: "TechStart Inc",
137
+ domain: "techstart.io",
138
+ industry: "Software",
139
+ size: "10-50",
140
+ website: "https://techstart.io",
141
+ createdAt: /* @__PURE__ */ new Date("2024-02-15T00:00:00Z")
142
+ },
143
+ {
144
+ id: "company-3",
145
+ name: "Global Ltd",
146
+ domain: "global.com",
147
+ industry: "Consulting",
148
+ size: "500-1000",
149
+ website: "https://global.com",
150
+ createdAt: /* @__PURE__ */ new Date("2023-12-01T00:00:00Z")
151
+ }
152
+ ];
153
+ const MOCK_CONTACTS = [
154
+ {
155
+ id: "contact-1",
156
+ firstName: "John",
157
+ lastName: "Smith",
158
+ email: "john.smith@acme.com",
159
+ phone: "+1-555-0101",
160
+ title: "VP of Engineering",
161
+ companyId: "company-1",
162
+ createdAt: /* @__PURE__ */ new Date("2024-01-05T00:00:00Z")
163
+ },
164
+ {
165
+ id: "contact-2",
166
+ firstName: "Sarah",
167
+ lastName: "Johnson",
168
+ email: "sarah@techstart.io",
169
+ phone: "+1-555-0102",
170
+ title: "CEO",
171
+ companyId: "company-2",
172
+ createdAt: /* @__PURE__ */ new Date("2024-02-20T00:00:00Z")
173
+ },
174
+ {
175
+ id: "contact-3",
176
+ firstName: "Michael",
177
+ lastName: "Brown",
178
+ email: "michael.brown@global.com",
179
+ phone: "+1-555-0103",
180
+ title: "CTO",
181
+ companyId: "company-3",
182
+ createdAt: /* @__PURE__ */ new Date("2023-12-10T00:00:00Z")
183
+ }
184
+ ];
185
+
186
+ //#endregion
187
+ export { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES };
188
+ //# sourceMappingURL=mock-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-data.js","names":["MOCK_STAGES: MockStage[]","MOCK_DEALS: MockDeal[]"],"sources":["../../src/handlers/mock-data.ts"],"sourcesContent":["/**\n * Mock data for crm-pipeline handlers\n */\n\n// ============ Types for Mock Data ============\n\nexport interface MockDeal {\n id: string;\n name: string;\n value: number;\n currency: string;\n pipelineId: string;\n stageId: string;\n status: 'OPEN' | 'WON' | 'LOST' | 'STALE';\n contactId?: string;\n companyId?: string;\n ownerId: string;\n expectedCloseDate?: Date;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface MockStage {\n id: string;\n name: string;\n position: number;\n pipelineId: string;\n}\n\n// ============ Pipeline Stages Mock Data ============\n\nexport const MOCK_STAGES: MockStage[] = [\n { id: 'stage-1', name: 'Lead', position: 1, pipelineId: 'pipeline-1' },\n { id: 'stage-2', name: 'Qualified', position: 2, pipelineId: 'pipeline-1' },\n { id: 'stage-3', name: 'Proposal', position: 3, pipelineId: 'pipeline-1' },\n { id: 'stage-4', name: 'Negotiation', position: 4, pipelineId: 'pipeline-1' },\n { id: 'stage-5', name: 'Closed', position: 5, pipelineId: 'pipeline-1' },\n];\n\n// ============ Deal Mock Data ============\n\nexport const MOCK_DEALS: MockDeal[] = [\n {\n id: 'deal-1',\n name: 'Enterprise License - Acme Corp',\n value: 75000,\n currency: 'USD',\n pipelineId: 'pipeline-1',\n stageId: 'stage-3',\n status: 'OPEN',\n contactId: 'contact-1',\n companyId: 'company-1',\n ownerId: 'user-1',\n expectedCloseDate: new Date('2024-05-15T00:00:00Z'),\n createdAt: new Date('2024-02-01T10:00:00Z'),\n updatedAt: new Date('2024-04-10T14:30:00Z'),\n },\n {\n id: 'deal-2',\n name: 'Startup Plan - TechStart Inc',\n value: 12000,\n currency: 'USD',\n pipelineId: 'pipeline-1',\n stageId: 'stage-2',\n status: 'OPEN',\n contactId: 'contact-2',\n companyId: 'company-2',\n ownerId: 'user-2',\n expectedCloseDate: new Date('2024-04-30T00:00:00Z'),\n createdAt: new Date('2024-03-15T09:00:00Z'),\n updatedAt: new Date('2024-04-08T11:15:00Z'),\n },\n {\n id: 'deal-3',\n name: 'Professional Services - Global Ltd',\n value: 45000,\n currency: 'USD',\n pipelineId: 'pipeline-1',\n stageId: 'stage-4',\n status: 'OPEN',\n contactId: 'contact-3',\n companyId: 'company-3',\n ownerId: 'user-1',\n expectedCloseDate: new Date('2024-04-20T00:00:00Z'),\n createdAt: new Date('2024-01-20T08:00:00Z'),\n updatedAt: new Date('2024-04-12T16:45:00Z'),\n },\n {\n id: 'deal-4',\n name: 'Annual Contract - SmallBiz Co',\n value: 8500,\n currency: 'USD',\n pipelineId: 'pipeline-1',\n stageId: 'stage-1',\n status: 'OPEN',\n contactId: 'contact-4',\n companyId: 'company-4',\n ownerId: 'user-3',\n createdAt: new Date('2024-04-05T12:00:00Z'),\n updatedAt: new Date('2024-04-05T12:00:00Z'),\n },\n {\n id: 'deal-5',\n name: 'Custom Integration - MegaCorp',\n value: 125000,\n currency: 'USD',\n pipelineId: 'pipeline-1',\n stageId: 'stage-5',\n status: 'WON',\n contactId: 'contact-5',\n companyId: 'company-5',\n ownerId: 'user-1',\n expectedCloseDate: new Date('2024-03-31T00:00:00Z'),\n createdAt: new Date('2023-11-10T10:00:00Z'),\n updatedAt: new Date('2024-03-28T09:00:00Z'),\n },\n {\n id: 'deal-6',\n name: 'Pilot Project - NewCo',\n value: 5000,\n currency: 'USD',\n pipelineId: 'pipeline-1',\n stageId: 'stage-2',\n status: 'LOST',\n contactId: 'contact-6',\n companyId: 'company-6',\n ownerId: 'user-2',\n createdAt: new Date('2024-01-15T14:00:00Z'),\n updatedAt: new Date('2024-02-28T10:30:00Z'),\n },\n];\n\n// ============ Company Mock Data ============\n\nexport const MOCK_COMPANIES = [\n {\n id: 'company-1',\n name: 'Acme Corporation',\n domain: 'acme.com',\n industry: 'Technology',\n size: '1000-5000',\n website: 'https://acme.com',\n createdAt: new Date('2024-01-01T00:00:00Z'),\n },\n {\n id: 'company-2',\n name: 'TechStart Inc',\n domain: 'techstart.io',\n industry: 'Software',\n size: '10-50',\n website: 'https://techstart.io',\n createdAt: new Date('2024-02-15T00:00:00Z'),\n },\n {\n id: 'company-3',\n name: 'Global Ltd',\n domain: 'global.com',\n industry: 'Consulting',\n size: '500-1000',\n website: 'https://global.com',\n createdAt: new Date('2023-12-01T00:00:00Z'),\n },\n];\n\n// ============ Contact Mock Data ============\n\nexport const MOCK_CONTACTS = [\n {\n id: 'contact-1',\n firstName: 'John',\n lastName: 'Smith',\n email: 'john.smith@acme.com',\n phone: '+1-555-0101',\n title: 'VP of Engineering',\n companyId: 'company-1',\n createdAt: new Date('2024-01-05T00:00:00Z'),\n },\n {\n id: 'contact-2',\n firstName: 'Sarah',\n lastName: 'Johnson',\n email: 'sarah@techstart.io',\n phone: '+1-555-0102',\n title: 'CEO',\n companyId: 'company-2',\n createdAt: new Date('2024-02-20T00:00:00Z'),\n },\n {\n id: 'contact-3',\n firstName: 'Michael',\n lastName: 'Brown',\n email: 'michael.brown@global.com',\n phone: '+1-555-0103',\n title: 'CTO',\n companyId: 'company-3',\n createdAt: new Date('2023-12-10T00:00:00Z'),\n },\n];\n"],"mappings":";AA+BA,MAAaA,cAA2B;CACtC;EAAE,IAAI;EAAW,MAAM;EAAQ,UAAU;EAAG,YAAY;EAAc;CACtE;EAAE,IAAI;EAAW,MAAM;EAAa,UAAU;EAAG,YAAY;EAAc;CAC3E;EAAE,IAAI;EAAW,MAAM;EAAY,UAAU;EAAG,YAAY;EAAc;CAC1E;EAAE,IAAI;EAAW,MAAM;EAAe,UAAU;EAAG,YAAY;EAAc;CAC7E;EAAE,IAAI;EAAW,MAAM;EAAU,UAAU;EAAG,YAAY;EAAc;CACzE;AAID,MAAaC,aAAyB;CACpC;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,UAAU;EACV,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,WAAW;EACX,WAAW;EACX,SAAS;EACT,mCAAmB,IAAI,KAAK,uBAAuB;EACnD,2BAAW,IAAI,KAAK,uBAAuB;EAC3C,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,UAAU;EACV,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,WAAW;EACX,WAAW;EACX,SAAS;EACT,mCAAmB,IAAI,KAAK,uBAAuB;EACnD,2BAAW,IAAI,KAAK,uBAAuB;EAC3C,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACD;EACE,IAAI;EACJ,MAAM;EACN,OAAO;EACP,UAAU;EACV,YAAY;EACZ,SAAS;EACT,QAAQ;EACR,WA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KAAK,uBAAuB;EAC5C;CACD;EACE,IAAI;EACJ,WAAW;EACX,UAAU;EACV,OAAO;EACP,OAAO;EACP,OAAO;EACP,WAAW;EACX,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACD;EACE,IAAI;EACJ,WAAW;EACX,UAAU;EACV,OAAO;EACP,OAAO;EACP,OAAO;EACP,WAAW;EACX,2BAAW,IAAI,KAAK,uBAAuB;EAC5C;CACF"}
@@ -0,0 +1,34 @@
1
+ import { CrmPipelineFeature } from "./crm-pipeline.feature.js";
2
+ import { DealStatusFilterEnum } from "./deal/deal.enum.js";
3
+ import { CreateDealContract, ListDealsContract, LoseDealContract, MoveDealContract, WinDealContract } from "./deal/deal.operation.js";
4
+ import { CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealWonPayloadModel, ListDealsInputModel, ListDealsOutputModel, LoseDealInputModel, MoveDealInputModel, WinDealInputModel } from "./deal/deal.schema.js";
5
+ import { CompanyEntity, CompanySizeEnum } from "./entities/company.entity.js";
6
+ import { ContactEntity, ContactStatusEnum } from "./entities/contact.entity.js";
7
+ import { DealEntity, DealStatusEnum, PipelineEntity, StageEntity } from "./entities/deal.entity.js";
8
+ import { ActivityEntity, TaskEntity, TaskPriorityEnum, TaskStatusEnum, TaskTypeEnum } from "./entities/task.entity.js";
9
+ import { crmPipelineSchemaContribution } from "./entities/index.js";
10
+ import { ContactCreatedEvent } from "./events/contact.event.js";
11
+ import { DealCreatedEvent, DealLostEvent, DealMovedEvent, DealWonEvent } from "./events/deal.event.js";
12
+ import { TaskCompletedEvent } from "./events/task.event.js";
13
+ import "./events/index.js";
14
+ import example from "./example.js";
15
+ import { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage } from "./handlers/mock-data.js";
16
+ import { CreateDealInput, Deal, ListDealsInput, ListDealsOutput, LoseDealInput, MoveDealInput, WinDealInput, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler } from "./handlers/deal.handlers.js";
17
+ import "./operations/index.js";
18
+ import { CrmDashboardPresentation, PipelineMetricsPresentation } from "./presentations/dashboard.presentation.js";
19
+ import { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation } from "./presentations/pipeline.presentation.js";
20
+ import "./presentations/index.js";
21
+ import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
22
+
23
+ //#region src/index.d.ts
24
+ /**
25
+ * Complete schema composition for CRM Pipeline.
26
+ */
27
+ declare const schemaComposition: {
28
+ modules: _contractspec_lib_schema0.ModuleSchemaContribution[];
29
+ provider: "postgresql";
30
+ outputPath: string;
31
+ };
32
+ //#endregion
33
+ export { ActivityEntity, CompanyEntity, CompanySizeEnum, ContactCreatedEvent, ContactEntity, ContactStatusEnum, CreateDealContract, CreateDealInput, CreateDealInputModel, CrmDashboardPresentation, CrmPipelineFeature, Deal, DealCardPresentation, DealCreatedEvent, DealDetailPresentation, DealEntity, DealListPresentation, DealLostEvent, DealLostPayloadModel, DealModel, DealMovedEvent, DealMovedPayloadModel, DealStatusEnum, DealStatusFilterEnum, DealWonEvent, DealWonPayloadModel, ListDealsContract, ListDealsInput, ListDealsInputModel, ListDealsOutput, ListDealsOutputModel, LoseDealContract, LoseDealInput, LoseDealInputModel, MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage, MoveDealContract, MoveDealInput, MoveDealInputModel, PipelineEntity, PipelineKanbanPresentation, PipelineMetricsPresentation, StageEntity, TaskCompletedEvent, TaskEntity, TaskPriorityEnum, TaskStatusEnum, TaskTypeEnum, WinDealContract, WinDealInput, WinDealInputModel, crmPipelineSchemaContribution, example, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler, schemaComposition };
34
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;cAqBa;WASZ,yBAAA,CAAA,wBAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ import { CrmPipelineFeature } from "./crm-pipeline.feature.js";
2
+ import example_default from "./example.js";
3
+ import { CompanyEntity, CompanySizeEnum } from "./entities/company.entity.js";
4
+ import { ContactEntity, ContactStatusEnum } from "./entities/contact.entity.js";
5
+ import { DealEntity, DealStatusEnum, PipelineEntity, StageEntity } from "./entities/deal.entity.js";
6
+ import { ActivityEntity, TaskEntity, TaskPriorityEnum, TaskStatusEnum, TaskTypeEnum } from "./entities/task.entity.js";
7
+ import { crmPipelineSchemaContribution } from "./entities/index.js";
8
+ import { DealStatusFilterEnum } from "./deal/deal.enum.js";
9
+ import { CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealWonPayloadModel, ListDealsInputModel, ListDealsOutputModel, LoseDealInputModel, MoveDealInputModel, WinDealInputModel } from "./deal/deal.schema.js";
10
+ import { CreateDealContract, ListDealsContract, LoseDealContract, MoveDealContract, WinDealContract } from "./deal/deal.operation.js";
11
+ import "./operations/index.js";
12
+ import { ContactCreatedEvent } from "./events/contact.event.js";
13
+ import { DealCreatedEvent, DealLostEvent, DealMovedEvent, DealWonEvent } from "./events/deal.event.js";
14
+ import { TaskCompletedEvent } from "./events/task.event.js";
15
+ import "./events/index.js";
16
+ import { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES } from "./handlers/mock-data.js";
17
+ import { mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler } from "./handlers/deal.handlers.js";
18
+ import { CrmDashboardPresentation, PipelineMetricsPresentation } from "./presentations/dashboard.presentation.js";
19
+ import { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation } from "./presentations/pipeline.presentation.js";
20
+ import "./presentations/index.js";
21
+ import "./docs/index.js";
22
+ import { identityRbacSchemaContribution } from "@contractspec/lib.identity-rbac";
23
+ import { auditTrailSchemaContribution } from "@contractspec/module.audit-trail";
24
+ import { notificationsSchemaContribution } from "@contractspec/module.notifications";
25
+
26
+ //#region src/index.ts
27
+ /**
28
+ * Complete schema composition for CRM Pipeline.
29
+ */
30
+ const schemaComposition = {
31
+ modules: [
32
+ identityRbacSchemaContribution,
33
+ auditTrailSchemaContribution,
34
+ notificationsSchemaContribution,
35
+ crmPipelineSchemaContribution
36
+ ],
37
+ provider: "postgresql",
38
+ outputPath: "./prisma/schema/generated.prisma"
39
+ };
40
+
41
+ //#endregion
42
+ export { ActivityEntity, CompanyEntity, CompanySizeEnum, ContactCreatedEvent, ContactEntity, ContactStatusEnum, CreateDealContract, CreateDealInputModel, CrmDashboardPresentation, CrmPipelineFeature, DealCardPresentation, DealCreatedEvent, DealDetailPresentation, DealEntity, DealListPresentation, DealLostEvent, DealLostPayloadModel, DealModel, DealMovedEvent, DealMovedPayloadModel, DealStatusEnum, DealStatusFilterEnum, DealWonEvent, DealWonPayloadModel, ListDealsContract, ListDealsInputModel, ListDealsOutputModel, LoseDealContract, LoseDealInputModel, MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MoveDealContract, MoveDealInputModel, PipelineEntity, PipelineKanbanPresentation, PipelineMetricsPresentation, StageEntity, TaskCompletedEvent, TaskEntity, TaskPriorityEnum, TaskStatusEnum, TaskTypeEnum, WinDealContract, WinDealInputModel, crmPipelineSchemaContribution, example_default as example, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler, schemaComposition };
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// CRM Pipeline Example\n// Demonstrates ContractSpec principles for a CRM application\n\nexport * from './entities';\nexport * from './operations';\nexport * from './events';\nexport * from './handlers';\nexport * from './presentations';\nexport * from './crm-pipeline.feature';\nexport { default as example } from './example';\nimport './docs';\n\n// Schema composition configuration\nimport { identityRbacSchemaContribution } from '@contractspec/lib.identity-rbac';\nimport { auditTrailSchemaContribution } from '@contractspec/module.audit-trail';\nimport { notificationsSchemaContribution } from '@contractspec/module.notifications';\nimport { crmPipelineSchemaContribution } from './entities';\n\n/**\n * Complete schema composition for CRM Pipeline.\n */\nexport const schemaComposition = {\n modules: [\n identityRbacSchemaContribution,\n auditTrailSchemaContribution,\n notificationsSchemaContribution,\n crmPipelineSchemaContribution,\n ],\n provider: 'postgresql' as const,\n outputPath: './prisma/schema/generated.prisma',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,oBAAoB;CAC/B,SAAS;EACP;EACA;EACA;EACA;EACD;CACD,UAAU;CACV,YAAY;CACb"}
@@ -0,0 +1,5 @@
1
+ import { DealStatusFilterEnum } from "../deal/deal.enum.js";
2
+ import { CreateDealContract, ListDealsContract, LoseDealContract, MoveDealContract, WinDealContract } from "../deal/deal.operation.js";
3
+ import { CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealWonPayloadModel, ListDealsInputModel, ListDealsOutputModel, LoseDealInputModel, MoveDealInputModel, WinDealInputModel } from "../deal/deal.schema.js";
4
+ import "../deal/index.js";
5
+ export { CreateDealContract, CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealStatusFilterEnum, DealWonPayloadModel, ListDealsContract, ListDealsInputModel, ListDealsOutputModel, LoseDealContract, LoseDealInputModel, MoveDealContract, MoveDealInputModel, WinDealContract, WinDealInputModel };
@@ -0,0 +1,6 @@
1
+ import { DealStatusFilterEnum } from "../deal/deal.enum.js";
2
+ import { CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealWonPayloadModel, ListDealsInputModel, ListDealsOutputModel, LoseDealInputModel, MoveDealInputModel, WinDealInputModel } from "../deal/deal.schema.js";
3
+ import { CreateDealContract, ListDealsContract, LoseDealContract, MoveDealContract, WinDealContract } from "../deal/deal.operation.js";
4
+ import "../deal/index.js";
5
+
6
+ export { CreateDealContract, CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealStatusFilterEnum, DealWonPayloadModel, ListDealsContract, ListDealsInputModel, ListDealsOutputModel, LoseDealContract, LoseDealInputModel, MoveDealContract, MoveDealInputModel, WinDealContract, WinDealInputModel };
@@ -0,0 +1,15 @@
1
+ import { PresentationSpec } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations/dashboard.presentation.d.ts
4
+
5
+ /**
6
+ * Main CRM dashboard presentation.
7
+ */
8
+ declare const CrmDashboardPresentation: PresentationSpec;
9
+ /**
10
+ * Pipeline metrics presentation.
11
+ */
12
+ declare const PipelineMetricsPresentation: PresentationSpec;
13
+ //#endregion
14
+ export { CrmDashboardPresentation, PipelineMetricsPresentation };
15
+ //# sourceMappingURL=dashboard.presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.presentation.d.ts","names":[],"sources":["../../src/presentations/dashboard.presentation.ts"],"sourcesContent":[],"mappings":";;;;AAqCA;;;cA5Ba,0BAA0B;;;;cA4B1B,6BAA6B"}
@@ -0,0 +1,59 @@
1
+ import { StabilityEnum } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations/dashboard.presentation.ts
4
+ /**
5
+ * Main CRM dashboard presentation.
6
+ */
7
+ const CrmDashboardPresentation = {
8
+ meta: {
9
+ key: "crm.dashboard",
10
+ version: 1,
11
+ title: "CRM Dashboard",
12
+ description: "Main CRM dashboard with pipeline overview, deal stats, and activities",
13
+ domain: "crm-pipeline",
14
+ owners: ["@crm-team"],
15
+ tags: ["dashboard", "overview"],
16
+ stability: StabilityEnum.Experimental,
17
+ goal: "Provide a high-level overview of CRM performance and active deals.",
18
+ context: "The landing page for CRM users."
19
+ },
20
+ source: {
21
+ type: "component",
22
+ framework: "react",
23
+ componentKey: "CrmDashboard"
24
+ },
25
+ targets: ["react", "markdown"],
26
+ policy: { flags: ["crm.enabled"] }
27
+ };
28
+ /**
29
+ * Pipeline metrics presentation.
30
+ */
31
+ const PipelineMetricsPresentation = {
32
+ meta: {
33
+ key: "crm.pipeline.metrics",
34
+ version: 1,
35
+ title: "Pipeline Metrics",
36
+ description: "Pipeline metrics and forecasting view",
37
+ domain: "crm-pipeline",
38
+ owners: ["@crm-team"],
39
+ tags: [
40
+ "pipeline",
41
+ "metrics",
42
+ "forecast"
43
+ ],
44
+ stability: StabilityEnum.Experimental,
45
+ goal: "Track pipeline health and sales forecasts.",
46
+ context: "Data-intensive widget for sales managers."
47
+ },
48
+ source: {
49
+ type: "component",
50
+ framework: "react",
51
+ componentKey: "PipelineMetricsView"
52
+ },
53
+ targets: ["react", "markdown"],
54
+ policy: { flags: ["crm.metrics.enabled"] }
55
+ };
56
+
57
+ //#endregion
58
+ export { CrmDashboardPresentation, PipelineMetricsPresentation };
59
+ //# sourceMappingURL=dashboard.presentation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard.presentation.js","names":["CrmDashboardPresentation: PresentationSpec","PipelineMetricsPresentation: PresentationSpec"],"sources":["../../src/presentations/dashboard.presentation.ts"],"sourcesContent":["/**\n * CRM Dashboard Presentation Descriptor\n */\nimport type { PresentationSpec } from '@contractspec/lib.contracts';\nimport { StabilityEnum } from '@contractspec/lib.contracts';\n\n/**\n * Main CRM dashboard presentation.\n */\nexport const CrmDashboardPresentation: PresentationSpec = {\n meta: {\n key: 'crm.dashboard',\n version: 1,\n title: 'CRM Dashboard',\n description:\n 'Main CRM dashboard with pipeline overview, deal stats, and activities',\n domain: 'crm-pipeline',\n owners: ['@crm-team'],\n tags: ['dashboard', 'overview'],\n stability: StabilityEnum.Experimental,\n goal: 'Provide a high-level overview of CRM performance and active deals.',\n context: 'The landing page for CRM users.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'CrmDashboard',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['crm.enabled'],\n },\n};\n\n/**\n * Pipeline metrics presentation.\n */\nexport const PipelineMetricsPresentation: PresentationSpec = {\n meta: {\n key: 'crm.pipeline.metrics',\n version: 1,\n title: 'Pipeline Metrics',\n description: 'Pipeline metrics and forecasting view',\n domain: 'crm-pipeline',\n owners: ['@crm-team'],\n tags: ['pipeline', 'metrics', 'forecast'],\n stability: StabilityEnum.Experimental,\n goal: 'Track pipeline health and sales forecasts.',\n context: 'Data-intensive widget for sales managers.',\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'PipelineMetricsView',\n },\n targets: ['react', 'markdown'],\n policy: {\n flags: ['crm.metrics.enabled'],\n },\n};\n"],"mappings":";;;;;;AASA,MAAaA,2BAA6C;CACxD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,YAAY;EACrB,MAAM,CAAC,aAAa,WAAW;EAC/B,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,cAAc,EACvB;CACF;;;;AAKD,MAAaC,8BAAgD;CAC3D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,YAAY;EACrB,MAAM;GAAC;GAAY;GAAW;GAAW;EACzC,WAAW,cAAc;EACzB,MAAM;EACN,SAAS;EACV;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,SAAS,WAAW;CAC9B,QAAQ,EACN,OAAO,CAAC,sBAAsB,EAC/B;CACF"}
@@ -0,0 +1,3 @@
1
+ import { CrmDashboardPresentation, PipelineMetricsPresentation } from "./dashboard.presentation.js";
2
+ import { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation } from "./pipeline.presentation.js";
3
+ export { CrmDashboardPresentation, DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation, PipelineMetricsPresentation };
@@ -0,0 +1,4 @@
1
+ import { CrmDashboardPresentation, PipelineMetricsPresentation } from "./dashboard.presentation.js";
2
+ import { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation } from "./pipeline.presentation.js";
3
+
4
+ export { CrmDashboardPresentation, DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation, PipelineMetricsPresentation };
@@ -0,0 +1,23 @@
1
+ import { PresentationSpec } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations/pipeline.presentation.d.ts
4
+
5
+ /**
6
+ * Kanban board presentation for the sales pipeline.
7
+ */
8
+ declare const PipelineKanbanPresentation: PresentationSpec;
9
+ /**
10
+ * List view of deals with filtering.
11
+ */
12
+ declare const DealListPresentation: PresentationSpec;
13
+ /**
14
+ * Deal detail presentation.
15
+ */
16
+ declare const DealDetailPresentation: PresentationSpec;
17
+ /**
18
+ * Deal card for kanban board.
19
+ */
20
+ declare const DealCardPresentation: PresentationSpec;
21
+ //#endregion
22
+ export { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation };
23
+ //# sourceMappingURL=pipeline.presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.presentation.d.ts","names":[],"sources":["../../src/presentations/pipeline.presentation.ts"],"sourcesContent":[],"mappings":";;;;AAsCA;AA4BA;AA4BA;cApFa,4BAA4B;;;;cA4B5B,sBAAsB;;;;cA4BtB,wBAAwB;;;;cA4BxB,sBAAsB"}