Context map
The diagram and the table are generated by npx ddd-ts-kit docs from ddd-ts-kit.config.json
and the CONTEXT.md files. Everything outside the markers is written by the team and kept.
flowchart LR analytics["analytics<br/><small>supporting</small>"]:::supporting identity["identity<br/><small>supporting</small>"]:::supporting notification["notification<br/><small>supporting</small>"]:::supporting scheduling["scheduling<br/><small>core</small>"]:::core scheduling -->|conformist| analytics scheduling -->|published-language| notification identity -->|published-language| notification identity -->|customer-supplier| scheduling classDef core fill:#1f6feb,stroke:#0b3d91,color:#ffffff,stroke-width:2px classDef supporting fill:#ddf4ff,stroke:#1f6feb,color:#0b3d91 classDef generic fill:#f6f8fa,stroke:#8c959f,color:#24292f,stroke-dasharray: 4 3
| Context | Classification | Purpose | Upstreams | Downstreams | Published events | Deployable alone |
|---|---|---|---|---|---|---|
analytics |
supporting | Measures the occupancy, the cancellations and the no-shows of each calendar, per day. | scheduling |
no | ||
identity |
supporting | Knows the people, the practices they work in and what a practitioner delegated to an assistant. | scheduling, notification |
identity.delegation.granted, identity.delegation.revoked, identity.person.registered, identity.practice.member-added, identity.practice.member-removed, identity.practice.opened |
no | |
notification |
supporting | Tells people what happened to their appointments and reminds them before the start. | scheduling, identity |
no | ||
scheduling |
core | Publishes the availability of calendars and takes appointments on them, from booking to completion. | identity |
notification, analytics |
scheduling.appointment.booked, scheduling.appointment.cancelled, scheduling.appointment.completed, scheduling.appointment.confirmed, scheduling.appointment.expired, scheduling.appointment.marked-no-show, scheduling.appointment.rescheduled, scheduling.calendar.created |
no |
Reading guide
Section titled “Reading guide”A manager adds a practitioner in identity; scheduling learns it from an event and lets that
practitioner open a calendar. A patient books in scheduling, which holds the slot and announces
it; notification tells the patient and plans the reminder, analytics counts it. Nothing flows
back to scheduling, and nothing but the audit trail of the platform sees every context.
Why these boundaries
Section titled “Why these boundaries”identity/scheduling: "practitioner" is a member with a role inidentityand the owner of calendars inscheduling; memberships and delegations change without a calendar noticing.schedulingkeeps availability, appointments and the waitlist together: whether a slot is free must be true at the same instant as the appointments that hold the calendar. Two contexts would need a distributed check for the one guarantee the product sells.notificationapart: a mail provider being down must never refuse a booking.analyticsapart: it speaks in counts per day, decides nothing and may lag.- Delegations stay in
identityand are not copied byscheduling:identitywrites the relationship on the practitioner's desk,schedulingrelates each calendar to its desk, and the authorization model joins them. The eventsidentity.delegation.*exist for the audit trail. - The audit trail is a capability of the platform (
src/platform/audit/), not a context: it records around every use case of every context, has no language and takes no decision of its own. It becomes a context the day auditors get use cases (legal holds, exports with a workflow).
Relationship notes
Section titled “Relationship notes”schedulingfromidentity, customer-supplier: the core states what it needs (the time zone of the practice inside the membership event, a batch lookup of display names) andidentityplans it. Cost: a change of those contracts is negotiated withschedulingfirst.analyticsfromscheduling, conformist:analyticsmeasures the facts ofschedulingin the terms ofscheduling. Cost: it moves whenever those events move, and has no say.- Two ways to read
identityfromscheduling, one of each on purpose. A projection (practitioners, fed byidentity.practice.member-addedand.member-removed): the data decides (a calendar is created only for a practitioner of the practice) and labels every row of an agenda, so it must be there whenidentityis not. A gateway with hydration (PersonDirectory, the display name of the patient on the detail of one appointment): one element, read rarely, always current, and personal data stays where it is owned.
Known tensions
Section titled “Known tensions”schedulingis large (calendars, appointments, waitlist). Signal for a split: availability sold on its own, or the waitlist growing rules that never read a calendar.notificationholds reminders. Signal: reminders getting channels, preferences and quiet hours of their own.- An organization above practices is not modelled. Signal: one manager for several practices.