CARRIER
🚛 Technical Specification: Carrier Setup
📋 Feature Overview
🛠️ Technical Implementation
A. Permissions & Access Control
Note: Access is controlled via
PermissionGuard and component-level checks.| Scope | Permission Code | Description & Page Usage |
|---|---|---|
| Menu Visibility | CARRIER.MENU |
Sidebar menu visibility.
|
| Page |
CARRIER.VIEW |
Access to
|
| Create Action | CARRIER.UPDATE |
Controls the + Add button on listing.\listing-fleet-panel-mover |
| Delete Action | CARRIER.DELETE |
Visibility of the Delete 🗑️ icon.\listing-fleet-panel-mover |
| Edit/Save Action | CARRIER.UPDATE |
Ability to save changes on Add/Edit screen.\add-edit-carrier |
B. API Interaction
Base URL:
${environment.baseApiUrl}1. RetrieveListing Carrier Listing (Custom Logic)Manage
\listing-fleet-panel-mover/carrier/getListing
POST
statusStartDatetime, statusEndDatetime, availability/movers/getQuery
Filter: "Availability"based(Filter onDropdown)
plateNo /tankers/getQuery
POSTFilter:
tankerNumber (Filter Dropdown)/drivers/getQuery
POSTFilter:
fullName (Filter Dropdown)/driverUser/getUserList
POSTPurpose: Populate User Filter
/carriers/update
POSTPurpose: Soft Delete (
isDeleted=true){ "statusStartDatetime": "2023-10-27T00:00:00.000Z", "statusEndDatetime": "2023-10-27T23:59:59.999Z", "limit": 25, "page": 1 // Optional: driverId, moverId, tankerId, availability }
2. DeleteAdd Carrier
\listing-fleet-panel-mover{ "id": Number, "isDeleted": true }
\add-edit-carrier/companies/getQuery
POSTFilter:
isDeleted=0/carriers/getQuery
POST
id (Fetch record or check uniqueness)filter/movers/getQuery
POSTFilter:
(Exclude active assets),:
id||id!$eq||{id}in...(Exclude active assets),
joincompanyId/tankers/getQuery
Filter:
id!$in... (Exclude active assets), companyId/drivers/getQuery
POSTFilter:
id!$in... (Exclude active assets), companyId/carriers/create
POSTPurpose: Create new
dataSource record/carriers/update
POSTPurpose: Update existing
dataSource record\add-edit-carriercarrier-calendar/carriers/creategetQuery
POST
/carriers/updatedriverBlockDayDetails/getQuery
POSTFilter:
driverId, blockStatus (Blocked, Released, etc.)/moverBlockDayDetails/getQuery
POSTFilter:
moverId, blockStatus/tankerBlockDayDetails/getQuery
POSTFilter:
tankerId, blockStatus{ "companyId": Number, "moverId": Number, "tankerId": Number, "driverId": Number, "remark": "String", "isDeleted": 0 }
\carrier-calendar\listing-fleet-panel-mover\add-edit-carrierC. Validation & Business Logic
1. Asset Availability Filtering (The "In-Use" Check) \add-edit-carrier
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.
id||!$in||{used_ids} AND companyId||$eq||{selectedCompany}id||!$in||{used_ids} AND companyId||$eq||{selectedCompany}id||!$in||{used_ids} AND companyId||$eq||{selectedCompany}2. Availability Status \listing-fleet-panel-mover
The "Availability" column is a calculated status derived from the statusStartDatetime and statusEndDatetime passed to the API.