Skip to main content

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-component-level checks.
Scope Permission Code Description & Page Usage
Menu Visibility PRODUCT.MENU

Sidebar menu visibility.

\listing-product-manage

\add-product-manage

Page AccessRouting PRODUCT.LISTING Access to listing route.
\listing-product-manage
Page

View Access

Routing
PRODUCT.VIEW Controls visibility

Access ofto actionadd buttonsroute.

(Edit).

\listing-add-product-manage

Create Action

PRODUCT.UPDATE

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

View AccessPRODUCT.VIEWControls visibility of action buttons (Edit).
\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. RetrieveListing Product ListManage \listing-product-manage
Endpoint
/products/getQuery
Method
POST
KeyFilter: ParamsproductCode, productName, productBrand, isDeleted=0
filter:
/orders/getQuery
POST
Filter: isDeleted||$eq||productId, isClosed=0 (plusDependency searchCheck)
on
Code,
Name,
Brand).
sort:
/jobs/getQuery
POST
Filter: productBrand,productNameproductId, isClosed=0 (Dependency Check)
/products/update
POST
Purpose: Soft Delete (isDeleted=true)
2. DeleteAdd 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)Manage \add-product-manage
Endpoint
/products/getQuery
Method
POST
Query Params
filter:Filter: id||$eq||{id}id
join: supplierProductList,(Fetch supplierProductList.pickupAddress...
specific
record)
4. Create
/products/getQuery
ProductPOST
Filter: productCode (Master-Detail)Uniqueness \add-product-manageCheck)
Endpoint
/products/mdCreate
MethodPOST
Purpose: Master-Detail Create
/products/mdUpdate
POST
Purpose: Master-Detail Update
{
  "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.

ModuleEndpointFilter Logic
📦 Orders/orders/getQueryproductId
🔧 Jobs/jobs/getQueryproductId
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".