<mxfile host="Electron" version="29.6.6" type="device">
  <diagram id="case01-relationships" name="Why must settlement records be summarized separately?">
    <mxGraphModel grid="1" gridSize="10" page="0" pageWidth="1160" pageHeight="1000" background="#FFFFFF">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <object id="title" label="Why must settlement records be summarized separately?">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=28;fontStyle=1;" vertex="1" parent="1">
            <mxGeometry x="25" y="15" width="1110" height="70" as="geometry" />
          </mxCell>
        </object>
        <object id="subtitle" label="Summarize each many-side independently to the comparison grain before joining; keep other analytical grains separate.">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=18;fontStyle=0;" vertex="1" parent="1">
            <mxGeometry x="25" y="87" width="1110" height="55" as="geometry" />
          </mxCell>
        </object>
        <object id="n0" label="Applications&#10;&#10;CashReceiptApplication&#10;Many dated allocations per invoice">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;rounded=1;arcSize=6;fillColor=#f6f4ee;align=left;verticalAlign=top;spacing=18;" vertex="1" parent="1">
            <mxGeometry x="25" y="170" width="330" height="200" as="geometry" />
          </mxCell>
        </object>
        <object id="n1" label="Credits&#10;&#10;CreditMemo&#10;Use OriginalSalesInvoiceID and the cutoff">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;rounded=1;arcSize=6;fillColor=#f6f4ee;align=left;verticalAlign=top;spacing=18;" vertex="1" parent="1">
            <mxGeometry x="25" y="465" width="330" height="200" as="geometry" />
          </mxCell>
        </object>
        <object id="applications-summary" label="Application summary&#10;&#10;One row per SalesInvoiceID&#10;Sum only in-scope AppliedAmount">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;rounded=1;arcSize=6;fillColor=#f6f4ee;align=left;verticalAlign=top;spacing=18;" vertex="1" parent="1">
            <mxGeometry x="410" y="170" width="330" height="200" as="geometry" />
          </mxCell>
        </object>
        <object id="credits-summary" label="Credit summary&#10;&#10;One row per original invoice&#10;Sum only in-scope credit amounts">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;rounded=1;arcSize=6;fillColor=#f6f4ee;align=left;verticalAlign=top;spacing=18;" vertex="1" parent="1">
            <mxGeometry x="410" y="465" width="330" height="200" as="geometry" />
          </mxCell>
        </object>
        <object id="n2" label="Invoice population&#10;&#10;SalesInvoice&#10;One row per invoice&#10;Compare amounts after both summaries">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;rounded=1;arcSize=6;fillColor=#f6f4ee;align=left;verticalAlign=top;spacing=18;" vertex="1" parent="1">
            <mxGeometry x="795" y="310" width="330" height="200" as="geometry" />
          </mxCell>
        </object>
        <object id="e0" label="sum" relationKind="aggregate">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;edgeStyle=orthogonalEdgeStyle;rounded=0;fillColor=none;fontSize=17;labelBackgroundColor=#FFFFFF;startArrow=none;endArrow=block;endFill=1;dashed=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="n0" target="applications-summary">
            <mxGeometry relative="1" as="geometry" />
          </mxCell>
        </object>
        <object id="e1" label="sum" relationKind="aggregate">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;edgeStyle=orthogonalEdgeStyle;rounded=0;fillColor=none;fontSize=17;labelBackgroundColor=#FFFFFF;startArrow=none;endArrow=block;endFill=1;dashed=1;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="n1" target="credits-summary">
            <mxGeometry relative="1" as="geometry" />
          </mxCell>
        </object>
        <object id="e2" label="join" relationKind="reference">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;edgeStyle=orthogonalEdgeStyle;rounded=0;fillColor=none;fontSize=17;labelBackgroundColor=#FFFFFF;startArrow=none;endArrow=block;endFill=1;dashed=0;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="applications-summary" target="n2">
            <mxGeometry relative="1" as="geometry">
              <Array as="points">
                <mxPoint x="765" y="270" />
                <mxPoint x="765" y="390" />
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="e3" label="join" relationKind="reference">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;edgeStyle=orthogonalEdgeStyle;rounded=0;fillColor=none;fontSize=17;labelBackgroundColor=#FFFFFF;startArrow=none;endArrow=block;endFill=1;dashed=0;exitX=1;exitY=0.5;entryX=0;entryY=0.5;" edge="1" parent="1" source="credits-summary" target="n2">
            <mxGeometry relative="1" as="geometry">
              <Array as="points">
                <mxPoint x="765" y="565" />
                <mxPoint x="765" y="430" />
              </Array>
            </mxGeometry>
          </mxCell>
        </object>
        <object id="footer" label="Summarize each many-side independently before joining. Receipt amounts can repeat on application rows.&#10;The arrows describe an analytical workflow, not additional stored foreign keys or a payment sequence.">
          <mxCell style="html=0;fontFamily=Arial;fontSize=20;fontColor=#17333e;strokeColor=#196252;strokeWidth=1.5;whiteSpace=wrap;text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;fontSize=17;fontStyle=0;" vertex="1" parent="1">
            <mxGeometry x="25" y="732" width="1110" height="60" as="geometry" />
          </mxCell>
        </object>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
