@sguild/dispatcher 2.0.0 → 2.0.1
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/README.md +4 -1
- package/contracts/README.md +30 -0
- package/contracts/coach-availability/README.md +355 -0
- package/contracts/coach-availability/README.v2.md +263 -0
- package/contracts/coach-availability/schema/payloads/coach.assigned-v1.json +91 -0
- package/contracts/coach-availability/validation/delivery-assignment.md +89 -0
- package/contracts/coach-availability/validation/sales-offer-construction.md +76 -0
- package/contracts/coaching-confirmation/README.md +96 -0
- package/contracts/coaching-confirmation/schema/payloads/coaching.lesson.confirmation_decided-v1.json +142 -0
- package/contracts/coaching-confirmation/schema/payloads/lead.coach.confirmation.requested-v1.json +124 -0
- package/contracts/credit-reservation-funding-state/README.md +147 -0
- package/contracts/credit-reservation-lock/README.md +433 -0
- package/contracts/credit-reservation-lock/delivery-state-vocabulary.md +73 -0
- package/contracts/credit-reservation-lock/reservation-create-api.md +191 -0
- package/contracts/credit-reservation-lock/reservation-release-api.md +171 -0
- package/contracts/credit-reservation-lock/schema/payloads/credit.locked-v1.json +1 -1
- package/contracts/credit-reservation-lock/schema/payloads/credit.reserved-v1.json +2 -3
- package/contracts/credit-reservation-lock/validation/lesson-lifecycle.md +318 -0
- package/contracts/event-envelope/README.md +205 -0
- package/contracts/event-envelope/schema/envelope-v1.json +2 -2
- package/contracts/event-envelope/validation/event-vocabulary.md +270 -0
- package/contracts/event-types-registry.json +337 -24
- package/contracts/external-actions/README.md +338 -0
- package/contracts/finance-mart/README.md +238 -0
- package/contracts/finance-mart/cac-payback.md +113 -0
- package/contracts/finance-mart/cash-position.md +98 -0
- package/contracts/finance-mart/cohort-summary.md +72 -0
- package/contracts/finance-mart/customer-journey-audit.md +92 -0
- package/contracts/finance-mart/ltv.md +92 -0
- package/contracts/finance-mart/margin.md +87 -0
- package/contracts/finance-mart/pnl.md +83 -0
- package/contracts/finance-mart/reconciliation.md +98 -0
- package/contracts/finance-mart/revenue-recognition-rollup.md +87 -0
- package/contracts/finance-mart/unit-economics.md +94 -0
- package/contracts/growth-warehouse-api/README.md +162 -0
- package/contracts/identity/README.md +184 -0
- package/contracts/identity/person-canonical-fields.md +120 -0
- package/contracts/identity/person-externals.md +267 -0
- package/contracts/identity/person-resolution-semantics.md +144 -0
- package/contracts/identity/person-role-taxonomy.md +120 -0
- package/contracts/identity/schema/payloads/intake.captured-v2.json +60 -0
- package/contracts/identity/schema/payloads/intake.matched-v2.json +123 -0
- package/contracts/identity/schema/payloads/person.updated-v1.json +8 -2
- package/contracts/identity/schema/payloads/role.assigned-v1.json +50 -0
- package/contracts/identity/schema/payloads/role.retired-v1.json +54 -0
- package/contracts/identity/validation/client-table.md +131 -0
- package/contracts/identity/validation/coach-handling.md +100 -0
- package/contracts/identity/validation/person-graph.md +140 -0
- package/contracts/lead-lifecycle/README.md +187 -0
- package/contracts/lead-lifecycle/schema/payloads/lead.handoff.context.recorded-v1.json +108 -0
- package/contracts/lead-lifecycle/schema/payloads/lead.qualified-v1.json +54 -0
- package/contracts/lead-lifecycle/schema/payloads/sales.lead.onboarded-v1.json +120 -0
- package/contracts/lesson-lifecycle/README.md +118 -0
- package/contracts/lesson-lifecycle/schema/payloads/lesson.cancelled-v1.json +30 -0
- package/contracts/lesson-lifecycle/schema/payloads/lesson.delivered-v1.json +29 -0
- package/contracts/lesson-lifecycle/schema/payloads/lesson.rescheduled-v1.json +157 -0
- package/contracts/lesson-lifecycle/schema/payloads/lesson.scheduled-v1.json +107 -0
- package/contracts/lesson-lifecycle/validation/README.md +5 -0
- package/contracts/mart-consumer-api/README.md +108 -0
- package/contracts/order-flow/README.md +106 -0
- package/contracts/order-flow/schema/payloads/order.created-v1.json +58 -0
- package/contracts/order-flow/schema/payloads/order.updated-v1.json +63 -0
- package/contracts/payment-flow/README.md +157 -0
- package/contracts/platform-comms/README.md +84 -0
- package/contracts/platform-comms/schema/payloads/platform.comms.inbound-v1.json +83 -0
- package/contracts/platform-geography-snapshot/README.md +205 -0
- package/contracts/platform-geography-snapshot/schema/payloads/geography.market.archived-v1.json +36 -0
- package/contracts/platform-geography-snapshot/schema/payloads/geography.market.upserted-v1.json +59 -0
- package/contracts/platform-geography-snapshot/schema/payloads/geography.service-area.archived-v1.json +36 -0
- package/contracts/platform-geography-snapshot/schema/payloads/geography.service-area.upserted-v1.json +65 -0
- package/contracts/portfolio-mart/README.md +133 -0
- package/contracts/portfolio-mart/cohort-funnel-panel.md +76 -0
- package/contracts/portfolio-mart/cross-discipline-performance.md +91 -0
- package/contracts/portfolio-mart/cross-market-performance.md +84 -0
- package/contracts/portfolio-mart/health-composites.md +88 -0
- package/contracts/portfolio-mart/org-topology.md +70 -0
- package/contracts/portfolio-mart/portfolio-level-funnel-health.md +92 -0
- package/contracts/portfolio-mart/validation/consumer-isolation.md +33 -0
- package/contracts/portfolio-mart/validation/decoupling-discipline.md +34 -0
- package/contracts/refund-flow/README.md +136 -0
- package/contracts/refund-flow/sales-callable-refund-initiation-api.md +218 -0
- package/contracts/sales-scheduling-surface/README.md +532 -0
- package/contracts/sales-scheduling-surface/schema/payloads/delivery.lesson-hold.cancelled-v1.json +42 -0
- package/contracts/sales-scheduling-surface/schema/payloads/delivery.lesson-hold.created-v1.json +115 -0
- package/contracts/sales-scheduling-surface/validation/composite-hold-create.md +97 -0
- package/contracts/sales-scheduling-surface/validation/lock-state-machine-conformance.md +84 -0
- package/contracts/sales-scheduling-surface/validation/sales-close-orchestration.md +77 -0
- package/contracts/warehouse-silver/README.md +118 -0
- package/contracts/warehouse-silver/coaching-utilization-columns.md +105 -0
- package/dist/events.d.ts +63 -0
- package/dist/events.js +293 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/postgres-consumer.js +2 -1
- package/dist/validator.js +1 -0
- package/package.json +1 -1
|
@@ -80,9 +80,18 @@
|
|
|
80
80
|
{
|
|
81
81
|
"version": 1,
|
|
82
82
|
"payload_schema": null,
|
|
83
|
-
"status": "
|
|
83
|
+
"status": "deprecated",
|
|
84
84
|
"registered_at": "2026-05-02",
|
|
85
|
-
"
|
|
85
|
+
"deprecated_at": "2026-05-12",
|
|
86
|
+
"notes": "Initial version with top-level person_id + originating_event_id + match_type + matched_at. Deprecated 2026-05-12 in favor of v2 which adds the submission_summary block so Sales can open a Lead from the matched event alone (no back-lookup against Growth's dispatcher_event). Producer cutover to v2 at 2026-05-26 (deprecated_at + 14 days per envelope-contract §16). v1 stays consumable by old consumers through that window; producer Platform flips from emitting v1 to v2 at cutover."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"version": 2,
|
|
90
|
+
"payload_schema": "contracts/identity/schema/payloads/intake.matched-v2.json",
|
|
91
|
+
"status": "active",
|
|
92
|
+
"registered_at": "2026-05-12",
|
|
93
|
+
"active_from": "2026-05-26",
|
|
94
|
+
"notes": "Adds the submission_summary block (first_name, last_name, phone_normalized, zip, student_age_group, timeline, lesson_setting, new_qualified) plus source / campaign_code / landing_url carry-through from the originating intake.captured. Eliminates Sales' need to JOIN back to Growth's dispatcher_event when opening a Lead. Authored per the 2026-05-12 decision to forward operator-relevant fields on intake.matched rather than have downstream consumers chase secondary lookups; consistent with the topology B principle of self-contained envelopes."
|
|
86
95
|
}
|
|
87
96
|
]
|
|
88
97
|
},
|
|
@@ -104,6 +113,159 @@
|
|
|
104
113
|
}
|
|
105
114
|
]
|
|
106
115
|
},
|
|
116
|
+
"platform.comms.inbound": {
|
|
117
|
+
"producer": "platform",
|
|
118
|
+
"consumers": [
|
|
119
|
+
"sales",
|
|
120
|
+
"platform-warehouse"
|
|
121
|
+
],
|
|
122
|
+
"owning_contract": "contracts/platform-comms/README.md",
|
|
123
|
+
"schema_versions": [
|
|
124
|
+
{
|
|
125
|
+
"version": 1,
|
|
126
|
+
"payload_schema": "contracts/platform-comms/schema/payloads/platform.comms.inbound-v1.json",
|
|
127
|
+
"status": "active",
|
|
128
|
+
"registered_at": "2026-05-17",
|
|
129
|
+
"notes": "Platform-owned inbound SMS and voice-call cadence-reset signal per 2026-05-17-platform-cadence-inbound-comms-position. Subject is person_id, actor is system:platform. Payload carries safe routing metadata only; raw provider payloads, full body text, contact details, and transcripts stay in Platform-owned comms storage. Sales consumes to reset cadence; platform-warehouse ingests for analytics."
|
|
130
|
+
}
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"coaching.lesson.confirmation_decided": {
|
|
134
|
+
"producer": "coaching",
|
|
135
|
+
"consumers": [
|
|
136
|
+
"sales",
|
|
137
|
+
"platform-warehouse"
|
|
138
|
+
],
|
|
139
|
+
"owning_contract": "contracts/coaching-confirmation/README.md",
|
|
140
|
+
"schema_versions": [
|
|
141
|
+
{
|
|
142
|
+
"version": 1,
|
|
143
|
+
"payload_schema": "contracts/coaching-confirmation/schema/payloads/coaching.lesson.confirmation_decided-v1.json",
|
|
144
|
+
"status": "active",
|
|
145
|
+
"registered_at": "2026-05-17",
|
|
146
|
+
"notes": "Coaching-produced answer to Sales' lead.coach.confirmation.requested confirmation handshake per 2026-05-17-coaching-cadence-confirmation-event-position. Subject is confirmation_request_id. Sales consumes for cadence Stage 3b resolution; platform-warehouse ingests for confirmation latency, denial-rate, and re-engagement analytics."
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"lead.coach.confirmation.requested": {
|
|
151
|
+
"producer": "sales",
|
|
152
|
+
"consumers": [
|
|
153
|
+
"coaching",
|
|
154
|
+
"platform-warehouse"
|
|
155
|
+
],
|
|
156
|
+
"owning_contract": "contracts/coaching-confirmation/README.md",
|
|
157
|
+
"schema_versions": [
|
|
158
|
+
{
|
|
159
|
+
"version": 1,
|
|
160
|
+
"payload_schema": "contracts/coaching-confirmation/schema/payloads/lead.coach.confirmation.requested-v1.json",
|
|
161
|
+
"status": "active",
|
|
162
|
+
"registered_at": "2026-05-18",
|
|
163
|
+
"notes": "Sales-produced request that starts the Stage 3b coach-confirmation handshake per 2026-05-17-sales-cadence-stage-map-sales-side-commitments and 2026-05-17-coaching-cadence-confirmation-event-position. Subject is confirmation_request_id. Coaching consumes to decide confirm-or-deny without reading Sales state; platform-warehouse ingests for confirmation latency, denial-rate, and re-engagement analytics."
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
"geography.market.upserted": {
|
|
168
|
+
"producer": "platform",
|
|
169
|
+
"consumers": [
|
|
170
|
+
"sales",
|
|
171
|
+
"platform-warehouse"
|
|
172
|
+
],
|
|
173
|
+
"owning_contract": "contracts/platform-geography-snapshot/README.md",
|
|
174
|
+
"schema_versions": [
|
|
175
|
+
{
|
|
176
|
+
"version": 1,
|
|
177
|
+
"payload_schema": "contracts/platform-geography-snapshot/schema/payloads/geography.market.upserted-v1.json",
|
|
178
|
+
"status": "active",
|
|
179
|
+
"registered_at": "2026-05-18",
|
|
180
|
+
"notes": "Platform-produced canonical Market snapshot event per platform-geography-snapshot v0.1.0 and 2026-05-16-platform-geography-snapshot-contract-position. Emitted on Market mint or canonical-field change when the row is not transitioning to archived. Sales consumes for a local geography fallback snapshot; platform-warehouse ingests for reference-data history."
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
"geography.market.archived": {
|
|
185
|
+
"producer": "platform",
|
|
186
|
+
"consumers": [
|
|
187
|
+
"sales",
|
|
188
|
+
"platform-warehouse"
|
|
189
|
+
],
|
|
190
|
+
"owning_contract": "contracts/platform-geography-snapshot/README.md",
|
|
191
|
+
"schema_versions": [
|
|
192
|
+
{
|
|
193
|
+
"version": 1,
|
|
194
|
+
"payload_schema": "contracts/platform-geography-snapshot/schema/payloads/geography.market.archived-v1.json",
|
|
195
|
+
"status": "active",
|
|
196
|
+
"registered_at": "2026-05-18",
|
|
197
|
+
"notes": "Platform-produced canonical Market archive event per platform-geography-snapshot v0.1.0. Emitted when a Market transitions to archived so consumers can retire local snapshot rows without relying solely on daily reconciliation."
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"geography.service-area.upserted": {
|
|
202
|
+
"producer": "platform",
|
|
203
|
+
"consumers": [
|
|
204
|
+
"sales",
|
|
205
|
+
"platform-warehouse"
|
|
206
|
+
],
|
|
207
|
+
"owning_contract": "contracts/platform-geography-snapshot/README.md",
|
|
208
|
+
"schema_versions": [
|
|
209
|
+
{
|
|
210
|
+
"version": 1,
|
|
211
|
+
"payload_schema": "contracts/platform-geography-snapshot/schema/payloads/geography.service-area.upserted-v1.json",
|
|
212
|
+
"status": "active",
|
|
213
|
+
"registered_at": "2026-05-18",
|
|
214
|
+
"notes": "Platform-produced canonical Service Area snapshot event per platform-geography-snapshot v0.1.0 and ADR-0013. Emitted on Service Area mint or canonical-field change when the row is not transitioning to archived. Delivery is a reference-holder, not producer."
|
|
215
|
+
}
|
|
216
|
+
]
|
|
217
|
+
},
|
|
218
|
+
"geography.service-area.archived": {
|
|
219
|
+
"producer": "platform",
|
|
220
|
+
"consumers": [
|
|
221
|
+
"sales",
|
|
222
|
+
"platform-warehouse"
|
|
223
|
+
],
|
|
224
|
+
"owning_contract": "contracts/platform-geography-snapshot/README.md",
|
|
225
|
+
"schema_versions": [
|
|
226
|
+
{
|
|
227
|
+
"version": 1,
|
|
228
|
+
"payload_schema": "contracts/platform-geography-snapshot/schema/payloads/geography.service-area.archived-v1.json",
|
|
229
|
+
"status": "active",
|
|
230
|
+
"registered_at": "2026-05-18",
|
|
231
|
+
"notes": "Platform-produced canonical Service Area archive event per platform-geography-snapshot v0.1.0. Emitted when a Service Area transitions to archived so consumers can retire local snapshot rows without relying solely on daily reconciliation."
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
"role.assigned": {
|
|
236
|
+
"producer": "sales",
|
|
237
|
+
"consumers": [
|
|
238
|
+
"platform",
|
|
239
|
+
"platform-warehouse"
|
|
240
|
+
],
|
|
241
|
+
"owning_contract": "contracts/identity/README.md",
|
|
242
|
+
"schema_versions": [
|
|
243
|
+
{
|
|
244
|
+
"version": 1,
|
|
245
|
+
"payload_schema": "contracts/identity/schema/payloads/role.assigned-v1.json",
|
|
246
|
+
"status": "active",
|
|
247
|
+
"registered_at": "2026-05-12",
|
|
248
|
+
"notes": "Emitted by a role-owning producer-domain when a Person gains a role-bearing relationship with one of that domain's entities. Closed enum of role values per contracts/identity/person-role-taxonomy.md: lead (sales), customer (revenue), student (delivery), coach (coaching), guardian (platform), operator (platform). Multiple domains produce; producer field on each envelope identifies which one. Platform consumes to maintain the person_role projection backing GET /api/identity/v1/person/<id>/roles. Sales is the v1 production producer (Lead → lead role); Revenue/Delivery/Coaching join additively as each domain wires its emit hooks. Guardian and operator roles are written in-process by Platform without going through the dispatcher (same Prisma transaction as the underlying guardian/member row write)."
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
},
|
|
252
|
+
"role.retired": {
|
|
253
|
+
"producer": "sales",
|
|
254
|
+
"consumers": [
|
|
255
|
+
"platform",
|
|
256
|
+
"platform-warehouse"
|
|
257
|
+
],
|
|
258
|
+
"owning_contract": "contracts/identity/README.md",
|
|
259
|
+
"schema_versions": [
|
|
260
|
+
{
|
|
261
|
+
"version": 1,
|
|
262
|
+
"payload_schema": "contracts/identity/schema/payloads/role.retired-v1.json",
|
|
263
|
+
"status": "active",
|
|
264
|
+
"registered_at": "2026-05-12",
|
|
265
|
+
"notes": "Emitted by a role-owning producer-domain when a Person's role-bearing relationship terminates (Lead reaches terminal stage, Coach moves to inactive, Participant deactivates, Guardian relationship terminated, Member row deleted). Idempotent at the projection: re-delivery for an already-retired row is a no-op. customer role is sticky — Revenue emits role.retired only for compliance scenarios with reason='compliance_purge'. Sales is the v1 production producer; other domains join additively per the same rollout schedule as role.assigned."
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
},
|
|
107
269
|
"customer.handoff": {
|
|
108
270
|
"producer": "revenue",
|
|
109
271
|
"consumers": [
|
|
@@ -155,7 +317,7 @@
|
|
|
155
317
|
"payload_schema": "contracts/credit-reservation-lock/schema/payloads/credit.reserved-v1.json",
|
|
156
318
|
"status": "active",
|
|
157
319
|
"registered_at": "2026-05-02",
|
|
158
|
-
"notes": "Emitted
|
|
320
|
+
"notes": "Emitted when Revenue records a reservation claim per §9.2. lesson_id is optional on Sales-originated reservations until Delivery hold-create mints les_; Coaching uses Delivery hold-created for coach-specific booking facts when lesson_id is absent."
|
|
159
321
|
}
|
|
160
322
|
]
|
|
161
323
|
},
|
|
@@ -191,7 +353,7 @@
|
|
|
191
353
|
"payload_schema": "contracts/credit-reservation-lock/schema/payloads/credit.locked-v1.json",
|
|
192
354
|
"status": "active",
|
|
193
355
|
"registered_at": "2026-05-02",
|
|
194
|
-
"notes": "Emitted on T-
|
|
356
|
+
"notes": "Emitted on T-24h lock per §9.4. customer.handoff sidecar fires on first per Person."
|
|
195
357
|
}
|
|
196
358
|
]
|
|
197
359
|
},
|
|
@@ -262,21 +424,41 @@
|
|
|
262
424
|
},
|
|
263
425
|
"lesson.scheduled": {
|
|
264
426
|
"producer": "delivery",
|
|
265
|
-
"consumers": [
|
|
266
|
-
|
|
427
|
+
"consumers": [
|
|
428
|
+
"coaching"
|
|
429
|
+
],
|
|
430
|
+
"owning_contract": "contracts/lesson-lifecycle/README.md",
|
|
267
431
|
"schema_versions": [
|
|
268
432
|
{
|
|
269
433
|
"version": 1,
|
|
270
|
-
"payload_schema":
|
|
434
|
+
"payload_schema": "contracts/lesson-lifecycle/schema/payloads/lesson.scheduled-v1.json",
|
|
271
435
|
"status": "active",
|
|
272
436
|
"registered_at": "2026-05-02",
|
|
273
|
-
"notes": "Emitted by Delivery when a lesson is scheduled.
|
|
437
|
+
"notes": "Emitted by Delivery when a lesson is scheduled. Coaching consumes scheduling identity for assigned-vs-eligible projection enrichment per coach-availability §4.2.1 producer-internal note. Payload is PII-free and carries lesson, participant, reservation, coach, site, service-area, lesson-type, ZIP, and window correlations."
|
|
438
|
+
}
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
"lesson.rescheduled": {
|
|
442
|
+
"producer": "delivery",
|
|
443
|
+
"consumers": [
|
|
444
|
+
"sales"
|
|
445
|
+
],
|
|
446
|
+
"owning_contract": "contracts/lesson-lifecycle/README.md",
|
|
447
|
+
"schema_versions": [
|
|
448
|
+
{
|
|
449
|
+
"version": 1,
|
|
450
|
+
"payload_schema": "contracts/lesson-lifecycle/schema/payloads/lesson.rescheduled-v1.json",
|
|
451
|
+
"status": "active",
|
|
452
|
+
"registered_at": "2026-05-18",
|
|
453
|
+
"notes": "Emitted by Delivery when a scheduled Lesson's window changes in place. Sales consumes to keep Lead.lessonDate and lesson-date-keyed cadence state aligned from new_window.start, per 2026-05-17-delivery-cadence-reschedule-event-position. Payload is PII-free and carries previous/new scheduling windows plus nullable lock, reservation, coach, site, service-area, and lesson-type correlations."
|
|
274
454
|
}
|
|
275
455
|
]
|
|
276
456
|
},
|
|
277
457
|
"lesson.attended": {
|
|
278
458
|
"producer": "delivery",
|
|
279
|
-
"consumers": [
|
|
459
|
+
"consumers": [
|
|
460
|
+
"coaching"
|
|
461
|
+
],
|
|
280
462
|
"owning_contract": null,
|
|
281
463
|
"schema_versions": [
|
|
282
464
|
{
|
|
@@ -290,31 +472,34 @@
|
|
|
290
472
|
},
|
|
291
473
|
"lesson.cancelled": {
|
|
292
474
|
"producer": "delivery",
|
|
293
|
-
"consumers": [
|
|
294
|
-
|
|
475
|
+
"consumers": [
|
|
476
|
+
"coaching"
|
|
477
|
+
],
|
|
478
|
+
"owning_contract": "contracts/lesson-lifecycle/README.md",
|
|
295
479
|
"schema_versions": [
|
|
296
480
|
{
|
|
297
481
|
"version": 1,
|
|
298
|
-
"payload_schema":
|
|
482
|
+
"payload_schema": "contracts/lesson-lifecycle/schema/payloads/lesson.cancelled-v1.json",
|
|
299
483
|
"status": "active",
|
|
300
|
-
"registered_at": "2026-05-
|
|
301
|
-
"notes": "Emitted on lesson cancellation by Delivery.
|
|
484
|
+
"registered_at": "2026-05-14",
|
|
485
|
+
"notes": "Emitted on lesson cancellation by Delivery. Carries lesson_id, cancellation_reason (flexible string), and cancelled_at. Deliberately no credit_reservation_id field: the credit cancellation path (credit.released or credit.forfeited) is a separate Revenue-produced event. No cross-domain consumers at v1; Revenue's Lesson Completion Job uses lesson.delivered, not this event. v2 additive candidate if a real consumer need surfaces."
|
|
302
486
|
}
|
|
303
487
|
]
|
|
304
488
|
},
|
|
305
489
|
"lesson.delivered": {
|
|
306
490
|
"producer": "delivery",
|
|
307
491
|
"consumers": [
|
|
308
|
-
"revenue"
|
|
492
|
+
"revenue",
|
|
493
|
+
"coaching"
|
|
309
494
|
],
|
|
310
|
-
"owning_contract":
|
|
495
|
+
"owning_contract": "contracts/lesson-lifecycle/README.md",
|
|
311
496
|
"schema_versions": [
|
|
312
497
|
{
|
|
313
498
|
"version": 1,
|
|
314
|
-
"payload_schema":
|
|
499
|
+
"payload_schema": "contracts/lesson-lifecycle/schema/payloads/lesson.delivered-v1.json",
|
|
315
500
|
"status": "active",
|
|
316
|
-
"registered_at": "2026-05-
|
|
317
|
-
"notes": "Emitted post-delivery
|
|
501
|
+
"registered_at": "2026-05-14",
|
|
502
|
+
"notes": "Emitted post-delivery by Delivery; triggers Revenue's Lesson Completion Job per credit-reservation-lock §10. Payload: lesson_id (required), credit_reservation_id (optional, present for reserved lessons), delivered_at (required). Revenue keys on credit_reservation_id when present, falls back to lesson_id lookup otherwise."
|
|
318
503
|
}
|
|
319
504
|
]
|
|
320
505
|
},
|
|
@@ -327,16 +512,53 @@
|
|
|
327
512
|
"schema_versions": [
|
|
328
513
|
{
|
|
329
514
|
"version": 1,
|
|
330
|
-
"payload_schema":
|
|
515
|
+
"payload_schema": "contracts/coach-availability/schema/payloads/coach.assigned-v1.json",
|
|
331
516
|
"status": "active",
|
|
332
517
|
"registered_at": "2026-05-02",
|
|
333
|
-
"notes": "Single-writer per ADR-0008. Coaching consumes for the assigned-vs-eligible projection enrichment per coach-availability §4.3 prose."
|
|
518
|
+
"notes": "Single-writer per ADR-0008. Coaching consumes for the assigned-vs-eligible projection enrichment per coach-availability §4.3 prose. Payload is PII-free and carries lesson, previous coach, new coach, participant, site, service-area, lesson-type, window, and assigned_at."
|
|
519
|
+
}
|
|
520
|
+
]
|
|
521
|
+
},
|
|
522
|
+
"delivery.lesson-hold.created": {
|
|
523
|
+
"producer": "delivery",
|
|
524
|
+
"consumers": [
|
|
525
|
+
"sales",
|
|
526
|
+
"coaching",
|
|
527
|
+
"revenue"
|
|
528
|
+
],
|
|
529
|
+
"owning_contract": "contracts/sales-scheduling-surface/README.md",
|
|
530
|
+
"schema_versions": [
|
|
531
|
+
{
|
|
532
|
+
"version": 1,
|
|
533
|
+
"payload_schema": "contracts/sales-scheduling-surface/schema/payloads/delivery.lesson-hold.created-v1.json",
|
|
534
|
+
"status": "active",
|
|
535
|
+
"registered_at": "2026-05-19",
|
|
536
|
+
"notes": "Emitted by Delivery when the sales-scheduling-surface hold-create transaction inserts the Lesson row and advances the Delivery reservation lock to held. Payload carries scheduling-side facts only, including optional atomic-multi-create offer correlations."
|
|
537
|
+
}
|
|
538
|
+
]
|
|
539
|
+
},
|
|
540
|
+
"delivery.lesson-hold.cancelled": {
|
|
541
|
+
"producer": "delivery",
|
|
542
|
+
"consumers": [
|
|
543
|
+
"sales",
|
|
544
|
+
"coaching",
|
|
545
|
+
"revenue"
|
|
546
|
+
],
|
|
547
|
+
"owning_contract": "contracts/sales-scheduling-surface/README.md",
|
|
548
|
+
"schema_versions": [
|
|
549
|
+
{
|
|
550
|
+
"version": 1,
|
|
551
|
+
"payload_schema": "contracts/sales-scheduling-surface/schema/payloads/delivery.lesson-hold.cancelled-v1.json",
|
|
552
|
+
"status": "active",
|
|
553
|
+
"registered_at": "2026-05-19",
|
|
554
|
+
"notes": "Emitted by Delivery when the sales-scheduling-surface hold-cancel transaction cancels the Lesson row and advances the Delivery reservation lock to released. Revenue-owned refund and credit events remain on Revenue surfaces."
|
|
334
555
|
}
|
|
335
556
|
]
|
|
336
557
|
},
|
|
337
558
|
"lead.created": {
|
|
338
559
|
"producer": "sales",
|
|
339
560
|
"consumers": [
|
|
561
|
+
"growth",
|
|
340
562
|
"platform-warehouse"
|
|
341
563
|
],
|
|
342
564
|
"owning_contract": "contracts/lead-lifecycle/README.md",
|
|
@@ -346,13 +568,14 @@
|
|
|
346
568
|
"payload_schema": "contracts/lead-lifecycle/schema/payloads/lead.created-v1.json",
|
|
347
569
|
"status": "active",
|
|
348
570
|
"registered_at": "2026-05-14",
|
|
349
|
-
"notes": "Emitted by Sales when a new Lead opens per lead-lifecycle §4.1. Two opening cases (from intake.captured with null person_id, or from intake.matched with person_id populated) plus reactivations carrying reactivated_from. Producer-transactional emit per ADR-0009; same Prisma transaction as the Lead row creation."
|
|
571
|
+
"notes": "Emitted by Sales when a new Lead opens per lead-lifecycle §4.1. Two opening cases (from intake.captured with null person_id, or from intake.matched with person_id populated) plus reactivations carrying reactivated_from. Producer-transactional emit per ADR-0009; same Prisma transaction as the Lead row creation. Growth consumer (added 2026-05-12) populates growth.lead_intake_correlation by resolving originating_intake_event_id to a form_submission_id via Growth's local dispatcher_event table."
|
|
350
572
|
}
|
|
351
573
|
]
|
|
352
574
|
},
|
|
353
575
|
"lead.stage.changed": {
|
|
354
576
|
"producer": "sales",
|
|
355
577
|
"consumers": [
|
|
578
|
+
"growth",
|
|
356
579
|
"platform-warehouse"
|
|
357
580
|
],
|
|
358
581
|
"owning_contract": "contracts/lead-lifecycle/README.md",
|
|
@@ -362,13 +585,14 @@
|
|
|
362
585
|
"payload_schema": "contracts/lead-lifecycle/schema/payloads/lead.stage.changed-v1.json",
|
|
363
586
|
"status": "active",
|
|
364
587
|
"registered_at": "2026-05-14",
|
|
365
|
-
"notes": "Broad state-transition event per lead-lifecycle §4.2. transition_reason enum (operator_action | cadence_runtime | inbound_event) identifies what drove the move. May co-fire with lead.reached, lead.callback.scheduled, or lead.attempt.exhausted when both apply. Stage values flexible string at v1.0.0; v1.1 candidate to tighten to a closed enum."
|
|
588
|
+
"notes": "Broad state-transition event per lead-lifecycle §4.2. transition_reason enum (operator_action | cadence_runtime | inbound_event) identifies what drove the move. May co-fire with lead.reached, lead.callback.scheduled, or lead.attempt.exhausted when both apply. Stage values flexible string at v1.0.0; v1.1 candidate to tighten to a closed enum. Growth consumer (added 2026-05-12) upserts growth.qualified_intake on transitions to a qualifying to_stage (initially 'qualified'), sourcing the form_submission_id via lead_intake_correlation."
|
|
366
589
|
}
|
|
367
590
|
]
|
|
368
591
|
},
|
|
369
592
|
"lead.reached": {
|
|
370
593
|
"producer": "sales",
|
|
371
594
|
"consumers": [
|
|
595
|
+
"growth",
|
|
372
596
|
"platform-warehouse"
|
|
373
597
|
],
|
|
374
598
|
"owning_contract": "contracts/lead-lifecycle/README.md",
|
|
@@ -378,7 +602,7 @@
|
|
|
378
602
|
"payload_schema": "contracts/lead-lifecycle/schema/payloads/lead.reached-v1.json",
|
|
379
603
|
"status": "active",
|
|
380
604
|
"registered_at": "2026-05-14",
|
|
381
|
-
"notes": "Successful reach event per lead-lifecycle §4.3. Voicemail, busy, no-answer, disconnected do NOT fire this event; only real conversations. attempt_number 1-4 per the cadence cap. outcome flexible string at v1.0.0; v1.1 candidate to tighten."
|
|
605
|
+
"notes": "Successful reach event per lead-lifecycle §4.3. Voicemail, busy, no-answer, disconnected do NOT fire this event; only real conversations. attempt_number 1-4 per the cadence cap. outcome flexible string at v1.0.0; v1.1 candidate to tighten. Growth consumer (added 2026-05-12) upserts growth.qualified_intake when outcome='qualified', sourcing the form_submission_id via lead_intake_correlation."
|
|
382
606
|
}
|
|
383
607
|
]
|
|
384
608
|
},
|
|
@@ -414,6 +638,95 @@
|
|
|
414
638
|
}
|
|
415
639
|
]
|
|
416
640
|
},
|
|
641
|
+
"lead.qualified": {
|
|
642
|
+
"producer": "sales",
|
|
643
|
+
"consumers": [
|
|
644
|
+
"growth",
|
|
645
|
+
"platform-warehouse"
|
|
646
|
+
],
|
|
647
|
+
"owning_contract": "contracts/lead-lifecycle/README.md",
|
|
648
|
+
"schema_versions": [
|
|
649
|
+
{
|
|
650
|
+
"version": 1,
|
|
651
|
+
"payload_schema": "contracts/lead-lifecycle/schema/payloads/lead.qualified-v1.json",
|
|
652
|
+
"status": "active",
|
|
653
|
+
"registered_at": "2026-05-17",
|
|
654
|
+
"notes": "Qualification event per lead-lifecycle §4.6 (v1.1.0 amendment). Carries confirmed organization_id, market_id, and org_market_id — the authoritative (org, market) pair that closes Growth's provisional → confirmed attribution loop per ADR-0019. Growth MUST consume to update growth.qualified_intake. Sales MUST confirm org/market with the rep at qualification time; must not infer from campaign metadata. qualification_signal is a closed enum at v1: connected | replied | inbound_request."
|
|
655
|
+
}
|
|
656
|
+
]
|
|
657
|
+
},
|
|
658
|
+
"lead.handoff.context.recorded": {
|
|
659
|
+
"producer": "sales",
|
|
660
|
+
"consumers": [
|
|
661
|
+
"delivery",
|
|
662
|
+
"platform-warehouse"
|
|
663
|
+
],
|
|
664
|
+
"owning_contract": "contracts/lead-lifecycle/README.md",
|
|
665
|
+
"schema_versions": [
|
|
666
|
+
{
|
|
667
|
+
"version": 1,
|
|
668
|
+
"payload_schema": "contracts/lead-lifecycle/schema/payloads/lead.handoff.context.recorded-v1.json",
|
|
669
|
+
"status": "active",
|
|
670
|
+
"registered_at": "2026-05-19",
|
|
671
|
+
"notes": "Sales-produced curated handoff-context event per lead-lifecycle §4.7 and the 2026-05-19 platform/sales/delivery handoff-context thread. Delivery consumes to attach Sales-owned relationship-start context to customer tracking without expanding Revenue's customer.handoff payload. Platform-warehouse ingests for handoff-timeliness, context-coverage, and repeat-question analytics. Payload is curated and excludes raw comms content, contact details, Guardian facts, DOB, payment details, opt-out truth, and internal audit noise."
|
|
672
|
+
}
|
|
673
|
+
]
|
|
674
|
+
},
|
|
675
|
+
"sales.lead.onboarded": {
|
|
676
|
+
"producer": "sales",
|
|
677
|
+
"consumers": [
|
|
678
|
+
"platform-warehouse"
|
|
679
|
+
],
|
|
680
|
+
"owning_contract": "contracts/lead-lifecycle/README.md",
|
|
681
|
+
"schema_versions": [
|
|
682
|
+
{
|
|
683
|
+
"version": 1,
|
|
684
|
+
"payload_schema": "contracts/lead-lifecycle/schema/payloads/sales.lead.onboarded-v1.json",
|
|
685
|
+
"status": "active",
|
|
686
|
+
"registered_at": "2026-05-18",
|
|
687
|
+
"notes": "Sales-produced Stage 4 entry signal per 2026-05-17-sales-cadence-stage-map-sales-side-commitments. v1.1 candidate under lead-lifecycle. Emitted from the close-orchestration success path alongside Lead.lessonDate persistence in recordCloseLessonBooked. Platform-warehouse consumes for Stage 4 payment-to-lesson funnel analytics."
|
|
688
|
+
}
|
|
689
|
+
]
|
|
690
|
+
},
|
|
691
|
+
"order.created": {
|
|
692
|
+
"producer": "revenue",
|
|
693
|
+
"consumers": [
|
|
694
|
+
"revenue",
|
|
695
|
+
"sales",
|
|
696
|
+
"growth",
|
|
697
|
+
"delivery",
|
|
698
|
+
"platform-warehouse"
|
|
699
|
+
],
|
|
700
|
+
"owning_contract": "contracts/order-flow/README.md",
|
|
701
|
+
"schema_versions": [
|
|
702
|
+
{
|
|
703
|
+
"version": 1,
|
|
704
|
+
"payload_schema": "contracts/order-flow/schema/payloads/order.created-v1.json",
|
|
705
|
+
"status": "active",
|
|
706
|
+
"registered_at": "2026-05-14",
|
|
707
|
+
"notes": "Emitted by Revenue at the writeback transaction commit when an Order row first lands in the canonical Postgres store. Producer-transactional guarantee per ADR-0009."
|
|
708
|
+
}
|
|
709
|
+
]
|
|
710
|
+
},
|
|
711
|
+
"order.updated": {
|
|
712
|
+
"producer": "revenue",
|
|
713
|
+
"consumers": [
|
|
714
|
+
"revenue",
|
|
715
|
+
"sales",
|
|
716
|
+
"delivery",
|
|
717
|
+
"platform-warehouse"
|
|
718
|
+
],
|
|
719
|
+
"owning_contract": "contracts/order-flow/README.md",
|
|
720
|
+
"schema_versions": [
|
|
721
|
+
{
|
|
722
|
+
"version": 1,
|
|
723
|
+
"payload_schema": "contracts/order-flow/schema/payloads/order.updated-v1.json",
|
|
724
|
+
"status": "active",
|
|
725
|
+
"registered_at": "2026-05-14",
|
|
726
|
+
"notes": "Emitted by Revenue when an Order's load-bearing canonical fields change: status, amount_paid_cents, amount_total_cents, or cancelled_at. Free-text and operator-internal metadata edits do not emit."
|
|
727
|
+
}
|
|
728
|
+
]
|
|
729
|
+
},
|
|
417
730
|
"payment.received": {
|
|
418
731
|
"producer": "revenue",
|
|
419
732
|
"consumers": [
|