Skip to main content

EKAJAYA - DRIVER

🚛 Technical Specification: Driver Setup


📋 Feature Overview

AttributeDetail
Module📂 Directory (DRIVER)
Feature NameDriver Profile & Bank Info Management
DescriptionManages the full lifecycle of a driver profile, including personal details, license validity (GDL, Passport), bank information, and system access (PWA Login).
User Guide📄 [Ekajaya Admin User Guide - Directory Module, Section 2]

đŸ•šī¸ Functional Workflow

  • 📍 Navigation  Go to Directory > Driver 
  • đŸ‘ī¸ Listing View Paginated list displaying Name, ID, Join Date, License Expiry. Filters: Company, Name.
  • ➕ Add Action Click the + button to register a new driver.
  • đŸĻ Bank Info Click the Bank icon on the listing to manage banking details.
  • 👤 Activate User Inside Driver Edit, use action to create System User for mobile app access.
  • đŸ—‘ī¸ Delete Action Soft delete (requires validation against Carriers).

đŸ› ī¸ Technical Implementation

A. Permissions & Access Control

Note: Access is granular, separating general driver info from sensitive bank info.
ScopePermission CodeDescription
Menu VisibilityDRIVER.MENUSidebar menu visibility.
Listing AccessDRIVER.LISTINGAccess to /listing-driver-manage.
Create/EditDRIVER.UPDATEControls Add/Edit capabilities.
View DetailsDRIVER.VIEWRead-only access to driver details.
DeleteDRIVER.DELETEDelete capability.
Bank Info ViewDRIVER_BANK_INFO.VIEWAccess to Bank Info page.
Bank Info EditDRIVER_BANK_INFO.UPDATEAbility to save/update bank details.

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Driver List
Endpoint
/drivers/getQuery
Method
POST
Key Params
join: company
filter: 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-dd string format before sending to the API.