Company Setup
đĸ Technical Specification: Company Setup
1. đ Feature Overview
| Attribute | Detail |
| Module | âī¸ Settings |
| Feature Name | Company Setup |
| Description | Acts as the master data management tool for company entities. Supports creating internal/external companies and manages soft deletes. |
| User Guide | đ [Ekajaya Admin User Guide - Setting Module, Page 3] |
2. đšī¸ Functional Workflow (User Perspective)
đ UI Input Fields
| Field Name | Type | Required | Description |
| Company Name | Text |
â Yes | Must be unique across active records. |
| Description | Text |
â No | Optional details about the company. |
| Remark | Text |
â No | Optional internal remarks. |
| Is Internal? | Checkbox |
â No | Flag to mark the company as an internal entity. |
3. đ ī¸ Technical Implementation
đ A. đ Permissions & Access Control
Access is controlled via PermissionGuard and UI directives (*ngIf).
| Scope | Permission Code | Description |
| Menu Visibility | COMPANY.MENU |
Sidebar menu item visibility. |
| Page Access | COMPANY.LISTING |
Access to /listing-company. |
| Create Action | COMPANY.CREATE |
Visibility of the + Add button. |
| View/Edit Access | COMPANY.VIEW |
Access to /add-company-manage. |
| Update 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
Endpoint:
/companies/getQueryMethod:
POSTPurpose: Fetches paginated data for the grid.
Key Params:
filter:isDeleted||$eq||0(plus dynamic search filters).sort:companyName
đ 2. đ Get Single Company (Edit Mode)
Endpoint:
/companies/getOneMethod:
GETQuery Params:
id(Number)
⨠3. ⨠Create Company
Endpoint:
/companies/createMethod:
POSTPayload:
{
"companyName": "String",
"description": "String", // Optional
"remark": "String", // Optional
"isInternal": Boolean
}
4. đž Update Company
Endpoint:/companies/updateMethod:POSTPayload:Same as Create, but includes"id": Number.
5. đī¸ Delete Company (Soft Delete)
Endpoint:/companies/updateMethod:POSTLogic:Updates the record status; does not remove from DB.Payload:JSON{ "id": Number, "isDeleted": true }
C. â ī¸ Validation & Business Logic
1. đĢ Unique Name Validation
Trigger:On Save (Create Mode only).Logic:Frontend calls/companies/getQuery.Filter:companyName||$eq||{InputName};isDeleted||$eq||0Error:IfresultCount > 0, display:"Company name already exists".
2. đĄī¸ Pre-Delete Dependency Checks
Before deleting, the system verifies the company isn't in use. If any API returns data, the delete is blocked.
| |||
| |||
| |||
|