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]

đŸ•šī¸ Functional Workflow

  • 📍 Navigation Go to Directory > Driver
  • đŸ‘ī¸ Listing View Paginated list displaying Name, ID, License Expiry dates, 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 (if permission allows) to manage beneficiary details.
  • 📱 Activate User Inside the Edit screen, an "Activate User" option allows creating a login for the Driver App.
  • đŸ—‘ī¸ Delete Action Click the Trash icon to remove a driver.

đŸ› ī¸ Technical Implementation

A. Permissions & Access Control

Note: Access is controlled via PermissionGuard and component-level checks.
Scope Permission Code Description
Menu Visibility DRIVER.MENU Sidebar menu visibility.
Page Access DRIVER.LISTING Access to /listing-driver-manage.
Create Action DRIVER.UPDATE Controls the + Add button on listing.
View Access DRIVER.VIEW Access to /add-driver-manage.
Edit/Save Action DRIVER.UPDATE Ability to save changes.
Delete Action DRIVER.DELETE Visibility of the Delete đŸ—‘ī¸ icon.
Bank Info Access DRIVER_BANK_INFO.VIEW Visibility of the Bank icon.
Bank Info Update DRIVER_BANK_INFO.UPDATE Ability to save 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
2. Get 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-MM-dd",
  "gdlExpiryDate": "yyyy-MM-dd",
  "isDeleted": 0
}
4. Manage Bank Info (Sub-Page)
Get Info
/driverBankInfos/getQuery (filter: driverId)
Create/Update
/driverBankInfos/create OR /update
Method
POST
{
  "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. Dependency Checks (Pre-Delete)

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

When adding Bank Info, the following are strictly required:

  • â€ĸ accountCode
  • â€ĸ bankBeneficiaryName
  • â€ĸ bankBeneficiaryNric
  • â€ĸ bankBeneficiaryAccountNo
  • â€ĸ driverBeneficiaryRelationship