#1100: TimesheetDO.kt

projectforge-business/src/main/kotlin/org/projectforge/business/timesheet/TimesheetDO.kt JPA Entity / Timesheet Domain, projectforge-business/src/main/kotlin/org/projectforge/business/timesheet/TimesheetDO.kt 322 lines · 218 code · 70 comments · 34 blank
Core JPA entity for timesheets (table T_TIMESHEET), extending DefaultBaseDO and implementing Comparable (by startTime). Fields: task (lazy ManyToOne, indexed embedded), user (lazy ManyToOne, indexed embedded with objectId), timeZone, startTime/stopTime (Date with minute precision, rounded to 5-min multiples via setStartDate/setStopDate), location (100 chars), reference (1000 chars, jiraPreservingAnalyzer), tag, description (4000 chars). Kost2 association (lazy ManyToOne, nullable). AI time savings support: timeSavedByAI (BigDecimal), timeSavedByAIUnit enum (PERCENTAGE/HOURS), timeSavedByAIDescription. Computed properties: duration (millis from TimePeriod), durationAsString (formatted hours:minutes), workFractionDuration (weighted by kost2/kost2Art workFraction), timePeriod, userId/taskId/kost2Id. marked transient boolean for collision marking. getFormattedWeekOfYear() and getShortDescription() (50-char abbreviation). Named queries for start/stop by task, min/max dates, location/used-locations search, and references by task.

Git History

868d6abb7 2025 -> 2026
9c40a8d53 Claude-Code: jiraPreservingAnalyzer for Lucene for preserving ACME-12345
4722d841d Claude-Code: jiraPreservingAnalyzer for Lucene for preserving ACME-12345
c21d9772b VacationDao: NPE fix. AITimeSavings.getFraction(...) added (by adding NumberHelper.getFraction(...).
ee53d43df AI savings: calculation of percent modified, TimesheetDO @Enumerated in database for unit. TimePeriod.getDurationFields rounds now seconds and minutes (half up).
47d42a5bb AI savings: mass update of time-sheets, editing in classic page added, further improvements. Mass-update: Excel sheet with modifications is now stored in the user's personal DataTransfer box.
2ec065b52 WIP: time savings by AI: TimesheetListPage, MonthlyEmployeeReport
9fc09ddd4 Bugfix: Autocompletion for locations in timesheet works now again.
cbffabd60 WIP: time savings by AI
26a7fd093 WIP timesheet: saving by AI
88f099cab WIP: AI time savings in time sheets.
63081666f Source file headers: 2024-> 2025.
0237d5eba Json serialization refactored: IdOnlySerializer and IdsOnlySerializer introduced.
53b501ab6 Example scripts fixed. TimesheetDO.getDuration() -> TimesheetDO.duration.
c8f8ed935 Declared all entities as FetchType.LAZY (was EAGER).
4c04cfd65 MAJOR-CHANGE! Migration of integer id's to Long id's (including fk's etc.)
f5c09f87f Migration stuff in progress...
4f5a458c9 Migration stuff in progress...
c04fb0d51 Migration stuff in progress...
06828f490 Migration stuff in progress...
b6092df09 Copyright 2023 -> 2024
ab45d51fa Copyright 2001-2022 -> 2001-2023.
512ffa420 Configuration param: timesheetTag implemented.
5f7ef41b8 Copyright 2021 -> 2022
c0f2b9de0 Tenants functionality removed everywhere (untested).
d875be4d4 TimesheetDao: Java - Kotlin (!!!! Side effects may occur all over the project!!!!)
ceb63e8a1 Source code header: (C) 2001-2021.
4e891969e TimesheetDao.getUsedReferences(taskId) implemented.
18ae3e67c WIP: timesheet -> reference.
7e28918de wip
018b89e91 Timesheets time of day now with precistion of 5 minutes (was still 15 before in classical version).
b209e00ba PFDay.from -> from, fromOrNow, fromOrNull, PFDateTime.from -> from, fromOrNow, fromOrNull
d8ac48bb4 TimesheetDO.setStartDate(long): Timestamp -> Date
88f40cfd3 TimesheetDO.setStartDate(long) simlified.
7c1c48782 Replacing more instance of java.sql.Date with java.time.LocalDate Replacing instances of java sql.Timestamp with java.util.Date
7c79f1922 Copyright of source header -> 2020.
24019a0f5 Eliminate DateHolder occurences
e4cdd8d4b Revert "More Holder replacements"
f604a1afe More Holder replacements
4adb54338 WIP: Multifieldqueryparser...
19b97fcc3 DateBridge: encoding = EncodingType.STRING for all DateBridges in all DO's.
8675a1dbe Found big performance issue: Declared all Kotlin JPA entities and their properties as open. Lazy loading wasn't supported by Hibernate and results in thousands of JPA queries...
39cdd224c Hibernate search: DateBridge...
af35917ac More code cleanup
0d07a0db5 TimesheetDO.kt.marked: @JsonIgnore
fe5a7c982 Heavy WIP: NamedQueries everywhere... Plugin crm removed.
510e8d796 Heavy WIP: NamedQueries everywhere...
a75c0ffbd Kost2ArtDO.java -> Kost2ArtDO.kt
6d1f7a7cd Kost2DO.java -> Kost2DO.kt
05244ff19 CopyRight of all Kotlin file-header updated or created.
e5ba55b8d ToString method in business package introduced: DefaultBaseDO using now new toJsonString method at default.
66a58cf26 ToString method in business package introduced: Using now json for to String of DefaultBaseDO objects (started with timesheets). JsonValidator moved to business package for testing purposes of this new approach.
a2ee19c85 i18n-key for TimesheetDO.description fixed.
209dd8ce5 TimesheetDO.setStartTime(long) -> setStartDate(long).
a436210a3 WIP: React migration.
086e588b8 TimesheetDO.java -> TimesheetDO.kt...