Commit Graph

159 Commits

Author SHA1 Message Date
vergiLgood1 aa675f04f9 first commit 2025-08-05 14:30:36 +07:00
vergiLgood1 569e1d6049 feat: Enhance selfie verification step with navigation buttons and validation
- Added StepNavigationButtons to SelfieVerificationStep for improved navigation.
- Implemented validation logic to ensure selfie verification is completed before proceeding.
- Updated AuthButton to use theme colors for better consistency.
- Modified OfficerModel to allow nullable fields and added new fields for enhanced data handling.
- Set default role to Viewer in RoleSelectionController.
- Updated role selection screen with new asset for improved UI.
- Enhanced UserMetadataModel with new methods for updating officer and viewer data.
- Added logging to OfficerRepository and UserRepository for better debugging.
- Improved image uploader error overlay with a blurred background for better visibility.
- Added support for SVG images in StateScreen widget.
- Introduced custom input decoration in CustomTextField for more flexibility.
- Reduced total steps for officers from 4 to 3 in TNum constants.
- Fixed schema for patrol_units in Prisma to ensure correct field definitions.
- Created StepNavigationButtons widget for reusable navigation controls across steps.
2025-05-27 00:44:32 +07:00
vergiLgood1 105d992faa feat: Enhance KTP Validation Logic and Update Patrol Unit Selection UI
- Expanded KTP validation to include additional required fields: 'jenis_kelamin' and 'kewarganegaraan'.
- Improved error handling for missing or invalid gender and nationality during KTP validation.
- Updated Patrol Unit Selection Screen to reflect changes in UI elements, including renaming 'Position' to 'Rank' and enhancing dark mode support.
- Refactored image uploader and circular loader components to utilize theme-aware colors for better visual consistency.
2025-05-26 16:22:52 +07:00
vergiLgood1 5bd92a0399 feat: Enhance Selfie Verification Step with Dark Mode Support and Improved Snackbars
- Added dark mode support for warning colors in the Selfie Verification Step.
- Replaced hardcoded colors with theme-aware colors for better UI consistency.
- Updated Snackbar notifications to use a centralized loader utility for better user feedback.
- Refactored the auto-verify toggle and bypass liveness check functionality for clarity.
- Improved layout and styling for better user experience.

fix: Update Units Repository with Logging and Error Handling

- Integrated logging for unit fetching operations in the Units Repository.
- Added checks for empty unit lists to prevent unnecessary errors.
- Improved error handling for database operations.

refactor: Revamp Image Source Dialog and Uploader for Dark Mode

- Enhanced Image Source Dialog to support dark mode styling.
- Updated Image Uploader to use a custom circular loader for better visual feedback during uploads.

style: Standardize Step Indicator Colors Based on Theme

- Adjusted step indicator icon colors to adapt based on the current theme (dark/light).

chore: Update Tips Container to Use New Color Constants

- Refactored Tips Container to utilize new color constants for better maintainability.

style: Introduce New Color Constants for Card Styles

- Added new color constants for card backgrounds, borders, and text to improve UI consistency across the application.

fix: Adjust Total Steps for Officer Selection Process

- Updated the total steps for officer selection from 5 to 4 to reflect the current flow.

chore: Add Patrol Unit Selection Screen for Officer Information

- Implemented a new Patrol Unit Selection Screen to allow officers to configure their patrol units.
- Integrated selection modes and unit creation functionality for enhanced user experience.
2025-05-26 13:31:12 +07:00
vergiLgood1 64c9f233a1 Refactor code structure for improved readability and maintainability 2025-05-24 14:50:31 +07:00
vergiLgood1 512b29c54d add edge function for detect and verify faces with aws rekognition 2025-05-23 20:35:37 +07:00
vergiLgood1 a35ba880c5 Refactor code structure for improved readability and maintainability 2025-05-23 12:18:34 +07:00
vergiLgood1 c26d749026 feat: Add KTP model for Indonesian ID card representation
feat: Implement PermissionModel for role-based access control

feat: Create ResourceModel to manage resources with associated permissions

feat: Develop UserMetadataModel for user-related data management

feat: Implement AWS Signature helper for secure API requests

feat: Create detect-face function for AWS Rekognition integration

feat: Implement send-email function using Resend API

