2026-03-07 11:25:11 +03:30
|
|
|
model Good {
|
2026-05-28 16:39:07 +03:30
|
|
|
id String @id @default(ulid())
|
|
|
|
|
name String @db.VarChar(255)
|
|
|
|
|
is_default_guild_good Boolean @default(false)
|
|
|
|
|
pricing_model GoodPricingModel
|
|
|
|
|
description String? @db.Text
|
|
|
|
|
local_sku String? @unique @db.VarChar(100)
|
|
|
|
|
barcode String? @unique @db.VarChar(100)
|
|
|
|
|
base_sale_price Decimal? @default(0) @db.Decimal(15, 0)
|
|
|
|
|
image_url String? @db.VarChar(255)
|
|
|
|
|
created_at DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
|
updated_at DateTime @updatedAt @db.Timestamp(0)
|
|
|
|
|
deleted_at DateTime? @db.Timestamp(0)
|
|
|
|
|
sku_id String
|
|
|
|
|
measure_unit_id String
|
|
|
|
|
category_id String?
|
|
|
|
|
business_activity_id String?
|
2026-05-20 11:42:59 +03:30
|
|
|
consumer_account_good_favorites ConsumerAccountGoodFavorite[]
|
2026-05-28 16:39:07 +03:30
|
|
|
business_activity BusinessActivity? @relation(fields: [business_activity_id], references: [id])
|
|
|
|
|
category GoodCategory? @relation(fields: [category_id], references: [id])
|
|
|
|
|
measure_unit MeasureUnits @relation(fields: [measure_unit_id], references: [id])
|
|
|
|
|
sku StockKeepingUnits @relation(fields: [sku_id], references: [id])
|
|
|
|
|
sales_invoice_items SalesInvoiceItem[]
|
2026-03-07 11:25:11 +03:30
|
|
|
|
|
|
|
|
@@index([category_id])
|
2026-05-28 16:39:07 +03:30
|
|
|
@@index([business_activity_id], map: "goods_business_activity_id_fkey")
|
|
|
|
|
@@index([measure_unit_id], map: "goods_measure_unit_id_fkey")
|
|
|
|
|
@@index([sku_id], map: "goods_sku_id_fkey")
|
2026-03-07 11:25:11 +03:30
|
|
|
@@map("goods")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
model GoodCategory {
|
2026-05-28 16:39:07 +03:30
|
|
|
id String @id @default(ulid())
|
|
|
|
|
name String @db.VarChar(100)
|
|
|
|
|
description String? @db.Text
|
|
|
|
|
image_url String? @db.VarChar(255)
|
2026-03-07 11:25:11 +03:30
|
|
|
complex_id String?
|
2026-05-28 16:39:07 +03:30
|
|
|
is_default_guild_good Boolean @default(false)
|
2026-03-07 11:25:11 +03:30
|
|
|
guild_id String?
|
2026-05-28 16:39:07 +03:30
|
|
|
created_at DateTime @default(now()) @db.Timestamp(0)
|
|
|
|
|
updated_at DateTime @updatedAt @db.Timestamp(0)
|
|
|
|
|
deleted_at DateTime? @db.Timestamp(0)
|
|
|
|
|
complex Complex? @relation(fields: [complex_id], references: [id])
|
|
|
|
|
guild Guild? @relation(fields: [guild_id], references: [id])
|
|
|
|
|
goods Good[]
|
|
|
|
|
|
|
|
|
|
@@index([complex_id], map: "good_categories_complex_id_fkey")
|
|
|
|
|
@@index([guild_id], map: "good_categories_guild_id_fkey")
|
2026-03-07 11:25:11 +03:30
|
|
|
@@map("good_categories")
|
|
|
|
|
}
|