feat(workflows): update product workflow (#4982)
**What** - added "update product" workflow Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com>
This commit is contained in:
co-authored by
Riqwan Thamir
parent
3aba6269ed
commit
aba9ded2a3
@@ -127,6 +127,11 @@ export interface IInventoryService {
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
restoreInventoryItem(
|
||||
inventoryItemId: string | string[],
|
||||
context?: SharedContext
|
||||
): Promise<void>
|
||||
|
||||
deleteInventoryItemLevelByLocationId(
|
||||
locationId: string | string[],
|
||||
context?: SharedContext
|
||||
|
||||
@@ -2433,4 +2433,10 @@ export interface IProductModuleService {
|
||||
config?: RestoreReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
|
||||
restoreVariants<TReturnableLinkableKeys extends string = string>(
|
||||
variantIds: string[],
|
||||
config?: RestoreReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export interface CreateProductSalesChannelInputDTO {
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface CraeteProductProductCategoryInputDTO {
|
||||
export interface CreateProductProductCategoryInputDTO {
|
||||
id: string
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface CreateProductVariantPricesInputDTO {
|
||||
max_quantity?: number
|
||||
}
|
||||
|
||||
export interface CraeteProductVariantOptionInputDTO {
|
||||
export interface CreteProductVariantOptionInputDTO {
|
||||
value: string
|
||||
option_id: string
|
||||
}
|
||||
@@ -57,7 +57,7 @@ export interface CreateProductVariantInputDTO {
|
||||
metadata?: Record<string, unknown>
|
||||
|
||||
prices?: CreateProductVariantPricesInputDTO[]
|
||||
options?: CraeteProductVariantOptionInputDTO[]
|
||||
options?: CreteProductVariantOptionInputDTO[]
|
||||
}
|
||||
|
||||
export interface CreateProductInputDTO {
|
||||
@@ -73,7 +73,7 @@ export interface CreateProductInputDTO {
|
||||
type?: CreateProductTypeInputDTO
|
||||
collection_id?: string
|
||||
tags?: CreateProductTagInputDTO[]
|
||||
categories?: CraeteProductProductCategoryInputDTO[]
|
||||
categories?: CreateProductProductCategoryInputDTO[]
|
||||
options?: CreateProductOptionInputDTO[]
|
||||
variants?: CreateProductVariantInputDTO[]
|
||||
weight?: number
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
export * from "./create-products"
|
||||
export * from "./update-products"
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
import { ProductStatus } from "../../product"
|
||||
|
||||
export interface UpdateProductTypeInputDTO {
|
||||
id?: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface UpdateProductTagInputDTO {
|
||||
id?: string
|
||||
value: string
|
||||
}
|
||||
|
||||
export interface UpdateProductSalesChannelInputDTO {
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface UpdateProductProductCategoryInputDTO {
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface UpdateProductVariantPricesInputDTO {
|
||||
id?: string
|
||||
region_id?: string
|
||||
currency_code?: string
|
||||
amount: number
|
||||
min_quantity?: number
|
||||
max_quantity?: number
|
||||
}
|
||||
|
||||
export interface UpdateProductVariantOptionInputDTO {
|
||||
value: string
|
||||
option_id: string
|
||||
}
|
||||
|
||||
export interface UpdateProductVariantInputDTO {
|
||||
id?: string
|
||||
title?: string
|
||||
sku?: string
|
||||
ean?: string
|
||||
upc?: string
|
||||
barcode?: string
|
||||
hs_code?: string
|
||||
inventory_quantity?: number
|
||||
allow_backorder?: boolean
|
||||
manage_inventory?: boolean
|
||||
weight?: number
|
||||
length?: number
|
||||
height?: number
|
||||
width?: number
|
||||
origin_country?: string
|
||||
mid_code?: string
|
||||
material?: string
|
||||
metadata?: Record<string, unknown>
|
||||
|
||||
prices?: UpdateProductVariantPricesInputDTO[]
|
||||
options?: UpdateProductVariantOptionInputDTO[]
|
||||
}
|
||||
|
||||
export interface UpdateProductInputDTO {
|
||||
id: string
|
||||
title?: string
|
||||
subtitle?: string
|
||||
description?: string
|
||||
discountable?: boolean
|
||||
images?: string[]
|
||||
thumbnail?: string
|
||||
handle?: string
|
||||
status?: ProductStatus
|
||||
type?: UpdateProductTypeInputDTO
|
||||
collection_id?: string
|
||||
tags?: UpdateProductTagInputDTO[]
|
||||
sales_channels?: UpdateProductSalesChannelInputDTO[]
|
||||
categories?: UpdateProductProductCategoryInputDTO[]
|
||||
variants?: UpdateProductVariantInputDTO[]
|
||||
weight?: number
|
||||
length?: number
|
||||
width?: number
|
||||
height?: number
|
||||
hs_code?: string
|
||||
origin_country?: string
|
||||
mid_code?: string
|
||||
material?: string
|
||||
metadata?: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface UpdateProductsWorkflowInputDTO {
|
||||
products: UpdateProductInputDTO[]
|
||||
}
|
||||
Reference in New Issue
Block a user