feat(sync): synchronize customer addresses
Mirror the addresses embedded in GET /customer/🆔 per customer, delete the ones missing from Hiboutik, then upsert each of them (failures logged and skipped). CustomerAddress gains its own recipient (firstName, lastName, company, phone) plus state and other. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -146,16 +146,23 @@ 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
|
||||
company String?
|
||||
country String
|
||||
firstName String
|
||||
hiboutikId Int @unique
|
||||
isDefault Boolean @default(false)
|
||||
lastName String
|
||||
/// Free complement (building, floor, door code...)
|
||||
other String?
|
||||
phone String?
|
||||
state String?
|
||||
zipCode String
|
||||
|
||||
customer Customer @relation(fields: [customerId], references: [id], onDelete: Cascade)
|
||||
|
||||
Reference in New Issue
Block a user