Skip to main content

Company Setup

đŸĸ Technical Specification: Company Setup

 

📋 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]

đŸ•šī¸ Functional Workflow

(User Perspective)
  • 📍 Navigation:Navigation  Go to Settings > Company 
  • đŸ‘ī¸ Listing View:View PaginatedDisplays listpaginated withlist. searchSearch (filtersfilters: byName, name,Description, description, remark).Remark.
  • ➕ Add Action:Action OpensClick the "Add Company"button to open the creation form.
  • âœī¸ Edit Action:Action Click the Pencil icon on a row to modify details.
  • đŸ—‘ī¸ Delete Action:Action Click the Trash icon to soft-perform a soft delete (requiresvalidation validation)required).

📝 UI Input Fields

Field Name Type Required Description
Company Name Text ✅ YesYES Must be unique across active records.
Description Text ❌ NoNO Optional details about the company.
Remark Text ❌ NoNO Optional internal remarks.
Is Internal? Checkbox ❌ NoNO Flag to mark the company as an internal entity.

đŸ› ī¸ 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 visibility.visibility for both listing and edit/add company.
Page Access COMPANY.LISTING Access to /listing-company.
Create ActionCOMPANY.CREATEVisibility of the + Add button.
View/Edit Access COMPANY.VIEW Access to /add-company-manage.
Update

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.
  • Key
    Params
    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/getOnegetQuery with filter companyName||$eq||{Input}
    • Method:Error: GET
    • Blocking
    • Queryerror: Params:"Company idname (Number)
    • already

    ✨ 3. Create Company

    • Endpoint: /companies/create
    • Method: POST
    • Payload:exists".

    2. Pre-Delete Dependency Checks

    Before allowing a delete, the system checks if the company is tied to active records in other modules.

    #ModuleEndpointFilter
    1đŸ‘Ĩ Users/companyUsers/getQuerycompanyId
    2🚚 Drivers/drivers/getQuerycompanyId
    3đŸ“Ļ Movers/movers/getQuerycompanyId
    4â›Ŋ Tankers/tankers/getQuerycompanyId