ERP HR Employee-Lifecycle and Policy-Operations Skill
Overview
This skill covers five related HRMS operations:
- Onboarding closeout — verifying leave and payroll setup before approving close
- Remote-work policy case review — folder readiness and formal notice quality
- Recruitment reconciliation — candidate outcomes, offer verification, notice follow-up, and payroll handoff
- Leave source precedence — determining the authoritative leave policy when sources conflict
- Payroll assignment and accrual readiness — verifying submitted salary assignment and accrual batch status
API Usage Workflow
Endpoint Reference
All endpoints are under the base URL. Useful public endpoints:
| Endpoint | Purpose |
|---|---|
GET /api/manifest |
Module inventory, record counts, seed |
GET /api/summary |
Aggregate counts, departmental structure |
GET /api/employees |
Employee profiles (summary-level, possibly stale) |
GET /api/payroll-ledgers |
Authoritative leave assignments, salary assignments, and ledger entries |
GET /api/cases |
All case headers |
GET /api/cases/<case_id> |
Case detail including approvals, attachments, audit events, comments |
GET /api/policies |
All policy documents |
GET /api/policies/<policy_id> |
Policy detail with sections |
GET /api/recruitment |
Recruitment openings with candidates, offer register, cost ledger, notice packets, payroll precheck records |
GET /api/documents |
Document folders with files, required files, required tags, and readiness status |
GET /api/messages |
Formal notices and messages with quality assessment and defect lists |
GET /api/notifications |
Notification records (often mirrors messages) |
GET /api/audit |
All audit events |
GET /api/audit/<event_id> |
Single audit event detail |
Recommended Investigation Order
- Start with
/api/manifestto understand the environment shape and record counts. - Locate the subject entity — employee via
/api/employees, case via/api/cases, or recruitment opening via/api/recruitment. - Pull authoritative records from
/api/payroll-ledgersfiltered byemployee_id. Never treat the employee profile summary as authoritative for leave or payroll; it may be stale. - Retrieve case detail via
/api/cases/<case_id>which embeds approvals, attachments, audit events, and comments. - Check folder readiness via
/api/documents— compare actual files and tags against required lists. - Inspect notices via
/api/messagesor thenotice_packetsinside/api/recruitment. - Verify with audit events —
/api/auditor embedded in case detail. - Consult policy via
/api/policies/<policy_id>for the governing business rule. - For recruitment, pull
/api/recruitmentfor the full opening packet: candidates, offer register, cost ledger, notice packets, and payroll precheck records.
Core Business Rules
1. Leave Source Precedence (Policy LEAVE-SRC-001)
Rule: The latest approved or submitted leave assignment record for the period controls. Draft, voided/superseded, and obsolete records are always excluded, even when the employee profile summary shows different values.
Authoritative record type: Leave assignment (in /api/payroll-ledgers filtered by record_type).
Precedence order:
- Approved leave assignment (highest authority)
- Submitted leave assignment
- Employee profile summary (stale, low trust — use only when no assignment records exist)
- Case summary only (lowest trust)
Other record types (People Ops adjustment, HRMS leave ledger, Payroll worksheet) are supporting records only — they do not determine the authoritative leave policy or balance.
When to ignore the profile summary: An approved or submitted leave assignment overrides the leave_balance_days and policy shown in /api/employees. The profile is an approximation; the ledger assignment is the source of truth.
2. Payroll Assignment Source (Policy PAY-SRC-001 §3.4)
Rule: Use the current submitted salary assignment. Draft planning assignments do not affect payroll readiness or accrual checks. Superseded records are obsolete.
Authoritative record type: Salary assignment with status Submitted.
Precedence order:
- Submitted salary assignment (authoritative)
- Draft — excluded
- Superseded — excluded
Effective date comes from the updated_at field of the submitted assignment.
3. Folder Readiness (Policy POL-DOCS-2026 §5.1)
Rule: A folder is not ready unless ALL required files AND ALL required tags are present.
ready: trueonly when:required_files ⊆ actual filesANDrequired_tags ⊆ actual tags- If any required file is missing →
ready: false - If any required tag is missing →
ready: false - The
readyfield in/api/documentsis pre-computed and authoritative.
4. Formal Notice Quality
Required elements for a valid formal notice:
- Acknowledgement deadline
- Appeal instructions
- Correct policy reference
- Waitlist status (for waitlist notices specifically)
Recognized defect codes:
missing_ack_deadline— no acknowledgement deadline in the noticemissing_appeal_instructions— no appeal instructionsmissing_waitlist_status— waitlist notice omits waitlist statusmissing_correct_policy— references wrong/legacy policy
Quality determination:
valid— no defectsdefective— one or more defects present
Evidence sources (in priority order):
notice_packet_inspection— notice packets from/api/recruitmentor/api/messageswith explicitdefectsandqualityfieldsmessage_notice_inspection— message records withdefectsarrayscase_summary_only— fallback; lowest reliability
Notice quality in messages vs notifications: Messages and notifications typically contain the same data. Use the first source that has explicit quality and defects fields. When both exist and differ, prefer messages.
5. Recruitment Handoff Gate (Policy PAY-SRC-001 §4.2)
Rule: Payroll handoff is created only after a selected candidate has an accepted offer. The handoff assignment must be submitted; draft prechecks do not satisfy the assignment gate.
Candidate outcome source precedence:
- Committee decision + offer register confirmation (highest authority)
- Case summary only
- Message-only status (lowest)
Payroll handoff actions:
create_submitted_assignment_after_acceptance— selected candidate accepted; create and submit handoffcreate_payroll_precheck— preliminary check only, insufficient for gateno_payroll_handoff— no accepted candidate
Draft payroll precheck records (in /api/recruitment → payroll_precheck_records) are never acceptable for the handoff gate — only a submitted assignment satisfies the requirement.
Payroll handoff gate scoping:
accepted_offer_only— only the accepted candidate matters for payrollaccepted_offer_and_submitted_assignment— require both offer acceptance and submitted assignmentall_interviewed_candidates— broader scope (rare)
6. Audit Scope Rules
Three mutually exclusive audit scopes:
| Scope | Use when reviewing |
|---|---|
document_notice_findings_only |
Folder readiness or formal notice quality |
leave_source_precedence_only |
Determining authoritative leave policy |
payroll_assignment_readiness |
Verifying payroll assignment and accrual status |
Audit inclusion/exclusion rules:
- When scoped to one domain (e.g., leave), exclude audit events from adjacent domains (e.g., document/notice findings, payroll events).
- The audit event that directly addresses the domain question is the primary audit event.
- Supporting audit events are those whose
eventfield matches the domain being reviewed. - Events with mismatched domains (e.g.,
folder.tag_missingwhen doing leave precedence) must be inexcluded_audit_event_ids.
Audit event types and their domains:
leave.profile_mismatch→ leave scopepayroll.ready,payroll.draft_excluded→ payroll scopenotice.defect,folder.tag_missing,case.close_blocked→ document/notice scopecross_module.escalation_package→ cross-module (references related events; review each before assigning)
7. Closeout Gate Logic
Gate determination:
approval_sufficient_when_records_clean→ All required records present, no defective notices, no missing files/tags, drafts properly excludedapproval_not_sufficient_when_folder_or_notice_defective→ At least one of: missing required files, missing required tags, defective formal notice
Final control results:
approve_closeout— all records clean, closeout can proceedhold_for_folder_and_notice_defects— blocking issues found in folder or noticeready_with_monitoring— records are clean but the audit recommends ongoing monitoring (e.g.,payroll.readywith "ready_with_monitoring" detail)
8. Closeout Actions
approve_onboarding_close— records clean; proceed with closeblock_close_and_reissue_notice— defective notice; reissue required before closeopen_records_remediation— missing files/tags; open remediation workflow
Blockers:
missing_required_files— at least one required file absent from foldermissing_required_tags— at least one required tag absent from folderdefective_formal_notice— notice has one or more quality defects
Record Statuses and Their Meaning
| Status | Meaning | Authoritative? |
|---|---|---|
Approved |
Approved and active | Yes — for leave assignments |
Submitted |
Submitted and awaiting/live | Yes — for payroll assignments |
Draft |
Planning only, not live | No — always exclude |
Superseded |
Replaced by newer record | No — always exclude |
Output Field Conventions
Normalized Enum Labels
Always use the exact enum values from the answer template — never free-text descriptions. Key enums:
Source/gate labels:
approved_assignment_over_profile— precedence when an approved assignment beats the profile summaryapproved_assignment_current_period— leave source is the approved assignmentprofile_summary_current_period— leave source is the profile (only when no assignment exists)case_summary_only— fallback when nothing better is available
Control results:
approve_closeout/hold_for_folder_and_notice_defects/ready_with_monitoring
Status values:
submitted/draft/superseded
Notice quality:
valid/defective
Folder required tag action:
no_tag_action— tag is present, no action neededadd_required_tag— tag is missing, must be added
Remediation owners:
Records— missing files/tags in the document folderPeople Ops Compliance— policy violations or cross-module issuesPayroll QA— payroll-specific issues
Escalation actions:
block_close_and_reissue_notice/open_records_remediation/no_action
Calculation Rules
Recruitment Cost Total
Sum all amount values from the recruitment opening's cost_ledger array. Do not filter by label or line type — every ledger line item counts.
Leave Balance Days
Take approved_leave_days from the authoritative leave assignment record (not the employee profile and not from supporting ledger entries).
Accrual Readiness
Accrual is ready: true when:
- A submitted salary assignment exists for the employee
- The assignment references an accrual batch ID
- The audit confirms
payroll.readystatus
Date and Sorting Rules
Period Format
- Annual periods:
"2026" - Monthly periods:
"2026-03","2026-04", etc.
Record Sorting (for same employee, same record_type)
When multiple records exist, sort by status precedence:
Approved/Submitted(tie-break by most recentupdated_at)Superseded(excluded from authority)Draft(excluded from authority)
Within the same status, pick the most recently updated record (updated_at descending).
Policy Effective Date
All policies in this environment have effective_date: "2026-01-01".
Evidence Source Order
For case reviews, the evidence source order indicates which sources were consulted and in what priority:
approval_history_folder_notice_audit— full chain: approvals → folder checklist → notice inspection → audit detailfolder_notice_audit— folder, notice, and audit only (no approvals)audit_only— audit events only
Common Pitfalls
Trusting the employee profile summary. The
leave_balance_daysand policy in/api/employeescan be stale. Always verify against/api/payroll-ledgersfor the employee's leave and salary assignments.Including draft records. Draft assignments (leave or payroll) must always be excluded from the authoritative determination, even if they have a newer date or higher values than approved/submitted records.
Including superseded records. "Superseded" means the record was replaced. It is not authoritative and must be excluded. Use the superseding (newer approved/submitted) record instead.
Confusing record types. Only
Leave assignmentrecord types determine leave policy.People Ops adjustment,HRMS leave ledger, andPayroll worksheetentries are supporting records — their values do not override the assignment record.Assuming folder is ready when some files/tags exist. All required files AND all required tags must be present. Partial completeness = not ready.
Mixing audit scopes. When determining leave source precedence, exclude document/notice audit events. When reviewing folder/notice quality, exclude leave and payroll audit events. Audit events from the wrong domain will mislead the conclusion.
Assuming notice is valid because it was sent. A sent notice can still be defective. Always check the
qualityfield anddefectsarray in the message or notification record.Handoff for non-selected candidates. Only the accepted candidate triggers payroll handoff. Waitlisted and rejected candidates need notice follow-up, not payroll setup.
Draft payroll prechecks. Draft precheck records in recruitment data do NOT satisfy the payroll handoff gate. A submitted assignment is required.
Cost ledger filtering. Sum ALL cost ledger line items — do not filter by label or exclude any line.
Off-by-one in evidence precedence. When the audit event explicitly names the controlling record (e.g., "Approved assignment LA-118-APP-02 controls leave policy"), that audit finding is binding. Don't override it with your own record comparison.
Notice quality from wrong source. When
/api/messageshas explicitqualityanddefectsfields, use those rather than inferring quality from the case summary alone. If notice packets in/api/recruitmentare available for the candidate, those take priority.