@@ -263,6 +263,12 @@ enum HqAdminRole {
|
||||
OPS
|
||||
FINANCE
|
||||
CUSTOMER_SERVICE
|
||||
CITY_STORE_SERVICE
|
||||
}
|
||||
|
||||
enum HqPermissionEffect {
|
||||
GRANT
|
||||
DENY
|
||||
}
|
||||
|
||||
enum PartnerBillStatus {
|
||||
@@ -1031,6 +1037,7 @@ model CommonCity {
|
||||
partnerAccounts PartnerAccount[] @relation("PartnerAccountCity")
|
||||
stores Store[]
|
||||
orders Order[]
|
||||
hqAccountCities HqAccountCity[]
|
||||
|
||||
@@map("common_city")
|
||||
}
|
||||
@@ -1244,10 +1251,13 @@ model HqAccount {
|
||||
wxUnionId String? @map("wx_union_id") @db.VarChar(64)
|
||||
status AccountStatus @default(ACTIVE)
|
||||
lastLoginAt DateTime? @map("last_login_at") @db.DateTime(3)
|
||||
/// HQ 各列表的显示列与顺序(按 listKey)
|
||||
listColumnPrefs Json? @map("list_column_prefs")
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
|
||||
updatedAt DateTime @updatedAt @map("updated_at") @db.DateTime(3)
|
||||
|
||||
permissions HqAccountPermission[]
|
||||
cities HqAccountCity[]
|
||||
testWhitelistPhones CommonTestWhitelistPhone[] @relation("TestWhitelistCreatedBy")
|
||||
|
||||
@@map("hq_account")
|
||||
@@ -1263,9 +1273,10 @@ model HqRolePermission {
|
||||
}
|
||||
|
||||
model HqAccountPermission {
|
||||
hqAccountId BigInt @map("hq_account_id") @db.UnsignedBigInt
|
||||
permissionKey String @map("permission_key") @db.VarChar(64)
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
|
||||
hqAccountId BigInt @map("hq_account_id") @db.UnsignedBigInt
|
||||
permissionKey String @map("permission_key") @db.VarChar(64)
|
||||
effect HqPermissionEffect @default(GRANT)
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
|
||||
|
||||
hqAccount HqAccount @relation(fields: [hqAccountId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@ -1273,6 +1284,19 @@ model HqAccountPermission {
|
||||
@@map("hq_account_permission")
|
||||
}
|
||||
|
||||
model HqAccountCity {
|
||||
hqAccountId BigInt @map("hq_account_id") @db.UnsignedBigInt
|
||||
cityId BigInt @map("city_id") @db.UnsignedBigInt
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
|
||||
|
||||
hqAccount HqAccount @relation(fields: [hqAccountId], references: [id], onDelete: Cascade)
|
||||
city CommonCity @relation(fields: [cityId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@id([hqAccountId, cityId])
|
||||
@@index([cityId])
|
||||
@@map("hq_account_city")
|
||||
}
|
||||
|
||||
// ─── USER ─────────────────────────────────────────────
|
||||
|
||||
model User {
|
||||
|
||||
Reference in New Issue
Block a user