fix(fulfillment): don't cascade shipping option delete to shipping option type (#13280)

**What**
- don't cascade delete shipping option type when shipping option is deleted since types can be shared between options
- prevent shipping option type deletion if there are options associated with it
This commit is contained in:
Frane Polić
2025-08-25 08:00:41 +00:00
committed by GitHub
parent 6264a6262b
commit 57077406f9
6 changed files with 194 additions and 71 deletions
@@ -74,7 +74,7 @@ function expectSoftDeleted(
let shippingOption = serviceZone.shipping_options[0]
expect(!!shippingOption.deleted_at).toEqual(softDeleted)
expect(!!shippingOption.shipping_profile.deleted_at).toEqual(false)
expect(!!shippingOption.type.deleted_at).toEqual(softDeleted)
expect(!!shippingOption.type.deleted_at).toEqual(false) // do not cascade delete shipping option type since it is shared between shipping options
expect(shippingOption.fulfillments).toHaveLength(1)
expect(shippingOption.rules).toHaveLength(1)