feat: 员工特殊状态台账(三期/工伤/医疗期)完整实现
This commit is contained in:
@@ -256,6 +256,7 @@ model Employee {
|
||||
leaveRecords LeaveRecord[]
|
||||
calendarEvents CalendarEvent[]
|
||||
workProcesses WorkProcess[]
|
||||
specialStatuses EmployeeSpecialStatus[]
|
||||
|
||||
@@unique([orgId, idCardHash])
|
||||
}
|
||||
@@ -1235,3 +1236,50 @@ model AttendancePublish {
|
||||
@@unique([orgId, month])
|
||||
@@index([orgId, month])
|
||||
}
|
||||
|
||||
// ========== 员工特殊状态台账(三期/工伤/医疗期等) ==========
|
||||
model EmployeeSpecialStatus {
|
||||
id String @id @default(cuid())
|
||||
orgId String
|
||||
org Organization @relation(fields: [orgId], references: [id], onDelete: Cascade)
|
||||
employeeId String
|
||||
employee Employee @relation(fields: [employeeId], references: [id], onDelete: Cascade)
|
||||
type String // PREGNANCY(三期) | WORK_INJURY(工伤) | MEDICAL_PERIOD(医疗期) | OTHER
|
||||
status String @default("ACTIVE") // ACTIVE(进行中) | RESOLVED(已结束) | PENDING(待处理)
|
||||
|
||||
// 通用时间节点
|
||||
startDate DateTime? // 开始日期
|
||||
endDate DateTime? // 预计结束日期
|
||||
actualEndDate DateTime? // 实际结束日期
|
||||
|
||||
// 三期专用
|
||||
expectedDueDate DateTime? // 预产期
|
||||
maternityLeaveStart DateTime? // 产假开始
|
||||
maternityLeaveEnd DateTime? // 产假结束
|
||||
nursingEndDate DateTime? // 哺乳期截止
|
||||
|
||||
// 工伤专用
|
||||
injuryDate DateTime? // 受伤日期
|
||||
injuryDescription String? // 伤情描述
|
||||
certificationDate DateTime? // 工伤认定日期
|
||||
certificationNo String? // 认定书编号
|
||||
disabilityLevel Int? // 伤残等级(1-10级)
|
||||
assessmentDate DateTime? // 鉴定日期
|
||||
|
||||
// 医疗期专用
|
||||
medicalMonths Int? // 医疗期月数
|
||||
medicalPeriodEnd DateTime? // 医疗期截止日
|
||||
|
||||
// 通用
|
||||
description String? // 备注
|
||||
attachments Json? // 附件列表 [{name, url}]
|
||||
timeline Json? // 操作时间线 [{time, action, by}]
|
||||
reminderDate DateTime? // 提醒日期
|
||||
createdBy String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([orgId, status])
|
||||
@@index([orgId, type])
|
||||
@@index([employeeId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user