feat: customer module skeleton (#6126)

This commit is contained in:
Sebastian Rindom
2024-01-19 10:18:54 +00:00
committed by GitHub
parent a12c28b7d5
commit 12aa1737d5
47 changed files with 1157 additions and 0 deletions
+19
View File
@@ -1,6 +1,25 @@
import { AddressDTO } from "../address"
export interface CustomerDTO {
id: string
email: string
default_billing_address_id?: string | null
default_shipping_address_id?: string | null
company_name?: string | null
first_name?: string | null
last_name?: string | null
default_billing_address?: AddressDTO
default_shipping_address?: AddressDTO
addresses?: AddressDTO[]
phone?: string | null
groups?: { id: string }[]
metadata?: Record<string, unknown>
deleted_at?: Date | string
created_at?: Date | string
updated_at?: Date | string
}
export type legacy_CustomerDTO = {
id: string
email: string
billing_address_id?: string | null
+2
View File
@@ -1 +1,3 @@
export * from "./common"
export * from "./service"
export * from "./mutations"
+17
View File
@@ -0,0 +1,17 @@
export interface CreateCustomerDTO {
company_name?: string
first_name?: string
last_name?: string
email?: string
phone?: string
metadata?: Record<string, unknown>
}
export interface UpdateCustomerDTO {
company_name?: string
first_name?: string
last_name?: string
email?: string
phone?: string
metadata?: Record<string, unknown>
}
+15
View File
@@ -0,0 +1,15 @@
import { FindConfig } from "../common"
import { IModuleService } from "../modules-sdk"
import { Context } from "../shared-context"
import { CustomerDTO } from "./common"
import { CreateCustomerDTO } from "./mutations"
export interface ICustomerModuleService extends IModuleService {
retrieve(
customerId: string,
config?: FindConfig<CustomerDTO>,
sharedContext?: Context
): Promise<CustomerDTO>
create(data: CreateCustomerDTO, sharedContext?: Context): Promise<CustomerDTO>
}