US-312: Employee Views Leave Balance & Submits Request¶
1. Story Title¶
Leave balance display & request submission
2. Context / Background¶
After leave types & accrual (US-311), employees need to consume balances via a request workflow.
3. User Persona¶
Primary: Mark – Employee Secondary: Manager (approval path)
4. Problem Statement¶
Without self-service visibility, employees rely on HR for balance inquiries; manual process for requesting leave.
5. Desired Outcome¶
Employee sees current balances and submits a leave request specifying dates & type; system persists and notifies manager.
6. Business Value¶
Reduces HR workload; improves transparency and satisfaction.
7. Scope (In / Out)¶
In: balance display, request form (type, start, end, note), basic validation, notification event. Out: Partial-day requests, multi-approver chains, complex blackout rules.
8. Acceptance Criteria (BDD)¶
Scenario: View balances
Given employee has Vacation 12h, Sick 4h
When he opens leave page
Then those balances are displayed
Scenario: Submit request
Given employee has sufficient Vacation hours
When he submits a request for 8h
Then request status is Pending
And manager notified
Scenario: Insufficient balance
Given employee has Vacation 4h
When he requests 8h Vacation
Then validation error insufficient balance
Scenario: Overlapping request prevented
Given a pending request covering 2025-03-10 to 2025-03-11
When submitting another Vacation request for those dates
Then overlap error shown
9. UX Notes / References¶
Balances summary panel + request form drawer; inline errors under fields.
10. Data / Domain Model Impact¶
LeaveRequest entity: employeeId, typeId, startDate, endDate, hours, status, note.
11. NFR Touchpoints¶
- Performance: balance + recent requests load < 500ms.
- Observability: request creation + notification events traced.
- Security: employee only views own balances.
12. Dependencies¶
US-311 leave types & accrual; manager relationship retrieval.
13. Risks & Mitigations¶
| Risk | Impact | Probability | Mitigation |
|---|---|---|---|
| Balance stale due to late accrual job | Incorrect decisions | Low | On-demand recalculation fallback |
| Notification failure | Manager unaware | Medium | Retry queue + dashboard visibility |
14. Estimation Support¶
- Balance fetch service
- Request creation + validation
- Notification event
- UI integration
15. Analytics / Success Metrics¶
Request submission rate; denial reasons; average balance utilization.
16. Rollout / Release Strategy¶
Vacation type first; add Sick requests after stability.
17. Definition of Ready Checklist¶
- Validation rules confirmed
- Notification channel chosen
18. Definition of Done Checklist¶
- Scenario tests pass
- Events logged
19. Open Questions¶
- Need cancellation flow in MVP?
- Auto-calculate hours vs manual entry?
Version: 1.0