EKAJAYA - DRIVER
đ Technical Specification: Driver Setup
đ Feature Overview
đšī¸ Functional Workflow
đ ī¸ Technical Implementation
A. Permissions & Access Control
Note: Access is granular, separating general driver info from sensitive bank info.
| Scope | Permission Code | Description |
|---|---|---|
| Menu Visibility | DRIVER.MENU |
Sidebar menu visibility. |
| Listing Access | DRIVER.LISTING |
Access to /listing-driver-manage. |
| Create/Edit | DRIVER.UPDATE |
Controls Add/Edit capabilities. |
| View Details | DRIVER.VIEW |
Read-only access to driver details. |
| Delete | DRIVER.DELETE |
Delete capability. |
| Bank Info View | DRIVER_BANK_INFO.VIEW |
Access to Bank Info page. |
| Bank Info Edit | DRIVER_BANK_INFO.UPDATE |
Ability to save/update bank details. |
B. API Interaction
Base URL:
${environment.baseApiUrl}1. Retrieve Driver List
Endpoint
/drivers/getQuery
Method
POST
Key Params
join: companyfilter: isDeleted||$eq||0 (plus companyId, fullName)2. Create Driver
Endpoint
/drivers/create
Method
POST
{
"companyId": Number,
"fullName": "String",
"identificationNumber": "String",
"licenseExpiryDate": "YYYY-MM-DD",
"gdlExpiryDate": "YYYY-MM-DD",
"isConnected": false
}
3. Update Driver
Endpoint
/drivers/update
Method
POST
Payload is same as Create, but includes "id": Number.
4. User Activation (PWA Access)
Endpoint
/admin/createUser
Method
POST
Trigger
activateUser() function in AddDriverManagePage.Logic
Creates a record in the users table. Upon success, the userId is linked back to the driver via
/drivers/update.5. Detach User
Endpoint
/driver/detachDriver
Method
POST
Purpose
Removes system access without deleting the driver profile.
{ "driverId": Number }
6. Bank Information (Sub-Module)
List/Get
/driverBankInfos/getQuery (driverId filter)
Create
/driverBankInfos/create
Update
/driverBankInfos/update
{
"driverId": Number,
"accountCode": "String",
"bankBeneficiaryName": "String",
"bankBeneficiaryAccountNo": "String",
"driverBeneficiaryRelationship": "String"
}
C. Validation & Business Logic
1. Unique ID Validation
- Trigger: On Save.
- Logic: Calls
/drivers/getQuery. Filter:identificationNumber||$eq||{inputID};isDeleted||$eq||0. - Error: "Driver identification number already exists".
2. Pre-Delete Check (Carrier Tagging)
Before deleting, the system checks if the driver is assigned to a Carrier (Truck).
- Endpoint:
/carriers/getQuery - Filter:
driverId||$eq||{id};isDeleted||$eq||0 - Error: "Unable to delete Driver due to tagging to carrier."
3. Date Formatting
- Library: Luxon (DateTime).
- Logic: Frontend converts UI date objects to
yyyy-MM-ddstring format before sending to the API.