Frontend
Masters
Category Master

Category Master

Navigation Path

Company → Masters → Category Master


Module URL

/masters/category-master


1. Category List Page

URL

/masters/category-master

Page Description

  • Displays all configured categories
  • Allows users to search, edit, and delete category records
  • Categories are used across multiple master and transaction modules

List Table Columns

Column NameDescription
S NoSerial number
CategoryCategory name
ActionsEdit and Delete

Available Features

  • Global search by Category Name
  • Column-level filter for Category
  • Checkbox selection for rows
  • Edit and Delete actions for each record

Row Actions

ActionDescription
EditOpens Edit Category page
DeleteOpens delete confirmation popup

2. Add Category Page

Page Description

  • Allows administrators to create a new category
  • Categories are used for classification and reporting

Add Category – Fields

Field NameTypeMandatoryDescription
CategoryText InputYesEnter category name

Actions

ActionBehavior
SaveValidates and saves the category
ResetClears entered value
CancelReturns to Category List page

Validation Rules

  • Category field cannot be empty
  • Duplicate categories are not allowed

3. Edit Category Page

Triggered From

Category List Page → Edit icon


Page Description

  • Allows modification of an existing category
  • Field is pre-filled with saved data

Editable Fields

Field NameEditable
CategoryYes

Actions

ActionBehavior
UpdateSaves the updated category
CancelDiscards changes and returns to list

4. Delete Category

Triggered From

Category List Page → Delete icon


Confirmation Message

“Are you sure you want to delete this Category?”


Actions

  • Yes / Confirm → Permanently deletes the category
  • Cancel → Closes the confirmation dialog

Delete Behavior

  • Deletion is permanent after confirmation
  • Deletion may be restricted if category is mapped to:
    • Clients
    • Units
    • Payroll or statutory configurations

Field Definitions, Usage, and Calculation Logic

This section provides a technical analysis of the Category Master's data structure and its role in organizational tagging.

1. Field Definitions

Field NameData TypeDescriptionExample Value
categoryNameStringOfficial name of the category (Required).Skilled, Unskilled
descriptionStringAdditional details about the category.High skill requirement
companyIdObjectIdReference to the parent Company.60d8a...

2. Field Usage & System Impact

CategoryValidation / RuleSystem Behavior
UniquenesscategoryName + companyIdEnforced unique index to prevent duplicate categories within the same company.
Logic ScopingcategoryNameUsed as a filter in Payroll Processing and Statutory Reports (PF/ESI).
Data PartitioningcompanyIdEnsures multi-tenant isolation; categories are company-specific.

3. Business & Calculation Logic

The Category Master acts as a primary tag for employee classification with the following technical logic:

A. Bulk Import Engine

The system supports a consolidated import process via the /all-in-one-category-import endpoint:

  • Mapping: The Excel column category is automatically mapped to the categoryName field.
  • Deduplication: Before insertion, the system checks for existing records by categoryName. If found, it updates the description; otherwise, it creates a new record.
  • Normalization: All inputs are processed using .trim() to eliminate accidental duplicates caused by trailing spaces.

B. Soft Delete Pattern

Instead of hard deletion, the system uses an isDeleted status flag. This ensures that historical payroll records linked to a category remain valid for audits while preventing the category from appearing in new selection dropdowns.


API Endpoints

The Category Master module interacts with the following API endpoints:

Base URL

export const CATEGORYMASTER_URL = '/api/salaryCategoryMaster'

Endpoints

EndpointMethodDescriptionParameters/Body
${CATEGORYMASTER_URL}POSTCreate a new salary categoryBody: data
${CATEGORYMASTER_URL}GETGet all salary categoriesQuery: page, limit
${CATEGORYMASTER_URL}/:categoryIdGETGet salary category by IDPath: categoryId
${CATEGORYMASTER_URL}/:categoryIdPATCHUpdate an existing salary categoryPath: categoryId, Body: body
${CATEGORYMASTER_URL}/delete/:categoryIdPATCHDelete a salary category (soft delete)Path: categoryId

RTK Query Hooks

The following hooks are available for frontend integration:

  • useCreateSalaryCategoryMutation
  • useGetAllSalaryCategoriesQuery
  • useGetSalaryCategoryByIdQuery
  • useUpdateSalaryCategoryMutation
  • useDeleteSalaryCategoryMutation

Summary

The Category Master provides a centralized way to manage classification data used throughout the system, ensuring consistency and structured configuration.


End of Documentation