Skip to main content

EKAJAYA - 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.
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
View/Edit Access SUPPLIER.VIEW Controls visibility of action buttons to navigate to edit page.
\listing-supplier-profile
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-profile
Endpoint
/suppliers/getQuery
Method
POST
Purpose
Fetches paginated data for the grid.
Params
filter: isDeleted||$eq||0 (plus dynamic search).
sort: supplierCode
2. Get Single Supplier (Edit Mode) \add-supplier-profile-manage
Endpoint
/suppliers/getQuery
Method
POST
Params
filter: id||$eq||{id}
join: pickupAddressList, district, state
Note: Uses getQuery with limit 1 to join address relations.
3. Create Supplier \add-supplier-profile-manage
Endpoint
/suppliers/mdCreate
Method
POST
{
  "supplierCode": "String",
  "supplierName": "String",
  "pickupAddressList": [ ... ],
  "countryId": Number,
  "stateId": Number,
  "districtId": Number,
  "isCima": Boolean
}
4. Update Supplier \add-supplier-profile-manage
Endpoint
/suppliers/mdUpdate
Method
POST
Payload is same as Create, but includes "id": Number.
5. Delete Supplier \listing-supplier-profile
Endpoint
/supplier/delete
Method
POST
{
  "id": Number
}
6. 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".