feat(core-flows,medusa,types): create/update workflows to create and update PriceList prices (#6711)

what:

- create and update workflows for price list prices
- update price list endpoint does a "set"
This commit is contained in:
Riqwan Thamir authored and GitHub committed 2024-03-18 14:14:28 +00:00
1 parent 84b8836cbf
commit 0c705d7bd4
28 files changed
+509 -206

No files matched your search

+36 -1
View File
@@ -37,5 +37,40 @@ export interface UpdatePriceListWorkflowInputDTO {
ends_at?: string | null
status?: PriceListStatus
rules?: Record<string, string[]>
prices?: (UpdatePriceListPriceWorkflowDTO | CreatePriceListPriceWorkflowDTO)[]
prices?: CreatePriceListPriceWorkflowDTO[]
}
export interface UpdatePriceListPricesWorkflowDTO {
id: string
prices: UpdatePriceListPriceWorkflowDTO[]
}
export interface CreatePriceListPricesWorkflowDTO {
id: string
prices: CreatePriceListPriceWorkflowDTO[]
}
export interface UpdatePriceListPriceWorkflowDTO {
data: Pick<UpdatePriceListWorkflowInputDTO, "id" | "prices">[]
variant_price_map: Record<string, string>
}
export interface UpdatePriceListPriceWorkflowStepDTO {
data?: UpdatePriceListPricesWorkflowDTO[]
variant_price_map: Record<string, string>
}
export interface UpsertPriceListPricesWorkflowStepDTO {
data: Pick<UpdatePriceListWorkflowInputDTO, "id" | "prices">[]
variant_price_map: Record<string, string>
}
export interface CreatePriceListsWorkflowStepDTO {
data: CreatePriceListWorkflowInputDTO[]
variant_price_map: Record<string, string>
}
export interface CreatePriceListPricesWorkflowStepDTO {
data: (Pick<CreatePriceListWorkflowInputDTO, "prices"> & { id: string })[]
variant_price_map: Record<string, string>
}
@@ -1,3 +1,2 @@
export * from "./create-price-list"
export * from "./update-price-list"
export * from "./remove-price-list"
@@ -1,25 +0,0 @@
import { CreatePriceListRules, PriceListStatus } from "../../pricing"
import { UpdateProductVariantPricesInputDTO } from "../product"
export type PriceListVariantPriceDTO = UpdateProductVariantPricesInputDTO & {
variant_id?: string
price_set_id?: string
}
export interface UpdatePriceListWorkflowDTO {
id: string
name?: string
starts_at?: Date
ends_at?: Date
status?: PriceListStatus
rules?: CreatePriceListRules
prices?: PriceListVariantPriceDTO[]
customer_groups?: {
id: string
}[]
}
export interface UpdatePriceListWorkflowInputDTO {
price_lists: UpdatePriceListWorkflowDTO[]
}