feat: Develop verify-face function for comparing KTP and selfie images
2025-05-23 08:33:52 +07:00
vergiLgood1 7f6f0c40b7 Add animation for empty address and implement custom SliverPersistentHeaderDelegate
- Added a new JSON animation file for empty address in the assets/images/animations directory.
- Created a custom SliverPersistentHeaderDelegate class for tab bar functionality in custom_silverbar.dart.
- Introduced a global form key management class to streamline form key usage across the application in form_key.dart.
2025-05-22 09:42:28 +07:00
vergiLgood1 ac39366371 feat: Update user metadata model and authentication flow; enhance ID card verification process and error handling 2025-05-20 03:30:19 +07:00
vergiLgood1 867efe0bc9 Add role selection 2025-05-19 13:35:57 +07:00
vergiLgood1 c7bdb24ceb feat: Add triggers and functions for user management and location handling
- Implemented user creation, update, and deletion triggers to manage officer and standard user data.
- Created functions to handle user type changes and conditional updates based on user metadata.
- Added a function to retrieve nearby units based on geographical coordinates.
- Established triggers to update distance to units upon location changes.
- Created spatial indexes for efficient querying of units and locations.
- Added a function to delete the current user from the auth.users table.
2025-05-18 13:52:26 +07:00
vergiLgood1 ffed8b8ede feat(panic-button): add models for events, evidences, incident logs, and sessions
- Implement EventModel with JSON serialization and deserialization.
- Create EvidenceModel with associated JSON handling.
- Develop IncidentLogModel to manage incident logs and their evidences.
- Introduce SessionsModel to track user sessions related to events.
- Update index file to export new models.

feat(personalization): introduce permissions and resources models

- Add PermissionModel to manage user permissions with JSON support.
- Create ResourceModel to define resources and their associated permissions.
- Ensure proper serialization and deserialization for both models.

chore(database): update Prisma schema for new models and relationships

