feat: sales channel module (#5923)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { BaseFilterable } from "../dal"
|
||||
|
||||
export interface SalesChannelLocationDTO {
|
||||
sales_channel_id: string
|
||||
location_id: string
|
||||
@@ -6,8 +8,16 @@ export interface SalesChannelLocationDTO {
|
||||
|
||||
export interface SalesChannelDTO {
|
||||
id: string
|
||||
name: string
|
||||
description: string | null
|
||||
is_disabled: boolean
|
||||
metadata: Record<string, unknown> | null
|
||||
locations?: SalesChannelLocationDTO[]
|
||||
}
|
||||
|
||||
export interface FilterableSalesChannelProps
|
||||
extends BaseFilterable<FilterableSalesChannelProps> {
|
||||
id?: string[]
|
||||
name?: string[]
|
||||
is_disabled?: boolean
|
||||
}
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export * from "./common"
|
||||
export * from "./mutations"
|
||||
export * from "./service"
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
export interface CreateSalesChannelDTO {
|
||||
name: string
|
||||
description?: string
|
||||
is_disabled?: boolean
|
||||
}
|
||||
|
||||
export interface UpdateSalesChannelDTO {
|
||||
id: string
|
||||
name?: string
|
||||
description?: string
|
||||
is_disabled?: boolean
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { IModuleService } from "../modules-sdk"
|
||||
import { FilterableSalesChannelProps, SalesChannelDTO } from "./common"
|
||||
import { FindConfig } from "../common"
|
||||
import { Context } from "../shared-context"
|
||||
import { RestoreReturn, SoftDeleteReturn } from "../dal"
|
||||
import { CreateSalesChannelDTO, UpdateSalesChannelDTO } from "./mutations"
|
||||
|
||||
export interface ISalesChannelModuleService extends IModuleService {
|
||||
create(
|
||||
data: CreateSalesChannelDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO[]>
|
||||
create(
|
||||
data: CreateSalesChannelDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO>
|
||||
|
||||
update(
|
||||
data: UpdateSalesChannelDTO[],
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO[]>
|
||||
update(
|
||||
data: UpdateSalesChannelDTO,
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO>
|
||||
|
||||
delete(ids: string[], sharedContext?: Context): Promise<void>
|
||||
delete(id: string, sharedContext?: Context): Promise<void>
|
||||
|
||||
retrieve(
|
||||
id: string,
|
||||
config?: FindConfig<SalesChannelDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO>
|
||||
|
||||
list(
|
||||
filters?: FilterableSalesChannelProps,
|
||||
config?: FindConfig<SalesChannelDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<SalesChannelDTO[]>
|
||||
|
||||
listAndCount(
|
||||
filters?: FilterableSalesChannelProps,
|
||||
config?: FindConfig<SalesChannelDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<[SalesChannelDTO[], number]>
|
||||
|
||||
softDelete<TReturnableLinkableKeys extends string = string>(
|
||||
salesChannelIds: string[],
|
||||
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
|
||||
restore<TReturnableLinkableKeys extends string = string>(
|
||||
salesChannelIds: string[],
|
||||
config?: RestoreReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
}
|
||||
Reference in New Issue
Block a user