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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user