- Add new models: events, evidences, incident_logs, sessions, permissions, and resources.
- Define relationships between users, roles, and permissions.
- Update existing models to maintain referential integrity.
- Introduce enums for session status, contact message status, crime rates, and crime status.
2025-05-16 18:41:16 +07:00
vergiLgood1 7ad427baf6 feat: Update pubspec.yaml with new dependencies and local assets
- Updated description format in pubspec.yaml
- Added multiple utility packages for enhanced functionality
- Included local assets and fonts for better UI design
- Updated widget test to reference the new app structure
- Registered new plugins in generated_plugin_registrant.cc for Windows
- Updated generated_plugins.cmake to include new plugins
- Modified Supabase config to allow additional redirect URLs
2025-05-16 15:42:03 +07:00
vergiLgood1 4b0bae1bcd feat: Implement migration and seeding for officers and patrol units
- Added migration to change primary key type for patrol_units and update foreign key constraints in officers table.
- Created seeder for officers, generating random data and ensuring each officer is linked to a patrol unit.
- Developed seeder for patrol units, including logic for generating patrol types, statuses, and locations based on police units.
- Enhanced Supabase triggers for user creation, updates, and deletions to handle officer-specific logic and maintain data integrity.
- Introduced GIS functions and triggers to calculate distances between locations and units, optimizing spatial queries.
2025-05-16 00:50:30 +07:00
vergiLgood1 223195e3fb Refactor map utility functions and components
- Moved map utility functions from `map.ts` to `map/common.ts` for better organization.
- Updated imports in `district-extrusion-layer.tsx`, `district-layer.tsx`, `layers.tsx`, and `distance-info.tsx` to reflect the new location of utility functions.
- Enhanced `DistrictFillLineLayer` to improve handling of fill color expressions and opacity based on active controls.
- Introduced new types for crime source in `map.ts` and updated relevant components to use these types.
- Added a new `IncidentDetailTab` component to display detailed information about incidents, including severity and status.
- Improved handling of severity and status information across components for consistency and clarity.
2025-05-15 15:47:56 +07:00
vergiLgood1 2ab60befd8 feat: Enhance Crime Sidebar and Incident Tab with Recent Incidents
- Updated CrimeSidebar to accept recent incidents as a prop for user reports from the last 24 hours.
- Modified SidebarIncidentsTab to format and display recent incidents, including filtering by category and sorting by timestamp.
- Adjusted CrimeMap to manage the selected year based on the source type and to handle recent incidents data.
- Renamed MapLegend to ClusterLegend for clarity and updated its props accordingly.
2025-05-15 14:15:18 +07:00
vergiLgood1 c3eeb4051e refactor: optimize crime analytics hook and improve filtering logic 2025-05-15 12:35:47 +07:00
vergiLgood1 4590e21c39 Refactor map layers: consolidate imports, enhance type definitions, and improve layer management. Remove UnclusteredPointLayer and introduce AllIncidentsLayer for better incident handling and visualization. 2025-05-15 12:21:24 +07:00
vergiLgood1 952bdbed8f feat: implement centralized layer visibility management across map layers 2025-05-15 10:55:34 +07:00
vergiLgood1 ba191c5e88 feat: add layer visibility management for recent incidents and ensure proper initialization 2025-05-15 10:19:25 +07:00
vergiLgood1 da93032a24 fix: adjust ping animation duration and simplify keyframes for better performance 2025-05-15 10:09:31 +07:00
vergiLgood1 b9f69ade3b feat: update incident logs structure and add popup component
- Modified IIncidentLogs interface to include user details and additional fields.
- Implemented IncidentLogsPopup component for displaying incident details on the map.
- Added functionality to format timestamps, display severity badges, and show reporter information.
- Created SQL functions for retrieving nearby units and updating location distances in the database.
- Added spatial indexes to optimize queries related to units and locations.
2025-05-14 19:21:36 +07:00
vergiLgood1 849b3c1ae3 fix: fix kesalahan oengambilan properti distance pada units layer 2025-05-14 17:17:10 +07:00
vergiLgood1 58f033d0e4 Refactor map layers and pop-ups for improved incident handling and UI updates
- Removed unused CrimePopup component and replaced with IncidentPopup in layers.tsx
- Consolidated incident click handling logic in UnitsLayer and RecentIncidentsLayer
- Updated UnitsLayer to fetch nearest units and display them in the IncidentPopup
- Enhanced UI for displaying nearby police units with loading states and better formatting
- Cleaned up console logs for production readiness
- Adjusted map flyTo parameters for better user experience
- Added wave circle animations for incident markers
2025-05-14 16:14:40 +07:00
vergiLgood1 f4b6d19eb2 feat: remove fill when district pop up is close 2025-05-14 12:31:31 +07:00
vergiLgood1 5808758855 Refactor map layer animations to use BASE_DURATION and introduce new constants for 3D view settings
- Updated DistrictFillLineLayer to use BASE_DURATION for animation duration instead of a hardcoded value.
- Commented out the flyTo animation in DistrictFillLineLayer for potential future use.
- Modified Layers component to utilize ZOOM_3D and PITCH_3D constants for flyTo animations, enhancing readability and maintainability.
2025-05-14 12:11:34 +07:00
vergiLgood1 8a1582c994 refactor: streamline map constants and enhance animation handling in layers 2025-05-14 12:04:21 +07:00
vergiLgood1 6c96c1140c Refactor tooltip and control types for improved clarity and consistency
- Renamed ITooltips to ITooltipsControl for better context in map controls.
- Updated type references in search-control, tooltips, crime-map, and layers to use the new ITooltipsControl type.
- Enhanced fill opacity logic in map layers based on active control state.
- Introduced getFillOpacity utility function to centralize opacity determination based on active control.
- Adjusted event handling for district clicks to ensure proper focus and visibility toggling.
- Cleaned up CSS styles by commenting out unused styles for circles.
2025-05-14 11:08:06 +07:00
vergiLgood1 9c6e005839 fix: fix bug district pop up always show while selected district is not focus 2025-05-14 10:06:09 +07:00
vergiLgood1 834d4b02cf feat: Enhance unit popup to display nearby incidents and loading state 2025-05-14 08:56:08 +07:00
vergiLgood1 2c11cc5991 fix: Update district coordinates and improve unit seeding logic 2025-05-14 08:15:27 +07:00
vergiLgood1 9f9b14992d add seeds supaabse 2025-05-14 07:08:11 +07:00
vergiLgood1 db8e2a6321 add seeds supaabse 2025-05-14 06:54:34 +07:00
vergiLgood1 2a8f249d0c add filter source_type 2025-05-12 12:24:50 +07:00
vergiLgood1 77c865958a feat: Add crime data JSON and district center data for crime incidents
feat: Update database schema to allow nullable year in crimes table

feat: Create test table for future use in migrations

feat: Add crime_cleared column to crimes table and drop test table

feat: Add city_id column to units table and adjust district_id constraints

feat: Add phone column to units table

feat: Add avg_crime column to crimes table

feat: Implement seeder for crime incidents with detailed mock data generation

