feat(time): show reviewable submit/change/approve history in approvals #416
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-340-timesheet-approval-history"
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?
The Timesheet Approvals & History view now surfaces a per-timesheet "History" button (on pending and decided rows alike) that opens a modal with a chronological submit/change/approve/reject timeline plus the applicable timesheet rules, so a reviewer can audit how a timesheet reached its current state even after it is approved.
The timeline is composed entirely from data the server already exposes, so no new endpoint is needed: each time entry's created_at yields a "Logged" event and an updated_at strictly later yields an "Edited" change event (both attributed to the employee), and the week's rolled-up decision (decided_by / decided_at / rejection_reason, already carried on the approvals summary since PMS-506) yields the terminal Approved/Rejected event. Events are merged and sorted oldest-first by build_timesheet_history, a pure function unit-tested natively (ordering, edit detection, decision folding, post-approval survival, blank-reviewer fallback).
Alongside the timeline the modal shows the applicable timesheet rules: the per-day max-hours cap (/settings/time_tracking/max_hours_per_day) and the tenant rounding rules (/time-rounding-rules), each fetched tolerantly so a missing setting or older server simply omits that line. RemoteTimeEntry gains optional created_at/updated_at fields (default-tolerant) to drive the derivation.
#MAPPS-340