Company Setup
đĸ Technical Specification: Company Setup
đ Feature Overview
đšī¸ Functional Workflow
đ UI Input Fields
đ ī¸ Technical Implementation
đ A. Permissions & Access Control
Note: Access is controlled via
PermissionGuard and UI directives (*ngIf).| Scope | Permission Code | Description | |||
|---|---|---|---|---|---|
| Menu Visibility | COMPANY.MENU |
Sidebar menu item |
|||
| Page Access | COMPANY.LISTING |
Access to /listing-company. | |||
| |
||||
| View/Edit Access | COMPANY.VIEW |
Access to /add-company-manage. |
|||
Create Action |
COMPANY.CREATE |
Visibility of the Add + button. |
|||
| Update/Edit Action | COMPANY.UPDATE |
Ability to save changes on Edit screen. | |||
| Delete Action | COMPANY.DELETE |
Visibility of the Delete đī¸ icon. |
đ B. API Interaction
Base URL:
${environment.baseApiUrl}đĨ
1. Retrieve Company List (Query)
Endpoint
Endpoint: /companies/getQuery
Method:Method
POST
Purpose:Purpose
Fetches paginated data for the grid.
KeyParams
Params:
filter: isDeleted||$eq||0 (plus dynamic search filters).
sort: companyName
đ 2. Get Single Company (Edit Mode)
Endpoint
/companies/getOne
Method
GET
Params
id (Number)
3. Create Company
Endpoint
/companies/create
Method
POST
{
"companyName": "String",
"description": "String",
"remark": "String",
"isInternal": Boolean
}
4. Update Company
Endpoint
/companies/update
Method
POST
Payload is same as Create, but includes "id": Number.
5. Delete Company (Soft Delete)
Endpoint
/companies/update
Method
POST
Logic
Updates record setting
isDeleted: true.{
"id": Number,
"isDeleted": true
}
C. Validation & Business Logic
1. Unique Name Validation
Endpoint:Trigger: On Save (Create Mode Only)- Logic: Calls
/companies/with filtergetOnegetQuerycompanyName||$eq||{Input} Method:Error:GETBlocking Queryerror:Params:"Companynameid(Number)already
⨠3. Create Company
Endpoint:/companies/createMethod:POSTPayload:exists".
2. Pre-Delete Dependency Checks
Before allowing a delete, the system checks if the company is tied to active records in other modules.
| # | Module | Endpoint | Filter |
|---|---|---|---|
| 1 | đĨ Users | /companyUsers/getQuery |
companyId |
| 2 | đ Drivers | /drivers/getQuery |
companyId |
| 3 | đĻ Movers | /movers/getQuery |
companyId |
| 4 | âŊ Tankers | /tankers/getQuery |
companyId |