Frontend
Masters
City

City Master

Navigation Path

Company → Masters → City Master


1. City List Page

URL

/masters/city-master

Page Description

  • Displays a list of all cities configured in the system
  • Shows statutory applicability details per city
  • Provides actions to add, edit, and delete city records

List Table Columns

Column NameDescription
S NoSerial number
StateState associated with the city
City NameName of the city
Central / StateIndicates whether Central or State
Central TypeCentral classification type
PF NoPF number mapped to the city
ESI NoESI number mapped to the city
Is MetroIndicates whether the city is metro
PT ApplicableProfessional Tax applicability
LWF ApplicableLabour Welfare Fund applicability
ActionsEdit and Delete options

Row Actions

ActionDescription
EditOpens Edit City page with pre-filled data
DeleteOpens delete confirmation alert

2. Add City Page

Triggered From

City List Page → Add City button

Page Description

  • Allows admins to add a new city under a selected state
  • Enables statutory and tax-related configuration at city level

Add City – Fields

Field NameTypeMandatoryDescription
StateDropdownYesSelect or create a state
City NameText InputYesEnter the city name
Central / StateDropdownYesSelect Central or State
Central TypeDropdownConditionalEnabled when Central is selected
PF NoText InputNoEnter PF number
ESI NoText InputNoEnter ESI number
Is MetroCheckboxNoIndicates metro city
PT ApplicableCheckboxNoEnables Professional Tax
LWF ApplicableCheckboxNoEnables Labour Welfare Fund

Actions

ActionBehavior
SaveValidates and saves the city
ResetClears all entered values
CancelReturns to City List page

Validation Rules

  • State selection is mandatory
  • City Name cannot be empty
  • Central Type is mandatory if Central is selected
  • Duplicate city names are not allowed within the same state

3. Edit City Page

/masters/city-master/edit/:id

Triggered From

City List Page → Edit icon

Page Description

  • Allows updating existing city details
  • All fields are pre-filled with saved data

Editable Fields

Field NameEditable
StateYes
City NameYes
Central / StateYes
Central TypeYes
PF NoYes
ESI NoYes
Is MetroYes
PT ApplicableYes
LWF ApplicableYes

Actions

ActionBehavior
UpdateSaves changes
CancelDiscards changes and navigates back

4. Delete City Confirmation Alert

Triggered From

City List Page → Delete icon

Alert Content

  • Confirmation message before deletion

Actions:

  • Confirm / Yes → Deletes the city
  • Cancel → Closes the alert without action

Delete Behavior

  • City is removed permanently after confirmation
  • If the city is mapped to other records, deletion may be restricted


Field Definitions, Usage, and Calculation Logic

This section provides a technical analysis of the City Master's data structure and its impact on payroll and statutory compliance.

1. Field Definitions

Field NameData TypeDescriptionExample Value
cityNameStringOfficial city name (Required).Pune
stateObjectIdReference to the parent State Master.60d8a...
cityCategoryIdObjectIdReference to City Category (A, B, C).60d8c...
isMetroBooleanFlag for Metro/Non-Metro designation.true
PTApplicableBooleanIf Professional Tax should be deducted.true
LWFApplicableBooleanIf Labour Welfare Fund should be deducted.true
PFNoStringPF number for the city location.PN-00123
ESINoStringESI number for the city location.ESI-45678

2. Field Usage & System Impact

CategoryValidation / RuleSystem Behavior
TaxationPTApplicableTriggers the calculation of Professional Tax based on the state's slab rules.
WelfareLWFApplicableIncludes the employee in LWF contribution cycles (Employer/Employee).
HRA ReliefisMetroAffects Income Tax calculations (50% HRA for Metro, 40% for Non-Metro).
Unique Keystate + cityNamePrevents duplicate cities within the same state for a specific company.

3. Business & Calculation Logic

The City Master is the primary configuration point for locale-based salary logic:

A. Professional Tax (PT) & LWF Logic

The system uses the PTApplicable and LWFApplicable flags as master switches. If these are set to false, no deductions will occur for employees assigned to this city, even if they meet the salary thresholds defined in the state slabs.

B. Bulk Import & Data Normalization

The /all-in-one-city-import endpoint automates city-state mapping:

  • Auto-State Creation: If the provided State in Excel doesn't exist, the system initializes a new State record (Parent Country: INDIA).
  • Data Casting: Excel values for lwf_applicable and pt_applicable (often 1 or 0) are atomically cast to Boolean true/false.
  • Defaulting: Imported cities are defaulted to centralOrState: 'State' and isMetro: false unless explicitly updated later.

C. Relational Hierarchy

City records are heavily indexed (state, cityCategoryId) to ensure rapid lookups during employee document creation. Deletion is restricted if active Units or Deployments are currently mapped to the city.


The City Master module interacts with the following API endpoints:

Base URL

export const CITYMASTER_URL = '/api/salaryCityMaster'

Endpoints

EndpointMethodDescriptionParameters/Body
${CITYMASTER_URL}POSTCreate a new cityBody: data
${CITYMASTER_URL}GETGet all citiesQuery: page, limit
${CITYMASTER_URL}/:cityIdGETGet city by IDPath: cityId
${CITYMASTER_URL}/searchGETSearch city mastersQuery: cityName, page, limit
${CITYMASTER_URL}/:cityIdPATCHUpdate an existing cityPath: cityId, Body: body
${CITYMASTER_URL}/delete/:cityIdPATCHDelete a cityPath: cityId

RTK Query Hooks

The following hooks are available for frontend integration:

  • useCreateCityMutation
  • useGetAllCitiesQuery
  • useGetCityByIdQuery
  • useSearchCityMastersQuery
  • useUpdateCityMutation
  • useDeleteCityMutation

End of Documentation