feat(user): add certificate production tracking and update localization
- Introduced a new field `certificateProductionsCountSince` in the `FalukantUser` model to track the date from which production logs are counted for certificate requirements. - Updated the `FalukantService` to utilize the new field for calculating completed productions since the specified date. - Enhanced the UI to display the count of productions since the last promotion, with corresponding translations added for multiple languages including Cebuano, German, English, Spanish, and French. - Implemented a method to delete old production logs, ensuring efficient data management while maintaining necessary historical records for certificate calculations.
This commit is contained in:
@@ -25,6 +25,7 @@ private:
|
||||
int calculateHealthChange(int age);
|
||||
void handleCharacterDeath(int characterId);
|
||||
void recalculateKnowledge();
|
||||
void deleteOldProductionLogs();
|
||||
void processPregnancies();
|
||||
void handleCredits();
|
||||
void setHeir(int characterId);
|
||||
@@ -61,7 +62,13 @@ private:
|
||||
static constexpr const char *QUERY_UPDATE_GET_ITEMS_TO_UPDATE = R"(
|
||||
SELECT id, product_id, producer_id, quantity
|
||||
FROM falukant_log.production p
|
||||
WHERE p.production_timestamp::date < current_date
|
||||
WHERE (COALESCE(p.production_timestamp, p.production_date::timestamp))::date < CURRENT_DATE
|
||||
)";
|
||||
|
||||
/** Log-Retention: ältere Zeilen entfernen (Daemon/UI-Zertifikatszählung braucht Historie nur begrenzt). */
|
||||
static constexpr const char *QUERY_DELETE_OLD_PRODUCTIONS = R"(
|
||||
DELETE FROM falukant_log.production
|
||||
WHERE COALESCE(production_timestamp, production_date::timestamp) < NOW() - INTERVAL '30 days'
|
||||
)";
|
||||
|
||||
static constexpr const char *QUERY_UPDATE_GET_CHARACTER_IDS = R"(
|
||||
|
||||
Reference in New Issue
Block a user