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:
@@ -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;
|
||||
"#;
|
||||
|
||||
Reference in New Issue
Block a user