Project

General

Profile

Bug #2748

sation Visit expenses and personal expenses UI Implementation

Added by Prashant Jain about 2 months ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Start date:
06/18/2026
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

API routes
Feature Base route
EmployeeAdvance
api/v1/station/employee-advances
EmployeeExpenseClaim
api/v1/station/employee-expenses
Call them from CMS the same way you call other api/v1/station/... endpoints (through your API gateway / station-service host).

Authentication
CMS user logs in → use the Bearer token on each request.
Endpoints are gated by [RequirePermission], not a separate CMS-only API.
There is a Postman collection at docs/postman/employee-expense-advance-approval.postman_collection.json for the full approval workflow.
Permissions by CMS role
Permission Typical CMS roles
stations.expense.submit
Roles with station/accounting view (technicians, managers, etc.)
stations.expense.view_own
Same as above
stations.expense.view_all
tenant_admin, company_admin, manager
stations.expense.approve_manager
tenant_admin, company_admin, manager
stations.expense.approve_finance
tenant_admin, company_admin
stations.expense.post
tenant_admin, company_admin, manager
stations.expense.advance.manage
tenant_admin, company_admin
stations.expense.advance.view_own
Anyone who can submit expenses
If a CMS user gets 401/403, assign the right permission to their role in tenant role management.

Main endpoints for CMS UI
Employee expenses (EmployeeExpenseClaimController):

GET /employee-expenses — list + summary ledger
GET /employee-expenses/users — employee picker (role-scoped)
GET /employee-expenses/{id} — detail
POST /employee-expenses?draft_only=true|false — create/update (JSON or multipart with attachments)
POST .../submit, approve-manager, approve-finance, reject, post, cancel
Attachment presign/upload/download endpoints under /{claimId}/attachments/...
GET /employee-expenses/tech-visits/{techVisitId}/expense-stations — tech visit linkage
Employee advances (EmployeeAdvanceController):

GET /employee-advances/balance — imprest balance
GET /employee-advances — list
POST /employee-advances — create/update advance
POST .../submit, approve-manager, approve-finance, reject, post, cancel
GET/POST /employee-advances/remittances — cash remittances
CMS-specific behavior already built in
User picker visibility by role (tenant_admin → managers/technicians; manager → technicians; finance/admin → broader).
Tech visit filtering via tech_visit_id on expense list.
Multipart uploads for expense receipts (form field payload + attachments files).
Summary
You can wire these directly into CMS screens for expense claims, advances, approvals, and imprest balance — no separate API layer is required. Ensure each CMS role has the permissions above, and use the Postman collection or Swagger (non-production) to shape request/response DTOs for the UI.

If you want, I can map specific CMS screens (e.g. tech visit expenses, manager inbox, finance approval) to the exact endpoints and query params.

#1

Updated by Yashaditya Singh about 1 month ago

Completed the Employee Advances System UI. This included implementing the advances listing page, balance summary cards, employee/status/date filters, pagination, and API integrations. I completed the Create Advance, Submit, Manager Approval, Finance Approval, Reject, Cancel, and Post workflows along with validation handling and permission-based actions. I also refined the UI to match project standards by updating filter layouts, table styling, column alignment, status chips, branded button colors, and action icons. Finally, I tested all workflows, filters, validations, permissions, and overall user experience to ensure the module is functioning correctly.

#2

Updated by Yashaditya Singh about 1 month ago

Worked on the Employee Expenses module, focusing on Claims, Approvals, and Advances. I fixed the Apply button refresh behavior, verified filter and API integration, and implemented mandatory Approval Remarks validation for claim approval and rejection actions. I also tested the updated workflows and validated the overall expense claim process to ensure proper functionality and user experience.

#3

Updated by Yashaditya Singh about 1 month ago

Today I tested and validated the Employee Advances and Employee Expense Claims modules, thoroughly verifying their functionality across different workflows. During testing, I identified multiple issues related to the approval flow, claim actions, UI behavior, and API responses, and worked on fixing them. I also verified the implemented fixes to ensure the pages function correctly and the workflows behave as expected.

#4

Updated by Yashaditya Singh about 1 month ago

Today I tested and validated the Tech Visit Plan and Employee Expense modules by verifying end-to-end workflows, UI behavior, API responses, and approval processes. During testing, I identified and fixed multiple issues related to claims, approvals, validations, and page functionality, and revalidated the fixes to ensure the modules were working as expected.

#5

Updated by Yashaditya Singh about 1 month ago

I updated the advance creation flow by separating draft and submit functionality, removed the automatic submit API call after creating an advance, and started implementing submission from the Advance Details screen. I also debugged the advance submit API, traced the request flow through the controller, service, and repository, validated the database status updates, and investigated the issue causing the submit API to return a 404.

Also available in: Atom PDF