feat(sync): synchronize customer adresses and orders from Hiboutik sales (#1)
Co-authored-by: MastersGame <quentin.duwa1210@gmail.com> Reviewed-on: #1
This commit is contained in:
@@ -2,3 +2,11 @@ import { Prisma } from '../generated/client';
|
||||
|
||||
/** Product loaded with its versions (`include: { versions: true }`). */
|
||||
export type ProductWithVersions = Prisma.ProductGetPayload<{ include: { versions: true } }>;
|
||||
|
||||
/**
|
||||
* Order to save with its lines. Lines are kept apart from the nested Prisma input so that the repository can link
|
||||
* them to the current catalog (`productVersion`) and replace them on update.
|
||||
*/
|
||||
export type OrderWithLinesInput = Omit<Prisma.OrderCreateInput, 'lines'> & {
|
||||
lines: Prisma.OrderLineCreateWithoutOrderInput[];
|
||||
};
|
||||
|
||||
@@ -146,17 +146,30 @@ model Customer {
|
||||
@@map("customers")
|
||||
}
|
||||
|
||||
/// Address of a customer, mirrored from Hiboutik (sync not implemented yet).
|
||||
/// Address of a customer, mirrored from Hiboutik. Its recipient (name, company, phone) can differ from the customer.
|
||||
model CustomerAddress {
|
||||
id String @id @default(uuid())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
address String
|
||||
city String
|
||||
country String
|
||||
hiboutikId Int @unique
|
||||
isDefault Boolean @default(false)
|
||||
zipCode String
|
||||
address String
|
||||
city String
|
||||
company String?
|
||||
/// Company registration number (SIRET...), only for an address with a company
|
||||
companyNumber String?
|
||||
country String
|
||||
firstName String
|
||||
hiboutikId Int @unique
|
||||
isDefault Boolean @default(false)
|
||||
lastName String
|
||||
/// Company legal status (SAS, SARL...), only for an address with a company
|
||||
legalStatus String?
|
||||
/// Free complement (building, floor, door code...)
|
||||
other String?
|
||||
phone String?
|
||||
state String?
|
||||
/// Company VAT number, only for an address with a company
|
||||
taxNumber String?
|
||||
zipCode String
|
||||
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
customerId String
|
||||
|
||||
Reference in New Issue
Block a user