VSN-2006 : Correcting first phase validation of preapred passengers api call by Introducing email of connected user to track validator.
Refactor: Integration of Validator Email Into First-Phase Validation Workflow
This merge request introduces several refinements related to the first-phase validation flow. These changes focus on propagating the validator’s email address across the API, service layer, repository query, and client-side integration. The goal is to ensure accurate traceability of the user performing the validation, improve endpoint consistency, and maintain alignment across the backend and frontend layers.
Summary of Changes
1. Refactor: First Validation API Call
Commit: Adding email to first validation API call
The API call responsible for triggering first-phase validation has been extended to include a validator email parameter. This ensures that backend services can correctly identify the user performing the action.
2. Refactor: Dynamising Endpoint
Commit: Dynamising endpoint based on connected user email
The endpoint URL is now dynamically constructed based on the email of the authenticated user. This allows the UI to automatically send the correct validator email without requiring hardcoded or manually injected values.
3. Refactor: Store Method
Commit: Changing the endpoint call during store function by passing email
The store function that orchestrates the validation invocation has been updated to pass the validator email consistently. This aligns the data flow between UI components and the service layer.
4. Refactor: Integration
Commit: Correcting store method invocation by retrieving email & passing it to activation method
A final adjustment ensures full integration: the validated email is retrieved before calling the activation method, guaranteeing that all validation actions are traced back to the correct user.
Technical Rationale
These updates resolve inconsistencies between frontend and backend logic regarding the validator identity. Previously, validation actions lacked direct attribution to the user triggering them, limiting transparency and auditability. By injecting the validator email throughout the workflow, the system now supports:
- Better traceability of validation actions
- More robust backend auditing and reporting
- Reduced ambiguity in update queries
- Improved alignment with repository-level operations that require email propagation
- Cleaner and more maintainable code across services, controllers, and client modules
Impacted Areas
- Frontend Service Calls: Construction of dynamic endpoints and email propagation
- Store Functions & Integration Points: Updated invocation logic
- Backend Endpoints: Email added as a required parameter
- Validation Flow: Full integration of validator identity across stages
Expected Improvements
- Stronger maintainability and consistency across code layers
- Improved clarity in validation operations
- Enhanced compliance with internal business rules requiring user attribution
- More resilient and predictable update operations in the data layer
If you want, I can also generate a shorter version, a version tailored for a GitLab MR template, or one combining this with previous MR descriptions.
Closes VSN-2006