Payroll Section in Notes List
1. What does this feature do? (High-Level Overview)
Section titled “1. What does this feature do? (High-Level Overview)”This section provides a payroll summary inside Notes List based on the selected date range. It allows users to review calculated total hours and total pay without leaving the notes workflow. From this component, the payroll request is scoped to the logged-in user (provider_id = authenticated user id).
2. Who is this for? (Roles & Permissions)
Section titled “2. Who is this for? (Roles & Permissions)”- Authenticated users who can access Notes List: can view payroll summary when filters are valid.
- Payroll request is scoped to the authenticated user id as provider context in backend call.
- Users do not need export-related permissions to see payroll section.
Required permissions used by this feature path:
- No explicit payroll-specific permission is checked in this component.
- Access depends on entering Notes List route and valid date filter state.
3. Business Rules & Enforcements
Section titled “3. Business Rules & Enforcements”- Rule 1: Payroll data is requested only when both date_start and date_end exist.
- Rule 2: When date range is missing, payroll list is cleared and guidance message is shown.
- Rule 3: Payroll filter is derived from Notes filters (start_date, end_date, patient_id, provider_id, note_type).
- Rule 4: Backend request always attaches authenticated user id as provider_id in params.
- Rule 5: If start_date is later than end_date, an error modal is shown and payroll data is reset.
- Rule 6: On invalid date-range error path, search date fields are cleared in child filter state.
- Rule 7: On successful response, payroll rows are rendered from response.data.
- Rule 8: On backend error, payrollErrorMsg is set and filtersReady becomes false.
- Rule 9: If payrollErrorMsg exists, an alert is rendered with contextual instruction text.
- Rule 10: If no error and payroll list is empty, table shows No data available row.
4. UI Placement
Section titled “4. UI Placement”- Feature location: Notes List page, below the notes table/pagination block.
- Section title: Payroll.
- Table columns:
- Name
- Total Hours
- Total Pay
- Auxiliary alerts:
- Error/instruction alert when payrollErrorMsg exists.
- Guidance alert when date_start/date_end are missing.
5. How-To Guide (Step-by-Step)
Section titled “5. How-To Guide (Step-by-Step)”Scenario A: View payroll totals for selected date range
Section titled “Scenario A: View payroll totals for selected date range”- Open Notes List.
- Select valid From and To dates.
- Wait for notes filter application.
- Scroll to Payroll section.
- Review Name, Total Hours, and Total Pay values.
Scenario B: View payroll with additional filters
Section titled “Scenario B: View payroll with additional filters”- Set From and To dates.
- Optionally apply Patient, Provider, or Note Type filters.
- Confirm payroll section refreshes for current filter context.
Scenario C: Recover from invalid dates
Section titled “Scenario C: Recover from invalid dates”- Set Start date later than End date.
- Observe error modal.
- Re-enter valid date range.
- Verify payroll section loads again.
6. What happens if…? (Edge Cases / FAQ)
Section titled “6. What happens if…? (Edge Cases / FAQ)”-
Q: What happens if start and end dates are not selected?
-
A: Payroll request is not executed and user sees guidance to select both dates.
-
Q: What happens if start date is greater than end date?
-
A: Error modal appears, payroll is cleared, and date fields are reset.
-
Q: What happens if backend returns an error message?
-
A: payrollErrorMsg is shown in alert and payroll section is marked not ready.
-
Q: What happens if backend returns success with empty data?
-
A: Payroll table renders a No data available row.
-
Q: Is payroll paginated in this section?
-
A: No pagination controls are rendered for payroll in current template.