e24ffa3bdf3d507a260edf843d318080eaf48e17
:sales-order/charges is a component attribute, so [:db/retractEntity order] cascades into the charges. Where two clients were configured on one Square location, both clients' orders resolved to the SAME charge entity, because charge keys carried no client scoping and :charge/external-id is :db.unique/identity. Retracting a voided order therefore deletes a charge the other client's order still references, leaving that order with sales and no tender: the day goes out of balance and the payment disappears from the current database value. Measured on the restore: 35,870 of 56,829 charges (63%) in the contended clients' recent window have more than one parent order. Phase 0 stops new sharing and the re-key makes it structurally impossible going forward, but neither splits the charges that are already shared, so the hazard outlives both. Records the options, including guarding the retraction so it detaches shared charges rather than deleting them. Pre-existing risk, not introduced here. The validation run skipped this step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Description
No description provided
Languages
Clojure
91%
CSS
4.2%
Sass
2.3%
HTML
1.2%
HCL
0.4%
Other
0.7%