Stationed At Master
The Stationed At Master provides a centralized way to manage specific physical or logical locations where employees are stationed, ensuring consistent reporting across HR, deployment, and operational modules.
Navigation Path
Company → Masters → Stationed At Master
1. Stationed At List Page
URL
/masters/stationed-at-master
Page Description
- Displays a comprehensive list of all configured stationing locations.
- Allows administrators to search, filter, and manage station records.
- Locations defined here are typically used in Grade configurations and Employee profiles.
Filter & Search Section
| Field Name | Type | Description |
|---|---|---|
| Code | Text Input | Search for a station by its unique alphabetic or numeric code. |
| Description | Text Input | Search for a station by its full name or description. |
Actions:
- Search → Filters the table based on the entered criteria.
- Reset → Clears all search inputs and reloads the full list.
List Table Columns
| Column Name | Description |
|---|---|
| S No | Serial number. |
| Code | Unique identifier for the location. |
| Description | Detailed name of the station (e.g., "Main Plant", "Head Office"). |
| Actions | Edit and Delete options. |
Row Actions
| Action | Description |
|---|---|
| Edit | Opens Edit Station drawer/form with pre-filled data. |
| Delete | Opens delete confirmation alert. |
2. Add Stationed At Page
Triggered From
Stationed At List Page → Add Station button
Page Description
- Allows administrators to create a new location entry.
- Defines the "Code" which is often used in export reports and legacy integrations.
Add Stationed At – Fields
| Field Name | Type | Mandatory | Description |
|---|---|---|---|
| Code | Text Input | Yes | Enter a unique alphanumeric code for the station. |
| Description | Text Input | Yes | Enter the full descriptive name of the location. |
Actions
| Action | Behavior |
|---|---|
| Save | Validates and saves the new station record. |
| Reset | Clears the entered text values. |
| Cancel | Returns to the Stationed At List page. |
Validation Rules
- Both Code and Description are mandatory.
- Duplicate codes are prohibited within the same company.
- Input is trimmed to avoid spacing-related duplicates.
3. Edit Stationed At Page
Triggered From
Stationed At List Page → Edit icon
Page Description
- Allows updating existing station details.
- Useful for correcting descriptions or updating internal codes without breaking relations.
Editable Fields
| Field Name | Editable |
|---|---|
| Code | Yes |
| Description | Yes |
Actions
| Action | Behavior |
|---|---|
| Update | Saves changes and refreshes the list view. |
| Cancel | Discards changes and returns to the list. |
4. Delete Stationed At Confirmation Alert
Triggered From
Stationed At List Page → Delete icon
Alert Content
- "Are you sure you want to delete this Stationed At record?"
Actions:
- Confirm / Yes → Marks the record as deleted (
isDeleted.status: true). - Cancel → Closes the alert without action.
Field Definitions, Usage, and Calculation Logic
This section provides a technical analysis of the Stationed At Master's data structure.
1. Field Definitions
| Field Name | Data Type | Description | Example Value |
|---|---|---|---|
code | String | Unique alphanumeric identifier (Required). | M-PLANT |
description | String | Human-readable name of the station (Required). | Main Production Plant |
isActive | Boolean | Operational status of the station. | true |
companyId | ObjectId | Reference to the parent Company. | 60d8a... |
2. Field Usage & System Impact
| Category | Validation / Rule | System Behavior |
|---|---|---|
| Mapping | EmployeeProfile | Employees are linked to a station for deployment tracking. |
| Grade Logic | SalaryGradeMaster | Grades can be scoped to specific stations for differential pay. |
| Data Partitioning | companyId | Ensures multi-tenant isolation. |
3. Business Logic
A. Soft Delete Pattern
Records are not permanently purged. The isDeleted flag ensures historical consistency in employee deployment records while hiding the station from new dropdown selections.
B. Search Interface
The backend implements a multi-field search allowing users to find records by either code or description using case-insensitive partial matching.
API Endpoints
The Station At Master module interacts with the following API endpoints:
Base URL
export const STATIONATMASTER_URL = '/api/stationAtMaster'
Endpoints
| Endpoint | Method | Description | Parameters/Body |
|---|---|---|---|
${STATIONATMASTER_URL} | POST | Create a new station | Body: data |
${STATIONATMASTER_URL} | GET | Get all stations | Query: page, limit |
${STATIONATMASTER_URL}/:stationId | GET | Get station by ID | Path: stationId |
${STATIONATMASTER_URL}/:stationId | PATCH | Update an existing station | Path: stationId, Body: body |
${STATIONATMASTER_URL}/delete/:stationId | PATCH | Soft delete a station | Path: stationId |
RTK Query Hooks
The following hooks are available for frontend integration (from stationAtMasterApiSlice.js):
useCreateStationAtMutationuseGetAllStationAtQueryuseGetStationAtByIdQueryuseUpdateStationAtMutationuseDeleteStationAtMutation
Summary
The Stationed At Master ensures consistent location-based grouping of employees, facilitating accurate deployment reporting and station-specific payroll logic.
End of Documentation