feat: enhance PowerClamp service with energy consumption procedures and enums

This commit is contained in:
faris Aljohari
2025-04-24 03:14:03 +03:00
parent f3fd6646a1
commit 881618a4ee
9 changed files with 87 additions and 126 deletions
@@ -1,7 +1,7 @@
WITH params AS (
SELECT
'd72f3d5d-02e5-4a9e-a1f7-7ab8c3534910'::uuid AS device_id,
'2025-04-23'::date AS target_date
$1::uuid AS device_id,
$2::date AS target_date
),
total_energy AS (
SELECT
@@ -1,8 +1,8 @@
WITH params AS (
SELECT
'd72f3d5d-02e5-4a9e-a1f7-7ab8c3534910'::uuid AS device_id,
'2025-04-23'::date AS target_date,
'14'::text AS target_hour
$1::uuid AS device_id,
$2::date AS target_date,
$3::text AS target_hour
),
total_energy AS (
SELECT
@@ -1,7 +1,7 @@
WITH params AS (
SELECT
'd72f3d5d-02e5-4a9e-a1f7-7ab8c3534910'::uuid AS device_id,
'03-2025'::text AS target_month -- Format should match 'MM-YYYY'
$1::uuid AS device_id,
$2::text AS target_month -- Format should match 'MM-YYYY'
),
total_energy AS (
SELECT