{"openapi":"3.1.0","info":{"title":"3B API Documentation","version":"1.0.0","description":"API for discovering devices, managing buildings, configuring cross-device notification rules, and analyzing metric metrics.","contact":{"name":"RDI","email":"test@rdi.com"}},"servers":[{"url":"http://localhost:3000/api/v1","description":"Development server"}],"tags":[{"name":"Auth","description":"Authentication & Authorization API"},{"name":"User","description":"User Management API"},{"name":"Building","description":"Building Management API"},{"name":"Devices","description":"Device Management API"},{"name":"Rules","description":"Cross-Device Rule Engine & Threshold API"},{"name":"Energy","description":"Energy Data API"},{"name":"Environmental","description":"Environmental Data API"},{"name":"Mobility","description":"Mobility Data API"},{"name":"Event","description":"Event Data API"}],"paths":{"/auth/login":{"post":{"summary":"Authenticate user and get tokens","tags":["Auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Successful login","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"401":{"description":"Invalid credentials"}}}},"/auth/token":{"post":{"summary":"Authenticate a system client application via Client ID","description":"Alternative authentication method typically used for machine-to-machine integrations or automated background worker nodes.","tags":["Auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientTokenRequest"}}}},"responses":{"200":{"description":"Authentication successful, tokens generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}},"400":{"description":"Missing required fields"},"401":{"description":"Invalid client credentials"}}}},"/auth/refresh":{"post":{"summary":"Refresh access token","tags":["Auth"],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}}},"responses":{"200":{"description":"New access token generated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshResponse"}}}},"401":{"description":"Invalid or expired refresh token"}}}},"/auth/logout":{"post":{"summary":"Logout user and invalidate refresh token","tags":["Auth"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Logged out successfully"},"400":{"description":"Invalid request"},"401":{"description":"Unauthorized"}}}},"/user/register":{"post":{"summary":"Register a new user","tags":["User"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"201":{"description":"User successfully created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterResponse"}}}}}}},"/user/users":{"get":{"summary":"Retrieve a list of all users","description":"Returns an array of user objects. Admin access required.","tags":["User"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"A list of users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserAccount"}}}}},"401":{"description":"Unauthorized – missing or invalid token"},"403":{"description":"Forbidden – insufficient privileges"},"500":{"description":"Internal server error"}}}},"/user/profile":{"get":{"summary":"Get current user's profile","description":"Returns the profile information for the authenticated user.","tags":["User"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User profile retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Unauthorized – missing or invalid token"},"500":{"description":"Internal server error"}}}},"/user/update":{"patch":{"summary":"Update user information","description":"Allows a logged-in user to update their information.","tags":["User"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["firstname","lastname","email"],"properties":{"firstname":{"type":"string","example":"John"},"lastname":{"type":"string","example":"Doe"},"email":{"type":"string","example":"john.doe@example.com"}}}}}},"responses":{"200":{"description":"User information updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User information updated successfully"}}}}}},"400":{"description":"Invalid email or bad request"},"401":{"description":"Unauthorized – missing or invalid token"},"500":{"description":"Internal server error"}}}},"/user/change-password":{"patch":{"summary":"Change the password of the currently authenticated user","tags":["User"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["currentPassword","newPassword"],"properties":{"currentPassword":{"type":"string","example":"oldPassword123"},"newPassword":{"type":"string","example":"newSecurePassword456"}}}}}},"responses":{"200":{"description":"Password updated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Password updated successfully"}}}}}},"400":{"description":"Invalid current password or bad request"},"401":{"description":"Unauthorized – missing or invalid token"},"500":{"description":"Internal server error"}}}},"/user/delete":{"delete":{"summary":"Delete a user account","tags":["User"],"security":[{"bearerAuth":[]}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"targetUserId":{"type":"integer","example":5,"description":"(Admin only) ID of the user to delete"}}}}}},"responses":{"200":{"description":"User deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"User deleted successfully"}}}}}},"400":{"description":"Invalid request or authorization error"},"401":{"description":"Unauthorized (missing or invalid token)"},"404":{"description":"User not found"}}}},"/user/assign-role":{"post":{"summary":"Assign a role to a user (admin only)","tags":["User"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","rolename"],"properties":{"username":{"type":"string","example":"user1"},"rolename":{"type":"string","enum":["admin","manager","user"],"example":"manager"}}}}}},"responses":{"201":{"description":"User role successfully assigned","content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"rolename":{"type":"string"}}}}}}}}},"/user/assign-category":{"post":{"summary":"Assign a data category to a user (admin only)","tags":["User"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["username","categoryName"],"properties":{"username":{"type":"string","example":"user1"},"categoryName":{"type":"string","example":"Environmental"}}}}}},"responses":{"201":{"description":"User category successfully assigned"}}}},"/user/categories":{"get":{"summary":"Retrieve all categories assigned to a user (admin only)","tags":["User"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"username","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A list of categories for the user","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","example":1},"name":{"type":"string","example":"Environmental"}}}}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/user/devices":{"get":{"summary":"Retrieve all devices assigned to a user (admin only)","tags":["User"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"username","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"A list of devices for the user","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/building/create":{"post":{"summary":"Create a new building","tags":["Building"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBuildingDTO"}}}},"responses":{"201":{"description":"Building created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"400":{"description":"Bad request"}}}},"/building/buildings":{"get":{"summary":"Get all buildings","tags":["Building"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of buildings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Building"}}}}},"401":{"description":"Unauthorized"}}}},"/building/building":{"get":{"summary":"Get building info by buildingName (query)","tags":["Building"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"buildingName","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Building details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Building not found"}}}},"/building/update":{"patch":{"summary":"Update building info (identified by query buildingId)","tags":["Building"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"buildingId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBuildingDTO"}}}},"responses":{"200":{"description":"Updated building","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Building"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"404":{"description":"Building not found"}}}},"/building/delete":{"delete":{"summary":"Delete building by buildingId (query)","tags":["Building"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"buildingId","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Building deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Building not found"}}}},"/building/assign-building":{"post":{"summary":"Assign a building to a user (admin only)","tags":["Building"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["buildingName","userName"],"properties":{"buildingName":{"type":"string"},"userName":{"type":"string"}}}}}},"responses":{"200":{"description":"Assignment successful"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/device/create":{"post":{"summary":"Create a new device","tags":["Devices"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDeviceDTO"}}}},"responses":{"201":{"description":"Device created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"400":{"description":"Bad request"}}}},"/device/devices":{"get":{"summary":"Get all devices","tags":["Devices"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"List of devices","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Device"}}}}},"401":{"description":"Unauthorized"}}}},"/device/device":{"get":{"summary":"Get device info by deviceName (query)","tags":["Devices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceName","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Device details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Device not found"}}}},"/device/update":{"patch":{"summary":"Update device info (identified by query deviceId)","tags":["Devices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDeviceDTO"}}}},"responses":{"200":{"description":"Updated device","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Device"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"404":{"description":"Device not found"}}}},"/device/delete":{"delete":{"summary":"Delete device by deviceId (query)","tags":["Devices"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Device deleted"},"401":{"description":"Unauthorized"},"404":{"description":"Device not found"}}}},"/device/assign-device":{"post":{"summary":"Assign a device to a user (admin only)","tags":["Devices"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignDeviceToUserDTO"}}}},"responses":{"200":{"description":"Assignment successful"},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"}}}},"/rule/create":{"post":{"summary":"Create a new cross-device logic threshold notification rule","tags":["Rules"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRuleDTO"}}}},"responses":{"201":{"description":"Multi-device rule created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"400":{"description":"Invalid conditions configuration structure or logic errors"}}}},"/rule/rules":{"get":{"summary":"Retrieve all rule thresholds","description":"Fetches active and inactive data threshold system evaluation rules.","tags":["Rules"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"A list of configured multi-device rules","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Rule"}}}}},"401":{"description":"Unauthorized"}}}},"/rule/update":{"patch":{"summary":"Update an existing multi-device evaluation rule configuration","tags":["Rules"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"ruleId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleDTO"}}}},"responses":{"200":{"description":"Rule updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"404":{"description":"Rule not found"}}}},"/rule/delete":{"delete":{"summary":"Delete an evaluation rule configuration matching ruleId","tags":["Rules"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"ruleId","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Rule deleted successfully"},"404":{"description":"Rule not found"}}}},"/energy/emu-power-meter":{"post":{"summary":"Create a new EMU power meter record","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"},"description":"Target Device ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostEmuPowerMeterDTO"}}}},"responses":{"201":{"description":"EMU power meter record created"},"400":{"description":"Invalid input"},"401":{"description":"Unauthorized"},"404":{"description":"Device not found"}}},"get":{"summary":"Get EMU power meter records for a device","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"limit","schema":{"type":"integer","default":100}},{"in":"query","name":"offset","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Paged list of EMU power meter records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedEmuPowerMeterResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"}}}},"/energy/emu-power-meter/stats":{"get":{"summary":"Get aggregated EMU power meter statistics","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"interval","required":true,"schema":{"type":"string","example":"1h"},"description":"Time bucket size (e.g. 15m, 1h, 1d)"},{"in":"query","name":"aggregate","required":true,"schema":{"type":"string","enum":["MIN","MAX","SUM","AVG"]},"description":"Statistical calculation targeting metric properties."}],"responses":{"200":{"description":"Aggregated EMU power meter statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmuPowerMeterStatsResponse"}}}},"400":{"description":"Bad request"},"401":{"description":"Unauthorized"}}}},"/energy/fuel-tank":{"post":{"summary":"Create a new fuel tank sensor record","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostFuelTankDTO"}}}},"responses":{"201":{"description":"Fuel tank record created"},"400":{"description":"Invalid input"}}},"get":{"summary":"Get fuel tank sensor records for a device","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"limit","schema":{"type":"integer","default":100}},{"in":"query","name":"offset","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"Paged list of fuel tank records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedFuelTankResponse"}}}}}}},"/energy/fuel-tank/stats":{"get":{"summary":"Get aggregated fuel tank sensor statistics","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"interval","required":true,"schema":{"type":"string","example":"1h"}},{"in":"query","name":"aggregate","required":true,"schema":{"type":"string","enum":["MIN","MAX","SUM","AVG"]}}],"responses":{"200":{"description":"Aggregated fuel tank statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FuelTankStatsResponse"}}}}}}},"/energy/milesight-power-meter":{"post":{"summary":"Create a new Milesight power meter record","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostMilesightPowerMeterDTO"}}}},"responses":{"201":{"description":"Milesight power meter record created"}}},"get":{"summary":"Get Milesight power meter records for a device","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Paged list of Milesight power meter records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedMilesightPowerMeterResponse"}}}}}}},"/energy/milesight-power-meter/stats":{"get":{"summary":"Get aggregated Milesight power meter statistics","tags":["Energy"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"interval","required":true,"schema":{"type":"string"}},{"in":"query","name":"aggregate","required":true,"schema":{"type":"string","enum":["MIN","MAX","SUM","AVG"]}}],"responses":{"200":{"description":"Aggregated Milesight power meter statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MilesightPowerMeterStatsResponse"}}}}}}},"/environmental/libelium":{"post":{"summary":"Create a new Libelium environmental sensor record","tags":["Environmental"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostLibeliumEnvDTO"}}}},"responses":{"201":{"description":"Libelium environmental record created"}}},"get":{"summary":"Get Libelium environmental sensor records for a device","tags":["Environmental"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paged list of Libelium environmental records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedLibeliumEnvResponse"}}}}}}},"/environmental/libelium/stats":{"get":{"summary":"Get aggregated Libelium environmental sensor statistics","tags":["Environmental"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"interval","required":true,"schema":{"type":"string"}},{"in":"query","name":"aggregate","required":true,"schema":{"type":"string","enum":["MIN","MAX","SUM","AVG"]}}],"responses":{"200":{"description":"Aggregated Libelium environmental statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibeliumEnvStatsResponse"}}}}}}},"/environmental/decentlab":{"post":{"summary":"Create a new Decentlab weather station record","tags":["Environmental"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDecentlabWeatherDTO"}}}},"responses":{"201":{"description":"Decentlab weather record created"}}},"get":{"summary":"Get Decentlab weather station records for a device","tags":["Environmental"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paged list of Decentlab weather records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedDecentlabWeatherResponse"}}}}}}},"/environmental/decentlab/stats":{"get":{"summary":"Get aggregated Decentlab weather station statistics","tags":["Environmental"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"interval","required":true,"schema":{"type":"string"}},{"in":"query","name":"aggregate","required":true,"schema":{"type":"string","enum":["MIN","MAX","SUM","AVG"]}}],"responses":{"200":{"description":"Aggregated Decentlab weather statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecentlabWeatherStatsResponse"}}}}}}},"/mobility/fines":{"post":{"summary":"Ingest a new parking fine record","tags":["Mobility"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostFineDTO"}}}},"responses":{"201":{"description":"Fine record created"}}},"get":{"summary":"Get parking fine records for a device","tags":["Mobility"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paged list of fine records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedFineResponse"}}}}}}},"/mobility/appeals":{"post":{"summary":"Ingest a new fine appeal record","tags":["Mobility"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostAppealDTO"}}}},"responses":{"201":{"description":"Appeal record created"}}},"get":{"summary":"Get fine appeal records for a device","tags":["Mobility"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paged list of appeal records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedAppealResponse"}}}}}}},"/event/events":{"post":{"summary":"Create a new device event record","tags":["Event"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostEventDTO"}}}},"responses":{"201":{"description":"Event record created"}}},"get":{"summary":"Get device event records","tags":["Event"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Paged list of device event records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PagedEventResponse"}}}}}}},"/event/events/stats":{"get":{"summary":"Get aggregated device event statistics","tags":["Event"],"security":[{"bearerAuth":[]}],"parameters":[{"in":"query","name":"deviceId","required":true,"schema":{"type":"string"}},{"in":"query","name":"startTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"endTime","required":true,"schema":{"type":"string","format":"date-time"}},{"in":"query","name":"interval","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aggregated device event statistics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventStatsResponse"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"RoleName":{"type":"string","enum":["admin","manager","user"],"example":"manager"},"Role":{"type":"object","required":["name"],"properties":{"name":{"type":"string","enum":["admin","manager","user"],"example":"manager"}}},"User":{"type":"object","required":["id","username","email","password_hash","created_at","role"],"properties":{"id":{"type":"string","example":"a1b2c3d4"},"username":{"type":"string","example":"jdoe"},"firstname":{"type":"string","example":"John"},"lastname":{"type":"string","example":"Doe"},"email":{"type":"string","example":"john.doe@example.com"},"password_hash":{"type":"string","example":"$2b$10$..."},"created_at":{"type":"string","format":"date-time","example":"2025-02-05T12:00:00Z"},"role":{"$ref":"#/components/schemas/Role"}}},"UserAccount":{"type":"object","required":["user_id","username","email","password_hash","created_at"],"properties":{"user_id":{"type":"string","example":"u_123"},"username":{"type":"string","example":"jdoe"},"firstname":{"type":"string","example":"John"},"lastname":{"type":"string","example":"Doe"},"password_hash":{"type":"string","example":"$2b$10$..."},"email":{"type":"string","example":"john.doe@example.com"},"created_at":{"type":"string","format":"date-time","example":"2025-02-05T12:00:00Z"}}},"RegisterRequest":{"type":"object","required":["username","firstname","lastname","email","password","confirmPassword"],"properties":{"username":{"type":"string","example":"johndoe"},"firstname":{"type":"string","example":"John"},"lastname":{"type":"string","example":"Doe"},"email":{"type":"string","format":"email","example":"johndoe@example.com"},"password":{"type":"string","example":"StrongPassword123!"},"confirmPassword":{"type":"string","example":"StrongPassword123!"}}},"RegisterResponse":{"type":"object","required":["id","username","email","createdAt"],"properties":{"id":{"type":"string","example":"64f1b6e9e35f9a0012345678"},"username":{"type":"string","example":"Johndoe"},"firstname":{"type":"string","example":"John"},"lastname":{"type":"string","example":"Doe"},"email":{"type":"string","format":"email","example":"johndoe@example.com"},"createdAt":{"type":"string","format":"date-time","example":"2025-10-20T12:34:56.789Z"}}},"LoginRequest":{"type":"object","required":["username","password"],"properties":{"username":{"type":"string","example":"adminUser"},"password":{"type":"string","example":"StrongPass123!"}}},"ClientTokenRequest":{"type":"object","required":["clientId","password"],"properties":{"clientId":{"type":"string","format":"uuid","example":"3b9c1d2e-4f5a-6b7c-8d9e-0f1a2b3c4d5e"},"password":{"type":"string","example":"ClientSecretSecure789!"}}},"LoginResponse":{"type":"object","properties":{"accessToken":{"type":"string","example":"eyJ...access"},"refreshToken":{"type":"string","example":"eyJ...refresh"}}},"RefreshRequest":{"type":"object","required":["refreshToken"],"properties":{"refreshToken":{"type":"string","example":"eyJ...refresh"}}},"RefreshResponse":{"type":"object","properties":{"accessToken":{"type":"string","example":"eyJ...access"}}},"Building":{"type":"object","properties":{"id":{"type":"string"},"buildingName":{"type":"string"},"address":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreateBuildingDTO":{"type":"object","required":["buildingName"],"properties":{"buildingName":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"}}},"UpdateBuildingDTO":{"type":"object","properties":{"name":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"}}},"Device":{"type":"object","properties":{"id":{"type":"string"},"deviceName":{"type":"string"},"deviceType":{"type":"string","nullable":true},"address":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"latitude":{"type":"number","nullable":true},"longitude":{"type":"number","nullable":true},"buildingId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"CreateDeviceDTO":{"type":"object","required":["deviceName"],"properties":{"deviceName":{"type":"string"},"deviceType":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"}}},"UpdateDeviceDTO":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"address":{"type":"string"},"city":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"}}},"AssignDeviceToUserDTO":{"type":"object","required":["deviceName","userName"],"properties":{"deviceName":{"type":"string"},"userName":{"type":"string"}}},"Rule":{"type":"object","required":["id","name","operator","conditions","targetUserId","isActive","createdAt","updatedAt"],"properties":{"id":{"type":"string","format":"uuid","example":"8f7b3a12-c4d5-4e6f-8a9b-0c1d2e3f4a5b"},"name":{"type":"string","example":"Server Room Climate Emergency"},"description":{"type":"string","example":"Triggers if rooms overheat while main servers spike draw values."},"operator":{"type":"string","enum":["AND","OR"],"description":"Logical verification method evaluating the multi-conditional metrics array block.","example":"AND"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/RuleCondition"}},"targetUserId":{"type":"string","example":"a1b2c3d4"},"isActive":{"type":"boolean","example":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"RuleCondition":{"type":"object","required":["deviceId","field","operator","value"],"properties":{"deviceId":{"type":"string","format":"uuid","description":"Unique identifier of the device stream evaluated in this assertion instance.","example":"e25a1234-bacd-4f1a-9876-111111111111"},"field":{"type":"string","description":"Target property dictionary metric key identifier.","example":"temperature"},"operator":{"type":"string","enum":["GT","GTE","LT","LTE","EQ","NEQ"],"example":"GT"},"value":{"type":"number","example":30}}},"CreateRuleDTO":{"type":"object","required":["name","operator","conditions","targetUserId"],"properties":{"name":{"type":"string","example":"Cross-Device Threshold Rule Alert"},"description":{"type":"string"},"operator":{"type":"string","enum":["AND","OR"],"default":"AND"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/RuleCondition"},"example":[{"deviceId":"e25a1234-bacd-4f1a-9876-111111111111","field":"temperature","operator":"GT","value":30},{"deviceId":"f98b5678-dcba-4e2b-1234-222222222222","field":"total_active_power","operator":"GT","value":5000}]},"targetUserId":{"type":"string"}}},"UpdateRuleDTO":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"operator":{"type":"string","enum":["AND","OR"]},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/RuleCondition"}},"targetUserId":{"type":"string"},"isActive":{"type":"boolean"}}},"FieldStats":{"type":"number","format":"float","description":"Calculated numeric aggregate metric value matching execution filter criteria (MIN, MAX, SUM, AVG)","example":22.4},"EmuPowerMeterRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"totalActivePower":{"type":"number"},"l1ActivePower":{"type":"number"},"l2ActivePower":{"type":"number"},"l3ActivePower":{"type":"number"},"averagePower":{"type":"number"},"totalCurrent":{"type":"number"},"l1Current":{"type":"number"},"l2Current":{"type":"number"},"l3Current":{"type":"number"},"neutralCurrent":{"type":"number"},"l1nVoltage":{"type":"number"},"l2nVoltage":{"type":"number"},"l3nVoltage":{"type":"number"},"l1PowerFactor":{"type":"number"},"l2PowerFactor":{"type":"number"},"l3PowerFactor":{"type":"number"},"gridFrequency":{"type":"number"},"totalForwardActiveEnergyT1":{"type":"number"},"totalForwardActiveEnergyT2":{"type":"number"}}},"PostEmuPowerMeterDTO":{"type":"object","required":["time"],"properties":{"time":{"type":"string","format":"date-time","example":"2026-02-02T01:00:00.009Z"},"total_active_power":{"type":"number"},"l1_active_power":{"type":"number"},"l2_active_power":{"type":"number"},"l3_active_power":{"type":"number"},"average_power":{"type":"number"},"total_current":{"type":"number"},"l1_current":{"type":"number"},"l2_current":{"type":"number"},"l3_current":{"type":"number"},"neutral_current":{"type":"number"},"l1n_voltage":{"type":"number"},"l2n_voltage":{"type":"number"},"l3n_voltage":{"type":"number"},"l1_power_factor":{"type":"number"},"l2_power_factor":{"type":"number"},"l3_power_factor":{"type":"number"},"grid_frequency":{"type":"number"},"total_forward_active_energy_t1":{"type":"number"},"total_forward_active_energy_t2":{"type":"number"},"total_reverse_active_energy_t1":{"type":"number"},"total_reverse_active_energy_t2":{"type":"number"},"total_forward_reactive_energy_t1":{"type":"number"},"total_forward_reactive_energy_t2":{"type":"number"},"total_reverse_reactive_energy_t1":{"type":"number"},"total_reverse_reactive_energy_t2":{"type":"number"}}},"PagedEmuPowerMeterResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EmuPowerMeterRecord"}},"total":{"type":"integer"}}},"EmuPowerMeterStatsResponse":{"type":"object","properties":{"interval":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time"},"totalActivePower":{"$ref":"#/components/schemas/FieldStats"},"l1ActivePower":{"$ref":"#/components/schemas/FieldStats"},"l2ActivePower":{"$ref":"#/components/schemas/FieldStats"},"l3ActivePower":{"$ref":"#/components/schemas/FieldStats"},"averagePower":{"$ref":"#/components/schemas/FieldStats"},"totalCurrent":{"$ref":"#/components/schemas/FieldStats"},"l1Current":{"$ref":"#/components/schemas/FieldStats"},"l2Current":{"$ref":"#/components/schemas/FieldStats"},"l3Current":{"$ref":"#/components/schemas/FieldStats"},"neutralCurrent":{"$ref":"#/components/schemas/FieldStats"},"l1nVoltage":{"$ref":"#/components/schemas/FieldStats"},"l2nVoltage":{"$ref":"#/components/schemas/FieldStats"},"l3nVoltage":{"$ref":"#/components/schemas/FieldStats"},"l1PowerFactor":{"$ref":"#/components/schemas/FieldStats"},"l2PowerFactor":{"$ref":"#/components/schemas/FieldStats"},"l3PowerFactor":{"$ref":"#/components/schemas/FieldStats"},"gridFrequency":{"$ref":"#/components/schemas/FieldStats"}}}}}},"FuelTankRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"rawDistance":{"type":"number"},"temperature":{"type":"number"},"battery":{"type":"number"}}},"PostFuelTankDTO":{"type":"object","required":["time"],"properties":{"time":{"type":"string","format":"date-time"},"raw_distance":{"type":"number"},"temperature":{"type":"number"},"battery":{"type":"number"}}},"PagedFuelTankResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FuelTankRecord"}},"total":{"type":"integer"}}},"FuelTankStatsResponse":{"type":"object","properties":{"interval":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time"},"rawDistance":{"$ref":"#/components/schemas/FieldStats"},"temperature":{"$ref":"#/components/schemas/FieldStats"},"battery":{"$ref":"#/components/schemas/FieldStats"}}}}}},"MilesightPowerMeterRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"totalVoltage":{"type":"number"},"activePower":{"type":"number"},"powerFactor":{"type":"number"},"totalForwardActiveEnergy":{"type":"number"},"totalCurrent":{"type":"number"},"switchStatus":{"type":"boolean"}}},"PostMilesightPowerMeterDTO":{"type":"object","required":["time"],"properties":{"time":{"type":"string","format":"date-time"},"total_voltage":{"type":"number"},"active_power":{"type":"number"},"power_factor":{"type":"number"},"total_forward_active_energy":{"type":"number"},"total_current":{"type":"number"},"switch_status":{"type":"boolean"}}},"PagedMilesightPowerMeterResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/MilesightPowerMeterRecord"}},"total":{"type":"integer"}}},"MilesightPowerMeterStatsResponse":{"type":"object","properties":{"interval":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time"},"totalVoltage":{"$ref":"#/components/schemas/FieldStats"},"activePower":{"$ref":"#/components/schemas/FieldStats"},"powerFactor":{"$ref":"#/components/schemas/FieldStats"},"totalForwardActiveEnergy":{"$ref":"#/components/schemas/FieldStats"},"totalCurrent":{"$ref":"#/components/schemas/FieldStats"}}}}}},"LibeliumEnvRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"temperature":{"type":"number"},"humidity":{"type":"number"},"pressure":{"type":"number"}}},"PostLibeliumEnvDTO":{"type":"object","required":["time"],"properties":{"time":{"type":"string","format":"date-time"},"temperature":{"type":"number"},"humidity":{"type":"number"},"pressure":{"type":"number"},"dew_point":{"type":"number"},"heat_index":{"type":"number"},"wind_chill":{"type":"number"},"rain_storm":{"type":"number"},"rain_day":{"type":"number"},"rain_month":{"type":"number"},"rain_15min":{"type":"number"},"rain_1h":{"type":"number"},"rain_rate":{"type":"number"},"rain_24h":{"type":"number"},"rain_year":{"type":"number"},"wind_dir_10min":{"type":"number"},"wind_dir_inst":{"type":"number"},"wind_speed_10min":{"type":"number"},"wind_speed_gust":{"type":"number"},"wind_speed_inst":{"type":"number"},"uv_index":{"type":"number"},"solar_radiation":{"type":"number"},"thsw_index":{"type":"number"},"et_day":{"type":"number"},"et_month":{"type":"number"},"et_year":{"type":"number"},"noise_la1":{"type":"number"},"noise_la10":{"type":"number"},"noise_la50":{"type":"number"},"noise_la90":{"type":"number"},"noise_la99":{"type":"number"},"noise_la_max":{"type":"number"},"noise_la_min":{"type":"number"},"noise_laeg":{"type":"number"},"air_quality_pm1_0":{"type":"number"},"air_quality_pm2_5":{"type":"number"},"air_quality_pm4_0":{"type":"number"},"air_quality_pm10":{"type":"number"},"air_quality_tsp":{"type":"number"},"air_quality_tpc":{"type":"number"},"air_quality_no2":{"type":"number"},"air_quality_o3":{"type":"number"},"air_quality_co":{"type":"number"},"air_quality_so2":{"type":"number"},"air_quality_no":{"type":"number"},"air_quality_h2s":{"type":"number"},"air_quality_cl2":{"type":"number"},"air_quality_voc":{"type":"number"},"air_quality_co2":{"type":"number"},"pump_health":{"type":"number"}}},"PagedLibeliumEnvResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/LibeliumEnvRecord"}},"total":{"type":"integer"}}},"LibeliumEnvStatsResponse":{"type":"object","properties":{"interval":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time"},"temperature":{"$ref":"#/components/schemas/FieldStats"},"humidity":{"$ref":"#/components/schemas/FieldStats"},"pressure":{"$ref":"#/components/schemas/FieldStats"}}}}}},"DecentlabWeatherRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"solarRadiation":{"type":"number"},"precipitation":{"type":"number"}}},"PostDecentlabWeatherDTO":{"type":"object","required":["time"],"properties":{"time":{"type":"string","format":"date-time"},"solar_radiation":{"type":"number"},"precipitation":{"type":"number"},"lightning_strike_count":{"type":"number"},"lightning_avg_distance":{"type":"number"},"wind_speed":{"type":"number"},"wind_direction":{"type":"number"},"wind_speed_max":{"type":"number"},"wind_speed_north":{"type":"number"},"wind_speed_east":{"type":"number"},"air_temperature":{"type":"number"},"vapor_pressure":{"type":"number"},"barometric_pressure":{"type":"number"},"relative_humidity":{"type":"number"},"internal_temperature":{"type":"number"},"tilt_x":{"type":"number"},"tilt_y":{"type":"number"},"compass_heading":{"type":"number"},"battery_voltage":{"type":"number"}}},"PagedDecentlabWeatherResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/DecentlabWeatherRecord"}},"total":{"type":"integer"}}},"DecentlabWeatherStatsResponse":{"type":"object","properties":{"interval":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time"},"solarRadiation":{"$ref":"#/components/schemas/FieldStats"},"precipitation":{"$ref":"#/components/schemas/FieldStats"}}}}}},"FineRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"licensePlate":{"type":"string"},"amount":{"type":"number"}}},"PostFineDTO":{"type":"object","required":["licensePlate"],"properties":{"extSysId":{"type":"string"},"licensePlate":{"type":"string"},"isLicensePlateForeign":{"type":"boolean","default":false},"photo":{"type":"string"},"vehicleTypeId":{"type":"string"},"vehicleTypeName":{"type":"string"},"vehicleTypeExtSysId":{"type":"string"},"vehicleBrand":{"type":"string"},"vehicleColor":{"type":"string"},"address":{"type":"string"},"locationDetails":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"officerId":{"type":"string","format":"string"},"officerFullname":{"type":"string"},"date":{"type":"string","format":"date-time"},"type":{"type":"string"},"amount":{"type":"number"},"penaltyVehicleLicenseDays":{"type":"integer"},"penaltyVehicleLicenseRemoved":{"type":"boolean"},"penaltyLicensePlateDays":{"type":"integer"},"penaltyLicensePlateRemoved":{"type":"boolean"},"penaltyDrivingLicenseDays":{"type":"integer"},"penaltyDrivingLicenseRemoved":{"type":"boolean"},"description":{"type":"string"},"comments":{"type":"string"},"presenceStatus":{"type":"string"},"presenceStatusEn":{"type":"string"},"presenceStatusEl":{"type":"string"},"presenceStatusFr":{"type":"string"},"code":{"type":"string"},"serialNumber":{"type":"string"},"isPaid":{"type":"boolean","default":false},"isCanceled":{"type":"boolean","default":false},"canceledNotes":{"type":"string"},"typeEntryId":{"type":"string"},"typeEntryName":{"type":"string"},"typeEntryExtSysId":{"type":"string"}}},"PagedFineResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/FineRecord"}},"total":{"type":"integer"}}},"AppealRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"fineId":{"type":"string"}}},"PostAppealDTO":{"type":"object","required":["fineId"],"properties":{"fineId":{"type":"string"},"description":{"type":"string"},"detailsName":{"type":"string"},"detailsSurname":{"type":"string"},"detailsFatherName":{"type":"string"},"detailsEmail":{"type":"string","format":"email"},"detailsMobile":{"type":"string"},"detailsAddress":{"type":"string"},"detailsProfession":{"type":"string"},"detailsVatNumber":{"type":"string"},"detailsIdOrPassport":{"type":"string"},"resolution":{"type":"string"},"code":{"type":"string"},"fileIdOrPassport":{"type":"string"},"fileCarLicense":{"type":"string"},"fileDriverLicense":{"type":"string"},"fileAuthorization":{"type":"string"},"fileOther":{"type":"string"}}},"PagedAppealResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AppealRecord"}},"total":{"type":"integer"}}},"EventRecord":{"type":"object","properties":{"time":{"type":"string","format":"date-time"},"deviceId":{"type":"string"},"description":{"type":"string"},"severityLevel":{"type":"integer"},"eventType":{"type":"string"}}},"PostEventDTO":{"type":"object","required":["time","eventType"],"properties":{"time":{"type":"string","format":"date-time","example":"2026-02-02T01:00:00.009Z"},"description":{"type":"string","example":"Sensor disconnected"},"severityLevel":{"type":"integer","example":2},"eventType":{"type":"string","example":"connectivity"}}},"PagedEventResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/EventRecord"}},"total":{"type":"integer"}}},"EventStatsResponse":{"type":"object","properties":{"interval":{"type":"string"},"buckets":{"type":"array","items":{"type":"object","properties":{"bucket":{"type":"string","format":"date-time"},"count":{"type":"integer"},"bySeverity":{"type":"object","additionalProperties":{"type":"integer"}},"byType":{"type":"object","additionalProperties":{"type":"integer"}}}}}}}}}}