docs: add CONTEXTS.md — bounded contexts, invariants, rules, and dependencies#5
Draft
docs: add CONTEXTS.md — bounded contexts, invariants, rules, and dependencies#5
Conversation
…ntation Agent-Logs-Url: https://github.com/fleuronvilik/bookflow-core/sessions/5a5fbce4-9bd4-451d-9e0b-99bd0232b25c Co-authored-by: fleuronvilik <34385716+fleuronvilik@users.noreply.github.com>
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
DeliveryRequestlifecycle, status machine (DRAFT → SUBMITTED → APPROVED/REJECTED → DELIVERED), invariants (min qty 2, no duplicate SKUs, strict transitions), and enforcement points per ruleAlreadyVoidedguard, audit-trail requirement on voidpartner_inventoriesrecords (transactionally updated on deliver/submit SR/void SR) vs.compute_partner_stockread-only projection; both documented with their rolePARTNER/ADMINinvariants), Audit (always in same tx as state change), Catalog (injectedIterable[str])ReportRequiredcreates a direct cross-context DB query from Delivery into SalesReport; dual stock-checking paths (PartnerInventoryvs. projection) are a maintenance surface worth watchingREADME.md/README.fr.mdBoth now link to
CONTEXTS.mdfrom the Core Concepts section.