Company Setup
đđĸ Technical Specification: Company Setup
1. đ Feature Overview
-
Module:AttributeDetail Module âī¸ Settings Feature Name:NameCompany Setup Description:DescriptionThis module allows administrators to create, update, and manage company entities within the system. It actsActs as athe master data management tool forcompanies,companysupportingentities.internalSupports creating internal/external companies andexternalmanagesentitysoftdefinitions.deletes.User Guide Reference:đ [Ekajaya Admin User Guide - Setting Module, Page 3] -
Endpoint:
/companies/getQuery -
Method:
POST -
FetchesQueryPurpose:Params:- paginated
- data
page:for(Number)thePage index.grid. -
limit:Key(Number) Records per page (default 25).Params: select:id,companyName,description,remark,isDeletedsort:companyName-
filter:isDeleted||$eq||0(plus dynamic searchfiltersfilters).for -
sort:companyName
name/description). - data
-
Endpoint:
/companies/getOne -
Method:
GET -
Query Params:
id(Number) -
Endpoint:
/companies/create -
Method:
POST -
Payload:
JSON{ "companyName": "String", "description": "String", // Optional "remark": "String", // Optional "isInternal": Boolean } -
Endpoint:
/companies/update -
Method:
POST -
Payload: Same as Create, but includes
"id": Number. -
Endpoint:
/companies/update -
Method:
POST -
Logic: Updates the record
bystatus;settingdoesisDeleted:nottrue.remove from DB. -
Payload:
JSON{ "id": Number, "isDeleted": true } -
Trigger: On Save (Create Mode only).
-
Logic: Frontend calls
/companies/getQuery.with -
Filter:
companyName||$eq||{InputName};isDeleted||$eq||0. -
Condition:Error: IfresultCount > 0,blockingdisplay:error:"Company name already exists".
2. đšī¸ Functional Workflow (User Perspective)
đ UI Input Fields
| Field Name | Type | Description | |
| Company Name | Text |
â Yes | Must be unique |
| Description | Text |
â No | Optional details about the company. |
| Remark | Text |
â No | Optional internal remarks. |
| Is Internal? | Checkbox |
â No |
3. đ ī¸ Technical Implementation
A. đ Permissions & Access Control
TheAccess followingis permission codes are required to access specific functionalities. These checks are implementedcontrolled via PermissionGuard and templateUI directives (*ngIf directives.).
| Scope | Permission Code | Description |
| Menu Visibility | COMPANY.MENU |
|
| Page Access | COMPANY.LISTING |
/listing-company. |
| Create Action | COMPANY.CREATE |
+ Add button. |
| View/Edit Access | COMPANY.VIEW |
/add-company-manage |
| Update Action | COMPANY.UPDATE |
|
| Delete Action | COMPANY.DELETE |
B. đ API Interaction
Base URL: ${environment.baseApiUrl}
1. đĨ Retrieve Company List (Pagination & Search)
2. đ Get Single Company (ForEdit Edit)Mode)
3. ⨠Create Company
4. đž Update Company
5. đī¸ Delete Company (Soft Delete)
C. â ī¸ Validation & Business Logic
1. đĢ Unique Name Validation
2. đĄī¸ Pre-Delete Dependency Checks
Before allowing a delete,deleting, the system checks ifverifies the company is tied to active recordsisn't in other modules.use. If any checkAPI returns data, the delete is blocked.
| Check |
đĻ Module | đ Endpoint | đ Filter Logic |
| 1 | Users | /companyUsers/getQuery |
`companyId |
| 2 | Drivers | /drivers/getQuery |
`companyId |
| 3 | Movers | /movers/getQuery |
`companyId |
| 4 | Tankers | /tankers/getQuery |
`companyId |