feat(hrms): reconcile custom fields + add Employee/Exit Interview/Asset Assignment missing fields (TETRA-1354) #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/TETRA-1354-reconcile-custom-fields"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Mục tiêu
Gom Frappe custom field fixtures từ Layer 2 (
apps/api/src/modules/recruitment/migrations/*.jsontrong tetra repo) về vhrms làm single source of truth — xem TETRA-1354.Đồng thời thêm các custom field mà NestJS API đang query nhưng chưa có trong vhrms (phát hiện trong TETRA-1352).
Thay đổi
Custom Fields mới
previous_status,custom_rejection_reasontalent_pool,talent_pool_level,talent_pool_notes,talent_pool_date,talent_pool_skills,talent_pool_suitable_positionscustom_interview_modecustom_meeting_location,custom_video_call_linkcustom_applicant_instructionscustom_interviewer_employee_idscustom_interviewer_idcustom_locationcustom_notes,custom_suggestionscustom_nps_scorecustom_skip_reasoncustom_returnedcustom_returned_datecustom_return_conditioncustom_return_notescustom_gross_salarycustom_is_pregnantcustom_pregnancy_statuscustom_notesLý do chọn kiểu dữ liệu (field gây nhầm lẫn)
Employee.custom_pregnancy_status→Data(khôngSelect):separation.service.ts:242chỉ truthy-check, test dùng giá trị'pregnant'— Data đủ linh hoạt để thêmpost_maternity, v.v. mà không phải edit lại custom_fields.Employee.custom_gross_salary→Currency: match vớiJob Offer.custom_gross_salaryđã có trong vhrms (consistency + auto format VND).Exit Interview.custom_interviewer_id→Data(khôngLink Employee/User): interviewer là Tetra eOffice user UUID, có thể chưa sync về HRMS — dùng Link sẽ báo LinkValidationError.Asset Assignment.custom_return_condition→Selectvới 4 giá trị cố định (good/fair/broken/missing): khớp vớiAssetReturnDto+ defaultgoodtrongseparation.service.ts:1208.Property Setters (TETRA-1354)
Open | Screening | Interview | Offer | Offer Accepted | Hired | Hold | Rejected | Cancelled(default Frappe chỉ có 4).set_only_once = 0→ cho phép HR reschedule.Wiring hooks
setup/property_setters.py: thêmensure_job_applicant_property_setters(),ensure_interview_property_setters(), entry pointensure_all_property_setters().setup/__init__.py: gọiensure_all_property_setters()trong cảafter_installvàafter_migrate.Side note — Asset Assignment
Asset Assignmentkhông phải DocType mặc định của ERPNext/HRMS. NestJS (separation.service.ts:1160) có query doctype này nhưng bọc try/catch trả[]khi fail. Tạm thời ta skip provisioning field khi DocType chưa có, sẽ tự provision khi team enable module Asset.Verification local
tetra-eoffice-hrms-backend, chạycreate_custom_fields(get_custom_fields(), ignore_validate=True)+ensure_all_property_setters()thành công.Employee: 123 → 126 (+3)Exit Interview: 0 → 6 (+6)Job Offer Term: 0 → 1 (+1)Interview,Job Applicant,Job Offer,Job Opening,Job Requisition,Employee Separation: không đổi (đã có đủ)GET /api/v1/recruitment/offers,GET /api/v1/hrms/separations?status=pending_cancellation,GET /api/v1/hrms/separations/compliance-alerts.Tiếp theo
Sau khi PR này merge, tetra repo sẽ:
vendor/vhrms/với vhrms develop HEAD.bench migratevàoconfigure.sh(PR riêng).Refs: TETRA-1354, TETRA-1352