ASSET1 统一电子资产与固定资产台账
这个提交包含在:
@@ -111,6 +111,21 @@ enum AssetCardStatus {
|
||||
archived
|
||||
}
|
||||
|
||||
enum AssetType {
|
||||
fixed_asset
|
||||
electronic_document
|
||||
electronic_system
|
||||
code_repository
|
||||
backup_media
|
||||
}
|
||||
|
||||
enum AssetSensitivityLevel {
|
||||
public_candidate
|
||||
internal
|
||||
confidential
|
||||
strictly_confidential
|
||||
}
|
||||
|
||||
enum InventoryCheckScopeType {
|
||||
all
|
||||
legal_entity
|
||||
@@ -639,6 +654,8 @@ model Employee {
|
||||
purchase_attachments_uploaded PurchaseAttachment[] @relation("PurchaseAttachmentUploader")
|
||||
purchase_order_archives PurchaseOrderArchive[] @relation("PurchaseOrderArchiveArchivedBy")
|
||||
assigned_asset_cards AssetCard[] @relation("AssetCardAssignee")
|
||||
owned_asset_cards AssetCard[] @relation("AssetCardOwner")
|
||||
kept_asset_cards AssetCard[] @relation("AssetCardKeeper")
|
||||
asset_assignments AssetAssignment[]
|
||||
asset_transfers_from AssetTransfer[] @relation("AssetTransferFromEmployee")
|
||||
asset_transfers_to AssetTransfer[] @relation("AssetTransferToEmployee")
|
||||
@@ -1198,6 +1215,8 @@ model AssetCard {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
asset_no String @unique
|
||||
name String
|
||||
asset_type AssetType @default(fixed_asset)
|
||||
sensitivity_level AssetSensitivityLevel @default(internal)
|
||||
category_id String @db.Uuid
|
||||
legal_entity_id String @db.Uuid
|
||||
cost_center_id String @db.Uuid
|
||||
@@ -1206,6 +1225,16 @@ model AssetCard {
|
||||
location String?
|
||||
status AssetCardStatus @default(in_stock)
|
||||
assignee_employee_id String? @db.Uuid
|
||||
owner_employee_id String? @db.Uuid
|
||||
keeper_employee_id String? @db.Uuid
|
||||
archive_location String?
|
||||
external_ref String?
|
||||
source_hash String?
|
||||
verification_no String? @unique
|
||||
confidentiality_note String?
|
||||
metadata Json?
|
||||
last_verified_at DateTime? @db.Date
|
||||
expires_at DateTime? @db.Date
|
||||
activated_at DateTime? @db.Date
|
||||
retired_at DateTime? @db.Date
|
||||
|
||||
@@ -1219,15 +1248,23 @@ model AssetCard {
|
||||
cost_center CostCenter @relation(fields: [cost_center_id], references: [id], onDelete: Restrict)
|
||||
purchase_request PurchaseRequest? @relation(fields: [purchase_request_id], references: [id], onDelete: SetNull)
|
||||
assignee Employee? @relation("AssetCardAssignee", fields: [assignee_employee_id], references: [id], onDelete: SetNull)
|
||||
owner Employee? @relation("AssetCardOwner", fields: [owner_employee_id], references: [id], onDelete: SetNull)
|
||||
keeper Employee? @relation("AssetCardKeeper", fields: [keeper_employee_id], references: [id], onDelete: SetNull)
|
||||
assignments AssetAssignment[]
|
||||
transfers AssetTransfer[]
|
||||
inventory_items InventoryCheckItem[]
|
||||
|
||||
@@index([asset_type], map: "idx_asset_cards_asset_type")
|
||||
@@index([sensitivity_level], map: "idx_asset_cards_sensitivity")
|
||||
@@index([category_id], map: "idx_asset_cards_category")
|
||||
@@index([legal_entity_id], map: "idx_asset_cards_legal_entity")
|
||||
@@index([cost_center_id], map: "idx_asset_cards_cost_center")
|
||||
@@index([purchase_request_id], map: "idx_asset_cards_purchase_request")
|
||||
@@index([assignee_employee_id], map: "idx_asset_cards_assignee")
|
||||
@@index([owner_employee_id], map: "idx_asset_cards_owner")
|
||||
@@index([keeper_employee_id], map: "idx_asset_cards_keeper")
|
||||
@@index([source_hash], map: "idx_asset_cards_source_hash")
|
||||
@@index([last_verified_at], map: "idx_asset_cards_last_verified")
|
||||
@@index([status], map: "idx_asset_cards_status")
|
||||
@@map("asset_cards")
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户