Refactor DirectorWorker SQL queries: Remove unused QUERY_GET_DIRECTOR_USER and update vehicle count retrieval to use consistent column names. This improves code clarity and maintains consistency in data handling.

This commit is contained in:
Torsten Schulz (local)
2026-01-05 11:32:56 +01:00
parent 1e4689212b
commit 713504d3ab
2 changed files with 7 additions and 18 deletions

View File

@@ -455,10 +455,6 @@ WITH new_sats AS (
UPDATE falukant_data.director dir SET satisfaction = ns.new_satisfaction FROM new_sats ns WHERE dir.id = ns.id AND dir.satisfaction IS DISTINCT FROM ns.new_satisfaction RETURNING dir.employer_user_id;
"#;
pub const QUERY_GET_DIRECTOR_USER: &str = r#"
SELECT fu.id AS falukant_user_id FROM falukant_data.director d JOIN falukant_data.falukant_user fu ON fu.id = d.employer_user_id WHERE d.id = $1 LIMIT 1;
"#;
pub const QUERY_COUNT_VEHICLES_IN_BRANCH_REGION: &str = r#"
SELECT COUNT(v.id) AS cnt FROM falukant_data.vehicle v WHERE v.falukant_user_id = $1 AND v.region_id = $2;
"#;