@lssm/example.crm-pipeline 0.0.0-canary-20251210171026 → 0.0.0-canary-20251212004227
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.log +21 -19
- package/CHANGELOG.md +8 -8
- package/dist/docs/crm-pipeline.docblock.js +49 -0
- package/dist/docs/index.js +1 -0
- package/dist/index.js +1 -1
- package/package.json +5 -1
- package/src/docs/crm-pipeline.docblock.ts +98 -0
- package/src/docs/index.ts +1 -0
- package/src/index.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,26 +2,28 @@ $ bun build:bundle && bun build:types
|
|
|
2
2
|
$ tsdown
|
|
3
3
|
[34mℹ[39m tsdown [2mv0.17.0[22m powered by rolldown [2mv1.0.0-beta.53[22m
|
|
4
4
|
[34mℹ[39m config file: [4m/home/runner/work/contractspec/contractspec/packages/examples/crm-pipeline/tsdown.config.js[24m
|
|
5
|
-
[34mℹ[39m entry: [34msrc/events.ts, src/feature.ts, src/index.ts, src/entities/company.ts, src/entities/contact.ts, src/entities/deal.ts, src/entities/index.ts, src/entities/task.ts, src/handlers/deal.handlers.ts, src/handlers/index.ts, src/handlers/mock-data.ts, src/
|
|
5
|
+
[34mℹ[39m entry: [34msrc/events.ts, src/feature.ts, src/index.ts, src/contracts/deal.ts, src/contracts/index.ts, src/docs/crm-pipeline.docblock.ts, src/docs/index.ts, src/entities/company.ts, src/entities/contact.ts, src/entities/deal.ts, src/entities/index.ts, src/entities/task.ts, src/handlers/deal.handlers.ts, src/handlers/index.ts, src/handlers/mock-data.ts, src/presentations/dashboard.ts, src/presentations/index.ts, src/presentations/pipeline.ts[39m
|
|
6
6
|
[34mℹ[39m target: [34mesnext[39m
|
|
7
7
|
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
8
|
[34mℹ[39m Build start
|
|
9
|
-
[34mℹ[39m [2mdist/[22m[1mcontracts/deal.js[22m
|
|
10
|
-
[34mℹ[39m [2mdist/[22m[1mindex.js[22m
|
|
11
|
-
[34mℹ[39m [2mdist/[22m[1mhandlers/mock-data.js[22m
|
|
12
|
-
[34mℹ[39m [2mdist/[22m[
|
|
13
|
-
[34mℹ[39m [2mdist/[22m[
|
|
14
|
-
[34mℹ[39m [2mdist/[22m[1mentities/
|
|
15
|
-
[34mℹ[39m [2mdist/[22m[
|
|
16
|
-
[34mℹ[39m [2mdist/[22m[
|
|
17
|
-
[34mℹ[39m [2mdist/[22m[
|
|
18
|
-
[34mℹ[39m [2mdist/[22m[
|
|
19
|
-
[34mℹ[39m [2mdist/[22m[
|
|
20
|
-
[34mℹ[39m [2mdist/[22m[
|
|
21
|
-
[34mℹ[39m [2mdist/[22m[
|
|
22
|
-
[34mℹ[39m [2mdist/[22m[
|
|
23
|
-
[34mℹ[39m [2mdist/[22m[
|
|
24
|
-
[34mℹ[39m [2mdist/[22m[
|
|
25
|
-
[34mℹ[39m
|
|
26
|
-
[
|
|
9
|
+
[34mℹ[39m [2mdist/[22m[1mcontracts/deal.js[22m [2m5.38 kB[22m [2m│ gzip: 1.27 kB[22m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mindex.js[22m [2m3.54 kB[22m [2m│ gzip: 1.08 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mhandlers/mock-data.js[22m [2m3.36 kB[22m [2m│ gzip: 0.97 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/crm-pipeline.docblock.js[22m [2m3.31 kB[22m [2m│ gzip: 1.36 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[1mevents.js[22m [2m3.12 kB[22m [2m│ gzip: 0.69 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[1mentities/deal.js[22m [2m2.52 kB[22m [2m│ gzip: 0.87 kB[22m
|
|
15
|
+
[34mℹ[39m [2mdist/[22m[1mentities/task.js[22m [2m2.35 kB[22m [2m│ gzip: 0.81 kB[22m
|
|
16
|
+
[34mℹ[39m [2mdist/[22m[1mhandlers/deal.handlers.js[22m [2m1.85 kB[22m [2m│ gzip: 0.78 kB[22m
|
|
17
|
+
[34mℹ[39m [2mdist/[22m[1mentities/contact.js[22m [2m1.68 kB[22m [2m│ gzip: 0.70 kB[22m
|
|
18
|
+
[34mℹ[39m [2mdist/[22m[1mpresentations/pipeline.js[22m [2m1.48 kB[22m [2m│ gzip: 0.48 kB[22m
|
|
19
|
+
[34mℹ[39m [2mdist/[22m[1mfeature.js[22m [2m1.41 kB[22m [2m│ gzip: 0.44 kB[22m
|
|
20
|
+
[34mℹ[39m [2mdist/[22m[1mentities/company.js[22m [2m1.35 kB[22m [2m│ gzip: 0.59 kB[22m
|
|
21
|
+
[34mℹ[39m [2mdist/[22m[1mcontracts/index.js[22m [2m0.79 kB[22m [2m│ gzip: 0.26 kB[22m
|
|
22
|
+
[34mℹ[39m [2mdist/[22m[1mentities/index.js[22m [2m0.77 kB[22m [2m│ gzip: 0.33 kB[22m
|
|
23
|
+
[34mℹ[39m [2mdist/[22m[1mpresentations/dashboard.js[22m [2m0.74 kB[22m [2m│ gzip: 0.33 kB[22m
|
|
24
|
+
[34mℹ[39m [2mdist/[22m[1mhandlers/index.js[22m [2m0.60 kB[22m [2m│ gzip: 0.25 kB[22m
|
|
25
|
+
[34mℹ[39m [2mdist/[22m[1mpresentations/index.js[22m [2m0.47 kB[22m [2m│ gzip: 0.19 kB[22m
|
|
26
|
+
[34mℹ[39m [2mdist/[22m[1mdocs/index.js[22m [2m0.04 kB[22m [2m│ gzip: 0.06 kB[22m
|
|
27
|
+
[34mℹ[39m 18 files, total: 34.73 kB
|
|
28
|
+
[32m✔[39m Build complete in [32m39ms[39m
|
|
27
29
|
$ tsc --noEmit
|
package/CHANGELOG.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# @lssm/example.crm-pipeline
|
|
2
2
|
|
|
3
|
-
## 0.0.0-canary-
|
|
3
|
+
## 0.0.0-canary-20251212004227
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 3086383: refactor: dependencies upgrade
|
|
8
8
|
- Updated dependencies [3086383]
|
|
9
|
-
- @lssm/lib.contracts@0.0.0-canary-
|
|
10
|
-
- @lssm/lib.schema@0.0.0-canary-
|
|
11
|
-
- @lssm/lib.jobs@0.0.0-canary-
|
|
12
|
-
- @lssm/lib.bus@0.0.0-canary-
|
|
13
|
-
- @lssm/lib.identity-rbac@0.0.0-canary-
|
|
14
|
-
- @lssm/module.audit-trail@0.0.0-canary-
|
|
15
|
-
- @lssm/module.notifications@0.0.0-canary-
|
|
9
|
+
- @lssm/lib.contracts@0.0.0-canary-20251212004227
|
|
10
|
+
- @lssm/lib.schema@0.0.0-canary-20251212004227
|
|
11
|
+
- @lssm/lib.jobs@0.0.0-canary-20251212004227
|
|
12
|
+
- @lssm/lib.bus@0.0.0-canary-20251212004227
|
|
13
|
+
- @lssm/lib.identity-rbac@0.0.0-canary-20251212004227
|
|
14
|
+
- @lssm/module.audit-trail@0.0.0-canary-20251212004227
|
|
15
|
+
- @lssm/module.notifications@0.0.0-canary-20251212004227
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"@lssm/lib.contracts/docs";e([{id:`docs.examples.crm-pipeline.goal`,title:`CRM Pipeline — Goal`,summary:`Deals, stages, contacts, companies, and tasks with auditable stage movement.`,kind:`goal`,visibility:`public`,route:`/docs/examples/crm-pipeline/goal`,tags:[`crm`,`goal`],body:`## Why it matters
|
|
2
|
+
- Regenerable CRM flow for deals/stages without code drift.
|
|
3
|
+
- Ensures stage movement, tasks, and contacts stay aligned across surfaces.
|
|
4
|
+
|
|
5
|
+
## Business/Product goal
|
|
6
|
+
- Give sales teams a governed pipeline with auditable moves and notifications.
|
|
7
|
+
- Allow experimentation (feature flags) on stage definitions and task flows.
|
|
8
|
+
|
|
9
|
+
## Success criteria
|
|
10
|
+
- Stage/state changes emit events and remain declarative in spec.
|
|
11
|
+
- PII (contacts) is scoped/redacted in presentations.`},{id:`docs.examples.crm-pipeline.usage`,title:`CRM Pipeline — Usage`,summary:`How to seed, extend, and regenerate the CRM pipeline.`,kind:`usage`,visibility:`public`,route:`/docs/examples/crm-pipeline/usage`,tags:[`crm`,`usage`],body:`## Setup
|
|
12
|
+
1) Seed (if available) or create pipeline stages, deals, contacts, companies, tasks.
|
|
13
|
+
2) Configure Notifications for stage changes/tasks; set policy.pii for contact data.
|
|
14
|
+
|
|
15
|
+
## Extend & regenerate
|
|
16
|
+
1) Adjust stage schema/order, deal fields, task fields in the spec.
|
|
17
|
+
2) Regenerate to sync UI/API/events; ensure kanban/action buttons update.
|
|
18
|
+
3) Use Feature Flags to trial new stages or SLA rules.
|
|
19
|
+
|
|
20
|
+
## Guardrails
|
|
21
|
+
- Emit events for stage moves and task completions; log to Audit Trail.
|
|
22
|
+
- Keep required fields enforced in contracts; avoid freeform state.
|
|
23
|
+
- Redact contact PII in markdown/JSON outputs.`},{id:`docs.examples.crm-pipeline.reference`,title:`CRM Pipeline — Reference`,summary:`Entities, contracts, events, and presentations for the CRM template.`,kind:`reference`,visibility:`public`,route:`/docs/examples/crm-pipeline`,tags:[`crm`,`reference`],body:`## Entities
|
|
24
|
+
- Contact, Company, Deal, Pipeline, Stage, Task.
|
|
25
|
+
|
|
26
|
+
## Contracts
|
|
27
|
+
- deal/create, stage/move, contact/company CRUD, task create/complete.
|
|
28
|
+
|
|
29
|
+
## Events
|
|
30
|
+
- deal.created, stage.moved, task.completed, contact.updated.
|
|
31
|
+
|
|
32
|
+
## Presentations
|
|
33
|
+
- Pipelines/kanban, deal detail, contact/company profiles, task lists.
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
- Stage definitions should be declarative; enforce via spec and regeneration.
|
|
37
|
+
- Use Notifications for deal/task updates; Audit Trail for state changes.`},{id:`docs.examples.crm-pipeline.constraints`,title:`CRM Pipeline — Constraints & Safety`,summary:`Internal guardrails for stages, PII, and regeneration semantics in the CRM template.`,kind:`reference`,visibility:`internal`,route:`/docs/examples/crm-pipeline/constraints`,tags:[`crm`,`constraints`,`internal`],body:`## Constraints
|
|
38
|
+
- Stage definitions/order must remain declarative; no imperative overrides in code.
|
|
39
|
+
- Events to emit: deal.created, stage.moved, task.completed, contact.updated (minimum).
|
|
40
|
+
- Regeneration should not alter stage semantics without explicit spec change.
|
|
41
|
+
|
|
42
|
+
## PII
|
|
43
|
+
- Mark contact/company PII (emails, phones) for redaction in presentations.
|
|
44
|
+
- Ensure MCP/web outputs avoid raw PII when not needed.
|
|
45
|
+
|
|
46
|
+
## Verification
|
|
47
|
+
- Add fixtures for stage move rules and SLA/task changes.
|
|
48
|
+
- Ensure Audit/Notifications remain wired for stage and task events.
|
|
49
|
+
- Use Feature Flags for experimental stages/SLAs; default safe/off.`}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./crm-pipeline.docblock.js";
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ContactCreatedEvent as e,CrmPipelineEvents as t,DealCreatedEvent as n,DealLostEvent as r,DealMovedEvent as i,DealWonEvent as a,TaskCompletedEvent as o}from"./events.js";import{CrmPipelineFeature as s}from"./feature.js";import{ContactEntity as c,ContactStatusEnum as l}from"./entities/contact.js";import{CompanyEntity as u,CompanySizeEnum as d}from"./entities/company.js";import{DealEntity as f,DealStatusEnum as p,PipelineEntity as m,StageEntity as h}from"./entities/deal.js";import{ActivityEntity as g,TaskEntity as _,TaskPriorityEnum as v,TaskStatusEnum as y,TaskTypeEnum as b}from"./entities/task.js";import{crmPipelineEntities as x,crmPipelineSchemaContribution as S}from"./entities/index.js";import{CreateDealContract as C,CreateDealInputModel as w,DealLostPayloadModel as T,DealModel as E,DealMovedPayloadModel as D,DealStatusFilterEnum as O,DealWonPayloadModel as k,ListDealsContract as ee,ListDealsInputModel as A,ListDealsOutputModel as j,LoseDealContract as M,LoseDealInputModel as N,MoveDealContract as P,MoveDealInputModel as F,WinDealContract as I,WinDealInputModel as L}from"./contracts/deal.js";import"./contracts/index.js";import{MOCK_COMPANIES as R,MOCK_CONTACTS as z,MOCK_DEALS as B,MOCK_STAGES as V}from"./handlers/mock-data.js";import{mockCreateDealHandler as H,mockGetDealsByStageHandler as U,mockGetPipelineStagesHandler as W,mockListDealsHandler as G,mockLoseDealHandler as K,mockMoveDealHandler as q,mockWinDealHandler as J}from"./handlers/deal.handlers.js";import{DealCardPresentation as Y,DealDetailPresentation as X,DealListPresentation as Z,PipelineKanbanPresentation as Q}from"./presentations/pipeline.js";import{CrmDashboardPresentation as $,PipelineMetricsPresentation as te}from"./presentations/dashboard.js";import{CrmPipelinePresentations as ne}from"./presentations/index.js";import{identityRbacSchemaContribution as re}from"@lssm/lib.identity-rbac";import{auditTrailSchemaContribution as ie}from"@lssm/module.audit-trail";import{notificationsSchemaContribution as ae}from"@lssm/module.notifications";const oe={modules:[re,ie,ae,S],provider:`postgresql`,outputPath:`./prisma/schema/generated.prisma`};export{g as ActivityEntity,u as CompanyEntity,d as CompanySizeEnum,e as ContactCreatedEvent,c as ContactEntity,l as ContactStatusEnum,C as CreateDealContract,w as CreateDealInputModel,$ as CrmDashboardPresentation,t as CrmPipelineEvents,s as CrmPipelineFeature,ne as CrmPipelinePresentations,Y as DealCardPresentation,n as DealCreatedEvent,X as DealDetailPresentation,f as DealEntity,Z as DealListPresentation,r as DealLostEvent,T as DealLostPayloadModel,E as DealModel,i as DealMovedEvent,D as DealMovedPayloadModel,p as DealStatusEnum,O as DealStatusFilterEnum,a as DealWonEvent,k as DealWonPayloadModel,ee as ListDealsContract,A as ListDealsInputModel,j as ListDealsOutputModel,M as LoseDealContract,N as LoseDealInputModel,R as MOCK_COMPANIES,z as MOCK_CONTACTS,B as MOCK_DEALS,V as MOCK_STAGES,P as MoveDealContract,F as MoveDealInputModel,m as PipelineEntity,Q as PipelineKanbanPresentation,te as PipelineMetricsPresentation,h as StageEntity,o as TaskCompletedEvent,_ as TaskEntity,v as TaskPriorityEnum,y as TaskStatusEnum,b as TaskTypeEnum,I as WinDealContract,L as WinDealInputModel,x as crmPipelineEntities,S as crmPipelineSchemaContribution,H as mockCreateDealHandler,U as mockGetDealsByStageHandler,W as mockGetPipelineStagesHandler,G as mockListDealsHandler,K as mockLoseDealHandler,q as mockMoveDealHandler,J as mockWinDealHandler,oe as schemaComposition};
|
|
1
|
+
import{ContactCreatedEvent as e,CrmPipelineEvents as t,DealCreatedEvent as n,DealLostEvent as r,DealMovedEvent as i,DealWonEvent as a,TaskCompletedEvent as o}from"./events.js";import{CrmPipelineFeature as s}from"./feature.js";import{ContactEntity as c,ContactStatusEnum as l}from"./entities/contact.js";import{CompanyEntity as u,CompanySizeEnum as d}from"./entities/company.js";import{DealEntity as f,DealStatusEnum as p,PipelineEntity as m,StageEntity as h}from"./entities/deal.js";import{ActivityEntity as g,TaskEntity as _,TaskPriorityEnum as v,TaskStatusEnum as y,TaskTypeEnum as b}from"./entities/task.js";import{crmPipelineEntities as x,crmPipelineSchemaContribution as S}from"./entities/index.js";import{CreateDealContract as C,CreateDealInputModel as w,DealLostPayloadModel as T,DealModel as E,DealMovedPayloadModel as D,DealStatusFilterEnum as O,DealWonPayloadModel as k,ListDealsContract as ee,ListDealsInputModel as A,ListDealsOutputModel as j,LoseDealContract as M,LoseDealInputModel as N,MoveDealContract as P,MoveDealInputModel as F,WinDealContract as I,WinDealInputModel as L}from"./contracts/deal.js";import"./contracts/index.js";import{MOCK_COMPANIES as R,MOCK_CONTACTS as z,MOCK_DEALS as B,MOCK_STAGES as V}from"./handlers/mock-data.js";import{mockCreateDealHandler as H,mockGetDealsByStageHandler as U,mockGetPipelineStagesHandler as W,mockListDealsHandler as G,mockLoseDealHandler as K,mockMoveDealHandler as q,mockWinDealHandler as J}from"./handlers/deal.handlers.js";import{DealCardPresentation as Y,DealDetailPresentation as X,DealListPresentation as Z,PipelineKanbanPresentation as Q}from"./presentations/pipeline.js";import{CrmDashboardPresentation as $,PipelineMetricsPresentation as te}from"./presentations/dashboard.js";import{CrmPipelinePresentations as ne}from"./presentations/index.js";import"./docs/index.js";import{identityRbacSchemaContribution as re}from"@lssm/lib.identity-rbac";import{auditTrailSchemaContribution as ie}from"@lssm/module.audit-trail";import{notificationsSchemaContribution as ae}from"@lssm/module.notifications";const oe={modules:[re,ie,ae,S],provider:`postgresql`,outputPath:`./prisma/schema/generated.prisma`};export{g as ActivityEntity,u as CompanyEntity,d as CompanySizeEnum,e as ContactCreatedEvent,c as ContactEntity,l as ContactStatusEnum,C as CreateDealContract,w as CreateDealInputModel,$ as CrmDashboardPresentation,t as CrmPipelineEvents,s as CrmPipelineFeature,ne as CrmPipelinePresentations,Y as DealCardPresentation,n as DealCreatedEvent,X as DealDetailPresentation,f as DealEntity,Z as DealListPresentation,r as DealLostEvent,T as DealLostPayloadModel,E as DealModel,i as DealMovedEvent,D as DealMovedPayloadModel,p as DealStatusEnum,O as DealStatusFilterEnum,a as DealWonEvent,k as DealWonPayloadModel,ee as ListDealsContract,A as ListDealsInputModel,j as ListDealsOutputModel,M as LoseDealContract,N as LoseDealInputModel,R as MOCK_COMPANIES,z as MOCK_CONTACTS,B as MOCK_DEALS,V as MOCK_STAGES,P as MoveDealContract,F as MoveDealInputModel,m as PipelineEntity,Q as PipelineKanbanPresentation,te as PipelineMetricsPresentation,h as StageEntity,o as TaskCompletedEvent,_ as TaskEntity,v as TaskPriorityEnum,y as TaskStatusEnum,b as TaskTypeEnum,I as WinDealContract,L as WinDealInputModel,x as crmPipelineEntities,S as crmPipelineSchemaContribution,H as mockCreateDealHandler,U as mockGetDealsByStageHandler,W as mockGetPipelineStagesHandler,G as mockListDealsHandler,K as mockLoseDealHandler,q as mockMoveDealHandler,J as mockWinDealHandler,oe as schemaComposition};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/example.crm-pipeline",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251212004227",
|
|
4
4
|
"description": "CRM Pipeline - Contacts, Companies, Deals, Tasks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
".": "./src/index.ts",
|
|
10
10
|
"./contracts": "./src/contracts/index.ts",
|
|
11
11
|
"./contracts/deal": "./src/contracts/deal.ts",
|
|
12
|
+
"./docs": "./src/docs/index.ts",
|
|
13
|
+
"./docs/crm-pipeline.docblock": "./src/docs/crm-pipeline.docblock.ts",
|
|
12
14
|
"./entities": "./src/entities/index.ts",
|
|
13
15
|
"./entities/company": "./src/entities/company.ts",
|
|
14
16
|
"./entities/contact": "./src/entities/contact.ts",
|
|
@@ -57,6 +59,8 @@
|
|
|
57
59
|
".": "./dist/index.js",
|
|
58
60
|
"./contracts": "./dist/contracts/index.js",
|
|
59
61
|
"./contracts/deal": "./dist/contracts/deal.js",
|
|
62
|
+
"./docs": "./dist/docs/index.js",
|
|
63
|
+
"./docs/crm-pipeline.docblock": "./dist/docs/crm-pipeline.docblock.js",
|
|
60
64
|
"./entities": "./dist/entities/index.js",
|
|
61
65
|
"./entities/company": "./dist/entities/company.js",
|
|
62
66
|
"./entities/contact": "./dist/entities/contact.js",
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { DocBlock } from '@lssm/lib.contracts/docs';
|
|
2
|
+
import { registerDocBlocks } from '@lssm/lib.contracts/docs';
|
|
3
|
+
|
|
4
|
+
const crmPipelineDocBlocks: DocBlock[] = [
|
|
5
|
+
{
|
|
6
|
+
id: 'docs.examples.crm-pipeline.goal',
|
|
7
|
+
title: 'CRM Pipeline — Goal',
|
|
8
|
+
summary:
|
|
9
|
+
'Deals, stages, contacts, companies, and tasks with auditable stage movement.',
|
|
10
|
+
kind: 'goal',
|
|
11
|
+
visibility: 'public',
|
|
12
|
+
route: '/docs/examples/crm-pipeline/goal',
|
|
13
|
+
tags: ['crm', 'goal'],
|
|
14
|
+
body: `## Why it matters
|
|
15
|
+
- Regenerable CRM flow for deals/stages without code drift.
|
|
16
|
+
- Ensures stage movement, tasks, and contacts stay aligned across surfaces.
|
|
17
|
+
|
|
18
|
+
## Business/Product goal
|
|
19
|
+
- Give sales teams a governed pipeline with auditable moves and notifications.
|
|
20
|
+
- Allow experimentation (feature flags) on stage definitions and task flows.
|
|
21
|
+
|
|
22
|
+
## Success criteria
|
|
23
|
+
- Stage/state changes emit events and remain declarative in spec.
|
|
24
|
+
- PII (contacts) is scoped/redacted in presentations.`,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'docs.examples.crm-pipeline.usage',
|
|
28
|
+
title: 'CRM Pipeline — Usage',
|
|
29
|
+
summary: 'How to seed, extend, and regenerate the CRM pipeline.',
|
|
30
|
+
kind: 'usage',
|
|
31
|
+
visibility: 'public',
|
|
32
|
+
route: '/docs/examples/crm-pipeline/usage',
|
|
33
|
+
tags: ['crm', 'usage'],
|
|
34
|
+
body: `## Setup
|
|
35
|
+
1) Seed (if available) or create pipeline stages, deals, contacts, companies, tasks.
|
|
36
|
+
2) Configure Notifications for stage changes/tasks; set policy.pii for contact data.
|
|
37
|
+
|
|
38
|
+
## Extend & regenerate
|
|
39
|
+
1) Adjust stage schema/order, deal fields, task fields in the spec.
|
|
40
|
+
2) Regenerate to sync UI/API/events; ensure kanban/action buttons update.
|
|
41
|
+
3) Use Feature Flags to trial new stages or SLA rules.
|
|
42
|
+
|
|
43
|
+
## Guardrails
|
|
44
|
+
- Emit events for stage moves and task completions; log to Audit Trail.
|
|
45
|
+
- Keep required fields enforced in contracts; avoid freeform state.
|
|
46
|
+
- Redact contact PII in markdown/JSON outputs.`,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'docs.examples.crm-pipeline.reference',
|
|
50
|
+
title: 'CRM Pipeline — Reference',
|
|
51
|
+
summary:
|
|
52
|
+
'Entities, contracts, events, and presentations for the CRM template.',
|
|
53
|
+
kind: 'reference',
|
|
54
|
+
visibility: 'public',
|
|
55
|
+
route: '/docs/examples/crm-pipeline',
|
|
56
|
+
tags: ['crm', 'reference'],
|
|
57
|
+
body: `## Entities
|
|
58
|
+
- Contact, Company, Deal, Pipeline, Stage, Task.
|
|
59
|
+
|
|
60
|
+
## Contracts
|
|
61
|
+
- deal/create, stage/move, contact/company CRUD, task create/complete.
|
|
62
|
+
|
|
63
|
+
## Events
|
|
64
|
+
- deal.created, stage.moved, task.completed, contact.updated.
|
|
65
|
+
|
|
66
|
+
## Presentations
|
|
67
|
+
- Pipelines/kanban, deal detail, contact/company profiles, task lists.
|
|
68
|
+
|
|
69
|
+
## Notes
|
|
70
|
+
- Stage definitions should be declarative; enforce via spec and regeneration.
|
|
71
|
+
- Use Notifications for deal/task updates; Audit Trail for state changes.`,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'docs.examples.crm-pipeline.constraints',
|
|
75
|
+
title: 'CRM Pipeline — Constraints & Safety',
|
|
76
|
+
summary:
|
|
77
|
+
'Internal guardrails for stages, PII, and regeneration semantics in the CRM template.',
|
|
78
|
+
kind: 'reference',
|
|
79
|
+
visibility: 'internal',
|
|
80
|
+
route: '/docs/examples/crm-pipeline/constraints',
|
|
81
|
+
tags: ['crm', 'constraints', 'internal'],
|
|
82
|
+
body: `## Constraints
|
|
83
|
+
- Stage definitions/order must remain declarative; no imperative overrides in code.
|
|
84
|
+
- Events to emit: deal.created, stage.moved, task.completed, contact.updated (minimum).
|
|
85
|
+
- Regeneration should not alter stage semantics without explicit spec change.
|
|
86
|
+
|
|
87
|
+
## PII
|
|
88
|
+
- Mark contact/company PII (emails, phones) for redaction in presentations.
|
|
89
|
+
- Ensure MCP/web outputs avoid raw PII when not needed.
|
|
90
|
+
|
|
91
|
+
## Verification
|
|
92
|
+
- Add fixtures for stage move rules and SLA/task changes.
|
|
93
|
+
- Ensure Audit/Notifications remain wired for stage and task events.
|
|
94
|
+
- Use Feature Flags for experimental stages/SLAs; default safe/off.`,
|
|
95
|
+
},
|
|
96
|
+
];
|
|
97
|
+
|
|
98
|
+
registerDocBlocks(crmPipelineDocBlocks);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './crm-pipeline.docblock';
|
package/src/index.ts
CHANGED