Redesign login/register with Mento branding and email/mobile OTP.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -172,9 +172,13 @@ model Organization {
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
email String
|
||||
/// موبایل نرمالشده (مثلاً 9121234567) — برای ورود با موبایل
|
||||
mobile String?
|
||||
passwordHash String
|
||||
fullName String
|
||||
role UserRole @default(sales)
|
||||
emailVerifiedAt DateTime?
|
||||
mobileVerifiedAt DateTime?
|
||||
organizationId String
|
||||
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
||||
ownedDeals Deal[] @relation("DealOwner")
|
||||
@@ -197,7 +201,9 @@ model User {
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([organizationId, email])
|
||||
@@unique([mobile])
|
||||
@@index([organizationId])
|
||||
@@index([email])
|
||||
}
|
||||
|
||||
model Company {
|
||||
@@ -934,6 +940,32 @@ model AutomationRule {
|
||||
@@index([organizationId, isActive, trigger])
|
||||
}
|
||||
|
||||
/// چالش OTP برای ثبتنام / ورود پنل
|
||||
model AuthChallenge {
|
||||
id String @id @default(cuid())
|
||||
/// register | login
|
||||
kind String
|
||||
/// برای login: email | mobile
|
||||
channel String?
|
||||
email String?
|
||||
mobile String?
|
||||
passwordHash String?
|
||||
/// دادهٔ موقت ثبتنام (سازمان، نام، زمینه، کد معرف، …)
|
||||
payload Json @default("{}")
|
||||
emailCode String?
|
||||
mobileCode String?
|
||||
emailVerified Boolean @default(false)
|
||||
mobileVerified Boolean @default(false)
|
||||
expiresAt DateTime
|
||||
consumedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([kind, createdAt])
|
||||
@@index([expiresAt])
|
||||
@@index([email])
|
||||
@@index([mobile])
|
||||
}
|
||||
|
||||
/// اتصال به نرمافزار حسابداری خارجی (تهحساب) — چند اتصال/DB بهازای هر سازمان
|
||||
model AccountingConnection {
|
||||
id String @id @default(cuid())
|
||||
|
||||
Reference in New Issue
Block a user