Update environment configuration and enhance logging: Add support for loading a local .env file and improve logging behavior based on QUIET_ENV_LOGS settings. Introduce new diagnostic scripts in package.json for town worth and money flow analysis. Adjust production cost calculations in FalukantService to align with updated pricing logic and enhance product initialization parameters.

This commit is contained in:
Torsten Schulz (local)
2026-03-25 13:23:51 +01:00
parent 44991743d2
commit 8af726c65a
15 changed files with 498 additions and 46 deletions

View File

@@ -0,0 +1,14 @@
-- Kurzüberblick: Zeilen, Nutzer, Summen Ein-/Ausgang im gleichen Fenster wie
-- falukant_moneyflow_by_activity.sql (Platzhalter identisch).
SELECT
COUNT(*)::bigint AS row_count,
COUNT(DISTINCT m.falukant_user_id)::bigint AS distinct_falukant_users,
ROUND(SUM(m.change_value)::numeric, 2) AS net_sum_all,
ROUND(SUM(CASE WHEN m.change_value < 0 THEN m.change_value ELSE 0 END)::numeric, 2) AS sum_negative_only,
ROUND(SUM(CASE WHEN m.change_value > 0 THEN m.change_value ELSE 0 END)::numeric, 2) AS sum_positive_only,
MIN(m."time") AS first_ts,
MAX(m."time") AS last_ts
FROM falukant_log.moneyflow m
WHERE m."time" >= NOW() - (INTERVAL '1 day' * __DIAG_DAYS__)
__DIAG_USER_FILTER__;