Add Province and District Fields to Help Requests with Numeric Enums - #67
Merged
Conversation
…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.
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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