<mxfile host="thecodeclouds.com" agent="hand-built" version="24.0.0" type="device">
<diagram id="ecom-checkout" name="Checkout: placing one order safely"><mxGraphModel dx="1400" dy="900" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1500" pageHeight="930" math="0" shadow="0"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="c1" value="Placing one order: the checkout saga, step by step" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=18;fontColor=#232F3E;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="20" y="14" width="1100" height="24" as="geometry"/></mxCell>
<mxCell id="c2" value="Every step can be retried. The idempotency key and the order id are what make retries safe." style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=12;fontColor=#5F6368;fontStyle=0;spacing=0;" vertex="1" parent="1"><mxGeometry x="20" y="40" width="1200" height="18" as="geometry"/></mxCell>
<mxCell id="c3" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#5F6368;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="40" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c4" value="Shopper app" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#5F6368;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="40" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c5" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="115" y="116" as="sourcePoint"/><mxPoint x="115" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c6" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#E37400;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="220" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c7" value="API gateway" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#E37400;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="220" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c8" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="295" y="116" as="sourcePoint"/><mxPoint x="295" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c9" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#1A73E8;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="400" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c10" value="Checkout" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#1A73E8;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="400" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c11" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="475" y="116" as="sourcePoint"/><mxPoint x="475" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c12" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#1E8E3E;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="580" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c13" value="Inventory" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#1E8E3E;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="580" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c14" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="655" y="116" as="sourcePoint"/><mxPoint x="655" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c15" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#1E8E3E;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="760" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c16" value="Orders DB" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#1E8E3E;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="760" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c17" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="835" y="116" as="sourcePoint"/><mxPoint x="835" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c18" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#1A73E8;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="940" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c19" value="Payments" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#1A73E8;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="940" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c20" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1015" y="116" as="sourcePoint"/><mxPoint x="1015" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c21" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#5F6368;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="1120" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c22" value="PSP" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#5F6368;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="1120" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c23" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1195" y="116" as="sourcePoint"/><mxPoint x="1195" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c24" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#8430CE;fillColor=#FFFFFF;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="1300" y="76" width="150" height="40" as="geometry"/></mxCell>
<mxCell id="c25" value="Event bus" style="text;html=1;whiteSpace=wrap;align=center;verticalAlign=top;fontSize=13;fontColor=#8430CE;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="1300" y="88" width="150" height="19" as="geometry"/></mxCell>
<mxCell id="c26" style="edgeStyle=none;html=1;rounded=0;strokeColor=#BDC1C6;strokeWidth=1;dashed=1;startArrow=none;startFill=1;endArrow=none;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1375" y="116" as="sourcePoint"/><mxPoint x="1375" y="740" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c27" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1A73E8;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="115" y="140" as="sourcePoint"/><mxPoint x="295" y="140" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c28" value="1" style="ellipse;html=1;fillColor=#1A73E8;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="121" y="114" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c29" value="POST /orders  Idempotency-Key: 7f3a-91c2" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="149" y="118" width="440" height="17" as="geometry"/></mxCell>
<mxCell id="c30" style="edgeStyle=none;html=1;rounded=0;strokeColor=#E37400;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="295" y="140" as="sourcePoint"/><mxPoint x="475" y="140" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c31" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1A73E8;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="475" y="186" as="sourcePoint"/><mxPoint x="479" y="204" as="targetPoint"/><Array as="points"><mxPoint x="525" y="186"/><mxPoint x="525" y="204"/></Array></mxGeometry></mxCell>
<mxCell id="c32" value="2" style="ellipse;html=1;fillColor=#1A73E8;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="441" y="182" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c33" value="key seen before? return the saved response" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="533" y="188" width="360" height="17" as="geometry"/></mxCell>
<mxCell id="c34" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1E8E3E;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="475" y="246" as="sourcePoint"/><mxPoint x="655" y="246" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c35" value="3" style="ellipse;html=1;fillColor=#1E8E3E;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="481" y="220" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c36" value="reserve 1 x SKU-4417, hold 10 min" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="509" y="224" width="440" height="17" as="geometry"/></mxCell>
<mxCell id="c37" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1E8E3E;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="655" y="292" as="sourcePoint"/><mxPoint x="475" y="292" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c38" value="4" style="ellipse;html=1;fillColor=#1E8E3E;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="481" y="266" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c39" value="reservation r-5521 (available 499 → 498)" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="509" y="270" width="440" height="17" as="geometry"/></mxCell>
<mxCell id="c40" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1E8E3E;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="475" y="338" as="sourcePoint"/><mxPoint x="835" y="338" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c41" value="5" style="ellipse;html=1;fillColor=#1E8E3E;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="481" y="312" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c42" value="insert order o-88213  status=PENDING_PAYMENT" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="509" y="316" width="620" height="17" as="geometry"/></mxCell>
<mxCell id="c43" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1A73E8;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="475" y="384" as="sourcePoint"/><mxPoint x="1015" y="384" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c44" value="6" style="ellipse;html=1;fillColor=#1A73E8;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="481" y="358" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c45" value="authorize 649.00 EUR, key = o-88213" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="509" y="362" width="800" height="17" as="geometry"/></mxCell>
<mxCell id="c46" style="edgeStyle=none;html=1;rounded=0;strokeColor=#5F6368;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1015" y="430" as="sourcePoint"/><mxPoint x="1195" y="430" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c47" value="7" style="ellipse;html=1;fillColor=#5F6368;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="1021" y="404" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c48" value="auth request, timeout 3 s, 1 retry same key" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="1049" y="408" width="440" height="17" as="geometry"/></mxCell>
<mxCell id="c49" style="edgeStyle=none;html=1;rounded=0;strokeColor=#5F6368;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1195" y="476" as="sourcePoint"/><mxPoint x="1015" y="476" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c50" value="8" style="ellipse;html=1;fillColor=#5F6368;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="1021" y="450" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c51" value="authorized  auth=A-77Q (420 ms)" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="1049" y="454" width="440" height="17" as="geometry"/></mxCell>
<mxCell id="c52" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1A73E8;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1015" y="522" as="sourcePoint"/><mxPoint x="475" y="522" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c53" value="9" style="ellipse;html=1;fillColor=#1A73E8;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="481" y="496" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c54" value="payment p-3301 AUTHORIZED" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="509" y="500" width="800" height="17" as="geometry"/></mxCell>
<mxCell id="c55" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1E8E3E;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="475" y="568" as="sourcePoint"/><mxPoint x="835" y="568" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c56" value="10" style="ellipse;html=1;fillColor=#1E8E3E;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="481" y="542" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c57" value="one transaction: status=CONFIRMED + outbox row" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="509" y="546" width="620" height="17" as="geometry"/></mxCell>
<mxCell id="c58" style="edgeStyle=none;html=1;rounded=0;strokeColor=#8430CE;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="835" y="614" as="sourcePoint"/><mxPoint x="1375" y="614" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c59" value="11" style="ellipse;html=1;fillColor=#8430CE;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="841" y="588" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c60" value="outbox relay publishes order.placed" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="869" y="592" width="800" height="17" as="geometry"/></mxCell>
<mxCell id="c61" style="edgeStyle=none;html=1;rounded=0;strokeColor=#1A73E8;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="475" y="660" as="sourcePoint"/><mxPoint x="115" y="660" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c62" value="12" style="ellipse;html=1;fillColor=#1A73E8;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="121" y="634" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c63" value="201 Created  order o-88213  (p95 1.1 s end to end)" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="149" y="638" width="620" height="17" as="geometry"/></mxCell>
<mxCell id="c64" style="edgeStyle=none;html=1;rounded=0;strokeColor=#8430CE;strokeWidth=2;dashed=0;startArrow=none;startFill=1;endArrow=block;endFill=1;endSize=4;startSize=4;" edge="1" parent="1"><mxGeometry relative="1" as="geometry"><mxPoint x="1375" y="706" as="sourcePoint"/><mxPoint x="655" y="706" as="targetPoint"/></mxGeometry></mxCell>
<mxCell id="c65" value="13" style="ellipse;html=1;fillColor=#8430CE;strokeColor=none;fontColor=#FFFFFF;fontStyle=1;fontSize=12;aspect=fixed;" vertex="1" parent="1"><mxGeometry x="661" y="680" width="22" height="22" as="geometry"/></mxCell>
<mxCell id="c66" value="order.placed: reservation r-5521 → sold" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=11;fontColor=#202124;fontStyle=0;spacing=0;labelBackgroundColor=#FFFFFF;" vertex="1" parent="1"><mxGeometry x="689" y="684" width="980" height="17" as="geometry"/></mxCell>
<mxCell id="c67" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#D93025;fillColor=#FDF3F2;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="40" y="760" width="690" height="150" as="geometry"/></mxCell>
<mxCell id="c68" value="If something fails half way" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;fontColor=#D93025;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="56" y="770" width="660" height="19" as="geometry"/></mxCell>
<mxCell id="c69" value="Step 3 fails (out of stock): return 409, nothing to undo.&lt;br&gt;Step 8 declined: release reservation r-5521, order → PAYMENT_FAILED.&lt;br&gt;Step 8 times out: order → PAYMENT_UNKNOWN, do NOT charge again.&lt;br&gt;   Reconciler asks the PSP by key o-88213 after 60 s and settles it.&lt;br&gt;Shopper never gets step 12: the app retries with the same key,&lt;br&gt;   step 2 returns the first response. One order, one charge." style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=12;fontColor=#3C4043;fontStyle=0;spacing=0;" vertex="1" parent="1"><mxGeometry x="56" y="798" width="670" height="98" as="geometry"/></mxCell>
<mxCell id="c70" value="&lt;b&gt;&lt;/b&gt;" style="rounded=1;arcSize=8;html=1;whiteSpace=wrap;strokeColor=#1E8E3E;fillColor=#F0F9F2;dashed=0;fontSize=12;fontStyle=0;fontColor=#3C4043;align=left;verticalAlign=top;spacingLeft=8;" vertex="1" parent="1"><mxGeometry x="750" y="760" width="710" height="150" as="geometry"/></mxCell>
<mxCell id="c71" value="Why it holds" style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=13;fontColor=#1E8E3E;fontStyle=1;spacing=0;" vertex="1" parent="1"><mxGeometry x="766" y="770" width="680" height="19" as="geometry"/></mxCell>
<mxCell id="c72" value="Reservations expire on their own, so a crashed checkout never locks stock.&lt;br&gt;Payment is authorized, not captured. Capture happens at shipping.&lt;br&gt;The outbox row commits with the order, so no event is ever lost&lt;br&gt;   and no event is published for an order that rolled back.&lt;br&gt;Everything after step 11 is asynchronous: email, fraud review,&lt;br&gt;   warehouse pick, search update. Checkout does not wait for them." style="text;html=1;whiteSpace=wrap;align=left;verticalAlign=top;fontSize=12;fontColor=#3C4043;fontStyle=0;spacing=0;" vertex="1" parent="1"><mxGeometry x="766" y="798" width="690" height="98" as="geometry"/></mxCell></root></mxGraphModel></diagram>
</mxfile>
