EKAJAYA - SUPPLIER
🏭 Technical Specification: Supplier Setup
📋 Feature Overview
🛠️ Technical Implementation
A. Permissions & Access Control
Note: Access is controlled via
PermissionGuard and template checks.| Scope | Permission Code | Description & Page Usage |
|---|---|---|
| Menu Visibility | SUPPLIER.MENU |
Sidebar menu visibility. |
| Page Access | SUPPLIER.LISTING |
Access to listing route. |
| View/Edit Access | SUPPLIER.VIEW |
|
| Create Action | SUPPLIER.CREATE |
Visibility of the + Add button.\listing-supplier-profile |
| Update Action | SUPPLIER.UPDATE |
Ability to save changes on Edit screen.\add-supplier-profile-manage |
| Delete Action | SUPPLIER.DELETE |
Visibility of the Delete 🗑️ icon.\listing-supplier-profile |
B. API Interaction
Base URL:
${environment.baseApiUrl}1. Retrieve Supplier List
\listing-supplier-profileEndpoint
/suppliers/getQuery
Method
POST
Purpose
Fetches paginated data for the grid.
Params
filter: isDeleted||$eq||0 (plus dynamic search).sort: supplierCode2. Get Single Supplier (Edit Mode)
\add-supplier-profile-manageEndpoint
/suppliers/getQuery
Method
POST
Params
filter: id||$eq||{id}limitjoin: Note: Uses getQuery with limit 1,1 notto getOne.join address relations.
3. Create Supplier
\add-supplier-profile-manageEndpoint
/suppliers/mdCreate
Method
POST
{
"supplierCode": "String",
"supplierName": "String",
"pickupAddressList": [ ... ],
"countryId": Number,
"stateId": Number,
"districtId": Number,
"isCima": Boolean
}
4. Update Supplier
\add-supplier-profile-manageEndpoint
/suppliers/mdUpdate
Method
POST
Payload is same as Create, but includes "id": Number.
5. Delete Supplier
\listing-supplier-profileEndpoint
/supplier/delete
Method
POST
{
"id": Number
}
6. Helper APIs (Dropdowns)
\add-supplier-profile-manageCountries
/countries/getQuery
POST
States
/states/getQuery (countryId filter)
POST
Districts
/districts/getQuery (stateId filter)
POST
C. Validation & Business Logic
1. Unique Code Validation \add-supplier-profile-manage
- Trigger: On Save.
- Logic: Calls
/suppliers/getQuerywith filtersupplierCode||$eq||{inputCode}. - Error: Blocking error: "Supplier code already exists".
2. Pickup Address Validation \add-supplier-profile-manage
- Trigger: On Save.
- Logic: Checks
this.dataSource.pickupAddressList. - Condition: If the list is null or length is 0.
- Error: "Please add pickup address".