Skip to content

Add Province and District Fields to Help Requests with Numeric Enums - #67

Merged
SupunVirajDevendra merged 4 commits into
mainfrom
dev_deva
Dec 1, 2025
Merged

Add Province and District Fields to Help Requests with Numeric Enums#67
SupunVirajDevendra merged 4 commits into
mainfrom
dev_deva

Conversation

@SupunVirajDevendra

@SupunVirajDevendra SupunVirajDevendra commented Dec 1, 2025

Copy link
Copy Markdown
Collaborator

#Summary
Adds province and district fields to help requests, using numeric enums for better query performance. Fields are mandatory in the frontend and optional in the backend.
Changes

#New features
Province and district selection in the help request form
Numeric enums for provinces (1-9) and districts (1-25) for improved database

#performance
Province-to-district mapping with validation

#Backend changes
Added Province and District enums in libs/shared/src/enums/location.enum.ts
Updated HelpRequestModel to store province/district as INTEGER (optional)
Updated DTOs to use enum types with validation
Updated interfaces to use enum types
Updated DAO to handle enum values

#Frontend changes
Added province and district dropdowns to EmergencyRequestForm
Province dropdown shows all 9 Sri Lanka provinces
District dropdown dynamically updates based on selected province
Both fields are mandatory with validation
Form stores and submits numeric enum values

#Database schema
province: INTEGER (nullable) - Stores Province enum value
district: INTEGER (nullable) - Stores District enum value

…alidation and user guidance

- Updated EmergencyRequestForm to require valid GPS coordinates, ensuring users select their location on the map.
- Enhanced error messages for location selection to provide clearer instructions.
- Modified MapLocationPicker to improve geolocation accuracy checks and user feedback on location retrieval issues.
- Increased timeout for geolocation requests to enhance accuracy and added validation for location accuracy.
- Added a User Guide button to the LandingPage, triggering a dialog with options for simple, detailed, and volunteer guides.
- Included structured content in the guide dialog to assist users in navigating the platform effectively.
- Introduced a Video Guide section on the LoginPage, featuring an embedded YouTube video to help users understand the system's functionalities.
…elds

- Updated HelpRequestDao to include province and district in create and update operations.
- Modified HelpRequestModel to define province and district fields with appropriate data types.
- Enhanced EmergencyRequestForm to require province and district selection, including validation and dynamic district options based on selected province.
- Updated DTOs and interfaces to incorporate province and district for better data handling across the application.
…strict

- Changed province and district fields from string to numeric values (0) for better validation.
- Updated form initialization and validation logic to reflect the new data types.
- Adjusted error messages and select options to accommodate the numeric representation.
@SupunVirajDevendra SupunVirajDevendra linked an issue Dec 1, 2025 that may be closed by this pull request
@SupunVirajDevendra
SupunVirajDevendra merged commit 4fecb6f into main Dec 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]

1 participant