Skip to main content

EKAJAYA - PRODUCT

📦 Technical Specification: Product Setup


📋 Feature Overview

Attribute Detail
Module 📂 Directory (PRODUCT)
Feature Name Product Management
Description Manages product definitions (Code, Name, Brand) and links them to specific suppliers and pickup addresses. Supports master-detail creation.
User Guide 📄 [Ekajaya Admin User Guide - Directory Module, Section 7]

🛠️ Technical Implementation

A. Permissions & Access Control

Note: Access is controlled via PermissionGuard and code-level checks.
Scope Permission Code Description
Menu Visibility PRODUCT.MENU Sidebar menu visibility.
Page Access PRODUCT.LISTING Access to /listing-product-manage.

View Access

PRODUCT.VIEW Access to /add-product-manage (Read access).

Create Action

PRODUCT.UPDATE

Controls visibility of the + Add button.

Edit/Save Action PRODUCT.UPDATE Ability to save changes on Add/Edit screen.
Delete Action PRODUCT.DELETE Visibility of the Delete 🗑️ icon.

B. API Interaction

Base URL: ${environment.baseApiUrl}
1. Retrieve Product List
Endpoint
/products/getQuery
Method
POST
Key Params
filter: isDeleted||$eq||0 (plus search on Code, Name, Brand).
sort: productBrand,productName
2. Get Single Product (Edit Mode)
Endpoint
/products/getQuery
Method
POST
Query Params
filter: id||$eq||{id}
join: supplierProductList, supplierProductList.pickupAddress...
3. Create Product (Master-Detail)
Endpoint
/products/mdCreate
Method
POST
{
  "productCode": "String",
  "productName": "String",
  "productBrand": "String",
  "supplierProductList": [
      { "supplierId": Number, "pickupAddressId": Number }
  ],
  "isDeleted": 0
}
4. Update Product
Endpoint
/products/mdUpdate
Method
POST
Payload is same as Create, but includes "id": Number.
5. Delete Product (Soft Delete)
Endpoint
/products/update
Method
POST
Prerequisite
Must pass dependency checks (Order & Job) first.

{ 
  "id": Number, 
  "isDeleted": true 
}

C. Validation & Business Logic

1. Unique Code Validation

  • Trigger: On Save.
  • Logic: Calls /products/getQuery. Filter: productCode||$eq||{inputCode};isDeleted||$eq||0.
  • Error: Blocking error: "Product code already exists".

2. Dependency Checks (Pre-Delete)

Before deleting a product, the system ensures it is not currently used in active Orders or Jobs.

Module Endpoint Filter Logic
📦 Orders /orders/getQuery productId
🔧 Jobs /jobs/getQuery productId
Error: "Unable to delete Product due to tagging to [order/job]."

3. Minimum Data Requirement

  • Trigger: On Save.
  • Logic: Checks supplierProductList array.
  • Error: If list is empty, shows: "Please add product supplier".