Skip to main content

SUPPLIER

🏭 Technical Specification: Supplier Setup


📋 Feature Overview

Attribute Detail
Module 📂 Directory (SUPPLIER)
Feature Name Supplier Profile Management
Description Manages supplier profiles including general details, contact information, address logic (Country/State/District), and associated pickup addresses.
Page & Detail
1. Listing Page: /listing-supplier-profile
Displays grid of suppliers, filters, and delete actions.
2. Add/Edit Page: /add-supplier-profile-manage
Form for creating new suppliers or updating profile/address details.
User Guide 📄 [Ekajaya Admin User Guide - Directory Module, Section 6]

🛠️ 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.
\listing-supplier-profile
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-profile
Endpoint
/suppliers/getQuery
Method
POST
Purpose
Fetches paginated data for the grid.
Params
filter: isDeleted||$eq||0 (plus dynamic search).
sort: supplierCode
2. Delete Supplier \listing-supplier-profile
Endpoint
/supplier/delete
Method
POST
{
  "id": Number
}
3. Get Single Supplier (Edit Mode) \add-supplier-profile-manage
Endpoint
/suppliers/getQuery
Method
POST
Params
filter: id||$eq||{id}
limit: 1
Note: Uses getQuery with limit 1, not getOne.
4. Create/Update Supplier \add-supplier-profile-manage
Create 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-manage
Countries
/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/getQuery with filter supplierCode||$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".