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 Name | Type | Description |
|---|---|---|
| Nature Name | Text Input | Filters 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 Name | Description |
|---|---|
| S No | Serial number. |
| Nature | The official name of the salary nature. |
| Actions | Edit and Delete options. |
Row Actions
| Action | Description |
|---|---|
| Edit | Opens the Edit Nature drawer/form with the current value pre-filled. |
| Delete | Opens 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 Name | Type | Mandatory | Description |
|---|---|---|---|
| Nature | Text Input | Yes | Enter the name of the salary nature (e.g., Staff, Worker). |
Actions
| Action | Behavior |
|---|---|
| Save | Validates the name for uniqueness and saves the record. |
| Reset | Clears the text field. |
| Cancel | returns 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 Name | Editable |
|---|---|
| Nature | Yes |
Actions
| Action | Behavior |
|---|---|
| Update | Saves the updated nature name and refreshes the list. |
| Cancel | Discards 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.statustotrue. - Cancel → Dismisses the alert.
Field Definitions, Usage, and Calculation Logic
1. Technical Field Definitions
| Field Name | Data Type | Description | Example Value |
|---|---|---|---|
nature | String | Descriptor for the employee category (Required). | Permanent, Contract |
companyId | ObjectId | Reference to the parent Company. | 60d8a... |
2. Field Usage & System Impact
| Category | Validation / Rule | System Behavior |
|---|---|---|
| Classification | EmployeeProfile | Used to group employees for customized payroll cycles. |
| Data Partitioning | companyId | Ensures multi-tenant isolation. |
| Soft Delete | isDeleted.status | Preserves 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
| Endpoint | Method | Description | Parameters/Body |
|---|---|---|---|
${NATUREMASTER_URL} | POST | Create a new nature | Body: data |
${NATUREMASTER_URL} | GET | Get all active natures | Query: page, limit |
${NATUREMASTER_URL}/:natureId | GET | Get nature by ID | Path: natureId |
${NATUREMASTER_URL}/:natureId | PATCH | Update an existing nature | Path: natureId, Body: body |
${NATUREMASTER_URL}/delete/:natureId | PATCH | Soft delete a nature | Path: natureId |
RTK Query Hooks
Available in salaryNatureMasterApiSlice.js:
useCreateSalaryNatureMutationuseGetAllSalaryNaturesQueryuseGetSalaryNatureByIdQueryuseUpdateSalaryNatureMutationuseDeleteSalaryNatureMutation
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