feat(medusa, core-flows, types): Allow to update the rules from a shipping options (#7175)

**What**
Add support for the following operations
- update rules from the update shipping options end point
- update rules from the batch update end point

Also added some improvements, that can be revisited later
- Add a rule value normalizer, jsonb will transform the input value to a [primitive](https://www.postgresql.org/docs/current/datatype-json.html#JSON-TYPE-MAPPING-TABLE) when possible meaning that passing `"true"` will result in storing `true` and not the string. The normalizer takes care of that
This commit is contained in:
Adrien de Peretti
2024-04-30 16:45:17 +00:00
committed by GitHub
parent 3affcc2525
commit e26cda4b6a
11 changed files with 470 additions and 41 deletions
+8 -1
View File
@@ -1,4 +1,7 @@
import { CreateShippingOptionRuleDTO } from "./mutations"
import {
CreateShippingOptionRuleDTO,
UpdateShippingOptionRuleDTO,
} from "./mutations"
export type AddFulfillmentShippingOptionRulesWorkflowDTO = {
data: CreateShippingOptionRuleDTO[]
@@ -7,3 +10,7 @@ export type AddFulfillmentShippingOptionRulesWorkflowDTO = {
export type RemoveFulfillmentShippingOptionRulesWorkflowDTO = {
ids: string[]
}
export type UpdateFulfillmentShippingOptionRulesWorkflowDTO = {
data: UpdateShippingOptionRuleDTO[]
}