Commit Graph

166 Commits

Author SHA1 Message Date
vergiLgood1 ce7d448b2f feat: Add registration form steps for officer and personal information, selfie verification, and unit details
- Implemented OfficerInfoStep widget for officer details input.
- Implemented PersonalInfoStep widget for personal details input.
- Implemented SelfieVerificationStep widget for selfie upload and verification.
- Implemented UnitInfoStep widget for unit details input.
- Created step form screen to manage the registration process with navigation between steps.
2025-05-19 20:53:09 +07:00
vergiLgood1 b003d8a158 feat: Implement ID card and selfie verification process using Azure OCR and Face API
- Added AzureOCRService to handle ID card processing and face verification.
- Integrated image picker for uploading ID cards and selfies.
- Updated registration form to include ID card upload and selfie verification sections.
- Enhanced validation for extracted OCR data based on user role (officer or civilian).
- Added liveness check functionality for selfie verification.
- Improved user interface for image upload and verification status messages.
2025-05-19 16:08:20 +07:00
vergiLgood1 ba4cbd180a Refactor step indicator implementation and enhance registration form
- Removed the old StepIndicator widget and replaced it with a new implementation that supports multiple styles (standard, rounded, numbered).
- Added new styles for the StepIndicator: NumberedStepIndicator, RoundedStepIndicator, and StandardStepIndicator.
- Updated the registration form screen to utilize the new StepIndicator with improved styling and functionality.
- Enhanced the StateScreen widget to adapt to dark mode and utilize constants for spacing and sizes.
- Refactored CustomTextField to support dark mode and improved styling.
- Introduced a new FormRegistrationScreen for handling user registration with multiple steps and validation.
2025-05-19 15:09:05 +07:00
vergiLgood1 60fb38da76 fix: Correct class name and improve service initialization in bindings 2025-05-19 14:26:33 +07:00
vergiLgood1 19b4809611 feat: Implement repositories for permissions, profiles, resources, roles, and users
- Added PermissionsRepository for managing permissions, including fetching, creating, and deleting permissions.
- Added ProfileRepository for handling user profile data, including fetching, updating, and uploading avatars.
- Added ResourcesRepository for managing resources, including fetching, creating, updating, and deleting resources.
- Added RolesRepository for managing roles, including fetching all roles and role permissions.
- Added UserRepository for managing user data, including authentication checks, updating user metadata, and fetching user details.
- Created a bindings file for personalization features.
2025-05-19 14:22:38 +07:00
vergiLgood1 867efe0bc9 Add role selection 2025-05-19 13:35:57 +07:00
vergiLgood1 1fd17ee0af feat: Add branding and launch images for dark mode support
- Added dark mode branding images for the app.
- Created contents.json files for branding and launch background images.
- Implemented splash screen with animated Lottie assets based on theme.
- Developed authentication repository with email/password and social login functionalities.
- Introduced background service for heavy computations in isolates.
- Added splash controller to manage authentication flow during splash screen.
2025-05-19 00:12:05 +07:00
vergiLgood1 01d166816d Refactor Supadart model classes for consistency and clarity
- Renamed model classes to follow a unified naming convention (e.g., Evidence to EvidenceSupadartModel).
- Updated references to related models to match new naming conventions (e.g., IncidentLogs to IncidentLogSupadartModel).
- Adjusted static methods for conversion and JSON parsing to reflect the new class names.
- Modified table names in the models to align with the new naming scheme.
- Changed output directory in supadart.yaml to 'lib/generated/' for better organization.
- Mapped database table names to the new model class names in supadart.yaml.
2025-05-18 14:42:34 +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 07c53818a5 feat: Implement location logs repository with CRUD operations
- Added LocationLogsRepository for managing user location logs.
- Implemented methods to get user location logs, add a new log, get recent logs, and fetch logs within a time range.

feat: Create locations repository for district-based location management

- Added LocationsRepository to handle location data by district ID.
- Implemented methods to fetch locations by district, get location by ID, find nearby locations, and add new locations.

feat: Enhance permissions repository for role-based access control

- Added PermissionsRepository to manage permissions.
- Implemented methods to fetch all permissions, get permissions by role/resource, check user permissions, create and delete permissions.

feat: Update profile repository for user profile management

- Enhanced ProfileRepository to manage user profiles.
- Implemented methods to upload avatars, update profile information, create profiles if they don't exist, and fetch profiles by user ID/NIK.

feat: Develop resources repository for resource management

- Added ResourcesRepository to manage application resources.
- Implemented methods to fetch all resources, get resources by ID/type, create, update, and delete resources.

feat: Create roles repository for role management

- Added RolesRepository to manage user roles.
- Implemented methods to fetch all roles, get roles by ID/name, create and update roles, and fetch permissions for a role.

feat: Enhance users repository for user management

- Updated UsersRepository to manage user data and metadata.
- Implemented methods to check user roles, update user metadata, email, phone, and password, and search users by name/username/email.
- Added functionality to check if a user is banned.
2025-05-17 09:02:06 +07:00
vergiLgood1 8d67e7bbb3 feat: Add biometric permission and update activity to FlutterFragmentActivity; refactor bindings and remove unused repositories 2025-05-17 07:50:58 +07:00
vergiLgood1 803a28494d feat: Implement user profile and role management features
- Added ProfileRepository for managing user profile data including fetching, updating, and uploading avatars.
- Introduced RolesRepository to handle role-related operations such as fetching all roles and retrieving roles by ID or name.
- Created UserRepository for user data management, including user authentication checks and profile updates.
- Developed OfficerModel to represent officer data with JSON serialization.
- Implemented RoleSelectionController to manage role selection logic during onboarding.
- Added LocationWarningScreen to handle location validation and user notifications.
- Created RoleSelectionScreen for users to select their roles during onboarding.
- Developed RoleCard widget for displaying role options in a user-friendly manner.
2025-05-17 07:10:00 +07:00
vergiLgood1 8da86d10d2 feat(auth): enhance biometric login and user metadata handling 2025-05-16 22:34:23 +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 636f892a42 Add Flutter app sigap-mobile as regular folder 2025-05-16 06:36:07 +07:00
vergiLgood1 a9562b0316 Add Flutter project (sigap-mobile) into monorepo 2025-05-16 06:31:04 +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