Skip to main content

EKAJAYA - PRODUCT

đŸ“Ļ Technical Specification: Product Setup


📋 Feature Overview

AttributeDetail
Module📂 Directory (PRODUCT)
Feature NameProduct Management
DescriptionManages 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]

đŸ•šī¸ Functional Workflow

  • 📍 Navigation  Go to Directory > Product 
  • đŸ‘ī¸ Listing View Paginated list displaying Product Brand, Code, and Name.
  • ➕ Add Action Click the + button to create a new product. Requires linking at least one supplier.
  • âœī¸ Edit Action Click the Pencil icon on a row to modify details.
  • đŸ—‘ī¸ Delete Action Click the Trash icon to remove a product (soft delete with dependency checks).

đŸ› ī¸ Technical Implementation

A. Permissions & Access Control

Note: Access is controlled via PermissionGuard and code-level checks.
ScopePermission CodeDescription
Menu VisibilityPRODUCT.MENUSidebar menu visibility.
Page AccessPRODUCT.LISTINGAccess to /listing-product-manage.
Create ActionPRODUCT.UPDATEControls visibility of the + Add button.
View AccessPRODUCT.VIEWAccess to /add-product-manage (Read access).
Edit/Save ActionPRODUCT.UPDATEAbility to save changes on Add/Edit screen.
Delete ActionPRODUCT.DELETEVisibility 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.

ModuleEndpointFilter Logic
đŸ“Ļ Orders/orders/getQueryproductId
🔧 Jobs/jobs/getQueryproductId
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".