EKAJAYA - CARRIER
đ Technical Specification: Carrier Setup
đ Feature Overview
đšī¸ Functional Workflow
đ ī¸ Technical Implementation
A. Permissions & Access Control
Note: Access is controlled via
PermissionGuard and component-level checks.| Scope | Permission Code | Description |
|---|---|---|
| Menu Visibility | CARRIER.MENU |
Sidebar menu visibility. |
| Page Access | CARRIER.VIEW |
Access to /listing-fleet-panel-mover. |
| Create Action | CARRIER.UPDATE |
Controls the + Add button on listing. |
| Edit/Save Action | CARRIER.UPDATE |
Ability to save changes. |
| Delete Action | CARRIER.DELETE |
Visibility 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: mover3. 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
POST
Mover Blocks
/moverBlockDayDetails/getQuery
POST
Tanker Blocks
/tankerBlockDayDetails/getQuery
POST
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".