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:
Torsten Schulz (local)
2026-04-09 08:19:19 +02:00
parent 3e74ae47f4
commit dd77ba8a96
18 changed files with 200 additions and 25 deletions

View File

@@ -30,6 +30,7 @@ void UserCharacterWorker::run() {
processCharacterEvents();
updateCharactersMood();
handleCredits();
deleteOldProductionLogs();
} catch (const std::exception &e) {
std::cerr << "[UserCharacterWorker] Fehler in processCharacterEvents: " << e.what() << std::endl;
}
@@ -233,6 +234,17 @@ void UserCharacterWorker::setNewMoney(int falukantUserId, double newAmount) {
});
}
void UserCharacterWorker::deleteOldProductionLogs() {
try {
ConnectionGuard connGuard(pool);
auto &db = connGuard.get();
db.prepare("QUERY_DELETE_OLD_PRODUCTIONS", QUERY_DELETE_OLD_PRODUCTIONS);
db.execute("QUERY_DELETE_OLD_PRODUCTIONS");
} catch (const std::exception &e) {
std::cerr << "[UserCharacterWorker] Fehler in deleteOldProductionLogs: " << e.what() << std::endl;
}
}
void UserCharacterWorker::recalculateKnowledge() {
setCurrentStep("Get character data");
ConnectionGuard connGuard(pool);