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]

đŸ•šī¸ Functional Workflow

  • 📍 Navigation Go to Directory > Client
  • đŸ‘ī¸ Listing View Paginated list displaying Client Code, Name, and Registration Number.
  • ➕ Add Action Click the + button to register a new client. Requires at least one Delivery Address.
  • âœī¸ Edit Action Click the Pencil icon to modify details.
  • 👤 Assign User Special action to link a client record to a login user account.
  • đŸ—‘ī¸ Delete Action Click the Trash icon to remove a client.

đŸ› ī¸ 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
Check Link
/clientUsers/getQuery (clientId filter)
Available Users
/users/getQuery
Create/Update
/clientUsers/create OR /update

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.