73 lines
1.9 KiB
Plaintext
73 lines
1.9 KiB
Plaintext
|
|
model User {
|
||
|
|
id String @id @default(uuid())
|
||
|
|
// user_type UserType
|
||
|
|
created_at DateTime @default(now())
|
||
|
|
|
||
|
|
// individual_profile IndividualProfile?
|
||
|
|
// legal_profile LegalProfile?
|
||
|
|
mobile_number String @unique()
|
||
|
|
national_code String? @unique()
|
||
|
|
first_name String
|
||
|
|
last_name String
|
||
|
|
// username String
|
||
|
|
accounts Account[]
|
||
|
|
businessActivities BusinessActivity[]
|
||
|
|
|
||
|
|
@@map("users")
|
||
|
|
}
|
||
|
|
|
||
|
|
// model LegalProfile {
|
||
|
|
// user_id String @id
|
||
|
|
// company_name String
|
||
|
|
// register_no String @unique()
|
||
|
|
// representative_name String?
|
||
|
|
// representative_national_id String?
|
||
|
|
|
||
|
|
// // user User @relation(fields: [user_id], references: [id])
|
||
|
|
|
||
|
|
// @@map("legal_profiles")
|
||
|
|
// }
|
||
|
|
|
||
|
|
// model IndividualProfile {
|
||
|
|
// user_id String @id
|
||
|
|
// national_code String @unique()
|
||
|
|
// first_name String
|
||
|
|
// last_name String
|
||
|
|
// birth_date DateTime?
|
||
|
|
// mobile_number String
|
||
|
|
// // user User @relation(fields: [user_id], references: [id])
|
||
|
|
|
||
|
|
// @@map("individual_profiles")
|
||
|
|
// }
|
||
|
|
|
||
|
|
model Account {
|
||
|
|
id String @id @default(uuid())
|
||
|
|
username String @unique()
|
||
|
|
// first_name String
|
||
|
|
// last_name String
|
||
|
|
type AccountType
|
||
|
|
status AccountStatus
|
||
|
|
password String
|
||
|
|
created_at DateTime @default(now())
|
||
|
|
|
||
|
|
user_id String
|
||
|
|
user User @relation(fields: [user_id], references: [id])
|
||
|
|
|
||
|
|
partner_id String?
|
||
|
|
partner Partner? @relation(fields: [partner_id], references: [id])
|
||
|
|
|
||
|
|
business_id String?
|
||
|
|
business BusinessActivity? @relation(fields: [business_id], references: [id])
|
||
|
|
|
||
|
|
provider_id String?
|
||
|
|
provider Provider? @relation(fields: [provider_id], references: [id])
|
||
|
|
|
||
|
|
pos_id String?
|
||
|
|
pos Pos? @relation(fields: [pos_id], references: [id])
|
||
|
|
|
||
|
|
verification_codes VerificationCode[]
|
||
|
|
tokens Token[]
|
||
|
|
|
||
|
|
@@map("accounts")
|
||
|
|
}
|