From 230581c3f5d765a18a2ea91cc65ad1b36f6aed6d Mon Sep 17 00:00:00 2001 From: Papa Date: Sat, 31 May 2025 05:27:42 +0200 Subject: [PATCH] preparing teacherage --- .classpath | 7 ------- .project | 2 +- build.gradle | 4 ++-- .../module/registration/RegistrationRepository.java | 10 +++++----- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.classpath b/.classpath index 7606e94..f3bdce0 100644 --- a/.classpath +++ b/.classpath @@ -6,13 +6,6 @@ - - - - - - - diff --git a/.project b/.project index f2a18a9..471e857 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - camporganizer2 + CampOrganizer2 diff --git a/build.gradle b/build.gradle index 391660a..d677b95 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ plugins { } group = 'de.jottyfan.camporganizer' -version = '0.9.4' +version = '0.9.5' description = """CampOrganizer2""" @@ -41,7 +41,7 @@ war { dependencies { implementation 'org.jooq:jooq:3.19.14' - implementation 'de.jottyfan:COJooq:2024.10.24' + implementation 'de.jottyfan:COJooq:2025.04.23' implementation 'org.apache.logging.log4j:log4j-api:2.24.1' implementation 'org.apache.logging.log4j:log4j-core:2.24.1' diff --git a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationRepository.java b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationRepository.java index 945fb05..bf0a738 100644 --- a/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationRepository.java +++ b/src/main/java/de/jottyfan/camporganizer/module/registration/RegistrationRepository.java @@ -408,14 +408,14 @@ public class RegistrationRepository { if (EnumCamprole.teacher.equals(campRole)) { SelectConditionStep> sql = jooq // @formatter:off - .select(T_CAMP.MAX_AGE, - DSL.localDateTimeDiff(T_CAMP.DEPART, birthDateDay).as("teacherAge")) - .from(T_CAMP) - .where(T_CAMP.PK.eq(fkCamp)); + .select(V_CAMP.MIN_TEACHERAGE, + DSL.localDateTimeDiff(V_CAMP.DEPART, birthDateDay).as("teacherAge")) + .from(V_CAMP) + .where(V_CAMP.PK.eq(fkCamp)); // @formatter:on LOGGER.trace(sql.toString()); Record r = sql.fetchOne(); - Integer minTeacherAge = r.get(T_CAMP.MAX_AGE) + 2; // by default, we need 2 years older teachers at least + Integer minTeacherAge = r.get(V_CAMP.MIN_TEACHERAGE); DayToSecond currentTeacherAge = r.get("teacherAge", DayToSecond.class); double totalYears = currentTeacherAge.getTotalDays() / 365.25; // in years int years = (int) totalYears;