Skip to content

docs: add CONTEXTS.md — bounded contexts, invariants, rules, and dependencies#5

Draft
Copilot wants to merge 2 commits intoutilsfrom
copilot/clarifier-bounded-contexts
Draft

docs: add CONTEXTS.md — bounded contexts, invariants, rules, and dependencies#5
Copilot wants to merge 2 commits intoutilsfrom
copilot/clarifier-bounded-contexts

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 31, 2026

The codebase lacked explicit documentation of its bounded contexts, making it hard for new contributors to understand domain boundaries, invariants, and how contexts interact.

What's added

CONTEXTS.md (new)

Full breakdown of each bounded context:

  • DeliveryDeliveryRequest lifecycle, status machine (DRAFT → SUBMITTED → APPROVED/REJECTED → DELIVERED), invariants (min qty 2, no duplicate SKUs, strict transitions), and enforcement points per rule
  • SalesReport — submission/void lifecycle, same structural invariants, AlreadyVoided guard, audit-trail requirement on void
  • PartnerInventory (Stock) — live partner_inventories records (transactionally updated on deliver/submit SR/void SR) vs. compute_partner_stock read-only projection; both documented with their role
  • Cross-cutting — Identity (PARTNER/ADMIN invariants), Audit (always in same tx as state change), Catalog (injected Iterable[str])
  • Dependency diagram (Mermaid + ASCII overview) and a dependency summary table
  • Observations: ReportRequired creates a direct cross-context DB query from Delivery into SalesReport; dual stock-checking paths (PartnerInventory vs. projection) are a maintenance surface worth watching

README.md / README.fr.md

Both now link to CONTEXTS.md from the Core Concepts section.

Copilot AI changed the title [WIP] Documenter les Bounded Contexts et leurs dépendances docs: add CONTEXTS.md — bounded contexts, invariants, rules, and dependencies Mar 31, 2026
Copilot AI requested a review from fleuronvilik March 31, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarifier et documenter les Bounded Contexts et leurs dépendances

2 participants