R57 A1-A6:报销模板与差旅申请关联
这个提交包含在:
@@ -842,6 +842,23 @@ model ExpenseStandard {
|
||||
@@map("expense_standards")
|
||||
}
|
||||
|
||||
model ReimbursementTemplate {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
name String @db.VarChar(100)
|
||||
description String?
|
||||
items Json @default("[]")
|
||||
sort_order Int @default(0)
|
||||
enabled Boolean @default(true)
|
||||
|
||||
created_at DateTime @default(now())
|
||||
created_by String? @db.Uuid
|
||||
updated_at DateTime @default(now()) @updatedAt
|
||||
updated_by String? @db.Uuid
|
||||
|
||||
@@index([enabled, sort_order])
|
||||
@@map("reimbursement_templates")
|
||||
}
|
||||
|
||||
model DocumentSequence {
|
||||
document_type String @id
|
||||
prefix String
|
||||
@@ -1269,6 +1286,7 @@ model ReimbursementForm {
|
||||
paid_at DateTime?
|
||||
paid_by String? @db.Uuid
|
||||
project_id String? @db.Uuid
|
||||
linked_travel_request_id String? @db.Uuid
|
||||
|
||||
created_at DateTime @default(now())
|
||||
created_by String? @db.Uuid
|
||||
@@ -1280,6 +1298,7 @@ model ReimbursementForm {
|
||||
paid_by_employee Employee? @relation("ReimbursementPaidBy", fields: [paid_by], references: [id], onDelete: SetNull)
|
||||
department Department @relation(fields: [department_id], references: [id], onDelete: Restrict)
|
||||
project Project? @relation(fields: [project_id], references: [id], onDelete: SetNull)
|
||||
travel_request TravelRequest? @relation(fields: [linked_travel_request_id], references: [id], onDelete: SetNull)
|
||||
|
||||
items ReimbursementItem[]
|
||||
invoice_pool_items InvoicePool[]
|
||||
@@ -1293,6 +1312,7 @@ model ReimbursementForm {
|
||||
@@index([department_id])
|
||||
@@index([paid_by])
|
||||
@@index([project_id], map: "idx_reimbursement_forms_project")
|
||||
@@index([linked_travel_request_id], map: "idx_reimbursement_forms_linked_travel_request")
|
||||
@@index([status])
|
||||
@@index([reimbursement_date])
|
||||
@@index([owner_id, status, updated_at], map: "idx_reimbursement_owner_status_updated_at")
|
||||
@@ -2479,6 +2499,7 @@ model TravelRequest {
|
||||
|
||||
segments TravelRequestSegment[]
|
||||
travel_orders TravelOrder[]
|
||||
linked_reimbursements ReimbursementForm[]
|
||||
reconciliation_items TravelReconciliationItem[]
|
||||
card_authorizations CardAuthorization[]
|
||||
card_transactions CardTransaction[]
|
||||
|
||||
在新工单中引用
屏蔽一个用户