Frontend
Masters
Nature Master

Salary Nature Master

The Salary Nature Master defines the broad categories or "natures" of employment and salary structures (e.g., Permanent, Contractual, Trainee). These tags are used to differentiate payroll processing rules and statutory applicability at a high level.

Navigation Path

Company → Masters → Nature Master


1. Nature List Page

URL

/masters/nature-master

Page Description

  • Displays all salary natures configured for the company.
  • Allows administrators to quickly search, edit, or remove employment nature tags.
  • Natures defined here appear as options in the Employee Profile and Salary Structure assignments.

Filter & Search Section

Field NameTypeDescription
Nature NameText InputFilters the list by the nature's descriptive name.

Actions:

  • Search → Triggers a debounced filter of the table.
  • Reset → Clears search input and reloads all active natures.

List Table Columns

Column NameDescription
S NoSerial number.
NatureThe official name of the salary nature.
ActionsEdit and Delete options.

Row Actions

ActionDescription
EditOpens the Edit Nature drawer/form with the current value pre-filled.
DeleteOpens a delete confirmation alert for soft-deletion.

2. Add Nature Page

Triggered From

Nature List Page → Add Nature button

Page Description

  • Allows administrators to define a new salary nature category.
  • Values entered here are used as the primary classification for payroll grouping.

Add Nature – Fields

Field NameTypeMandatoryDescription
NatureText InputYesEnter the name of the salary nature (e.g., Staff, Worker).

Actions

ActionBehavior
SaveValidates the name for uniqueness and saves the record.
ResetClears the text field.
Cancelreturns to the Nature List page.

Validation Rules

  • Nature field cannot be empty.
  • Duplicate nature names are prohibited within the same company.
  • Input is trimmed to avoid accidental duplicates.

3. Edit Nature Page

Triggered From

Nature List Page → Edit icon

Page Description

  • Allows renaming an existing nature category.
  • Renaming a nature will reflect across all linked employee profiles instantly.

Editable Fields

Field NameEditable
NatureYes

Actions

ActionBehavior
UpdateSaves the updated nature name and refreshes the list.
CancelDiscards changes and returns to the list.

4. Delete Nature Confirmation Alert

Triggered From

Nature List Page → Delete icon

Alert Content

  • "Are you sure you want to delete this Nature?"

Actions:

  • Confirm / Yes → Sets isDeleted.status to true.
  • Cancel → Dismisses the alert.

Field Definitions, Usage, and Calculation Logic

1. Technical Field Definitions

Field NameData TypeDescriptionExample Value
natureStringDescriptor for the employee category (Required).Permanent, Contract
companyIdObjectIdReference to the parent Company.60d8a...

2. Field Usage & System Impact

CategoryValidation / RuleSystem Behavior
ClassificationEmployeeProfileUsed to group employees for customized payroll cycles.
Data PartitioningcompanyIdEnsures multi-tenant isolation.
Soft DeleteisDeleted.statusPreserves historical data integrity for closed payroll periods.

3. Business Logic

A. Multi-Tenant Scoping

Every nature is strictly scoped to a companyId. This prevents a "Nature" created in one branch or sister company from appearing in another, supporting complex corporate hierarchies.

B. Normalization

The system automatically trims leading and trailing whitespace from the nature field during both creation and update, preventing the creation of visually identical but technically unique records (e.g., "Staff" vs "Staff ").


API Endpoints

Base URL

export const NATUREMASTER_URL = '/api/salaryNatureMaster'

Endpoints

EndpointMethodDescriptionParameters/Body
${NATUREMASTER_URL}POSTCreate a new natureBody: data
${NATUREMASTER_URL}GETGet all active naturesQuery: page, limit
${NATUREMASTER_URL}/:natureIdGETGet nature by IDPath: natureId
${NATUREMASTER_URL}/:natureIdPATCHUpdate an existing naturePath: natureId, Body: body
${NATUREMASTER_URL}/delete/:natureIdPATCHSoft delete a naturePath: natureId

RTK Query Hooks

Available in salaryNatureMasterApiSlice.js:

  • useCreateSalaryNatureMutation
  • useGetAllSalaryNaturesQuery
  • useGetSalaryNatureByIdQuery
  • useUpdateSalaryNatureMutation
  • useDeleteSalaryNatureMutation

Summary

The Salary Nature Master ensures consistent high-level grouping of employee salary profiles, facilitating specialized payroll logic and accurate labor category reporting.


End of Documentation