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 Routing | SUPPLIER.LISTING |
Access to listing route.\listing-supplier-profile |
| Page Routing | SUPPLIER.VIEW |
Access to add route.
|
| Create Action | SUPPLIER.CREATE |
Visibility of the + Add button.\listing-supplier-profile |
| View Access | SUPPLIER.VIEW |
Controls visibility of action buttons (Edit).\listing-supplier-profile |
| Delete Action | SUPPLIER.DELETE |
Visibility of the Delete 🗑️ icon.\listing-supplier-profile |
| Update Action | SUPPLIER.UPDATE |
Ability to save changes on Edit screen.\add-supplier-profile-manage |
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. Delete Supplier
\listing-supplier-profileEndpoint
/supplier/delete
Method
POST
{
"id": Number
}
3. Get Single Supplier (Edit Mode)
\add-supplier-profile-manageEndpoint
/suppliers/getQuery
Method
POST
Params
filter: id||$eq||{id}limit: 1Note: Uses getQuery with limit 1, not getOne.
4. Create/Update Supplier
\add-supplier-profile-manageCreate EP
/suppliers/mdCreate
POST
Update EP
/suppliers/mdUpdate
POST
{
"supplierCode": "String",
"supplierName": "String",
"pickupAddressList": [ ... ],
"countryId": Number,
"stateId": Number,
"districtId": Number,
"isCima": Boolean
}
5. 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".