Implement director resignation processing in DirectorWorker: Added logic to check for director resignations based on satisfaction levels, including new SQL queries for retrieving candidates and deleting directors. Enhanced notification system to alert users of high resignation risks, improving overall management of director statuses.
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m32s
All checks were successful
Deploy yourpart (blue-green) / deploy (push) Successful in 1m32s
This commit is contained in:
@@ -638,6 +638,21 @@ 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_GET_DIRECTORS_FOR_RESIGNATION_CHECK: &str = r#"
|
||||
SELECT d.id,
|
||||
d.employer_user_id,
|
||||
d.director_character_id,
|
||||
COALESCE(d.satisfaction, 0)::int AS satisfaction
|
||||
FROM falukant_data.director d
|
||||
WHERE d.employer_user_id IS NOT NULL;
|
||||
"#;
|
||||
|
||||
pub const QUERY_DELETE_DIRECTOR_BY_ID: &str = r#"
|
||||
DELETE FROM falukant_data.director
|
||||
WHERE id = $1::int
|
||||
RETURNING employer_user_id, director_character_id;
|
||||
"#;
|
||||
|
||||
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