feat: add AssetItem Prisma model + migration
This commit is contained in:
@@ -63,6 +63,35 @@ model Employee {
|
||||
@@map("employees")
|
||||
}
|
||||
|
||||
// Fixed, closed set of 4 values tied to the domain (see docs/
|
||||
// asset-license-management.md's "Data model (sơ bộ)" table) — native
|
||||
// Postgres enum, same rationale as RequestType above.
|
||||
enum AssetItemStatus {
|
||||
in_stock
|
||||
assigned
|
||||
repair
|
||||
retired
|
||||
}
|
||||
|
||||
// Hardware inventory — see docs/asset-license-management.md's "Data model
|
||||
// (sơ bộ)" table (serial number, model, ngày mua, bảo hành, trạng thái).
|
||||
// No Vendor/Assignment relation yet — those entities don't exist yet
|
||||
// (see "Việc còn dở" in CLAUDE.md), so this is a standalone entity for now,
|
||||
// same starting shape as Employee before Request grew an FK to it.
|
||||
// warrantyEndDate is nullable: not every asset has known warranty terms at
|
||||
// intake time (smallest sensible assumption — doesn't block creation).
|
||||
model AssetItem {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
serialNumber String @unique @map("serial_number")
|
||||
model String
|
||||
purchaseDate DateTime @map("purchase_date") @db.Date
|
||||
warrantyEndDate DateTime? @map("warranty_end_date") @db.Date
|
||||
status AssetItemStatus @default(in_stock)
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(6)
|
||||
|
||||
@@map("asset_items")
|
||||
}
|
||||
|
||||
// Minimal internal auth accounts — NOT company SSO (deliberately ruled out,
|
||||
// see CLAUDE.md / auth decision notes). A handful of trusted IT staff
|
||||
// accounts, created by hand via scripts/create-user.ts, no self-registration.
|
||||
|
||||
Reference in New Issue
Block a user