Skip to main content

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.
Page & Detail
1. Listing Page: /listing-client-profile
Displays grid of clients, filters, and delete/assign-user actions.
2. Add/Edit Page: /add-client-profile-manage
Form for creating new clients, updating profiles, and managing delivery addresses.
3. Assign User Dialog: /assign-user-dialog
Additional function for adding user to the client.
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 & Page Usage
Menu Visibility CLIENT.MENU

Sidebar menu visibility.

\listing-client-profile

\add-client-profile-manage

Page Access CLIENT.LISTING Access to listing route.
\listing-client-profile
Create Action CLIENT.CREATE Visibility of the + Add button.
\listing-client-profile
View/Edit Access CLIENT.VIEW Controls visibility of the Edit icon.
\listing-client-profile
Delete Action CLIENT.DELETE Visibility of the Delete 🗑️ icon.
\listing-client-profile
Update Action CLIENT.UPDATE Ability to save changes on Edit screen.
\add-client-profile-manage

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Client List \listing-client-profile
Endpoint
/clients/getQuery
Method
POST
Key Params
filter: isDeleted||$eq||0 (plus search on Code, Name, RegNo).
sort: clientName
2. Delete Client \listing-client-profile
Endpoint
/client/delete
Method
POST
{ "id": Number }
3. Assign User Functionality AssignUserDialog
Dialog
AssignUserDialog
POST
Check Link
/clientUsers/getQuery (clientId filter)
POST
Available Users
/users/getQuery (isDeleted=0)
POST
Create/Update
/clientUsers/create OR /update
POST
4. Get Single Client (Edit Mode) \add-client-profile-manage
Endpoint
/clients/getQuery
Method
POST
Query Params
filter: id||$eq||{id}
join: deliveryAddressList, deliveryAddressList.district...
5. Create Client (Master-Detail) \add-client-profile-manage
Endpoint
/clients/mdCreate
Method
POST
{
  "clientCode": "String",
  "clientName": "String",
  "deliveryAddressList": [ ... ],
  "clientType": "String",
  "countryId": Number
}
6. Update Client \add-client-profile-manage
Endpoint
/clients/mdUpdate
Method
POST
Payload is same as Create, but includes "id": Number.
7. Helper APIs (Dropdowns) \add-client-profile-manage
Countries
/countries/getQuery
POST
States
/states/getQuery (countryId filter)
POST
Districts
/districts/getQuery (stateId filter)
POST
Client Type
/settings/getQuery (type=Client Type)
POST

C. Validation & Business Logic

1. Unique Code Validation \add-client-profile-manage

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

2. Delivery Address Validation \add-client-profile-manage

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

3. User Assignment Logic AssignUserDialog

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