feat(pricing): pricing models are made soft deletable (#6732)
what: - pricing models are made soft deletable - adds missing timestamp attributes - removes unwanted relationships + cascade cleanup
This commit is contained in:
@@ -10,8 +10,7 @@ export const deletePriceListsStep = createStep(
|
||||
ModuleRegistrationName.PRICING
|
||||
)
|
||||
|
||||
// TODO: Implement soft delete price lists
|
||||
await pricingModule.deletePriceLists(ids)
|
||||
await pricingModule.softDeletePriceLists(ids)
|
||||
|
||||
return new StepResponse(void 0, ids)
|
||||
},
|
||||
@@ -24,7 +23,6 @@ export const deletePriceListsStep = createStep(
|
||||
ModuleRegistrationName.PRICING
|
||||
)
|
||||
|
||||
// TODO: Implement restore price lists
|
||||
// await pricingModule.restorePriceLists(idsToRestore)
|
||||
await pricingModule.restorePriceLists(idsToRestore)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -19,7 +19,9 @@ export const removePriceListPricesStep = createStep(
|
||||
{ relations: ["price_list"] }
|
||||
)
|
||||
|
||||
await pricingModule.removePrices(psmas.map((psma) => psma.id))
|
||||
await pricingModule.softDeletePriceSetMoneyAmounts(
|
||||
psmas.map((psma) => psma.id)
|
||||
)
|
||||
|
||||
return new StepResponse(
|
||||
null,
|
||||
@@ -27,7 +29,7 @@ export const removePriceListPricesStep = createStep(
|
||||
)
|
||||
},
|
||||
async (ids, { container }) => {
|
||||
if (!ids) {
|
||||
if (!ids?.length) {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -35,7 +37,6 @@ export const removePriceListPricesStep = createStep(
|
||||
ModuleRegistrationName.PRICING
|
||||
)
|
||||
|
||||
// TODO: This needs to be implemented
|
||||
// pricingModule.restorePrices(ids)
|
||||
await pricingModule.restorePriceSetMoneyAmounts(ids)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user