feat(customers): add delete and update (#6148)

Depends on #6137 

**What**
- Add update and delete methods to the customer module
This commit is contained in:
Sebastian Rindom
2024-01-22 12:31:46 +00:00
committed by GitHub
parent da5cc4cf7f
commit 76291823f4
5 changed files with 245 additions and 25 deletions
+19
View File
@@ -9,6 +9,7 @@ export interface CreateCustomerDTO {
}
export interface UpdateCustomerDTO {
id: string
company_name?: string
first_name?: string
last_name?: string
@@ -28,6 +29,24 @@ export interface CustomerGroupUpdatableFileds {
metadata?: Record<string, unknown> | null
}
export interface UpdateCustomerGroupDTO {
id?: string
name?: string
customer_ids?: string[]
metadata?: Record<string, unknown> | null
}
export interface CreateCustomerGroupDTO {
name: string
metadata?: Record<string, unknown> | null
created_by?: string
}
export interface CustomerGroupUpdatableFileds {
name?: string
metadata?: Record<string, unknown> | null
}
export interface UpdateCustomerGroupDTO {
id?: string
name?: string
+23
View File
@@ -24,6 +24,29 @@ export interface ICustomerModuleService extends IModuleService {
create(data: CreateCustomerDTO, sharedContext?: Context): Promise<CustomerDTO>
update(
customerId: string,
data: Partial<CreateCustomerDTO>,
sharedContext?: Context
): Promise<CustomerDTO>
update(
customerIds: string[],
data: Partial<CreateCustomerDTO>,
sharedContext?: Context
): Promise<CustomerDTO[]>
update(
selector: FilterableCustomerProps,
data: Partial<CreateCustomerDTO>,
sharedContext?: Context
): Promise<CustomerDTO[]>
delete(customerId: string, sharedContext?: Context): Promise<void>
delete(customerIds: string[], sharedContext?: Context): Promise<void>
delete(
selector: FilterableCustomerProps,
sharedContext?: Context
): Promise<void>
createCustomerGroup(
data: CreateCustomerGroupDTO[],
sharedContext?: Context