feat(customer): admin CRUD endpoints (#6232)

**What**

- GET /customers/:id
- POST /customers/:id
- DELETE /customers/:id
- POST /customers

Including workflows for each.
This commit is contained in:
Sebastian Rindom
2024-01-30 11:43:30 +00:00
committed by GitHub
parent 328eb85a8b
commit 18ff739a94
21 changed files with 503 additions and 25 deletions
+15 -6
View File
@@ -48,12 +48,21 @@ export interface CreateCustomerDTO {
export interface UpdateCustomerDTO {
id: string
company_name?: string
first_name?: string
last_name?: string
email?: string
phone?: string
metadata?: Record<string, unknown>
company_name?: string | null
first_name?: string | null
last_name?: string | null
email?: string | null
phone?: string | null
metadata?: Record<string, unknown> | null
}
export interface CustomerUpdatableFields {
company_name?: string | null
first_name?: string | null
last_name?: string | null
email?: string | null
phone?: string | null
metadata?: Record<string, unknown> | null
}
export interface CreateCustomerGroupDTO {
+4 -3
View File
@@ -17,6 +17,7 @@ import {
CreateCustomerAddressDTO,
CreateCustomerDTO,
CreateCustomerGroupDTO,
CustomerUpdatableFields,
UpdateCustomerAddressDTO,
} from "./mutations"
@@ -35,17 +36,17 @@ export interface ICustomerModuleService extends IModuleService {
update(
customerId: string,
data: Partial<CreateCustomerDTO>,
data: CustomerUpdatableFields,
sharedContext?: Context
): Promise<CustomerDTO>
update(
customerIds: string[],
data: Partial<CreateCustomerDTO>,
data: CustomerUpdatableFields,
sharedContext?: Context
): Promise<CustomerDTO[]>
update(
selector: FilterableCustomerProps,
data: Partial<CreateCustomerDTO>,
data: CustomerUpdatableFields,
sharedContext?: Context
): Promise<CustomerDTO[]>