Commit Graph
100 Commits
Author SHA1 Message Date
faris Aljohari f80d097ff8 refactor: optimize log insertion and clean up device cache handling in TuyaWebSocketService 2025-06-25 18:57:56 -06:00
faris Aljohari 04bd156df1 Merge branch 'dev' into add-check-log-to-trace-the-map-issue 2025-06-25 18:42:43 -06:00
faris Aljohari 731819aeaa feat: enhance device status handling with caching and batch processing improvements 2025-06-25 18:37:46 -06:00
faris Aljohari 68d2d3b53d fix: improve device retrieval logic in addDeviceStatusToFirebase method 2025-06-25 08:13:02 -06:00
faris Aljohari c0a069b460 fix: enhance device status handling by integrating device cache for improved performance 2025-06-25 08:03:23 -06:00
faris Aljohari 324661e1ee fix: add missing check for device UUID in batch processing logs 2025-06-25 05:30:15 -06:00
faris Aljohari a83424f45b fix: remove unnecessary validation for missing properties in device status logs 2025-06-25 05:29:28 -06:00
faris Aljohari 71f6ccb4db fix: add validation for missing properties in device status logs 2025-06-25 05:20:26 -06:00
faris Aljohari 27dbe04299 fix: remove unnecessary comment from ScheduleModule import in scheduler module 2025-06-25 04:47:38 -06:00
faris Aljohari 9bebcb2f3e feat: implement scheduler for periodic data updates and optimize database procedures
- Added SchedulerModule and SchedulerService to handle hourly data updates for AQI, occupancy, and energy consumption.
- Refactored existing services to remove unused device repository dependencies and streamline procedure execution.
- Updated SQL procedures to use correct parameter indexing.
- Enhanced error handling and logging for scheduled tasks.
- Integrated new repositories for presence sensor and AQI pollutant stats across multiple modules.
- Added NestJS schedule package for task scheduling capabilities.
2025-06-25 03:20:25 -06:00
faris Aljohari 43ab0030f0 refactor: clean up unused services and optimize batch processing in DeviceStatusFirebaseService 2025-06-25 03:20:12 -06:00
faris Aljohari d1d4d529a8 Add methods to handle SOS events and device status updates in Firebase and our DB 2025-06-23 08:10:33 -06:00
faris Aljohari cf19f08dca turn on all the updates data points 2025-06-23 07:33:01 -06:00
faris Aljohari ff370b2baa Implement message queue for TuyaWebSocketService and batch processing 2025-06-23 07:31:58 -06:00
faris Aljohari 04f64407e1 turn off some update data points 2025-06-23 07:10:47 -06:00
faris Aljohari c8d691b380 tern off data procedure 2025-06-23 07:02:23 -06:00
faris Aljohari a6053b3971 refactor: implement query runners for database operations in multiple services 2025-06-23 06:34:53 -06:00
faris Aljohari f2ed04f206 feat: add SpaceDailyOccupancyDuration entity, DTO, and repository for occupancy tracking 2025-06-12 02:49:59 -06:00
faris Aljohari 2cb77504ca Add PollutantType enum and update AQI-related entities and services to use it 2025-06-11 00:28:00 -06:00
faris Aljohari c86be27576 Add AQI module and related services, controllers, and DTOs
- Introduced AqiModule with AqiService and AqiController for handling AQI data.
- Added DTOs for AQI requests: GetAqiDailyBySpaceDto and GetAqiPollutantBySpaceDto.
- Implemented AqiDataService for managing AQI sensor historical data.
- Updated existing modules to include AqiDataService where necessary.
- Defined new routes for AQI data retrieval in ControllerRoute.
2025-06-10 18:19:34 -06:00
faris Aljohari 3a08f9f258 Merge branch 'dev' into aqi-test 2025-06-10 17:08:06 -06:00
faris Aljohari 97e14e70f7 Refactor DeviceStatusLogEntity: expand unique constraint to include code and value 2025-06-10 01:41:41 -06:00
faris Aljohari 0793441e06 Refactor DeviceStatusLogEntity: correct unique constraint name for event time and device ID 2025-06-10 01:24:33 -06:00
faris Aljohari b6321c2530 Refactor DeviceStatusLogEntity: update unique constraint to include deviceId 2025-06-10 01:18:58 -06:00
faris Aljohari 7eb13088ac Refactor DeviceStatusLogEntity: update unique constraint and primary key definition 2025-06-09 04:50:58 -06:00
faris Aljohari 0d6de2df43 Refactor AqiSpaceDailyPollutantStatsEntity: update unique constraint and rename event fields for clarity 2025-06-04 15:24:13 -06:00
faris Aljohari 43dfaaa90d fix: utilize WEATHER_API_URL in WeatherService for dynamic API endpoint 2025-06-04 01:32:01 -06:00
faris Aljohari ea021ad228 fix: update error message for invalid latitude and longitude in fetchWeatherDetails method 2025-06-04 01:09:49 -06:00
faris Aljohari cd3e9016f2 fix: improve error handling in fetchWeatherDetails method 2025-06-04 01:08:33 -06:00
faris Aljohari ef2245eae1 Add AQI space daily pollutant stats module and related entities, DTOs, and repositories 2025-06-03 23:37:52 -06:00
faris Aljohari c39129f75b Add Weather module with controller, service, and DTO for fetching weather details 2025-06-03 02:38:44 -06:00
faris Aljohari 0fe6c80731 Add utility function to associate space UUID with devices in community and device services 2025-06-01 21:56:08 -06:00
faris Aljohari 81e017430e Merge pull request #392 from SyncrowIOT/temp-product-relation-fixes
Remove unique constraint on subspace and product in SubspaceProductAllocationEntity; update product relation to nullable in NewTagEntity
2025-06-02 06:20:03 +03:00
faris Aljohari 191d0dfaf6 Remove unique constraint on subspace and product in SubspaceProductAllocationEntity; update product relation to nullable in NewTagEntity 2025-06-01 21:16:51 -06:00
faris Aljohari 180d16eeb1 feat: add occupancy duration data retrieval and update procedures 2025-05-18 17:40:41 +03:00
faris Aljohari 8750da7e62 feat: optimize getAllDevicesByCommunity to prevent duplicate space processing 2025-05-15 10:09:29 +03:00
faris Aljohari e253d1ca03 refactor: optimize device retrieval by avoiding duplicate space visits in getAllDevicesByCommunity 2025-05-15 10:08:02 +03:00
faris Aljohari 67331aa92a feat: update DEVICE_SPACE_COMMUNITY route and add validation for spaceUuid and communityUuid in DTO 2025-05-14 13:00:09 +03:00
faris Aljohari 4aa3d04478 feat: update device and space services to use productType instead of deviceType and add query support for device retrieval by product type 2025-05-13 03:19:21 +03:00
faris Aljohari 799fcb6fb9 feat: add DEVICE_SPACE_COMMUNITY route and controller for device retrieval by space or community 2025-05-13 03:06:43 +03:00
faris Aljohari 7ec4171e1a feat: add occupancy module with controller, service, and related DTOs for heat map data retrieval 2025-05-12 02:15:57 +03:00
faris Aljohari fb5084ba3a feat: add groupByDevice option to GetPowerClampBySpaceDto and update service logic 2025-05-11 01:59:26 +03:00
faris Aljohari 8030644fee refactor: rename presence sensor entities and update related references 2025-05-09 13:11:14 +03:00
faris Aljohari 45b8cdcaae Add endpoints and logic for fetching power clamp data by community or space
- Introduced new API endpoints to retrieve power clamp historical data based on community or space UUID.
- Updated PowerClampController to handle requests with optional parameters for community and space.
- Enhanced PowerClampService to validate input and fetch devices accordingly.
- Created ResourceParamsDto to manage request parameters.
- Updated ControllerRoute with new action summaries and descriptions.
2025-05-07 23:09:01 +03:00
faris Aljohari 91abfb41ab Implement month-based date formatting and filtering in PowerClamp service 2025-05-07 12:17:17 +03:00
faris Aljohari d40fb7a762 Merge branch 'dev' into SP-1551-be-implement-total-energy-consumption-api-for-analytics-dashboard 2025-05-07 10:59:42 +03:00
faris Aljohari d197bf2bb4 feat: implement date formatting function and enhance PowerClampService with space-based data retrieval 2025-05-04 22:28:38 +03:00
faris Aljohari 2a1f1f52f6 feat: add presence sensor module with entity, DTO, and repository 2025-05-04 19:11:14 +03:00
faris Aljohari 0fcd974af2 refactor: update winston logger configuration for environment-based logging 2025-05-02 02:28:01 +03:00
faris Aljohari aee6b8df69 refactor: update procedure names in PowerClampService for clarity 2025-05-02 01:57:12 +03:00
faris Aljohari 8040594dc6 refactor: enhance PowerClampController with additional ApiParam for powerClampUuid 2025-04-28 10:18:07 +03:00
faris Aljohari 588d4cb98e refactor: update PowerClampController and service to use PowerClampParamsDto for parameter handling 2025-04-28 01:37:04 +03:00
faris Aljohari 72e65882b1 feat: update PowerClamp routes to support historical data retrieval 2025-04-24 15:08:54 +03:00
faris Aljohari 1bdb13846f Merge branch 'dev' into SP-1355-powr-clap-historical-data 2025-04-24 15:04:11 +03:00
faris Aljohari 0ee26698ff feat: enhance PowerClamp service and controller to support filtering by date, month, and year 2025-04-24 12:46:24 +03:00
faris Aljohari 45eec4bb30 Merge branch 'dev' into fix-add-device-issue 2025-04-24 11:08:38 +03:00
faris Aljohari 51bf4c0170 fix: update connection timeout value in database module 2025-04-24 11:06:47 +03:00
faris Aljohari fa3f49af18 fix: handle potential undefined deviceDetails in getDeviceByDeviceUuid 2025-04-24 11:06:41 +03:00
faris Aljohari 881618a4ee feat: enhance PowerClamp service with energy consumption procedures and enums 2025-04-24 03:14:03 +03:00
faris Aljohari f3fd6646a1 feat: add SqlLoaderService to multiple modules for improved SQL data handling 2025-04-24 02:31:35 +03:00
faris Aljohari 3c5b97f2f9 feat: add SQL procedures for daily, hourly, and monthly energy consumption data 2025-04-24 02:22:13 +03:00
faris Aljohari 7249a0badb Merge branch 'dev' into SP-1355-powr-clap-historical-data 2025-04-24 02:16:22 +03:00
faris Aljohari 92f908c0fb feat: implement PowerClampService for managing hourly energy consumption data 2025-04-24 02:15:45 +03:00
faris Aljohari 7f43ef5de5 feat: integrate PowerClamp service and repositories across multiple modules 2025-04-24 02:14:58 +03:00
faris Aljohari 61a7e1c742 remove unused client and space DTOs and repository module 2025-04-23 16:58:42 +03:00
faris Aljohari 5490b5781d fix deployment error 2025-04-23 16:55:57 +03:00
faris Aljohari 531f93d42c fix: enhance log output in device status to include UUID and timestamp 2025-04-23 16:52:54 +03:00
faris Aljohari fde34dcf9c fix: update log output in energy status check for better debugging 2025-04-23 15:13:53 +03:00
faris Aljohari 8228ccc293 feat: add power clamp entities, DTOs, and repository for energy consumption tracking 2025-04-23 15:08:51 +03:00
faris Aljohari 6bc068c5e6 add SQL query for hourly energy consumption analysis 2025-04-23 13:06:42 +03:00
faris Aljohari d1bc723834 fix: include productName in device details response 2025-04-23 12:51:24 +03:00
faris Aljohari dabf234349 refactor: clean up unused variable and update destructuring in device service 2025-04-22 13:54:12 +03:00
faris Aljohari 1b3eb08fcb fix: set name column to non-nullable in DeviceEntity 2025-04-22 01:58:31 +03:00
faris Aljohari 069cdf6f75 feat: add device name to actions and conditions in Automation and Scene services 2025-04-22 01:53:10 +03:00
faris Aljohari 2f12189eef feat: add device name field to DeviceEntity and update related DTOs and services 2025-04-22 01:53:03 +03:00
faris Aljohari 2b449e61ea add OTP email sending functionality and integrate with user authentication flow 2025-04-20 22:19:08 +03:00
faris Aljohari 1e6503c072 Merge pull request #337 from SyncrowIOT/SP-1346-be-sos-button-real-time-sync-issue 2025-04-18 09:21:24 +03:00
faris Aljohari d341c47286 add SosHandlerService and integrate SOS handling in TuyaWebSocketService 2025-04-17 16:58:34 +03:00
faris Aljohari 32112930c8 Implement product creation functionality with DTO and permissions 2025-04-15 13:26:56 +03:00
faris Aljohari 30dd8318e3 Add SQL queries for hourly energy consumption tracking and refactor daily energy consumed query 2025-04-15 12:20:37 +03:00
faris Aljohari f723b63a91 Merge branch 'dev' into fix-some-issues-wehn-add-new-device 2025-04-14 14:26:13 +03:00
faris Aljohari 7be4e4eeef Refactor SQL queries for device presence detection: rename missing_date to date, enhance motion detection logic, and update aggregation for total presence counts. 2025-04-14 14:17:48 +03:00
faris Aljohari f71279ea30 Fix SQL query in getPowerClampData method to use 'fact_daily_energy_consumed' 2025-04-14 13:47:40 +03:00
faris Aljohari 303ea696cb Add SQL queries for device logs, energy consumption, presence detection, and product category definitions 2025-04-14 13:47:32 +03:00
faris Aljohari 777105fc28 refactor: improve error handling for missing space in device listing 2025-04-14 13:24:40 +03:00
faris Aljohari 3745962827 Add PowerClamp module with controller and service for energy data retrieval 2025-04-14 12:17:44 +03:00
faris Aljohari a3001c8bb8 feat: add DEVICE_ADD permission and update device handling logic 2025-04-13 20:19:21 +03:00
faris Aljohari 22d98fa177 feat: add user UUID to project creation and validate user existence 2025-04-03 12:27:36 +03:00
faris Aljohari c7fc4e3a5d refactor: enhance TuyaWebSocketService to handle environment-specific message extraction 2025-03-28 03:34:30 +03:00
faris Aljohari cf8cf08bdc add client relation btw user and client 2025-03-27 01:55:26 +03:00
faris Aljohari cbd3f5028b finished client endpoints 2025-03-27 01:28:40 +03:00
faris Aljohari cd05c9906d convert the api from post to put 2025-03-25 10:25:13 +03:00
faris Aljohari ef9cf6ad28 convert the route to devices 2025-03-25 10:24:52 +03:00
faris Aljohari c5dac6c564 add register client api 2025-03-25 10:10:08 +03:00
faris Aljohari a4b743eb58 add client entity 2025-03-25 02:29:00 +03:00
faris Aljohari 6785fb2b1e finished refactor vistitor password device 2025-03-24 03:28:26 +03:00
faris Aljohari 8efd8cfba2 finished refactor devices module 2025-03-24 02:32:44 +03:00
faris Aljohari 2712ce673a Merge pull request #322 from SyncrowIOT/edit-visitor-passwords-route
finished edit visitor passwords route
2025-03-21 09:57:24 +03:00
faris Aljohari 794e12d5d3 finished edit visitor passwords route 2025-03-21 09:56:13 +03:00
faris Aljohari fb2e0c6cba Merge pull request #321 from SyncrowIOT/add-community-in-get-scenes-and-automation
finished add community data in scene and automation
2025-03-21 09:46:02 +03:00