|
|
@@ -21,6 +21,31 @@ enum TemplateTaskStatus {
|
|
|
FAILED
|
|
|
}
|
|
|
|
|
|
+enum CustomerContactType {
|
|
|
+ LINE
|
|
|
+ PHONE
|
|
|
+ EMAIL
|
|
|
+}
|
|
|
+
|
|
|
+enum CustomerLineStatus {
|
|
|
+ LINKED
|
|
|
+ UNLINKED
|
|
|
+ INVITED
|
|
|
+ KEEP
|
|
|
+}
|
|
|
+
|
|
|
+enum CustomerHairLength {
|
|
|
+ SHORT
|
|
|
+ MEDIUM
|
|
|
+ LONG
|
|
|
+}
|
|
|
+
|
|
|
+enum CustomerFollowStatus {
|
|
|
+ NONE
|
|
|
+ NEED_FOLLOW_UP
|
|
|
+ SENT
|
|
|
+}
|
|
|
+
|
|
|
model HairstylistUser {
|
|
|
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
|
|
username String @db.VarChar(50)
|
|
|
@@ -33,6 +58,45 @@ model HairstylistUser {
|
|
|
@@map("hairstylist_user")
|
|
|
}
|
|
|
|
|
|
+model Customer {
|
|
|
+ id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
|
|
+ hairstylistId BigInt @map("hairstylist_id") @db.UnsignedBigInt
|
|
|
+ name String @db.VarChar(100)
|
|
|
+ kana String @default("") @db.VarChar(100)
|
|
|
+ phone String @db.VarChar(32)
|
|
|
+ email String @default("") @db.VarChar(100)
|
|
|
+ birthday DateTime? @db.Date
|
|
|
+ avatarUrl String @map("avatar_url") @db.VarChar(500)
|
|
|
+ contactType CustomerContactType @default(LINE) @map("contact_type")
|
|
|
+ lineStatus CustomerLineStatus? @map("line_status")
|
|
|
+ lastVisitDate DateTime? @map("last_visit_date") @db.Date
|
|
|
+ nextVisitDate DateTime? @map("next_visit_date") @db.Date
|
|
|
+ visitCycle String @default("") @map("visit_cycle") @db.VarChar(64)
|
|
|
+ hairLength CustomerHairLength? @map("hair_length")
|
|
|
+ hairType String @default("") @map("hair_type") @db.VarChar(64)
|
|
|
+ hairCondition String @default("") @map("hair_condition") @db.VarChar(255)
|
|
|
+ concern String? @db.Text
|
|
|
+ desiredImage String? @map("desired_image") @db.Text
|
|
|
+ formulaNote String? @map("formula_note") @db.Text
|
|
|
+ allergyNote String? @map("allergy_note") @db.Text
|
|
|
+ privateNote String? @map("private_note") @db.Text
|
|
|
+ followStatus CustomerFollowStatus @default(NONE) @map("follow_status")
|
|
|
+ followTiming String @default("") @map("follow_timing") @db.VarChar(64)
|
|
|
+ followMessage String? @map("follow_message") @db.Text
|
|
|
+ createTime DateTime @default(now()) @map("create_time")
|
|
|
+ updateTime DateTime @updatedAt @map("update_time")
|
|
|
+ isDeleted Int @default(0) @map("is_deleted") @db.UnsignedTinyInt
|
|
|
+
|
|
|
+ @@index([hairstylistId], map: "idx_hairstylist_id")
|
|
|
+ @@index([phone], map: "idx_phone")
|
|
|
+ @@index([nextVisitDate], map: "idx_next_visit_date")
|
|
|
+ @@index([followStatus], map: "idx_follow_status")
|
|
|
+ @@index([hairLength], map: "idx_hair_length")
|
|
|
+ @@index([isDeleted], map: "idx_is_deleted")
|
|
|
+ @@index([hairstylistId, isDeleted], map: "idx_hairstylist_is_deleted")
|
|
|
+ @@map("customer")
|
|
|
+}
|
|
|
+
|
|
|
model CustomerTreatmentRecord {
|
|
|
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
|
|
customerId BigInt @map("customer_id") @db.UnsignedBigInt
|