Skip to main content

EKAJAYA - TANKER

🚛 Technical Specification: Tanker Setup


📋 Feature Overview

Attribute Detail
Module 📂 Directory (TANKER)
Feature Name Tanker Management (Trailers)
Description Manages the fleet of tankers (trailers) attached to prime movers. Tracks vehicle ID, specs, and compliance dates (Road Tax, Permits).
User Guide 📄 [Ekajaya Admin User Guide - Directory Module, Section 4]

🛠️ Technical Implementation

A. Permissions & Access Control

Note: Access is controlled via PermissionGuard and component-level checks.
Scope Permission Code Description
Menu Visibility TANKER.MENU Sidebar menu visibility.
Page Access TANKER.LISTING Access to /listing-tanker-manage.
Create Action TANKER.UPDATE Controls the + Add button on listing.
View Access TANKER.VIEW Access to /add-tanker-manage.
Edit/Save Action TANKER.UPDATE Ability to save changes.
Delete Action TANKER.DELETE Visibility of the Delete 🗑️ icon.

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Tanker List
Endpoint
/tankers/getQuery
Method
POST
Key Params
filter: isDeleted||$eq||0 (plus dynamic filters).
join: company
2. Get Single Tanker (Edit Mode)
Endpoint
/tankers/getQuery
Method
POST
Query Params
filter: id||$eq||{id}
limit: 1
3. Create/Update Tanker
Create EP
/tankers/create
Update EP
/tankers/update
Method
POST
{
  "companyId": Number,
  "tankerNumber": "String",
  "type": "String",
  "model": "String",
  "chassisNumber": "String",
  "bdm": "String",
  "spadPermitOwner": "String",
  "malaysiaRoadTaxExpiry": "yyyy-MM-dd",
  "singaporeRoadTaxExpiry": "yyyy-MM-dd",
  "opcCapacity": "String",
  "isDeleted": 0
}
4. Delete Tanker
Endpoint
/tankers/update
Method
POST
{ "id": Number, "isDeleted": true }
5. Helper APIs (Dropdowns)
Companies
/companies/getQuery
POST
Permit Owners
/settings/getQuery (type="SPAD Permit Owner")
POST

C. Validation & Business Logic

1. Unique Tanker Number Validation

  • Trigger: On Save.
  • Logic: Calls /tankers/getQuery. Filter: tankerNumber||$eq||{input}.
  • Error: Blocking error: "Tanker number already exists".

2. Dependency Checks (Pre-Delete)

Before deleting a tanker, the system ensures it is not assigned to an active Carrier.

Module Endpoint Filter Logic
🚛 Carriers /carriers/getQuery tankerId
Error: "Unable to delete Tanker due to tagging to carrier."

3. Date Formatting

  • Library: Luxon (DateTime).
  • Logic: Before saving, all date fields are converted to standard yyyy-MM-dd format. Null strings converted to null.