EKAJAYA - COMPANY
🏢 Technical Specification: Company Setup
📋 Feature Overview
🛠️ Technical Implementation
A. Permissions & Access Control
Note: Access is controlled via
PermissionGuard and UI directives.| Scope | Permission Code | Description & Page Usage |
|---|---|---|
| Menu Visibility | COMPANY.MENU |
Sidebar menu item visibility for both listing and edit/add company. |
| Page Access | COMPANY.LISTING |
Access to listing route.\listing-company |
|
Create Action |
COMPANY.CREATE |
Visibility of the Add + button. |
| View/Edit Access | COMPANY.VIEW |
Controls visibility of action buttons to navigate to edit page.\listing-company |
|
COMPANY. |
Visibility of the |
| Update/Edit Action | COMPANY.UPDATE |
Ability to save changes on Edit screen.\add-company-manage |
| |
B. API Interaction
Base URL:
${environment.baseApiUrl}1. Retrieve Company List (Query)
\listing-company \add-company-manageEndpoint
/companies/getQuery
Method
POST
Usage
- Listing: Fetches paginated data for the grid.
- Add/Manage: Used to check for Unique Company Name (Duplicate Check).
Params
filter: isDeleted||$eq||0sort: companyName2. Delete Company (Soft Delete)
\listing-companyEndpoint
/companies/update
Method
POST
Logic
Updates record setting
isDeleted: true.{
"id": Number,
"isDeleted": true
}
3. Get Single Company (Edit Mode)
\add-company-manageEndpoint
/companies/getOne
Method
GET
Params
id (Number)\add-company-manage/companies/create
Update EP
/companies/update
Method
POST
{
"companyName": "String",
"description": "String",
"remark": "String",
"isInternal": Boolean
}
\add-company-manage\listing-companyisDeleted: true{ "id": Number, "isDeleted": true }
C. Validation & Business Logic
1. Unique Name Validation \add-company-manage
Trigger:On Save (Create Mode Only)Logic:Calls/companies/getQuerywith filtercompanyName||$eq||{Input}Error:Blocking error: "Company name already exists".
2. Pre-Delete Dependency Checks \listing-company
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 |
2. Unique Name Validation \add-company-manage
- Trigger: On Save (Create Mode Only)
- Logic: Calls
/companies/getQuerywith filtercompanyName||$eq||{Input} - Error: Blocking error: "Company name already exists".