2026-03-07 11:25:11 +03:30
|
|
|
model Guild {
|
|
|
|
|
id String @id @default(uuid())
|
|
|
|
|
name String
|
|
|
|
|
code String?
|
|
|
|
|
|
2026-03-14 16:26:44 +03:30
|
|
|
created_at DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
|
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
|
|
|
|
|
2026-03-07 11:25:11 +03:30
|
|
|
business_activities BusinessActivity[]
|
|
|
|
|
goods Good[]
|
|
|
|
|
good_categories GoodCategory[]
|
|
|
|
|
|
|
|
|
|
@@map("guilds")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model BusinessActivity {
|
|
|
|
|
id String @id @default(uuid())
|
|
|
|
|
name String
|
2026-03-14 16:26:44 +03:30
|
|
|
created_at DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
|
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
|
|
|
|
|
|
|
|
|
guild_id String
|
|
|
|
|
owner_id String
|
2026-03-07 11:25:11 +03:30
|
|
|
|
|
|
|
|
guild Guild @relation(fields: [guild_id], references: [id])
|
|
|
|
|
user User @relation(fields: [owner_id], references: [id])
|
|
|
|
|
|
|
|
|
|
complexes Complex[]
|
|
|
|
|
accounts Account[]
|
|
|
|
|
|
|
|
|
|
@@map("business_activities")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model Complex {
|
|
|
|
|
id String @id @default(uuid())
|
|
|
|
|
name String
|
|
|
|
|
address String?
|
|
|
|
|
tax_id String?
|
|
|
|
|
|
2026-03-14 16:26:44 +03:30
|
|
|
created_at DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
|
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
|
|
|
|
|
2026-03-07 11:25:11 +03:30
|
|
|
business_activity_id String
|
|
|
|
|
|
|
|
|
|
business_activity BusinessActivity @relation(fields: [business_activity_id], references: [id])
|
|
|
|
|
|
|
|
|
|
pos_list Pos[]
|
|
|
|
|
goods Good[]
|
|
|
|
|
good_categories GoodCategory[]
|
|
|
|
|
|
|
|
|
|
@@map("complexes")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model Pos {
|
|
|
|
|
id String @id @default(uuid())
|
2026-03-14 16:26:44 +03:30
|
|
|
name String
|
2026-03-07 11:25:11 +03:30
|
|
|
serial String @unique
|
|
|
|
|
model String?
|
|
|
|
|
status POSStatus @default(ACTIVE)
|
|
|
|
|
pos_type POSType
|
2026-03-14 16:26:44 +03:30
|
|
|
created_at DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
|
updated_at DateTime @updatedAt() @db.Timestamp(0)
|
2026-03-07 11:25:11 +03:30
|
|
|
|
|
|
|
|
complex_id String
|
2026-03-14 16:26:44 +03:30
|
|
|
device_id String?
|
2026-03-07 11:25:11 +03:30
|
|
|
provider_id String?
|
|
|
|
|
|
|
|
|
|
complex Complex @relation(fields: [complex_id], references: [id])
|
2026-03-14 16:26:44 +03:30
|
|
|
device Device? @relation(fields: [device_id], references: [id])
|
2026-03-07 11:25:11 +03:30
|
|
|
provider Provider? @relation(fields: [provider_id], references: [id])
|
|
|
|
|
|
|
|
|
|
licenses License[]
|
|
|
|
|
accounts Account[]
|
|
|
|
|
|
|
|
|
|
@@map("poses")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// model BusinessAccount {
|
|
|
|
|
// id String @id @default(uuid())
|
|
|
|
|
// role BusinessRole
|
|
|
|
|
// status AccountStatus @default(ACTIVE)
|
|
|
|
|
// created_at DateTime @default(now())
|
|
|
|
|
// business_activity_id String
|
|
|
|
|
// account_id String @unique
|
|
|
|
|
|
|
|
|
|
// account Account @relation(fields: [account_id], references: [id])
|
|
|
|
|
// owned_activities BusinessActivity[] @relation("business_owner")
|
|
|
|
|
|
|
|
|
|
// @@unique([business_activity_id, account_id])
|
|
|
|
|
// @@map("business_accounts")
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// model PosAccount {
|
|
|
|
|
// id String @id @default(uuid())
|
|
|
|
|
// pos_id String
|
|
|
|
|
// account_id String
|
|
|
|
|
// role POSRole
|
|
|
|
|
// created_at DateTime @default(now())
|
|
|
|
|
|
|
|
|
|
// pos Pos @relation(fields: [pos_id], references: [id])
|
|
|
|
|
// account Account @relation(fields: [account_id], references: [id])
|
|
|
|
|
|
|
|
|
|
// @@unique([pos_id, account_id])
|
|
|
|
|
// @@map("pos_accounts")
|
|
|
|
|
// }
|