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.
Page & Detail
1. Listing Page: /listing-product-manage
Displays grid of products, filters, and delete actions.
2. Add/Edit Page: /add-product-manage
Form for creating new products or updating details/suppliers.
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 & Page Usage
Menu Visibility PRODUCT.MENU Sidebar menu visibility.
Page Access PRODUCT.LISTING Access to listing route.
\listing-product-manage

View Access

PRODUCT.VIEW Controls visibility of action buttons (Edit).
\listing-product-manage

Create Action

PRODUCT.UPDATE

Visibility of the + Add button (uses Update permission).
\listing-product-manage

Delete Action PRODUCT.DELETE Visibility of the Delete 🗑️ icon.
\listing-product-manage
Edit/Save Action PRODUCT.UPDATE Ability to save changes on Add/Edit screen.
\add-product-manage

B. API Interaction

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

C. Validation & Business Logic

1. Dependency Checks (Pre-Delete) \listing-product-manage

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]."

2. Unique Code Validation \add-product-manage

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

3. Minimum Data Requirement \add-product-manage

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