Skip to content

Un-mock the Timesheet screen and wire it to the Timesheet API (GA-008) - #446

Merged
Krisha190235 merged 1 commit into
mainfrom
Rana7xi/feature/timesheet-api
Jul 31, 2026
Merged

Un-mock the Timesheet screen and wire it to the Timesheet API (GA-008)#446
Krisha190235 merged 1 commit into
mainfrom
Rana7xi/feature/timesheet-api

Conversation

@Rana7xi

@Rana7xi Rana7xi commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

What this does

The Timesheet screen was reading from the attendance endpoint and working
out the hours on the phone, which ignored break time. It now loads from the
Timesheet API and shows the hours the backend already works out.

Changes

  • New API client for the timesheet endpoints
  • The screen loads from GET /timesheets instead of GET /attendance/:userId
  • Hours come from the backend, nothing is calculated on the phone
  • New Timesheet Details screen loads one record from GET /timesheets/:id
  • Loading, error and empty are separate states, with a retry button on error
  • Added the new text to all six language files

Testing

Tested on the Android emulator with two completed shifts, one normal day
shift and one that runs overnight across midnight. The hours on screen match
the API response. The detail view opens and the empty state works.
Type check, lint and format all pass.

TimeSheets page TimeSheets Detail page Error page

@Krisha190235

Copy link
Copy Markdown
Collaborator

The code is correct and I verified the backend contract fully matches (serializer fields, list {page,limit,total,timesheets}, both routes, guard-token scoping). It's also a cleaner, more complete implementation than the earlier timesheet work — proper endpoint, detail screen, totals, error/retry, i18n. The three notes I raised (pagination cap, formatHours decimals, UTC/local dates) are cosmetic follow-ups, not merge blockers.

@Krisha190235
Krisha190235 merged commit 2cacb1b into main Jul 31, 2026
3 checks passed
@Krisha190235
Krisha190235 deleted the Rana7xi/feature/timesheet-api branch July 31, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants