Skip to content

Request Enum Tables – Database Documentation

JASMITHA SRI AKURATHI edited this page Dec 8, 2025 · 1 revision

This page documents all Request Enum Tables (5 total) used by the Saayam platform. These tables store reference values (static enums) that define controlled vocabularies for the main request table such as type, status, priority, etc.

This wiki includes:

  • ✔ Description of each enum table
  • ✔ Table structure (DDL summary)
  • ✔ CSV seed values (DML)
  • ✔ Purpose & hierarchy
  • ✔ ER relationship with request table

📚 1. Overview The Saayam request system uses five enum tables that act as lookup/reference tables. These tables ensure:

  • Consistency across all services
  • Prevent invalid values
  • Enable easy updates to classification logic
  • Improve data integrity

These five enum tables are:

Enum Table Purpose
request_status Tracks the lifecycle stage of a request
request_type Specifies whether the request is In-Person or Remote
request_priority Indicates urgency level
request_for Specifies whether the request is for SELF or OTHER
request_isleadvol Indicates whether volunteer is a lead or not

All these tables are referenced by the main request table via foreign keys.

🧩 2. Entity-Relationship Overview

Main Table: request Foreign Key Links (typical design):

request.request_status_id → request_status.req_status_id

request.request_type_id → request_type.req_type_id

request.request_priority_id → request_priority.req_priority_id

request.request_for_id → request_for.req_for_id

request.is_lead_volunteer_id → request_isleadvol.req_islead_id

📘 3. Enum Table Documentation

1️⃣ request_status

Purpose - Represents the lifecycle state of a request — from creation to closure.

DDL Summary

CREATE TABLE request_status ( req_status_id SERIAL PRIMARY KEY, req_status_id SERIAL PRIMARY KEY, req_status VARCHAR(25) NOT NULL, req_status_desc VARCHAR(125), last_updated_date TIMESTAMP );

Seed Values (CSV / DML)

ID Status Description
0 CREATED Request submitted and awaiting review
1 MATCHING_VOLUNTEER System is finding a volunteer
2 IN_PROGRESS Volunteer is actively working
3 RESOLVED Successfully completed
4 CANCELLED User/admin canceled request
5 DELETED Removed from system
6 RATED_BY_REQUESTER Requester submitted rating
7 RATED_BY_VOLUNTEER Volunteer submitted rating

Role in System - Determines where the request currently stands and controls transitions between request lifecycle stages.

2️⃣ request_type

Purpose - Defines how a request will be served — physically or remotely.

DDL Summary

CREATE TABLE request_type ( req_type_id SERIAL PRIMARY KEY, req_type VARCHAR(25), req_type_desc VARCHAR(125), last_updated_date TIMESTAMP );

Seed Values

ID Type Description
0 IN_PERSON Help requires physical presence
1 REMOTE Help can be provided virtually

Role in System - Used for volunteer matching logic, scheduling, and logistics.

3️⃣ request_priority

Purpose - Indicates urgency of each request.

DDL Summary

CREATE TABLE request_priority ( req_priority_id SERIAL PRIMARY KEY, req_priority VARCHAR(25) NOT NULL, req_priority_desc VARCHAR(125), last_updated_date TIMESTAMP, UNIQUE (req_priority_id) );

Seed Values

ID Priority Description
0 LOW Can wait; not urgent
1 MEDIUM Needs attention soon
2 HIGH Urgent action required
3 CRITICAL Immediate help needed

Role in System - Determines volunteer assignment urgency and request ordering logic.

4️⃣ request_for

Purpose - Defines who the request is being created for.

DDL Summary

CREATE TABLE request_for ( req_for_id SERIAL PRIMARY KEY, req_for VARCHAR(25) NOT NULL, req_for_desc VARCHAR(125), last_updated_date TIMESTAMP );

Seed Values

ID For Description
0 SELF User is requesting for themselves
1 OTHER User is requesting for someone who has no account

Role in System - Affects the flow of communication, notifications, and profile linking.

5️⃣ request_isleadvol

Purpose - Determines whether the volunteer is the lead volunteer for that request.

CREATE TABLE request_isleadvol ( req_islead_id SERIAL PRIMARY KEY, req_islead VARCHAR(15) NOT NULL, req_islead_desc VARCHAR(100), last_updated_date TIMESTAMP );

Seed Values

ID Value Description
0 NO Volunteer contributes but is not the lead
1 YES Main point of contact with authority over the process

Role in System - Helps define responsibility and workflow hierarchy during request fulfillment.

🔗 4. Combined ER Diagram

ER_diagram

🌍 5. Regional Differences (Virginia vs Ireland)

Domain Virginia Region Ireland Region
user_id format Standard numeric/UUID Uses prefix “EID-”
Enum tables Same structure Same tables; values identical
Request logic Original implementation Must mirror Virginia with updated user_id handling

The enum tables themselves do not change between regions; only integrations (such as user_id format) differ.

Clone this wiki locally