Baseline of the P1 conception work produced over sessions 5-7 (was uncommitted in the working tree). 11-entity model, French naming. Superseded next by the prod-like revision (English, ~16 entities) per the 2026-06-04 decision session - this commit preserves the baseline in history before that rewrite.
78 lines
8.1 KiB
Text
78 lines
8.1 KiB
Text
<mxfile host="app.diagrams.net" agent="claude-code-byan" type="device">
|
|
<diagram name="MLD - Commande" id="mld-commande">
|
|
<mxGraphModel dx="1400" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1654" pageHeight="1169" math="0" shadow="0">
|
|
<root>
|
|
<mxCell id="0" />
|
|
<mxCell id="1" parent="0" />
|
|
|
|
<mxCell id="t_commande" value="<b>commande</b><hr><u>PK id : INT UNSIGNED AUTO_INCREMENT</u><br>UK numero : VARCHAR(20)<br>source : ENUM(kiosk,comptoir,drive)<br>mode_consommation : ENUM(sur_place,a_emporter,drive)<br>statut : ENUM DEFAULT pending_payment<br>total_ht_cents : INT UNSIGNED<br>total_tva_cents : INT UNSIGNED<br>total_ttc_cents : INT UNSIGNED<br>tva_taux_pourmille : SMALLINT UNSIGNED<br>paye_a : DATETIME NULL<br>created_at : DATETIME<br>updated_at : DATETIME<hr>CHECK (source != drive OR mode = drive)<br>CHECK (ttc = ht + tva)" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;align=left;verticalAlign=top;fontSize=11;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
|
|
<mxGeometry x="500" y="40" width="380" height="290" as="geometry" />
|
|
</mxCell>
|
|
|
|
<mxCell id="t_ligne_commande" value="<b>ligne_commande</b><hr><u>PK id : INT UNSIGNED AUTO_INCREMENT</u><br>FK commande_id : INT UNSIGNED<br>type_item : ENUM(produit,menu)<br>FK produit_id : INT UNSIGNED NULL<br>FK menu_id : INT UNSIGNED NULL<br>libelle_snapshot : VARCHAR(120)<br>prix_unitaire_ttc_cents_snapshot : INT UNSIGNED<br>quantite : SMALLINT UNSIGNED DEFAULT 1<br>created_at : DATETIME<hr>CHECK polymorphisme exclusif" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;align=left;verticalAlign=top;fontSize=11;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
|
|
<mxGeometry x="40" y="400" width="380" height="220" as="geometry" />
|
|
</mxCell>
|
|
|
|
<mxCell id="t_commande_event" value="<b>commande_event</b> (append-only)<hr><u>PK id : INT UNSIGNED AUTO_INCREMENT</u><br>FK commande_id : INT UNSIGNED<br>event_type : ENUM(CREATED,PAID,...)<br>from_statut : ENUM NULL<br>to_statut : ENUM<br>FK user_id : INT UNSIGNED NULL<br>payload : JSON NULL<br>created_at : DATETIME" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;align=left;verticalAlign=top;fontSize=11;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
|
|
<mxGeometry x="960" y="400" width="380" height="200" as="geometry" />
|
|
</mxCell>
|
|
|
|
<mxCell id="t_produit_stub" value="<b>produit</b> <i>(cf. Catalogue)</i><hr><u>PK id</u><br>..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;verticalAlign=top;fontSize=11;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
|
|
<mxGeometry x="40" y="680" width="200" height="80" as="geometry" />
|
|
</mxCell>
|
|
|
|
<mxCell id="t_menu_stub" value="<b>menu</b> <i>(cf. Catalogue)</i><hr><u>PK id</u><br>..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;verticalAlign=top;fontSize=11;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
|
|
<mxGeometry x="280" y="680" width="200" height="80" as="geometry" />
|
|
</mxCell>
|
|
|
|
<mxCell id="t_user_stub" value="<b>user</b> <i>(cf. RBAC)</i><hr><u>PK id</u><br>..." style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;align=left;verticalAlign=top;fontSize=11;spacingLeft=8;spacingTop=4" vertex="1" parent="1">
|
|
<mxGeometry x="1140" y="680" width="200" height="80" as="geometry" />
|
|
</mxCell>
|
|
|
|
<mxCell id="fk_lc_cmd" style="endArrow=open;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t_ligne_commande" target="t_commande">
|
|
<mxGeometry relative="1" as="geometry" />
|
|
</mxCell>
|
|
<mxCell id="fk_lc_cmd_lbl" value="FK ON DELETE CASCADE" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=10;fillColor=#ffffff;strokeColor=none" vertex="1" connectable="0" parent="fk_lc_cmd">
|
|
<mxGeometry relative="1" as="geometry"><mxPoint as="offset" /></mxGeometry>
|
|
</mxCell>
|
|
|
|
<mxCell id="fk_lc_prod" style="endArrow=open;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;dashed=1" edge="1" parent="1" source="t_ligne_commande" target="t_produit_stub">
|
|
<mxGeometry relative="1" as="geometry" />
|
|
</mxCell>
|
|
<mxCell id="fk_lc_prod_lbl" value="FK NULL ON DELETE RESTRICT" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=10;fillColor=#ffffff;strokeColor=none" vertex="1" connectable="0" parent="fk_lc_prod">
|
|
<mxGeometry relative="1" as="geometry"><mxPoint as="offset" /></mxGeometry>
|
|
</mxCell>
|
|
|
|
<mxCell id="fk_lc_menu" style="endArrow=open;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;dashed=1" edge="1" parent="1" source="t_ligne_commande" target="t_menu_stub">
|
|
<mxGeometry relative="1" as="geometry" />
|
|
</mxCell>
|
|
<mxCell id="fk_lc_menu_lbl" value="FK NULL ON DELETE RESTRICT" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=10;fillColor=#ffffff;strokeColor=none" vertex="1" connectable="0" parent="fk_lc_menu">
|
|
<mxGeometry relative="1" as="geometry"><mxPoint as="offset" /></mxGeometry>
|
|
</mxCell>
|
|
|
|
<mxCell id="fk_evt_cmd" style="endArrow=open;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle" edge="1" parent="1" source="t_commande_event" target="t_commande">
|
|
<mxGeometry relative="1" as="geometry" />
|
|
</mxCell>
|
|
<mxCell id="fk_evt_cmd_lbl" value="FK ON DELETE CASCADE" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=10;fillColor=#ffffff;strokeColor=none" vertex="1" connectable="0" parent="fk_evt_cmd">
|
|
<mxGeometry relative="1" as="geometry"><mxPoint as="offset" /></mxGeometry>
|
|
</mxCell>
|
|
|
|
<mxCell id="fk_evt_user" style="endArrow=open;html=1;rounded=0;edgeStyle=orthogonalEdgeStyle;dashed=1" edge="1" parent="1" source="t_commande_event" target="t_user_stub">
|
|
<mxGeometry relative="1" as="geometry" />
|
|
</mxCell>
|
|
<mxCell id="fk_evt_user_lbl" value="FK NULL ON DELETE SET NULL" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=10;fillColor=#ffffff;strokeColor=none" vertex="1" connectable="0" parent="fk_evt_user">
|
|
<mxGeometry relative="1" as="geometry"><mxPoint as="offset" /></mxGeometry>
|
|
</mxCell>
|
|
|
|
<mxCell id="note_audit" value="<b>Journal d'audit (event sourcing)</b><br>Append-only : aucun UPDATE / DELETE applicatif.<br>3 IDX : (commande_id, created_at), (user_id, created_at), (event_type, created_at).<br>Pattern d'ecriture : transaction qui modifie commande.statut insere aussi une ligne d'event." style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;align=left;verticalAlign=top;fontSize=10;spacingLeft=8;spacingTop=4;dashed=1" vertex="1" parent="1">
|
|
<mxGeometry x="960" y="620" width="380" height="80" as="geometry" />
|
|
</mxCell>
|
|
|
|
<mxCell id="legende" value="<b>Legende</b><br><u>PK</u> : cle primaire<br>FK : cle etrangere (fleche -> table referencee)<br>UK : contrainte unique<br>Bleu = table principale<br>Vert = journal d'audit<br>Violet = stub d'un autre sous-domaine<br>Pointille = FK nullable" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;align=left;verticalAlign=top;fontSize=10;spacingLeft=8;spacingTop=4;dashed=1" vertex="1" parent="1">
|
|
<mxGeometry x="40" y="40" width="280" height="150" as="geometry" />
|
|
</mxCell>
|
|
|
|
</root>
|
|
</mxGraphModel>
|
|
</diagram>
|
|
</mxfile>
|