feat: Fulfillment module basic structure (#6319)
**What** Scafold the fulfillment module basic structure **Bonus** Simplified module scaffolding with new factories and less directories to manage - mikro orm connection loader factory - initialize factory FIXES CORE-1709 FIXES CORE-1710
This commit is contained in:
1 parent
2104843826
commit
12054f5c01
42 files changed
+694
-1
No files matched your search
@@ -6,6 +6,7 @@ export * as CustomerTypes from "./customer"
|
||||
export * as DAL from "./dal"
|
||||
export * as EventBusTypes from "./event-bus"
|
||||
export * as FeatureFlagTypes from "./feature-flag"
|
||||
export * as FulfillmentTypes from "./fulfillment"
|
||||
export * as InventoryTypes from "./inventory"
|
||||
export * as LoggerTypes from "./logger"
|
||||
export * as ModulesSdkTypes from "./modules-sdk"
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export interface FulfillmentDTO {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from "./common"
|
||||
export * from "./mutations"
|
||||
export * from "./service"
|
||||
@@ -0,0 +1 @@
|
||||
export {}
|
||||
@@ -0,0 +1,58 @@
|
||||
import { IModuleService } from "../modules-sdk"
|
||||
import { FulfillmentDTO } from "./common"
|
||||
import { FindConfig } from "../common"
|
||||
import { Context } from "../shared-context"
|
||||
import { RestoreReturn, SoftDeleteReturn } from "../dal"
|
||||
|
||||
export interface IFulfillmentModuleService extends IModuleService {
|
||||
create(
|
||||
data: any[], // TODO Create appropriate DTO
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentDTO[]>
|
||||
create(
|
||||
data: any, // TODO Create appropriate DTO
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentDTO>
|
||||
|
||||
update(
|
||||
data: any[], // TODO Create appropriate DTO
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentDTO[]>
|
||||
update(
|
||||
data: any, // TODO Create appropriate DTO
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentDTO>
|
||||
|
||||
delete(ids: string[], sharedContext?: Context): Promise<void>
|
||||
delete(id: string, sharedContext?: Context): Promise<void>
|
||||
|
||||
retrieve(
|
||||
id: string,
|
||||
config?: FindConfig<FulfillmentDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentDTO>
|
||||
|
||||
list(
|
||||
filters?: any, // TODO Create appropriate filter type
|
||||
config?: FindConfig<FulfillmentDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<FulfillmentDTO[]>
|
||||
|
||||
listAndCount(
|
||||
filters?: any, // TODO Create appropriate filter type
|
||||
config?: FindConfig<FulfillmentDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<[FulfillmentDTO[], number]>
|
||||
|
||||
softDelete<TReturnableLinkableKeys extends string = string>(
|
||||
fulfillmentIds: string[],
|
||||
config?: SoftDeleteReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
|
||||
restore<TReturnableLinkableKeys extends string = string>(
|
||||
fulfillmentIds: string[],
|
||||
config?: RestoreReturn<TReturnableLinkableKeys>,
|
||||
sharedContext?: Context
|
||||
): Promise<Record<string, string[]> | void>
|
||||
}
|
||||
@@ -8,6 +8,7 @@ export * from "./customer"
|
||||
export * from "./dal"
|
||||
export * from "./event-bus"
|
||||
export * from "./feature-flag"
|
||||
export * from "./fulfillment"
|
||||
export * from "./file-service"
|
||||
export * from "./inventory"
|
||||
export * from "./joiner"
|
||||
|
||||
Reference in new issue
Block a user