Frontend
Masters
City Category

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

  1. Click the Delete icon from the Actions column

  2. A confirmation popup appears:

    Are you sure you want to delete this City Category?

  3. 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 NameData TypeDescriptionExample Value
cityCategoryNameStringShort classification code (Required).A, B1, C
companyIdObjectIdReference to the parent Company.60d8a...

2. Field Usage & System Impact

CategoryValidation / RuleSystem Behavior
Classificationmaxlength: 10Enforces short, standardized codes for city categorization.
Relational LinkcityCategoryIdReferenced by City Master to group cities for HRA calculations.
Data PartitioningcompanyIdEnsures 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 logger utility, capturing the oldValue and newValue for 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

EndpointMethodDescriptionParameters/Body
${CITYCATEGORYMASTER_URL}POSTCreate a new city categoryBody: data
${CITYCATEGORYMASTER_URL}GETGet all city categoriesQuery: page, limit
${CITYCATEGORYMASTER_URL}/:categoryIdGETGet city category by IDPath: categoryId
${CITYCATEGORYMASTER_URL}/:categoryIdPATCHUpdate an existing city categoryPath: categoryId, Body: body
${CITYCATEGORYMASTER_URL}/delete/:categoryIdPATCHDelete a city categoryPath: categoryId

RTK Query Hooks

The following hooks are available for frontend integration:

  • useCreateCityCategoryMutation
  • useGetAllCityCategoriesQuery
  • useGetCityCategoryByIdQuery
  • useUpdateCityCategoryMutation
  • useDeleteCityCategoryMutation

End of Documentation