feat(user): Init user module (#6293)
* init user module * add migration * update module with latest utils * pr ready * make interface types interfaces
This commit is contained in:
@@ -17,5 +17,6 @@ export * as SalesChannelTypes from "./sales-channel"
|
||||
export * as SearchTypes from "./search"
|
||||
export * as StockLocationTypes from "./stock-location"
|
||||
export * as TransactionBaseTypes from "./transaction-base"
|
||||
export * as UserTypes from "./user"
|
||||
export * as WorkflowTypes from "./workflow"
|
||||
|
||||
|
||||
@@ -26,5 +26,6 @@ export * from "./search"
|
||||
export * from "./shared-context"
|
||||
export * from "./stock-location"
|
||||
export * from "./transaction-base"
|
||||
export * from "./user"
|
||||
export * from "./workflow"
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
export type UserDTO = {
|
||||
id: string
|
||||
}
|
||||
|
||||
export type FilterableUserProps = {}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from "./common"
|
||||
export * from "./mutations"
|
||||
export * from "./service"
|
||||
@@ -0,0 +1,6 @@
|
||||
export interface CreateUserDTO {
|
||||
id?: string
|
||||
}
|
||||
export interface UpdateUserDTO {
|
||||
id: string
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import { CreateUserDTO, UpdateUserDTO } from "./mutations"
|
||||
import { FilterableUserProps, UserDTO } from "./common"
|
||||
|
||||
import { Context } from "../shared-context"
|
||||
import { FindConfig } from "../common"
|
||||
import { IModuleService } from "../modules-sdk"
|
||||
|
||||
export interface IUserModuleService extends IModuleService {
|
||||
retrieve(
|
||||
id: string,
|
||||
config?: FindConfig<UserDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<UserDTO>
|
||||
|
||||
list(
|
||||
filters?: FilterableUserProps,
|
||||
config?: FindConfig<UserDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<UserDTO[]>
|
||||
|
||||
listAndCount(
|
||||
filters?: FilterableUserProps,
|
||||
config?: FindConfig<UserDTO>,
|
||||
sharedContext?: Context
|
||||
): Promise<[UserDTO[], number]>
|
||||
|
||||
create(data: CreateUserDTO[], sharedContext?: Context): Promise<UserDTO[]>
|
||||
|
||||
create(data: CreateUserDTO, sharedContext?: Context): Promise<UserDTO>
|
||||
|
||||
update(data: UpdateUserDTO[], sharedContext?: Context): Promise<UserDTO[]>
|
||||
|
||||
update(data: UpdateUserDTO, sharedContext?: Context): Promise<UserDTO>
|
||||
|
||||
delete(ids: string[], sharedContext?: Context): Promise<void>
|
||||
}
|
||||
Reference in New Issue
Block a user