Frontend
Masters
Religion Master

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 NameTypeDescription
Religion NameText InputFilters 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 NameDescription
S NoSerial number.
ReligionThe official name of the religion.
ActionsEdit and Delete options.

Row Actions

ActionDescription
EditOpens Edit Religion drawer/form with pre-filled data.
DeleteOpens 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 NameTypeMandatoryDescription
ReligionText InputYesEnter the official religion name.

Actions

ActionBehavior
SaveValidates and saves the religion entry.
ResetClears the entered text value.
CancelReturns 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 NameEditable
ReligionYes

Actions

ActionBehavior
UpdateSaves the updated religion details.
CancelDiscards 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 NameData TypeDescriptionExample Value
religionNameStringOfficial name of the religion (Required).Hinduism, Islam
companyIdObjectIdReference to the parent Company.60d8a...

2. Field Usage & System Impact

CategoryValidation / RuleSystem Behavior
UniquenessreligionName + companyIdEnforced unique index to prevent duplicate religions within the same company.
Data PartitioningcompanyIdEnsures 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

EndpointMethodDescriptionParameters/Body
${RELIGIONMASTER_URL}POSTCreate a new religionBody: data
${RELIGIONMASTER_URL}GETGet all religionsQuery: page, limit
${RELIGIONMASTER_URL}/:religionIdGETGet religion by IDPath: religionId
${RELIGIONMASTER_URL}/:religionIdPATCHUpdate an existing religionPath: religionId, Body: body
${RELIGIONMASTER_URL}/delete/:religionIdPATCHSoft delete a religionPath: religionId

RTK Query Hooks

The following hooks are available for frontend integration (from religionMasterApiSlice.js):

  • useCreateReligionMutation
  • useGetAllReligionsQuery
  • useGetReligionByIdQuery
  • useUpdateReligionMutation
  • useDeleteReligionMutation

Summary

The Religion Master provides a consistent data set for employee demographic profiling, ensuring reporting accuracy and organizational compliance.


End of Documentation