Skip to main content

EKAJAYA - DRIVER

🚛🚚 Technical Specification: Driver Setup


📋 Feature Overview

Attribute Detail
Module 📂 Directory (DRIVER)
Feature Name Driver Profile & Bank Info Management
Description Manages the full lifecycle of a driver profile, includingprofiles, personal details, license validitylicensing (GDL, Passport), and bank information,beneficiary andinfo. Handles system accessuser (creation for Driver PWA Login).access.
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.Expiry Filters:dates, Company,and Company. Filters available for Company and Name.
  • ➕ Add Action Click the + button to register a new driver.
  • âœī¸ Edit Action Click the Pencil icon to modify personal details.
  • đŸĻ Bank Info Click the Bank icon on(if thepermission listingallows) to manage bankingbeneficiary details.
  • 👤📱 Activate User Inside Driverthe Edit,Edit usescreen, actionan to"Activate createUser" Systemoption Userallows creating a login for mobilethe appDriver access.App.
  • đŸ—‘ī¸ Delete Action SoftClick deletethe (requiresTrash validationicon againstto Carriers).remove a driver.

đŸ› ī¸ Technical Implementation

A. Permissions & Access Control

Note: Access is granular,controlled separatingvia generalPermissionGuard driverand infocomponent-level from sensitive bank info.checks.
Scope Permission Code Description
Menu Visibility DRIVER.MENU Sidebar menu visibility.
ListingPage Access DRIVER.LISTING Access to /listing-driver-manage.
Create/EditCreate Action DRIVER.UPDATE Controls Add/Editthe capabilities.+ Add button on listing.
View DetailsAccess DRIVER.VIEWRead-only access to driver details.
DeleteDRIVER.DELETEDelete capability.
Bank Info ViewDRIVER_BANK_INFO.VIEW Access to /add-driver-bank-infomanage.
Edit/Save ActionDRIVER.UPDATEAbility to save changes.
Delete ActionDRIVER.DELETEVisibility of the Delete đŸ—‘ī¸ icon.
Bank Info EditAccessDRIVER_BANK_INFO.VIEWVisibility of the Bank icon.
Bank Info Update DRIVER_BANK_INFO.UPDATE Ability to save/updatesave bank details.

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Driver List
Endpoint
/drivers/getQuery
Method
POST
Key Params
filter: isDeleted||$eq||0 (plus fullName/companyId).
join: company
filter: isDeleted||$eq||0 (plus companyId, fullName)
2. CreateGet Single Driver (Edit Mode)
Endpoint
/drivers/getQuery
Method
POST
Query Params
filter: id||$eq||{id}
join: user, district, district.state
3. Create/Update Driver Profile
Create
/drivers/create
Update
/drivers/update
Method
POST
{
  "companyId": Number,
  "fullName": "String",
  "identificationNumber": "String",
  "nationality": "String",
  "mobileNumber": "String",
  "drivingLicenseClass": "String",
  "licenseExpiryDate": "YYYY-yyyy-MM-DD"dd",
  "gdlExpiryDate": "YYYY-yyyy-MM-DD"dd",
  "isConnected"isDeleted": false0
}
3.4. UpdateManage DriverBank Info (Sub-Page)
EndpointGet Info
/drivers/driverBankInfos/getQuery (filter: driverId)
Create/Update
/driverBankInfos/create OR /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",
  "bankBeneficiaryNric": "String",
  "bankBeneficiaryAccountNo": "String",
  "driverBeneficiaryRelationship": "String"
}

5. User Activation (Driver App Access)
Create User
/admin/createUser
Link User
/drivers/update (Updates driver with returned userId)
Detach User
/driver/detachDriver (Payload: { driverId })
Method
POST
6. Delete Driver
Endpoint
/drivers/update
Method
POST
{ "id": Number, "isDeleted": true }
7. Helper APIs (Dropdowns)
Companies
/companies/getQuery
Nationalities
/settings/getQuery (Type: Nationality)
Relationships
/settings/getQuery (Type: Driver Beneficiary Relation)
Address
/countries/getQuery, /states/getQuery, /districts/getQuery
Method
POST

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-DeleteDependency CheckChecks (Carrier Tagging)Pre-Delete)

Before deleting,deleting a driver, the system checksensures ifthey theare driver isnot assigned to aan Carrieractive (Truck).Carrier.

  • Endpoint:
  • Filter:
  • driverId||$eq||{id};isDeleted||$eq||0
  • ModuleEndpointFilter Logic
    🚚 Carriers/carriers/getQuery driverId
    Error: "Unable to delete Driver due to tagging to carrier."

3. DateMandatory FormattingBank Fields

When adding Bank Info, the following are strictly required:

  • Library:â€ĸ Luxon (DateTime).accountCode
  • Logic: Frontend converts UI date objects toâ€ĸ yyyy-MM-ddbankBeneficiaryName
  • string
  • â€ĸ formatbankBeneficiaryNric
  • before
  • â€ĸ sendingbankBeneficiaryAccountNo
  • to
  • â€ĸ the API.driverBeneficiaryRelationship