Refactor money update execution in BaseWorker: Simplified the SQL execution by directly constructing the update query without parameterized placeholders, addressing serialization issues. Updated comments for clarity on the handling of money values and ensured compatibility with trusted data sources. Additionally, modified the casting of money in the director query to text for consistent mapping in Rust.

This commit is contained in:
Torsten Schulz (local)
2025-12-01 11:31:37 +01:00
parent 260b3b2962
commit a0e14788c7
2 changed files with 12 additions and 23 deletions

View File

@@ -82,10 +82,9 @@ const QUERY_GET_DIRECTORS: &str = r#"
const QUERY_GET_BEST_PRODUCTION: &str = r#"
SELECT
fdu.id falukant_user_id,
-- Geld explizit in einen numerischen Wert casten, damit das Mapping im
-- Rust-Code zuverlässig funktioniert (kein Sonderformat des PostgreSQL-
-- Typs `money` o.Ä.).
CAST(fdu.money AS numeric) AS money,
-- Geld explizit als Text casten, damit das Mapping im Rust-Code
-- zuverlässig funktioniert (unabhängig vom nativen DB-Typ wie `money`).
CAST(fdu.money AS text) AS money,
fdu.certificate,
ftp.id product_id,
ftp.label_tr,