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, 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.
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: 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.