City Category / Central Type Master
The City Category / Central Type Master is used to define and manage different city classifications that are referenced across Units, Clients, and Deployments.
1. City Category List Page
URL
/masters/city-category
Purpose
Displays all created city categories and allows users to search, edit, or delete records.
Page Elements
Table Columns
- S No
- City Category
- Actions
Available Features
- Global Search field (top right)
- Column-level search/filter for City Category
- Checkbox selection for rows
- Edit and Delete actions for each record
2. Add City Category
Purpose
Allows users to create a new City Category / Central Type.
Form Fields
- Category Name
- Text input
- Placeholder: Enter Category Name
- Mandatory field
Actions
- Save
- Validates input
- Saves the new city category
- Reset
- Clears the entered data
Validation Rules
- Category Name cannot be empty
- Duplicate category names are not allowed
3. Edit City Category
Purpose
Allows modification of an existing city category.
Behavior
- Clicking the Edit icon opens the record in editable mode
- The Category Name field is pre-filled with existing data
Editable Fields
- Category Name
Actions
- Save
- Updates the city category
- Reset
- Restores the original value
4. Delete City Category
Purpose
Allows removal of an existing city category.
Delete Flow
-
Click the Delete icon from the Actions column
-
A confirmation popup appears:
Are you sure you want to delete this City Category?
-
User options:
- Yes – Deletes the record permanently
- Cancel – Aborts the action
Field Definitions, Usage, and Calculation Logic
This section provides a technical analysis of the City Category Master's data structure and its role in payroll classification.
1. Field Definitions
| Field Name | Data Type | Description | Example Value |
|---|---|---|---|
cityCategoryName | String | Short classification code (Required). | A, B1, C |
companyId | ObjectId | Reference to the parent Company. | 60d8a... |
2. Field Usage & System Impact
| Category | Validation / Rule | System Behavior |
|---|---|---|
| Classification | maxlength: 10 | Enforces short, standardized codes for city categorization. |
| Relational Link | cityCategoryId | Referenced by City Master to group cities for HRA calculations. |
| Data Partitioning | companyId | Ensures city categories are specific to the corporate entity. |
3. Business & Calculation Logic
The City Category Master is a high-level grouping entity with the following technical characteristics:
A. Administrative Lifecycle
- Standardization: City categories (e.g., Tier-1, Tier-2 or A, B, C) are typically used to determine differential allowance rates (like HRA or DA) in salary formulas.
- Soft-Delete: When a category is soft-deleted (
isDeleted.status: true), it is excluded from all active search results and selection dropdowns to prevent new city assignments. - Auditing: All changes to category names are logged via the
loggerutility, capturing theoldValueandnewValuefor compliance tracking.
B. Impact on Salary Formulas
While the master itself is simple, its _id is a critical variable in the Salary Formula Master. The system uses this category to lookup percentage-based or flat-rate components that vary by the cost-of-living index associated with a geographical tier.
The City Category / Central Type Master module interacts with the following API endpoints:
Base URL
export const CITYCATEGORYMASTER_URL = '/api/salaryCityCategoryMaster'
Endpoints
| Endpoint | Method | Description | Parameters/Body |
|---|---|---|---|
${CITYCATEGORYMASTER_URL} | POST | Create a new city category | Body: data |
${CITYCATEGORYMASTER_URL} | GET | Get all city categories | Query: page, limit |
${CITYCATEGORYMASTER_URL}/:categoryId | GET | Get city category by ID | Path: categoryId |
${CITYCATEGORYMASTER_URL}/:categoryId | PATCH | Update an existing city category | Path: categoryId, Body: body |
${CITYCATEGORYMASTER_URL}/delete/:categoryId | PATCH | Delete a city category | Path: categoryId |
RTK Query Hooks
The following hooks are available for frontend integration:
useCreateCityCategoryMutationuseGetAllCityCategoriesQueryuseGetCityCategoryByIdQueryuseUpdateCityCategoryMutationuseDeleteCityCategoryMutation
End of Documentation