same stuff?
This commit is contained in:
+15
-7
@@ -19,16 +19,15 @@ two-file version, the grouping is real.
|
||||
| `mutation_set_recovery_contact.go` (+ tests) | Recovery | — | `state.Recovery`, `state.UpdatedAt` |
|
||||
| `mutation_subscription_added.go` | Subscription | `state.Items` | `state.Subscriptions`, `state.UpdatedAt` |
|
||||
| `mutation_upsert_subscriptiondetails.go` | Subscription details | `state.Subscriptions` | `state.Subscriptions`, `state.UpdatedAt` |
|
||||
| `mutation_remove_line_item_marking.go` | Markings | `state.Items[idx].Markings` | `state.Items[idx].Markings`, `state.UpdatedAt` |
|
||||
| `mutation_line_item_marking.go` | Markings apply | `state.Items[idx].Markings` | `state.Items[idx].Markings`, `state.UpdatedAt` |
|
||||
| `mutation_markings.go` (`mutation_line_item_marking.go` and `mutation_remove_line_item_marking.go` merged) | Markings apply/remove | `state.Items[idx].Markings` | `state.Items[idx].Markings`, `state.UpdatedAt` |
|
||||
|
||||
## Delete-test quick check
|
||||
|
||||
For any proposed grouping (e.g. merge all `marking*` mutations into one
|
||||
file), ask: does deleting the merged file concentrate complexity, or just
|
||||
move lines? For markings — yes, the shared logic (cascade to pricing) makes
|
||||
the merge worthwhile. For `voucher` vs `custom_fields` — no, those read
|
||||
different state and have different error contracts; keep separate.
|
||||
For any proposed grouping, ask: does deleting the merged file concentrate
|
||||
complexity, or just move lines? For markings — yes, the shared logic
|
||||
(cascade to pricing) makes the merge worthwhile, and the merge is now done
|
||||
(see below). For `voucher` vs `custom_fields` — no, those read different
|
||||
state and have different error contracts; keep separate.
|
||||
|
||||
### What is already merged
|
||||
|
||||
@@ -60,6 +59,15 @@ If a future merge lands, follow the same pattern: read the actual source
|
||||
to verify the row's claimed state surface, and prune label-noise before
|
||||
compressing two rows into one.
|
||||
|
||||
`pkg/cart/mutation_markings.go` (added 2025-07) — LineItemMarking and
|
||||
RemoveLineItemMarking both touch `state.Items[idx].Markings` and share
|
||||
the same item-lookup loop (find by ID, mutate `Marking` field). Merge
|
||||
passed the delete-test: the shared write surface and identical error
|
||||
contract ("item with ID %d not found") make the grouping real. No test
|
||||
files existed for either mutation, so the test surface is unchanged.
|
||||
Verified: `go build ./pkg/cart/...` and `go test -count=1 ./pkg/cart/...`
|
||||
clean.
|
||||
|
||||
### NOT to merge next
|
||||
|
||||
`mutation_change_quantity.go` looks like an obvious candidate for the next
|
||||
|
||||
Reference in New Issue
Block a user