Commit Graph

52 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 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 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 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 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 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 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
vergiLgood1 edf5013363 feat: Add CrimePopup and DistrictPopup components for displaying crime data on the map
- Implemented CrimePopup component to show detailed information about individual crime incidents.
- Implemented DistrictPopup component to provide an overview of crime statistics and demographics for selected districts.
- Added useFilteredCrimeData hook to filter crime data based on selected categories.
- Created calculateCrimeStats utility function to compute various crime statistics from raw data.
2025-05-02 22:19:54 +07:00
vergiLgood1 6f89892d8c feat: add map controls and sidebar components for crime data visualization
- Implemented MapControls component for selecting various crime-related metrics.
- Created MapFilterControl for filtering data by year and month.
- Developed MapSidebar to display crime statistics and district information.
- Added SidebarToggle for opening and closing the sidebar.
- Introduced SeverityIndicator to visually represent crime severity levels.
- Created TimeControls for selecting time frames for data analysis.
- Added useFullscreen hook for managing fullscreen functionality.
2025-04-28 00:14:16 +07:00
vergiLgood1 29925dc1b9 add some stuff 2025-04-27 22:41:27 +07:00
vergiLgood1 bcd71c6cad feat: enhance crime incidents seeder with year validation and import all-year summaries
- Added year validation in CrimeIncidentsSeeder to skip records with undefined year.
- Implemented importAllYearSummaries method in CrimesSeeder to import crime summaries from CSV for 2020-2024.
- Cleared existing data for units before seeding geographic data.
- Cleared locations data in role seeder before seeding roles.
- Added district summary CSV file for crime data from 2020 to 2024.
2025-04-25 16:58:32 +07:00
vergiLgood1 63b0721859 feat: add initial data seeding for resources, roles, demographics, crime incidents, and geographic data
- Created resources data structure in `resources.ts`
- Added roles data structure in `roles.ts`
- Implemented seeding for crime categories and incidents with detailed logic in `crime-category.ts` and `crime-incident.ts`
- Developed demographic data seeding logic in `demographic.ts`
- Implemented geographic data seeding from GeoJSON files in `geographic.ts`
- Added permission seeding logic in `permission.ts`
- Created resource and role seeding scripts in `resource.ts` and `role.ts`
2025-04-25 02:04:04 +07:00
vergiLgood1 0cbcd3e636 feat: add initial data seeding for resources, roles, demographics, crime incidents, and geographic data 2025-04-15 22:47:07 +07:00
vergiLgood1 c6f803b08c feat: add crime map components and functionality
- Implemented MapLegend component to display crime rate legend.
- Created YearSelector component for selecting the year of crime data.
- Developed CrimeMap component to manage crime incidents and district data.
- Added DistrictLayer for rendering districts on the map with hover and click interactions.
- Introduced CrimeMarker for displaying crime incidents on the map.
- Built MapView component for rendering the map with various controls.
- Established utility constants for crime colors and rates.
- Defined types for crime management and map features.
2025-04-14 23:47:44 +07:00
vergiLgood1 20238994dc add geojson data 2025-04-14 23:43:09 +07:00
vergiLgood1 258205ef49 Init roles, permissions and resources repository 2025-04-10 22:38:57 +07:00
vergiLgood1 a468f3db68 init model rbac 2025-04-07 20:50:57 +07:00
vergiLgood1 0af8a9be0b refactor add user and invite user 2025-03-22 23:20:31 +07:00
vergiLgood1 1a39925c97 implmentation clean architecture for auth services 2025-03-16 22:25:33 +07:00
vergiLgood1 aed9eba5d3 set up sentry 2025-03-16 00:46:37 +07:00
vergiLgood1 693f5d265e refactor project structure (backups) 2025-03-15 22:49:23 +07:00
vergiLgood1 5830eedb18 Refactor structure auth 2025-03-14 16:37:06 +07:00
vergiLgood1 bf84395efe change project structure 2025-03-12 16:13:57 +07:00
vergiLgood1 276a63a4dc add layout for my account, preference, notiication and import 2025-03-07 23:08:16 +07:00
vergiLgood1 aa52dd0ca4 resolve RLS issue for upload avatars images 2025-03-07 00:22:44 +07:00
vergiLgood1 45daf059d3 fix dupicate nav routes 2025-03-06 15:02:34 +07:00
vergiLgood1 121017dfb1 add profile and remove older project 2025-03-05 14:58:15 +07:00
vergiLgood1 dc3c0bebbb menampilkan user saat ini ke profile 2025-03-02 23:47:02 +07:00
vergiLgood1 f00544cb28 Remove reactQuery 2025-03-01 06:49:42 +07:00
vergiLgood1 681517e28e menambahkan user management 2025-02-28 20:23:31 +07:00
vergiLgood1 ca90871b22 remove older project 2025-02-28 19:26:26 +07:00
vergiLgood1 10ce404a1d add trigger for auth.users to custom public.user 2025-02-27 19:58:21 +07:00
vergiLgood1 39a0af5e0f add users table 2025-02-27 00:58:32 +07:00
vergiLgood1 d14cd33ef3 tes 2025-02-21 07:08:47 +07:00
vergiLgood1 538a8f4fa8 add shema for map fitur 2025-02-21 06:03:47 +07:00
vergiLgood1 a0b0289a86 init mapbox 2025-02-21 02:36:44 +07:00
vergiLgood1 bc0c6438a2 fecth dynamic navitem 2025-02-20 23:50:45 +07:00