feat: customer module skeleton (#6126)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
export * from "./common"
|
||||
export * from "./service"
|
||||
export * from "./mutations"
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
@@ -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>
|
||||
}
|
||||
Reference in New Issue
Block a user