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
Menu Visibility SUPPLIER.MENU Sidebar menu visibility.
Page Access SUPPLIER.LISTING Access to /listing-supplier-profile.
View/Edit Access SUPPLIER.VIEW Access to /add-supplier-profile-manage.
Create Action SUPPLIER.CREATE Visibility of the + Add button.
Update Action SUPPLIER.UPDATE Ability to save changes on Edit screen.
Delete Action SUPPLIER.DELETE Visibility of the Delete 🗑️ icon.

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Supplier List
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)
Endpoint
/suppliers/getQuery
Method
POST
Params
filter: id||$eq||{id}
limit: 1
Note: Uses getQuery with limit 1, not getOne.
3. Create Supplier
Endpoint
/suppliers/mdCreate
Method
POST
{
  "supplierCode": "String",
  "supplierName": "String",
  "pickupAddressList": [ ... ],
  "countryId": Number,
  "stateId": Number,
  "districtId": Number,
  "isCima": Boolean
}
4. Update Supplier
Endpoint
/suppliers/mdUpdate
Method
POST
Payload is same as Create, but includes "id": Number.
5. Delete Supplier
Endpoint
/supplier/delete
Method
POST
{
  "id": Number
}
6. Helper APIs (Dropdowns)
Countries
/countries/getQuery
States
/states/getQuery (countryId filter)
Districts
/districts/getQuery (stateId filter)

C. Validation & Business Logic

1. Unique Code Validation

  • Trigger: On Save.
  • Logic: Calls /suppliers/getQuery with filter supplierCode||$eq||{inputCode}.
  • Error: Blocking error: "Supplier code already exists".

2. Pickup Address Validation

  • Trigger: On Save.
  • Logic: Checks this.dataSource.pickupAddressList.
  • Condition: If the list is null or length is 0.
  • Error: "Please add pickup address".