US-311: Configure Leave Types & Basic Accrual¶
1. Story Title¶
Leave type configuration with monthly accrual
2. Context / Background¶
HR needs to define standard leave categories and simple accrual to support requests.
3. User Persona¶
Primary: Priya – HR Manager
4. Problem Statement¶
No system for tracking standardized leave categories & balances.
5. Desired Outcome¶
Priya can configure leave types (Vacation, Sick) and monthly accrual rules; system updates balances nightly.
6. Business Value¶
Enables transparent leave management, reducing manual tracking errors.
7. Scope (In / Out)¶
In: create/update leave type, set monthly accrual amount, manual balance adjustment. Out: Complex tenure-based tiers, carry-over rules, pro-rated mid-month hires.
8. Acceptance Criteria (BDD)¶
Scenario: Create leave type
Given HR is on leave config page
When she adds Vacation with 8 hours monthly accrual
Then type is saved
And accrual job includes the new type
Scenario: Accrual job updates balance
Given an employee with 0 Vacation hours
When monthly accrual runs
Then balance becomes 8
Scenario: Manual adjustment
Given employee has 8 Vacation hours
When HR adds 4 hours adjustment with reason
Then balance shows 12
And adjustment is logged
Scenario: Duplicate type prevented
Given Vacation type exists
When HR attempts to create Vacation again
Then validation error shown
9. UX Notes / References¶
Config table + modal form; adjustment panel with reason dropdown.
10. Data / Domain Model Impact¶
LeaveType entity; LeaveBalance records per employee; AccrualJob event.
11. NFR Touchpoints¶
- Performance: accrual batch completes < 2 min for 10k employees.
- Observability: accrual run metrics + success/failure events.
12. Dependencies¶
Employee profiles (US-301). Scheduling/job infrastructure.
13. Risks & Mitigations¶
| Risk | Impact | Probability | Mitigation |
|---|---|---|---|
| Accrual job scaling | Delay balances | Low | Efficient batched SQL updates |
| Manual adjustments abuse | Data integrity | Low | Require reason + audit logging |
14. Estimation Support¶
- Leave type CRUD
- Balance model
- Accrual job
- Adjustment flow
15. Analytics / Success Metrics¶
Accrual success rate; adjustment frequency.
16. Rollout / Release Strategy¶
Enable Vacation first; add Sick after verifying accrual job stability.
17. Definition of Ready Checklist¶
- Entity schema agreed
- Batch job approach validated
18. Definition of Done Checklist¶
- Tests for job & CRUD pass
- Audit events logged
19. Open Questions¶
- Need negative balance support?
Version: 1.0