Implemented an API to retrieve a pending checkout and pending regularization request for logged in employee #70

Merged
vikas.nale merged 1 commits from Ashutosh_Task#346_Pending_Attendance into Issue_May_4W 2025-05-24 04:34:03 +00:00
Collaborator
  • Get Tenant and Employee Info:
    • Retrieve the current tenant ID using _userHelper.GetTenantId().
    • Get the currently logged-in employee using _userHelper.GetCurrentEmployeeAsync().
  • Fetch Attendance Records:
    • Query the Attendes table for records:
      • Belonging to the current tenant
      • Associated with the logged-in employee
  • Check Attendance Records:
    • If attendance records exist:
      • Calculate:
        • PendingRegularization: Count of attendance entries with Activity == REQUEST_REGULARIZE
        • PendingCheckOut: Count of entries where OutTime is null (indicating the employee hasn’t checked out yet)
  • Prepare and Return Response:
    • Create an anonymous response object with the two counts.
    • Log an info message that pending items were fetched successfully.
    • Return a 200 OK response wrapped in ApiResponse
- **Get Tenant and Employee Info**: - Retrieve the current tenant ID using _userHelper.GetTenantId(). - Get the currently logged-in employee using _userHelper.GetCurrentEmployeeAsync(). - **Fetch Attendance Records**: - Query the Attendes table for records: - Belonging to the current tenant - Associated with the logged-in employee - **Check Attendance Records**: - If attendance records exist: - Calculate: - PendingRegularization: Count of attendance entries with Activity == REQUEST_REGULARIZE - PendingCheckOut: Count of entries where OutTime is null (indicating the employee hasn’t checked out yet) - **Prepare and Return Response**: - Create an anonymous response object with the two counts. - Log an info message that pending items were fetched successfully. - Return a 200 OK response wrapped in ApiResponse<object>.SuccessResponse(...). - **If No Records Found**: - Log an error message indicating no attendance entries exist. - Return a 404 Not Found with an error response.
ashutosh.nehete added 1 commit 2025-05-23 12:20:33 +00:00
vikas.nale merged commit 6b33c4baf4 into Issue_May_4W 2025-05-24 04:34:03 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/marco.pms.api#70
No description provided.