Religion Master
The Religion Master ensures standardized religion data across the system, supporting HR records, demographic reporting, and compliance requirements.
Navigation Path
Company → Masters → Religion Master
1. Religion List Page
URL
/religion-master/master
Page Description
- Displays all configured religions in the system.
- Allows users to search, edit, and delete religion records.
- Records are scoped by Company ID to ensure data isolation.
Filter & Search Section
| Field Name | Type | Description |
|---|---|---|
| Religion Name | Text Input | Filters the list by the religion's name. |
Actions:
- Search → Filters religions based on the entered name.
- Reset → Clears filter and reloads the full list.
List Table Columns
| Column Name | Description |
|---|---|
| S No | Serial number. |
| Religion | The official name of the religion. |
| Actions | Edit and Delete options. |
Row Actions
| Action | Description |
|---|---|
| Edit | Opens Edit Religion drawer/form with pre-filled data. |
| Delete | Opens delete confirmation alert. |
2. Add Religion Page
Triggered From
Religion List Page → Add Religion button
Page Description
- Allows administrators to add a new religion entry.
- Ensures data consistency for employee profiles.
Add Religion – Fields
| Field Name | Type | Mandatory | Description |
|---|---|---|---|
| Religion | Text Input | Yes | Enter the official religion name. |
Actions
| Action | Behavior |
|---|---|
| Save | Validates and saves the religion entry. |
| Reset | Clears the entered text value. |
| Cancel | Returns to the Religion List page. |
Validation Rules
- Religion Name cannot be empty.
- Duplicate names are not allowed within the same company.
- Input is trimmed to prevent duplicates caused by accidental spacing.
3. Edit Religion Page
Triggered From
Religion List Page → Edit icon
Page Description
- Allows modification of an existing religion entry.
- Fields are pre-filled with the current record data.
Editable Fields
| Field Name | Editable |
|---|---|
| Religion | Yes |
Actions
| Action | Behavior |
|---|---|
| Update | Saves the updated religion details. |
| Cancel | Discards changes and returns to the list. |
4. Delete Religion Confirmation Alert
Triggered From
Religion List Page → Delete icon
Alert Content
- "Are you sure you want to delete this Religion?"
Actions:
- Confirm / Yes → Permanently deletes the religion.
- Cancel → Closes the alert without action.
Delete Behavior
- Soft-deletion is applied (
isDeleted.status: true). - Deletion may be restricted if the religion is already mapped to active employee records.
Field Definitions, Usage, and Calculation Logic
This section provides a technical analysis of the Religion Master's data structure and its role in HR profiling.
1. Field Definitions
| Field Name | Data Type | Description | Example Value |
|---|---|---|---|
religionName | String | Official name of the religion (Required). | Hinduism, Islam |
companyId | ObjectId | Reference to the parent Company. | 60d8a... |
2. Field Usage & System Impact
| Category | Validation / Rule | System Behavior |
|---|---|---|
| Uniqueness | religionName + companyId | Enforced unique index to prevent duplicate religions within the same company. |
| Data Partitioning | companyId | Ensures multi-tenant isolation; religions are company-specific. |
3. Business & Calculation Logic
A. Soft Delete Pattern
Instead of hard deletion, the system uses an isDeleted status flag. This keeps historical data intact for existing employee records while removing the option for future selections.
B. Search Logic
The system implements a case-insensitive regex search for religion names, allowing for partial matches during lookup.
API Endpoints
The Religion Master module interacts with the following API endpoints:
Base URL
export const RELIGIONMASTER_URL = '/api/religionMaster'
Endpoints
| Endpoint | Method | Description | Parameters/Body |
|---|---|---|---|
${RELIGIONMASTER_URL} | POST | Create a new religion | Body: data |
${RELIGIONMASTER_URL} | GET | Get all religions | Query: page, limit |
${RELIGIONMASTER_URL}/:religionId | GET | Get religion by ID | Path: religionId |
${RELIGIONMASTER_URL}/:religionId | PATCH | Update an existing religion | Path: religionId, Body: body |
${RELIGIONMASTER_URL}/delete/:religionId | PATCH | Soft delete a religion | Path: religionId |
RTK Query Hooks
The following hooks are available for frontend integration (from religionMasterApiSlice.js):
useCreateReligionMutationuseGetAllReligionsQueryuseGetReligionByIdQueryuseUpdateReligionMutationuseDeleteReligionMutation
Summary
The Religion Master provides a consistent data set for employee demographic profiling, ensuring reporting accuracy and organizational compliance.
End of Documentation