Removes the kit value/visibility copy based on prod data validation#5635
Conversation
I looked at the before/after migrating with a prod snapshot and found that the value and visible_to_partners parts didn't do what we want; if we keep them then there will be visible changes, but if we remove them then everything looks the same before and after for users Without the copying and with a safety check this also becomes reversable
Before/after evidence from a production snapshot 🤖(removed the screenshots since it wasn't test data) (Claude-assisted analysis: screenshots and data checks produced with Claude Code, reviewed by me. Screenshots are from a local restore of a prod backup with PII redacted. Screenshots incoming in an edit.) Method: restored the latest prod backup locally, snapshotted every user-visible surface, then ran each migration variant and compared. The kit→item copy of Why the copy is the wrong direction: the kits-table Example 1 — past distribution values silently changeSame distribution page, before and after the copy. Every kit line reverts to its creation-time value ($6.10→$4.45, $11.25→$9.55); the total drops $347.00 → $280.00. The bank had set these values via the Items page; the copy rolls them back retroactively on an already-issued distribution. Example 2 — a kit's value is wiped to $0This kit's value was only ever set on the item ($11.25); its kits-table value is 0. The copy zeroes it — the value cells go blank and the distribution total drops $547.30 → $446.30. 57 kits on prod are in this situation. Example 3 — a deliberately hidden kit becomes partner-requestablePartner portal, New Request form (item list expanded). The bank hid "Period - Tampon Kit" from partners via the Items page; the kits-table flag still holds the creation-time default Prod-data breakdown of what the copy would have changed
Also validated on the repoint-only version: all 2,734 kit events repoint correctly (the new assertion passes), inventory replay validates for every org, and report service outputs are byte-identical before/after. |
I looked at the before/after migrating with a prod snapshot and found that the value and visible_to_partners parts didn't do what we want; if we keep them then there will be visible changes, but if we remove them then everything looks the same before and after for users. Also I added a safety check and a reverse (which might work without the copies).
With this on top of the existing branch we should be good to merge+deploy, but I wanted to break it out for review. I suppose the file is misnamed now, meh.