Skip to main content

EKAJAYA - DRIVER

👷🏼 Technical Specification: Driver Setup


📋 Feature Overview

Attribute Detail
Module 📂 Directory (DRIVER)
Feature Name Driver Management
Description Manages driver profiles, personal details, licensing (GDL, Passport), and bank beneficiary info. Handles system user creation for Driver PWA access.
User Guide 📄 [Ekajaya Admin User Guide - Directory Module, Section 2]

🛠️ Technical Implementation

A. Permissions & Access Control

Note: Access is controlled via PermissionGuard and component-level checks.
Scope Permission Code Description & Page Usage
Menu Visibility DRIVER.MENU Sidebar menu visibility.
Page Access DRIVER.LISTING Access to listing route.
\listing-driver-manage
Create Action DRIVER.UPDATE Controls the + Add button visibility.
\listing-driver-manage
View Access DRIVER.VIEW Controls visibility of Edit icon.
\listing-driver-manage
Edit/Save Action DRIVER.UPDATE Ability to save changes on Add/Edit screen.
\add-driver-manage
Delete Action DRIVER.DELETE Visibility of the Delete 🗑️ icon.
\listing-driver-manage
Bank Info View DRIVER_BANK_INFO.VIEW Visibility of the Bank icon.
\listing-driver-manage
Bank Info Update DRIVER_BANK_INFO.UPDATE Ability to save bank details.
\add-driver-bank-info

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Driver List \listing-driver-manage
Endpoint
/drivers/getQuery
Method
POST
Key Params
filter: isDeleted||$eq||0 (plus fullName/companyId).
join: company
2. Get Single Driver (Edit Mode) \add-driver-manage
Endpoint
/drivers/getQuery
Method
POST
Query Params
filter: id||$eq||{id}
join: user, district, district.state
3. Create/Update Driver Profile \add-driver-manage
Create
/drivers/create
POST
Update
/drivers/update
POST
{
  "companyId": Number,
  "fullName": "String",
  "identificationNumber": "String",
  "nationality": "String",
  "mobileNumber": "String",
  "drivingLicenseClass": "String",
  "licenseExpiryDate": "yyyy-MM-dd",
  "gdlExpiryDate": "yyyy-MM-dd",
  "isDeleted": 0
}
4. Manage Bank Info \add-driver-bank-info
Get Info
/driverBankInfos/getQuery (filter: driverId)
POST
Create/Update
/driverBankInfos/create OR /update
POST
{
  "driverId": Number,
  "accountCode": "String",
  "bankBeneficiaryName": "String",
  "bankBeneficiaryNric": "String",
  "bankBeneficiaryAccountNo": "String",
  "driverBeneficiaryRelationship": "String"
}
5. User Activation (Driver App Access) \add-driver-manage
Create User
/admin/createUser
POST
Link User
/drivers/update (Updates driver with returned userId)
POST
Detach User
/driver/detachDriver (Payload: { driverId })
POST
6. Delete Driver \listing-driver-manage
Endpoint
/drivers/update
Method
POST
{ "id": Number, "isDeleted": true }
7. Helper APIs (Dropdowns) \add-driver-manage
Companies
/companies/getQuery
POST
Nationalities
/settings/getQuery (Type: Nationality)
POST
Relationships
/settings/getQuery (Type: Driver Beneficiary Relation)
POST
Address
/countries/getQuery, /states/getQuery, /districts/getQuery
POST

C. Validation & Business Logic

1. Unique ID Validation \add-driver-manage

  • Trigger: On Save.
  • Logic: Calls /drivers/getQuery. Filter: identificationNumber||$eq||{inputID};isDeleted||$eq||0.
  • Error: "Driver identification number already exists".

2. Dependency Checks (Pre-Delete) \listing-driver-manage

Before deleting a driver, the system ensures they are not assigned to an active Carrier.

Module Endpoint Filter Logic
🚚 Carriers /carriers/getQuery driverId
Error: "Unable to delete Driver due to tagging to carrier."

3. Mandatory Bank Fields \add-driver-bank-info

When adding Bank Info, the following are strictly required:

  • accountCode
  • bankBeneficiaryName
  • bankBeneficiaryNric
  • bankBeneficiaryAccountNo
  • driverBeneficiaryRelationship