Commit Graph

19 Commits

Author SHA1 Message Date
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 0de70f9057 feat: add incident severity categorization and utility functions
- Implemented `getIncidentSeverity` function to categorize incidents based on predefined categories.
- Added `formatMonthKey` function to format month keys for display.
- Introduced `getTimeAgo` function to calculate and format time elapsed since a given timestamp.

feat: create custom hooks and components for crime analytics

- Developed `useCrimeAnalytics` hook to process and analyze crime data, providing insights such as total incidents, recent incidents, and category counts.
- Created `CrimeTypeCard`, `IncidentCard`, `StatCard`, and `SystemStatusCard` components for displaying crime statistics and incident details in the sidebar.
- Implemented `SidebarIncidentsTab` and `SidebarStatisticsTab` components to manage and display incident data and statistics.

feat: enhance sidebar functionality with info and statistics tabs

- Added `SidebarInfoTab` and `SidebarStatisticsTab` components to provide users with information about crime severity, map markers, and overall crime statistics.
- Integrated pagination functionality with `usePagination` hook to manage incident history navigation.

style: improve UI components with consistent styling and layout adjustments

- Updated card components and layout for better visual hierarchy and user experience.
- Ensured responsive design and accessibility across all new components.
2025-05-04 04:24:17 +07:00
vergiLgood1 428986c927 feat: add crime and district popups with detailed information and filtering capabilities
- Added `CrimePopup` component to display detailed information about individual crime incidents.
- Introduced `DistrictPopup` component to show district-level crime statistics and demographics.
- Implemented `useFilteredCrimeData` hook for filtering crime data based on selected categories.
- Created `calculateCrimeStats` utility function to compute various crime statistics from raw data.
- Updated package.json to include necessary dependencies for map and geocoder functionalities.
2025-05-02 22:20:22 +07:00
vergiLgood1 b564e6f330 feat(map): enhance map functionality with new controls and overlays
- Added GeolocateControl to the map for user location tracking.
- Introduced CategorySelector for filtering crime categories.
- Implemented TopNavigation for year, month, and category selection.
- Created MapSelectors for managing filters with reset functionality.
- Developed CrimeSidebar for displaying incidents, statistics, and reports.
- Added SidebarToggle for collapsing and expanding the sidebar.
- Prefetch crime data based on selected year and month.
- Updated Popover and Skeleton components for better UI experience.
- Refactored OverlayControl for improved rendering and cleanup.
- Enhanced styling and responsiveness across components.
2025-05-02 02:47:16 +07:00
vergiLgood1 2c09cb4d7c feat: implement map layer control and time slider components for enhanced crime data visualization 2025-04-28 23:45:06 +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 410535e1d9 feat: add generateId, generateCityCode and getLatId 2025-04-15 22:47:41 +07:00
vergiLgood1 e8acbf1645 Refactor user management components to use selectedUser instead of user
- Updated UserLogsTab to fetch logs for selectedUser and adjusted related state and props.
- Refactored UserOverviewTab to utilize selectedUser, including permission checks and user actions.
- Modified user-management component to pass selectedUser to UserInformationSheet.
- Enhanced use-detail-sheet handler to operate with selectedUser for user actions.
- Implemented useCheckPermissionsHandler to manage user permissions based on current user.
- Added new components: ActionRow, DangerAction, InfoRow, ProviderInfo, Section for better UI structure.
- Introduced constants for user roles and updated role model to include IUserRoles type.
- Updated global styles to include new color variables for better theming.
- Improved utility function getFullName to handle null or undefined values.
2025-04-12 17:18:36 +07:00
vergiLgood1 a468f3db68 init model rbac 2025-04-07 20:50:57 +07:00
vergiLgood1 5d3665807e add sign in with password and form forgot password 2025-04-04 22:00:19 +07:00
vergiLgood1 741c44ebe5 Refactor lagi anjir 2025-04-02 21:00:11 +07:00
vergiLgood1 9380c371f8 refactor createUsersTable 2025-03-29 21:34:48 +07:00
vergiLgood1 2faf6ce83e refactor handler and queries 2025-03-28 22:37:51 +07:00
vergiLgood1 e84a6f52c0 Refactor CRUD Users 2025-03-23 09:43:15 +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