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 Name | Description |
|---|---|
| S No | Serial number |
| Category | Category name |
| Actions | Edit 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
| Action | Description |
|---|---|
| Edit | Opens Edit Category page |
| Delete | Opens 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 Name | Type | Mandatory | Description |
|---|---|---|---|
| Category | Text Input | Yes | Enter category name |
Actions
| Action | Behavior |
|---|---|
| Save | Validates and saves the category |
| Reset | Clears entered value |
| Cancel | Returns 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 Name | Editable |
|---|---|
| Category | Yes |
Actions
| Action | Behavior |
|---|---|
| Update | Saves the updated category |
| Cancel | Discards 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 Name | Data Type | Description | Example Value |
|---|---|---|---|
categoryName | String | Official name of the category (Required). | Skilled, Unskilled |
description | String | Additional details about the category. | High skill requirement |
companyId | ObjectId | Reference to the parent Company. | 60d8a... |
2. Field Usage & System Impact
| Category | Validation / Rule | System Behavior |
|---|---|---|
| Uniqueness | categoryName + companyId | Enforced unique index to prevent duplicate categories within the same company. |
| Logic Scoping | categoryName | Used as a filter in Payroll Processing and Statutory Reports (PF/ESI). |
| Data Partitioning | companyId | Ensures 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
categoryis automatically mapped to thecategoryNamefield. - 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
| Endpoint | Method | Description | Parameters/Body |
|---|---|---|---|
${CATEGORYMASTER_URL} | POST | Create a new salary category | Body: data |
${CATEGORYMASTER_URL} | GET | Get all salary categories | Query: page, limit |
${CATEGORYMASTER_URL}/:categoryId | GET | Get salary category by ID | Path: categoryId |
${CATEGORYMASTER_URL}/:categoryId | PATCH | Update an existing salary category | Path: categoryId, Body: body |
${CATEGORYMASTER_URL}/delete/:categoryId | PATCH | Delete a salary category (soft delete) | Path: categoryId |
RTK Query Hooks
The following hooks are available for frontend integration:
useCreateSalaryCategoryMutationuseGetAllSalaryCategoriesQueryuseGetSalaryCategoryByIdQueryuseUpdateSalaryCategoryMutationuseDeleteSalaryCategoryMutation
Summary
The Category Master provides a centralized way to manage classification data used throughout the system, ensuring consistency and structured configuration.
End of Documentation