feat: Add trigger and function for calculating distance to district's police unit
2025-05-12 08:17:26 +07:00
vergiLgood1 e422c59da9 Add crime data CSV files and update database schema
- Added crime summary by type CSV file with district-wise crime statistics.
- Added yearly crime data CSV file with detailed crime statistics per district and year.
- Modified the database schema to include a new column `source_type` in the `crimes` table and a new column `distance` in the `locations` table.
- Created migration to add `location_logs` table for tracking user location data with relevant fields and indices.
- Updated migration to drop the `distance` column and replace it with `distance_from_unit` in the `locations` table.
- Added additional migrations to drop and recreate the `location_logs` table, modify existing columns, and enforce new constraints in the `unit_statistics` and `units` tables.
2025-05-11 14:44:14 +07:00
vergiLgood1 f4b1d9d633 feat: Implement custom animated popup for EWS alerts with wave circles and enhanced styling 2025-05-07 11:38:16 +07:00
vergiLgood1 8a1a4320c2 feat: Add Panic Button Demo component and EWS Alert Layer for incident management
- Implemented PanicButtonDemo component for triggering alerts with varying priorities.
- Created EWSAlertLayer to manage and display active incidents on the map.
- Added styles for alert markers and status indicators.
- Developed mock data utilities for generating and managing incident logs.
- Defined TypeScript interfaces for incident logs and locations.
2025-05-07 10:23:54 +07:00
vergiLgood1 3448945f4d add some geojson layer 2025-05-07 09:03:52 +07:00
vergiLgood1 05ba4ab920 feat: enhance SidebarInfoTab with detailed map layers and add timeline layer functionality to CrimeMap; update TimelineLegend and TimelinePopup styles 2025-05-07 08:01:07 +07:00
vergiLgood1 4cc01babf1 Enhance pop-up components with connection indicators and improve styling
- Refactored IncidentPopup, TimelinePopup, and UnitPopup components to include connection lines and dots for better visual indication of their relation to the map.
- Updated the layout and styling of the pop-ups for improved readability and consistency.
- Adjusted the TIME_ZONES data to reflect more accurate geographical locations.
- Enhanced the digital clock display in the TimeZonesDisplay component with improved styling and shadow effects.
- Added new CSS styles for digital clock presentation to enhance user experience.
2025-05-07 07:21:38 +07:00
vergiLgood1 da94277f4d feat: add digital clock and timezone markers to map
- Implemented DigitalClockMarker component to display a blinking digital clock at specified coordinates.
- Created TimeZonesDisplay component to show current times for different time zones on the map.
- Added styling for digital clock and time zone markers in globals.css.
- Introduced TimelinePopup component to display incident analysis for selected districts.
- Enhanced UnclusteredPointLayer and UnitsLayer components to manage visibility and interactions with markers.
- Updated map event handlers for improved user interaction and experience.
2025-05-07 07:08:12 +07:00
vergiLgood1 609a9c1327 Refactor map interaction and event handling
- Updated DistrictLayer to dispatch custom events for incident clicks and map fly-to actions.
- Enhanced DistrictFillLineLayer to support a new onDistrictClick prop for handling district interactions.
- Improved Layers component to manage district and incident selections, including new event listeners for incident clicks.
- Refactored UnclusteredPointLayer to streamline incident click handling and map interactions.
- Introduced FlyToHandler component to centralize fly-to event handling and highlight effects for incidents.
- Cleaned up event listener management across components to ensure proper cleanup and avoid memory leaks.
2025-05-07 06:41:33 +07:00
vergiLgood1 ae6eb40a13 refactor: enhance unclustered point layer to include GeoJSON conversion and improve layer setup; add optional prop for incident marker visibility 2025-05-07 03:42:14 +07:00
vergiLgood1 6bfc148821 refactor: enhance distance calculation and heatmap functionality; improve error handling and add interaction support 2025-05-07 03:17:59 +07:00
vergiLgood1 57fb1e4e46 Refactor GeoJSON seeder to insert data in smaller batches to prevent timeouts; added chunking logic and improved error handling. Update permission seeder to batch create permissions for roles and resources. Optimize unit seeder to prepare and insert unit data in bulk, enhancing performance. Adjust Supabase configuration for local development and modify migration scripts to restore GIS functions and types. 2025-05-06 21:37:28 +07:00
vergiLgood1 969d10958c refactor: streamline SQL migration scripts and enhance schema management for units and incidents 2025-05-06 15:37:07 +07:00
vergiLgood1 e891df87d0 Refactor seeding scripts to utilize generateIdWithDbCounter for unique ID generation across crime categories, incidents, and units. Implement a new utility function for generating distributed points within district areas to enhance incident location variability. Comment out unnecessary type drops and creations in SQL migration files for clarity. Add migration scripts to drop and re-add the phone field in the units table, ensuring data integrity during schema updates. 2025-05-06 01:21:04 +07:00
vergiLgood1 0747897fc7 Refactor database privileges and schema management
- Created migration scripts to manage the 'prisma' role and its privileges across various schemas including 'public', 'gis', 'auth', and 'storage'.
- Added explicit grants for all necessary tables, sequences, and functions to ensure the 'prisma' role has appropriate access.
- Implemented triggers for user management in the 'auth' schema to handle new user creation, updates, and deletions.
- Established default privileges for future objects in the specified schemas to streamline permission management.
- Updated remote schema management scripts to include grants for 'postgres' on specific tables and functions.
- Dropped and recreated types in the 'gis' schema to ensure proper structure and functionality.
2025-05-05 23:39:01 +07:00