feat: Admin V2 Customers (#6998)

This commit is contained in:
Oli Juhl authored and GitHub committed 2024-04-07 21:38:50 +02:00
1 parent f132929c7e
commit 4f88743591
53 files changed
+619 -724

No files matched your search

+22 -13
View File
@@ -449,75 +449,84 @@ export interface CustomerDTO {
*/
email: string
/**
* A flag indicating if customer has an account or not.
*/
has_account: boolean
/**
* The associated default billing address's ID.
*/
default_billing_address_id?: string | null
default_billing_address_id: string | null
/**
* The associated default shipping address's ID.
*/
default_shipping_address_id?: string | null
default_shipping_address_id: string | null
/**
* The company name of the customer.
*/
company_name?: string | null
company_name: string | null
/**
* The first name of the customer.
*/
first_name?: string | null
first_name: string | null
/**
* The last name of the customer.
*/
last_name?: string | null
last_name: string | null
/**
* The addresses of the customer.
*/
addresses?: CustomerAddressDTO[]
addresses: CustomerAddressDTO[]
/**
* The phone of the customer.
*/
phone?: string | null
phone: string | null
/**
* The groups of the customer.
*/
groups?: {
groups: {
/**
* The ID of the group.
*/
id: string
/**
* The name of the group.
*/
name: string
}[]
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, unknown>
metadata: Record<string, unknown>
/**
* Who created the customer.
*/
created_by?: string | null
created_by: string | null
/**
* The deletion date of the customer.
*/
deleted_at?: Date | string | null
deleted_at: Date | string | null
/**
* The creation date of the customer.
*/
created_at?: Date | string
created_at: Date | string
/**
* The update date of the customer.
*/
updated_at?: Date | string
updated_at: Date | string
}
/**
+13 -13
View File
@@ -90,7 +90,7 @@ export interface UpdateCustomerAddressDTO {
/**
* The address's name.
*/
address_name?: string
address_name?: string | null
/**
* Whether the address is the default for shipping.
@@ -105,62 +105,62 @@ export interface UpdateCustomerAddressDTO {
/**
* The associated customer's ID.
*/
customer_id?: string
customer_id?: string | null
/**
* The company.
*/
company?: string
company?: string | null
/**
* The first name.
*/
first_name?: string
first_name?: string | null
/**
* The last name.
*/
last_name?: string
last_name?: string | null
/**
* The address 1.
*/
address_1?: string
address_1?: string | null
/**
* The address 2.
*/
address_2?: string
address_2?: string | null
/**
* The city.
*/
city?: string
city?: string | null
/**
* The country code.
*/
country_code?: string
country_code?: string | null
/**
* The province.
*/
province?: string
province?: string | null
/**
* The postal code.
*/
postal_code?: string
postal_code?: string | null
/**
* The phone.
*/
phone?: string
phone?: string | null
/**
* Holds custom data in key-value pairs.
*/
metadata?: Record<string, unknown>
metadata?: Record<string, unknown> | null
}
/**
@@ -0,0 +1,83 @@
import { PaginatedResponse } from "../../../common"
/**
* @experimental
*/
export interface CustomerGroupResponse {
id: string
name: string | null
}
/**
* @experimental
*/
export interface CustomerAddressResponse {
id: string
address_name: string | null
is_default_shipping: boolean
is_default_billing: boolean
customer_id: string
company: string | null
first_name: string | null
last_name: string | null
address_1: string | null
address_2: string | null
city: string | null
country_code: string | null
province: string | null
postal_code: string | null
phone: string | null
metadata: Record<string, unknown> | null
created_at: string
updated_at: string
}
/**
* @experimental
*/
interface CustomerResponse {
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
has_account: boolean
addresses: CustomerAddressResponse[]
phone?: string | null
groups?: CustomerGroupResponse[]
metadata?: Record<string, unknown>
created_by?: string | null
deleted_at?: Date | string | null
created_at?: Date | string
updated_at?: Date | string
}
/**
* @experimental
*/
export interface AdminCustomerResponse {
customer: CustomerResponse
}
/**
* @experimental
*/
export interface AdminCustomerListResponse extends PaginatedResponse {
customers: CustomerResponse[]
}
/**
* @experimental
*/
export interface AdminCustomerGroupResponse {
customer_group: CustomerGroupResponse
}
/**
* @experimental
*/
export interface AdminCustomerGroupListResponse extends PaginatedResponse {
customer_groups: CustomerGroupResponse[]
}
@@ -0,0 +1 @@
export * from "./customer"
@@ -0,0 +1 @@
export * from "./admin"
+1
View File
@@ -1,4 +1,5 @@
export * from "./api-key"
export * from "./customer"
export * from "./fulfillment"
export * from "./pricing"
export * from "./sales-channel"