Skip to main content

EKAJAYA - CARRIER

🚛 Technical Specification: Carrier Setup


📋 Feature Overview

AttributeDetail
Module📂 Fleet (CARRIER)
Feature NameCarrier Management (Fleet Panel)
DescriptionLinks a Driver, Mover, and Tanker to form a deployable operational unit. Tracks operational Availability based on component schedules.
User Guide📄 [Ekajaya Admin User Guide - Fleet Module, Section 2]

đŸ•šī¸ Functional Workflow

  • 📍 Navigation  Go to Fleet > Carrier 
  • đŸ‘ī¸ Listing View Displays linked Mover, Tanker, and Driver. Shows Availability Status (default: Today).
  • ➕ Add Action Click the + button to assemble a new carrier. Requires filtering assets by Company.
  • âœī¸ Edit Action Click the Pencil icon to swap out a driver, mover, or tanker.
  • 📅 Calendar View consolidated schedule (Block Days) for all linked assets.
  • đŸ—‘ī¸ Delete Action Click the Trash icon to dissolve the carrier unit.

đŸ› ī¸ Technical Implementation

A. Permissions & Access Control

Note: Access is controlled via PermissionGuard and component-level checks.
ScopePermission CodeDescription
Menu VisibilityCARRIER.MENUSidebar menu visibility.
Page AccessCARRIER.VIEWAccess to /listing-fleet-panel-mover.
Create ActionCARRIER.UPDATEControls the + Add button on listing.
Edit/Save ActionCARRIER.UPDATEAbility to save changes.
Delete ActionCARRIER.DELETEVisibility of the Delete đŸ—‘ī¸ icon.

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Carrier Listing (Custom Logic)
Endpoint
/carrier/getListing
Method
POST
Purpose
Fetches carriers and calculates their "Availability" based on block days.
{
  "statusStartDatetime": "2023-10-27T00:00:00.000Z",
  "statusEndDatetime": "2023-10-27T23:59:59.999Z",
  "limit": 25,
  "page": 1
  // Optional: driverId, moverId, tankerId, availability
}
2. Get Single Carrier (Edit Mode)
Endpoint
/carriers/getQuery
Method
POST
Query Params
filter: id||$eq||{id}
join: mover
3. Create Carrier
Endpoint
/carriers/create
Method
POST
{
  "companyId": Number,
  "moverId": Number,
  "tankerId": Number,
  "driverId": Number,
  "remark": "String",
  "isDeleted": 0
}
4. Update Carrier
Endpoint
/carriers/update
Method
POST
Payload is same as Create, but includes "id": Number.
5. Delete Carrier
Endpoint
/carriers/update
Method
POST
{ "id": Number, "isDeleted": true }
6. Carrier Calendar (Consolidated View)
Aggregates block days (leave/maintenance) from three separate tables.
Driver Blocks
/driverBlockDayDetails/getQuery
Mover Blocks
/moverBlockDayDetails/getQuery
Tanker Blocks
/tankerBlockDayDetails/getQuery

C. Validation & Business Logic

1. Asset Availability Filtering (The "In-Use" Check)

System ensures you cannot select an asset already assigned to another active carrier.

  • Step 1: Fetch all active carriers (excluding current) via /carriers/getQuery.
  • Step 2: Filter Dropdowns by excluding IDs found in Step 1.
Movers: id||!$in||{used_ids} AND companyId||$eq||{selectedCompany}
Tankers: id||!$in||{used_ids} AND companyId||$eq||{selectedCompany}
Drivers: id||!$in||{used_ids} AND companyId||$eq||{selectedCompany}

2. Availability Status

The "Availability" column is a calculated status derived from the statusStartDatetime and statusEndDatetime passed to the API.

Logic: If any component (Driver/Mover/Tanker) has a block record during that window, the Carrier is marked "Unavailable".