@contractspec/example.crm-pipeline 0.0.0-canary-20260114030712 → 0.0.0-canary-20260119222405
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.
- package/.turbo/turbo-build$colon$bundle.log +8 -8
- package/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +42 -10
- package/README.md +29 -9
- package/dist/deal/deal.enum.d.ts +3 -3
- package/dist/deal/deal.enum.d.ts.map +1 -1
- package/dist/deal/deal.operation.d.ts +127 -127
- package/dist/deal/deal.operation.d.ts.map +1 -1
- package/dist/deal/deal.schema.d.ts +71 -71
- package/dist/docs/crm-pipeline.docblock.js +21 -1
- package/dist/docs/crm-pipeline.docblock.js.map +1 -1
- package/dist/entities/company.entity.d.ts +28 -28
- package/dist/entities/contact.entity.d.ts +32 -32
- package/dist/entities/contact.entity.d.ts.map +1 -1
- package/dist/entities/deal.entity.d.ts +53 -53
- package/dist/entities/deal.entity.d.ts.map +1 -1
- package/dist/entities/task.entity.d.ts +43 -43
- package/dist/events/contact.event.d.ts +7 -7
- package/dist/events/deal.event.d.ts +29 -29
- package/dist/events/task.event.d.ts +8 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/presentations/dashboard.presentation.d.ts +3 -3
- package/package.json +12 -12
- package/src/docs/crm-pipeline.docblock.ts +21 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,225 +1,225 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema128 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/deal/deal.schema.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* A deal in the CRM pipeline.
|
|
6
6
|
*/
|
|
7
|
-
declare const DealModel:
|
|
7
|
+
declare const DealModel: _contractspec_lib_schema128.SchemaModel<{
|
|
8
8
|
id: {
|
|
9
|
-
type:
|
|
9
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
10
10
|
isOptional: false;
|
|
11
11
|
};
|
|
12
12
|
name: {
|
|
13
|
-
type:
|
|
13
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
14
14
|
isOptional: false;
|
|
15
15
|
};
|
|
16
16
|
value: {
|
|
17
|
-
type:
|
|
17
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
18
18
|
isOptional: false;
|
|
19
19
|
};
|
|
20
20
|
currency: {
|
|
21
|
-
type:
|
|
21
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
22
22
|
isOptional: false;
|
|
23
23
|
};
|
|
24
24
|
pipelineId: {
|
|
25
|
-
type:
|
|
25
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
26
26
|
isOptional: false;
|
|
27
27
|
};
|
|
28
28
|
stageId: {
|
|
29
|
-
type:
|
|
29
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
30
30
|
isOptional: false;
|
|
31
31
|
};
|
|
32
32
|
status: {
|
|
33
|
-
type:
|
|
33
|
+
type: _contractspec_lib_schema128.EnumType<[string, string, string, string]>;
|
|
34
34
|
isOptional: false;
|
|
35
35
|
};
|
|
36
36
|
contactId: {
|
|
37
|
-
type:
|
|
37
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
38
38
|
isOptional: true;
|
|
39
39
|
};
|
|
40
40
|
companyId: {
|
|
41
|
-
type:
|
|
41
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
42
42
|
isOptional: true;
|
|
43
43
|
};
|
|
44
44
|
ownerId: {
|
|
45
|
-
type:
|
|
45
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
46
46
|
isOptional: false;
|
|
47
47
|
};
|
|
48
48
|
expectedCloseDate: {
|
|
49
|
-
type:
|
|
49
|
+
type: _contractspec_lib_schema128.FieldType<Date, string>;
|
|
50
50
|
isOptional: true;
|
|
51
51
|
};
|
|
52
52
|
createdAt: {
|
|
53
|
-
type:
|
|
53
|
+
type: _contractspec_lib_schema128.FieldType<Date, string>;
|
|
54
54
|
isOptional: false;
|
|
55
55
|
};
|
|
56
56
|
updatedAt: {
|
|
57
|
-
type:
|
|
57
|
+
type: _contractspec_lib_schema128.FieldType<Date, string>;
|
|
58
58
|
isOptional: false;
|
|
59
59
|
};
|
|
60
60
|
}>;
|
|
61
61
|
/**
|
|
62
62
|
* Input for creating a deal.
|
|
63
63
|
*/
|
|
64
|
-
declare const CreateDealInputModel:
|
|
64
|
+
declare const CreateDealInputModel: _contractspec_lib_schema128.SchemaModel<{
|
|
65
65
|
name: {
|
|
66
|
-
type:
|
|
66
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
67
67
|
isOptional: false;
|
|
68
68
|
};
|
|
69
69
|
value: {
|
|
70
|
-
type:
|
|
70
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
71
71
|
isOptional: false;
|
|
72
72
|
};
|
|
73
73
|
currency: {
|
|
74
|
-
type:
|
|
74
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
75
75
|
isOptional: true;
|
|
76
76
|
};
|
|
77
77
|
pipelineId: {
|
|
78
|
-
type:
|
|
78
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
79
79
|
isOptional: false;
|
|
80
80
|
};
|
|
81
81
|
stageId: {
|
|
82
|
-
type:
|
|
82
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
83
83
|
isOptional: false;
|
|
84
84
|
};
|
|
85
85
|
contactId: {
|
|
86
|
-
type:
|
|
86
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
87
87
|
isOptional: true;
|
|
88
88
|
};
|
|
89
89
|
companyId: {
|
|
90
|
-
type:
|
|
90
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
91
91
|
isOptional: true;
|
|
92
92
|
};
|
|
93
93
|
expectedCloseDate: {
|
|
94
|
-
type:
|
|
94
|
+
type: _contractspec_lib_schema128.FieldType<Date, string>;
|
|
95
95
|
isOptional: true;
|
|
96
96
|
};
|
|
97
97
|
}>;
|
|
98
98
|
/**
|
|
99
99
|
* Input for moving a deal to another stage.
|
|
100
100
|
*/
|
|
101
|
-
declare const MoveDealInputModel:
|
|
101
|
+
declare const MoveDealInputModel: _contractspec_lib_schema128.SchemaModel<{
|
|
102
102
|
dealId: {
|
|
103
|
-
type:
|
|
103
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
104
104
|
isOptional: false;
|
|
105
105
|
};
|
|
106
106
|
stageId: {
|
|
107
|
-
type:
|
|
107
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
108
108
|
isOptional: false;
|
|
109
109
|
};
|
|
110
110
|
position: {
|
|
111
|
-
type:
|
|
111
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
112
112
|
isOptional: true;
|
|
113
113
|
};
|
|
114
114
|
}>;
|
|
115
115
|
/**
|
|
116
116
|
* Payload for deal moved event.
|
|
117
117
|
*/
|
|
118
|
-
declare const DealMovedPayloadModel:
|
|
118
|
+
declare const DealMovedPayloadModel: _contractspec_lib_schema128.SchemaModel<{
|
|
119
119
|
dealId: {
|
|
120
|
-
type:
|
|
120
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
121
121
|
isOptional: false;
|
|
122
122
|
};
|
|
123
123
|
fromStage: {
|
|
124
|
-
type:
|
|
124
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
125
125
|
isOptional: false;
|
|
126
126
|
};
|
|
127
127
|
toStage: {
|
|
128
|
-
type:
|
|
128
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
129
129
|
isOptional: false;
|
|
130
130
|
};
|
|
131
131
|
}>;
|
|
132
132
|
/**
|
|
133
133
|
* Input for marking a deal as won.
|
|
134
134
|
*/
|
|
135
|
-
declare const WinDealInputModel:
|
|
135
|
+
declare const WinDealInputModel: _contractspec_lib_schema128.SchemaModel<{
|
|
136
136
|
dealId: {
|
|
137
|
-
type:
|
|
137
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
138
138
|
isOptional: false;
|
|
139
139
|
};
|
|
140
140
|
wonSource: {
|
|
141
|
-
type:
|
|
141
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
142
142
|
isOptional: true;
|
|
143
143
|
};
|
|
144
144
|
notes: {
|
|
145
|
-
type:
|
|
145
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
146
146
|
isOptional: true;
|
|
147
147
|
};
|
|
148
148
|
}>;
|
|
149
149
|
/**
|
|
150
150
|
* Payload for deal won event.
|
|
151
151
|
*/
|
|
152
|
-
declare const DealWonPayloadModel:
|
|
152
|
+
declare const DealWonPayloadModel: _contractspec_lib_schema128.SchemaModel<{
|
|
153
153
|
dealId: {
|
|
154
|
-
type:
|
|
154
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
155
155
|
isOptional: false;
|
|
156
156
|
};
|
|
157
157
|
value: {
|
|
158
|
-
type:
|
|
158
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
159
159
|
isOptional: false;
|
|
160
160
|
};
|
|
161
161
|
}>;
|
|
162
162
|
/**
|
|
163
163
|
* Input for marking a deal as lost.
|
|
164
164
|
*/
|
|
165
|
-
declare const LoseDealInputModel:
|
|
165
|
+
declare const LoseDealInputModel: _contractspec_lib_schema128.SchemaModel<{
|
|
166
166
|
dealId: {
|
|
167
|
-
type:
|
|
167
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
168
168
|
isOptional: false;
|
|
169
169
|
};
|
|
170
170
|
lostReason: {
|
|
171
|
-
type:
|
|
171
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
172
172
|
isOptional: false;
|
|
173
173
|
};
|
|
174
174
|
notes: {
|
|
175
|
-
type:
|
|
175
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
176
176
|
isOptional: true;
|
|
177
177
|
};
|
|
178
178
|
}>;
|
|
179
179
|
/**
|
|
180
180
|
* Payload for deal lost event.
|
|
181
181
|
*/
|
|
182
|
-
declare const DealLostPayloadModel:
|
|
182
|
+
declare const DealLostPayloadModel: _contractspec_lib_schema128.SchemaModel<{
|
|
183
183
|
dealId: {
|
|
184
|
-
type:
|
|
184
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
185
185
|
isOptional: false;
|
|
186
186
|
};
|
|
187
187
|
reason: {
|
|
188
|
-
type:
|
|
188
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
189
189
|
isOptional: false;
|
|
190
190
|
};
|
|
191
191
|
}>;
|
|
192
192
|
/**
|
|
193
193
|
* Input for listing deals.
|
|
194
194
|
*/
|
|
195
|
-
declare const ListDealsInputModel:
|
|
195
|
+
declare const ListDealsInputModel: _contractspec_lib_schema128.SchemaModel<{
|
|
196
196
|
pipelineId: {
|
|
197
|
-
type:
|
|
197
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
198
198
|
isOptional: true;
|
|
199
199
|
};
|
|
200
200
|
stageId: {
|
|
201
|
-
type:
|
|
201
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
202
202
|
isOptional: true;
|
|
203
203
|
};
|
|
204
204
|
status: {
|
|
205
|
-
type:
|
|
205
|
+
type: _contractspec_lib_schema128.EnumType<[string, string, string, string]>;
|
|
206
206
|
isOptional: true;
|
|
207
207
|
};
|
|
208
208
|
ownerId: {
|
|
209
|
-
type:
|
|
209
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
210
210
|
isOptional: true;
|
|
211
211
|
};
|
|
212
212
|
search: {
|
|
213
|
-
type:
|
|
213
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
214
214
|
isOptional: true;
|
|
215
215
|
};
|
|
216
216
|
limit: {
|
|
217
|
-
type:
|
|
217
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
218
218
|
isOptional: true;
|
|
219
219
|
defaultValue: number;
|
|
220
220
|
};
|
|
221
221
|
offset: {
|
|
222
|
-
type:
|
|
222
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
223
223
|
isOptional: true;
|
|
224
224
|
defaultValue: number;
|
|
225
225
|
};
|
|
@@ -227,59 +227,59 @@ declare const ListDealsInputModel: _contractspec_lib_schema253.SchemaModel<{
|
|
|
227
227
|
/**
|
|
228
228
|
* Output for listing deals.
|
|
229
229
|
*/
|
|
230
|
-
declare const ListDealsOutputModel:
|
|
230
|
+
declare const ListDealsOutputModel: _contractspec_lib_schema128.SchemaModel<{
|
|
231
231
|
deals: {
|
|
232
|
-
type:
|
|
232
|
+
type: _contractspec_lib_schema128.SchemaModel<{
|
|
233
233
|
id: {
|
|
234
|
-
type:
|
|
234
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
235
235
|
isOptional: false;
|
|
236
236
|
};
|
|
237
237
|
name: {
|
|
238
|
-
type:
|
|
238
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
239
239
|
isOptional: false;
|
|
240
240
|
};
|
|
241
241
|
value: {
|
|
242
|
-
type:
|
|
242
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
243
243
|
isOptional: false;
|
|
244
244
|
};
|
|
245
245
|
currency: {
|
|
246
|
-
type:
|
|
246
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
247
247
|
isOptional: false;
|
|
248
248
|
};
|
|
249
249
|
pipelineId: {
|
|
250
|
-
type:
|
|
250
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
251
251
|
isOptional: false;
|
|
252
252
|
};
|
|
253
253
|
stageId: {
|
|
254
|
-
type:
|
|
254
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
255
255
|
isOptional: false;
|
|
256
256
|
};
|
|
257
257
|
status: {
|
|
258
|
-
type:
|
|
258
|
+
type: _contractspec_lib_schema128.EnumType<[string, string, string, string]>;
|
|
259
259
|
isOptional: false;
|
|
260
260
|
};
|
|
261
261
|
contactId: {
|
|
262
|
-
type:
|
|
262
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
263
263
|
isOptional: true;
|
|
264
264
|
};
|
|
265
265
|
companyId: {
|
|
266
|
-
type:
|
|
266
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
267
267
|
isOptional: true;
|
|
268
268
|
};
|
|
269
269
|
ownerId: {
|
|
270
|
-
type:
|
|
270
|
+
type: _contractspec_lib_schema128.FieldType<string, string>;
|
|
271
271
|
isOptional: false;
|
|
272
272
|
};
|
|
273
273
|
expectedCloseDate: {
|
|
274
|
-
type:
|
|
274
|
+
type: _contractspec_lib_schema128.FieldType<Date, string>;
|
|
275
275
|
isOptional: true;
|
|
276
276
|
};
|
|
277
277
|
createdAt: {
|
|
278
|
-
type:
|
|
278
|
+
type: _contractspec_lib_schema128.FieldType<Date, string>;
|
|
279
279
|
isOptional: false;
|
|
280
280
|
};
|
|
281
281
|
updatedAt: {
|
|
282
|
-
type:
|
|
282
|
+
type: _contractspec_lib_schema128.FieldType<Date, string>;
|
|
283
283
|
isOptional: false;
|
|
284
284
|
};
|
|
285
285
|
}>;
|
|
@@ -287,11 +287,11 @@ declare const ListDealsOutputModel: _contractspec_lib_schema253.SchemaModel<{
|
|
|
287
287
|
isOptional: false;
|
|
288
288
|
};
|
|
289
289
|
total: {
|
|
290
|
-
type:
|
|
290
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
291
291
|
isOptional: false;
|
|
292
292
|
};
|
|
293
293
|
totalValue: {
|
|
294
|
-
type:
|
|
294
|
+
type: _contractspec_lib_schema128.FieldType<number, number>;
|
|
295
295
|
isOptional: false;
|
|
296
296
|
};
|
|
297
297
|
}>;
|
|
@@ -42,7 +42,27 @@ registerDocBlocks([
|
|
|
42
42
|
## Guardrails
|
|
43
43
|
- Emit events for stage moves and task completions; log to Audit Trail.
|
|
44
44
|
- Keep required fields enforced in contracts; avoid freeform state.
|
|
45
|
-
- Redact contact PII in markdown/JSON outputs
|
|
45
|
+
- Redact contact PII in markdown/JSON outputs.
|
|
46
|
+
|
|
47
|
+
## Adoption narrative
|
|
48
|
+
|
|
49
|
+
### Before
|
|
50
|
+
- A CRM app with hand-written data models and handler logic.
|
|
51
|
+
- Pipeline stage rules live in code and drift across UI/API/events.
|
|
52
|
+
- Regeneration is risky because specs and implementations are not aligned.
|
|
53
|
+
|
|
54
|
+
### After
|
|
55
|
+
- Contracts define deals, stages, and tasks as the source of truth.
|
|
56
|
+
- Regeneration keeps UI/API/events in sync when stages change.
|
|
57
|
+
- Compliance surfaces (audits, notifications) stay consistent with specs.
|
|
58
|
+
|
|
59
|
+
### Minimal adoption steps
|
|
60
|
+
1) Add ContractSpec CLI and core libraries.
|
|
61
|
+
2) Define one operation (for example, deal/create).
|
|
62
|
+
3) Run contractspec build to generate handlers and types.
|
|
63
|
+
4) Wire the generated handler into your existing router.
|
|
64
|
+
5) Expand to events and presentations as you add surface areas.
|
|
65
|
+
`
|
|
46
66
|
},
|
|
47
67
|
{
|
|
48
68
|
id: "docs.examples.crm-pipeline.reference",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crm-pipeline.docblock.js","names":[],"sources":["../../src/docs/crm-pipeline.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst crmPipelineDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.crm-pipeline.goal',\n title: 'CRM Pipeline — Goal',\n summary:\n 'Deals, stages, contacts, companies, and tasks with auditable stage movement.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/goal',\n tags: ['crm', 'goal'],\n body: `## Why it matters\n- Regenerable CRM flow for deals/stages without code drift.\n- Ensures stage movement, tasks, and contacts stay aligned across surfaces.\n\n## Business/Product goal\n- Give sales teams a governed pipeline with auditable moves and notifications.\n- Allow experimentation (feature flags) on stage definitions and task flows.\n\n## Success criteria\n- Stage/state changes emit events and remain declarative in spec.\n- PII (contacts) is scoped/redacted in presentations.`,\n },\n {\n id: 'docs.examples.crm-pipeline.usage',\n title: 'CRM Pipeline — Usage',\n summary: 'How to seed, extend, and regenerate the CRM pipeline.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/usage',\n tags: ['crm', 'usage'],\n body: `## Setup\n1) Seed (if available) or create pipeline stages, deals, contacts, companies, tasks.\n2) Configure Notifications for stage changes/tasks; set policy.pii for contact data.\n\n## Extend & regenerate\n1) Adjust stage schema/order, deal fields, task fields in the spec.\n2) Regenerate to sync UI/API/events; ensure kanban/action buttons update.\n3) Use Feature Flags to trial new stages or SLA rules.\n\n## Guardrails\n- Emit events for stage moves and task completions; log to Audit Trail.\n- Keep required fields enforced in contracts; avoid freeform state.\n- Redact contact PII in markdown/JSON outputs
|
|
1
|
+
{"version":3,"file":"crm-pipeline.docblock.js","names":[],"sources":["../../src/docs/crm-pipeline.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst crmPipelineDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.crm-pipeline.goal',\n title: 'CRM Pipeline — Goal',\n summary:\n 'Deals, stages, contacts, companies, and tasks with auditable stage movement.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/goal',\n tags: ['crm', 'goal'],\n body: `## Why it matters\n- Regenerable CRM flow for deals/stages without code drift.\n- Ensures stage movement, tasks, and contacts stay aligned across surfaces.\n\n## Business/Product goal\n- Give sales teams a governed pipeline with auditable moves and notifications.\n- Allow experimentation (feature flags) on stage definitions and task flows.\n\n## Success criteria\n- Stage/state changes emit events and remain declarative in spec.\n- PII (contacts) is scoped/redacted in presentations.`,\n },\n {\n id: 'docs.examples.crm-pipeline.usage',\n title: 'CRM Pipeline — Usage',\n summary: 'How to seed, extend, and regenerate the CRM pipeline.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/usage',\n tags: ['crm', 'usage'],\n body: `## Setup\n1) Seed (if available) or create pipeline stages, deals, contacts, companies, tasks.\n2) Configure Notifications for stage changes/tasks; set policy.pii for contact data.\n\n## Extend & regenerate\n1) Adjust stage schema/order, deal fields, task fields in the spec.\n2) Regenerate to sync UI/API/events; ensure kanban/action buttons update.\n3) Use Feature Flags to trial new stages or SLA rules.\n\n## Guardrails\n- Emit events for stage moves and task completions; log to Audit Trail.\n- Keep required fields enforced in contracts; avoid freeform state.\n- Redact contact PII in markdown/JSON outputs.\n\n## Adoption narrative\n\n### Before\n- A CRM app with hand-written data models and handler logic.\n- Pipeline stage rules live in code and drift across UI/API/events.\n- Regeneration is risky because specs and implementations are not aligned.\n\n### After\n- Contracts define deals, stages, and tasks as the source of truth.\n- Regeneration keeps UI/API/events in sync when stages change.\n- Compliance surfaces (audits, notifications) stay consistent with specs.\n\n### Minimal adoption steps\n1) Add ContractSpec CLI and core libraries.\n2) Define one operation (for example, deal/create).\n3) Run contractspec build to generate handlers and types.\n4) Wire the generated handler into your existing router.\n5) Expand to events and presentations as you add surface areas.\n`,\n },\n {\n id: 'docs.examples.crm-pipeline.reference',\n title: 'CRM Pipeline — Reference',\n summary:\n 'Entities, contracts, events, and presentations for the CRM template.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline',\n tags: ['crm', 'reference'],\n body: `## Entities\n- Contact, Company, Deal, Pipeline, Stage, Task.\n\n## Contracts\n- deal/create, stage/move, contact/company CRUD, task create/complete.\n\n## Events\n- deal.created, stage.moved, task.completed, contact.updated.\n\n## Presentations\n- Pipelines/kanban, deal detail, contact/company profiles, task lists.\n\n## Notes\n- Stage definitions should be declarative; enforce via spec and regeneration.\n- Use Notifications for deal/task updates; Audit Trail for state changes.`,\n },\n {\n id: 'docs.examples.crm-pipeline.constraints',\n title: 'CRM Pipeline — Constraints & Safety',\n summary:\n 'Internal guardrails for stages, PII, and regeneration semantics in the CRM template.',\n kind: 'reference',\n visibility: 'internal',\n route: '/docs/examples/crm-pipeline/constraints',\n tags: ['crm', 'constraints', 'internal'],\n body: `## Constraints\n- Stage definitions/order must remain declarative; no imperative overrides in code.\n- Events to emit: deal.created, stage.moved, task.completed, contact.updated (minimum).\n- Regeneration should not alter stage semantics without explicit spec change.\n\n## PII\n- Mark contact/company PII (emails, phones) for redaction in presentations.\n- Ensure MCP/web outputs avoid raw PII when not needed.\n\n## Verification\n- Add fixtures for stage move rules and SLA/task changes.\n- Ensure Audit/Notifications remain wired for stage and task events.\n- Use Feature Flags for experimental stages/SLAs; default safe/off.`,\n },\n];\n\nregisterDocBlocks(crmPipelineDocBlocks);\n"],"mappings":";;;AAqHA,kBAlHyC;CACvC;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,OAAO;EACrB,MAAM;;;;;;;;;;;EAWP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,QAAQ;EACtB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,YAAY;EAC1B,MAAM;;;;;;;;;;;;;;;EAeP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAO;GAAe;GAAW;EACxC,MAAM;;;;;;;;;;;;;EAaP;CACF,CAEsC"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema198 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/company.entity.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Company size enum.
|
|
6
6
|
*/
|
|
7
|
-
declare const CompanySizeEnum:
|
|
7
|
+
declare const CompanySizeEnum: _contractspec_lib_schema198.EntityEnumDef;
|
|
8
8
|
/**
|
|
9
9
|
* Company entity - organization/account.
|
|
10
10
|
*/
|
|
11
|
-
declare const CompanyEntity:
|
|
12
|
-
id:
|
|
13
|
-
name:
|
|
14
|
-
domain:
|
|
15
|
-
website:
|
|
16
|
-
industry:
|
|
17
|
-
size:
|
|
18
|
-
employeeCount:
|
|
19
|
-
annualRevenue:
|
|
20
|
-
organizationId:
|
|
21
|
-
ownerId:
|
|
22
|
-
phone:
|
|
23
|
-
email:
|
|
24
|
-
address:
|
|
25
|
-
city:
|
|
26
|
-
state:
|
|
27
|
-
country:
|
|
28
|
-
postalCode:
|
|
29
|
-
linkedInUrl:
|
|
30
|
-
description:
|
|
31
|
-
tags:
|
|
32
|
-
customFields:
|
|
33
|
-
createdAt:
|
|
34
|
-
updatedAt:
|
|
35
|
-
contacts:
|
|
36
|
-
deals:
|
|
11
|
+
declare const CompanyEntity: _contractspec_lib_schema198.EntitySpec<{
|
|
12
|
+
id: _contractspec_lib_schema198.EntityScalarField;
|
|
13
|
+
name: _contractspec_lib_schema198.EntityScalarField;
|
|
14
|
+
domain: _contractspec_lib_schema198.EntityScalarField;
|
|
15
|
+
website: _contractspec_lib_schema198.EntityScalarField;
|
|
16
|
+
industry: _contractspec_lib_schema198.EntityScalarField;
|
|
17
|
+
size: _contractspec_lib_schema198.EntityEnumField;
|
|
18
|
+
employeeCount: _contractspec_lib_schema198.EntityScalarField;
|
|
19
|
+
annualRevenue: _contractspec_lib_schema198.EntityScalarField;
|
|
20
|
+
organizationId: _contractspec_lib_schema198.EntityScalarField;
|
|
21
|
+
ownerId: _contractspec_lib_schema198.EntityScalarField;
|
|
22
|
+
phone: _contractspec_lib_schema198.EntityScalarField;
|
|
23
|
+
email: _contractspec_lib_schema198.EntityScalarField;
|
|
24
|
+
address: _contractspec_lib_schema198.EntityScalarField;
|
|
25
|
+
city: _contractspec_lib_schema198.EntityScalarField;
|
|
26
|
+
state: _contractspec_lib_schema198.EntityScalarField;
|
|
27
|
+
country: _contractspec_lib_schema198.EntityScalarField;
|
|
28
|
+
postalCode: _contractspec_lib_schema198.EntityScalarField;
|
|
29
|
+
linkedInUrl: _contractspec_lib_schema198.EntityScalarField;
|
|
30
|
+
description: _contractspec_lib_schema198.EntityScalarField;
|
|
31
|
+
tags: _contractspec_lib_schema198.EntityScalarField;
|
|
32
|
+
customFields: _contractspec_lib_schema198.EntityScalarField;
|
|
33
|
+
createdAt: _contractspec_lib_schema198.EntityScalarField;
|
|
34
|
+
updatedAt: _contractspec_lib_schema198.EntityScalarField;
|
|
35
|
+
contacts: _contractspec_lib_schema198.EntityRelationField;
|
|
36
|
+
deals: _contractspec_lib_schema198.EntityRelationField;
|
|
37
37
|
}>;
|
|
38
38
|
//#endregion
|
|
39
39
|
export { CompanyEntity, CompanySizeEnum };
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _contractspec_lib_schema225 from "@contractspec/lib.schema";
|
|
2
2
|
|
|
3
3
|
//#region src/entities/contact.entity.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Contact status enum.
|
|
6
6
|
*/
|
|
7
|
-
declare const ContactStatusEnum:
|
|
7
|
+
declare const ContactStatusEnum: _contractspec_lib_schema225.EntityEnumDef;
|
|
8
8
|
/**
|
|
9
9
|
* Contact entity - individual person.
|
|
10
10
|
*/
|
|
11
|
-
declare const ContactEntity:
|
|
12
|
-
id:
|
|
13
|
-
firstName:
|
|
14
|
-
lastName:
|
|
15
|
-
email:
|
|
16
|
-
phone:
|
|
17
|
-
companyId:
|
|
18
|
-
jobTitle:
|
|
19
|
-
status:
|
|
20
|
-
organizationId:
|
|
21
|
-
ownerId:
|
|
22
|
-
source:
|
|
23
|
-
linkedInUrl:
|
|
24
|
-
twitterHandle:
|
|
25
|
-
address:
|
|
26
|
-
city:
|
|
27
|
-
state:
|
|
28
|
-
country:
|
|
29
|
-
postalCode:
|
|
30
|
-
notes:
|
|
31
|
-
tags:
|
|
32
|
-
customFields:
|
|
33
|
-
lastContactedAt:
|
|
34
|
-
nextFollowUpAt:
|
|
35
|
-
createdAt:
|
|
36
|
-
updatedAt:
|
|
37
|
-
company:
|
|
38
|
-
deals:
|
|
39
|
-
tasks:
|
|
40
|
-
activities:
|
|
11
|
+
declare const ContactEntity: _contractspec_lib_schema225.EntitySpec<{
|
|
12
|
+
id: _contractspec_lib_schema225.EntityScalarField;
|
|
13
|
+
firstName: _contractspec_lib_schema225.EntityScalarField;
|
|
14
|
+
lastName: _contractspec_lib_schema225.EntityScalarField;
|
|
15
|
+
email: _contractspec_lib_schema225.EntityScalarField;
|
|
16
|
+
phone: _contractspec_lib_schema225.EntityScalarField;
|
|
17
|
+
companyId: _contractspec_lib_schema225.EntityScalarField;
|
|
18
|
+
jobTitle: _contractspec_lib_schema225.EntityScalarField;
|
|
19
|
+
status: _contractspec_lib_schema225.EntityEnumField;
|
|
20
|
+
organizationId: _contractspec_lib_schema225.EntityScalarField;
|
|
21
|
+
ownerId: _contractspec_lib_schema225.EntityScalarField;
|
|
22
|
+
source: _contractspec_lib_schema225.EntityScalarField;
|
|
23
|
+
linkedInUrl: _contractspec_lib_schema225.EntityScalarField;
|
|
24
|
+
twitterHandle: _contractspec_lib_schema225.EntityScalarField;
|
|
25
|
+
address: _contractspec_lib_schema225.EntityScalarField;
|
|
26
|
+
city: _contractspec_lib_schema225.EntityScalarField;
|
|
27
|
+
state: _contractspec_lib_schema225.EntityScalarField;
|
|
28
|
+
country: _contractspec_lib_schema225.EntityScalarField;
|
|
29
|
+
postalCode: _contractspec_lib_schema225.EntityScalarField;
|
|
30
|
+
notes: _contractspec_lib_schema225.EntityScalarField;
|
|
31
|
+
tags: _contractspec_lib_schema225.EntityScalarField;
|
|
32
|
+
customFields: _contractspec_lib_schema225.EntityScalarField;
|
|
33
|
+
lastContactedAt: _contractspec_lib_schema225.EntityScalarField;
|
|
34
|
+
nextFollowUpAt: _contractspec_lib_schema225.EntityScalarField;
|
|
35
|
+
createdAt: _contractspec_lib_schema225.EntityScalarField;
|
|
36
|
+
updatedAt: _contractspec_lib_schema225.EntityScalarField;
|
|
37
|
+
company: _contractspec_lib_schema225.EntityRelationField;
|
|
38
|
+
deals: _contractspec_lib_schema225.EntityRelationField;
|
|
39
|
+
tasks: _contractspec_lib_schema225.EntityRelationField;
|
|
40
|
+
activities: _contractspec_lib_schema225.EntityRelationField;
|
|
41
41
|
}>;
|
|
42
42
|
//#endregion
|
|
43
43
|
export { ContactEntity, ContactStatusEnum };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contact.entity.d.ts","names":[],"sources":["../../src/entities/contact.entity.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,iBAKX,EAAA,
|
|
1
|
+
{"version":3,"file":"contact.entity.d.ts","names":[],"sources":["../../src/entities/contact.entity.ts"],"sourcesContent":[],"mappings":";;;;;;AAUa,cAAA,iBAKX,EAAA,2BAAA,CAL4B,aAK5B;AAKF;;;cAAa,2CAAa;MAwExB,2BAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;wDAxEwB;EAAA,KAAA,iDAAA"}
|