Skip to content

[Domain] Renaming a SKU seeds a fresh zero-stock row and strands the old one #154

Description

@vedanshujain

Renaming a product's SKU seeds a fresh zero-stock inventory row for the new SKU and leaves the
old row orphaned, still holding the stock. The merchant's on-hand count silently drops to zero and
the old row is unreachable from the admin UI.

This is pre-existingupsertProductCommerce has always behaved this way, and the
create-if-absent seedOnHand is doing exactly what it says. PR 1a does not introduce it, but it
does make it marginally more reachable: the admin console becomes the only SKU writer, and the
edit path now seeds too.

Not fixed in 1a on purpose: a correct fix is a rename operation on the inventory row (or a
policy decision that SKUs are immutable once stocked), which is its own change with its own
contract cases, not a rider on the seeding invariant.

Source: plans/one-home-per-field.md §3.5, §9.7.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions