Refactor Falukant certificate management: Consolidated certificate logic into the FalukantFamilyWorker's daily processing, removing the separate FalukantCertificateWorker. Updated SQL queries to include app_user_id and enhanced documentation for clarity on certificate scoring and daily recalculation logic.
This commit is contained in:
@@ -3135,6 +3135,7 @@ pub const QUERY_INSERT_CHILD_RELATION_LOVER: &str = r#"
|
||||
pub const QUERY_GET_PRODUCTION_CERTIFICATE_INPUT_ROWS: &str = r#"
|
||||
SELECT DISTINCT ON (fu.id)
|
||||
fu.id AS falukant_user_id,
|
||||
COALESCE(fu.user_id, fu.id)::int AS app_user_id,
|
||||
COALESCE(fu.certificate, 1)::int AS certificate,
|
||||
COALESCE(fu.money, 0)::float8 AS money,
|
||||
c.id AS character_id,
|
||||
@@ -3179,7 +3180,8 @@ pub const QUERY_GET_PRODUCTION_CERTIFICATE_INPUT_ROWS: &str = r#"
|
||||
|
||||
pub const QUERY_UPDATE_FALUKANT_USER_CERTIFICATE: &str = r#"
|
||||
UPDATE falukant_data.falukant_user
|
||||
SET certificate = $1::int
|
||||
SET certificate = $1::int,
|
||||
updated_at = NOW()
|
||||
WHERE id = $2::int;
|
||||
"#;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user