Skip to main content

EKAJAYA - CLIENT

👥 Technical Specification: Client Setup


📋 Feature Overview

Attribute Detail
Module 📂 Directory (CLIENT)
Feature Name Client Profile Management
Description Manages client profiles, including billing details, contact info, and delivery addresses. Supports linking Client entity to a System User.
User Guide 📄 [Ekajaya Admin User Guide - Directory Module, Section 5]

🛠️ Technical Implementation

A. Permissions & Access Control

Note: Access is controlled via PermissionGuard and template checks.
Scope Permission Code Description
Menu Visibility CLIENT.MENU Sidebar menu visibility.
Page Access CLIENT.LISTING Access to /listing-client-profile.
View/Edit Access CLIENT.VIEW Access to /add-client-profile-manage.
Create Action CLIENT.CREATE Visibility of the + Add button.
Update Action CLIENT.UPDATE Ability to save changes on Edit screen.
Delete Action CLIENT.DELETE Visibility of the Delete 🗑️ icon.

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Client List
Endpoint
/clients/getQuery
Method
POST
Key Params
filter: isDeleted||$eq||0 (plus search).
sort: clientName
2. Get Single Client (Edit Mode)
Endpoint
/clients/getQuery
Method
POST
Query Params
filter: id||$eq||{id}
join: deliveryAddressList, deliveryAddressList.district...
3. Create Client (Master-Detail)
Endpoint
/clients/mdCreate
Method
POST
{
  "clientCode": "String",
  "clientName": "String",
  "deliveryAddressList": [ ... ],
  "clientType": "String",
  "countryId": Number
}
4. Update Client
Endpoint
/clients/mdUpdate
Method
POST
Payload is same as Create, but includes "id": Number.
5. Delete Client
Endpoint
/client/delete
Method
POST
{ "id": Number }
6. Assign User Functionality
Dialog
AssignUserDialog
POST
Check Link
/clientUsers/getQuery (clientId filter)
POST
Available Users
/users/getQuery
POST
Create/Update
/clientUsers/create OR /update
POST

C. Validation & Business Logic

1. Unique Code Validation

  • Trigger: On Save.
  • Logic: Calls /clients/getQuery. Filter: clientCode||$eq||{inputCode}.
  • Error: Blocking error: "Client code already exists".

2. Delivery Address Validation

  • Trigger: On Save.
  • Logic: Checks this.dataSource.deliveryAddressList.
  • Error: If list is null or empty: "Please add delivery address".

3. User Assignment Logic

Ensures a client can be linked to a system user (User ID) for Client Portal login.