Constants.ktThe single source of truth for all project-wide constants. A Kotlin object (thread-safe singleton) at 158 lines, referenced everywhere — by JPA entities as @Column(length = Constants.LENGTH_TITLE), by validators, formatters, and UI components. Javadoc: "Defines different constants (typical length of string columns) usable by plugins and core package."
| Constant | Value | Usage |
|---|---|---|
LENGTH_TEXT | 4000 | Default for text/description fields |
LENGTH_COMMENT | 4000 | Comment fields |
COMMENT_LENGTH | 4000 | Legacy alias for comment fields |
LENGTH_SUBJECT | 1000 | Subject line fields |
LENGTH_TITLE | 1000 | Title fields in all entities |
Standardizing column lengths in one place guarantees database schema consistency across all entity classes. Used in JPA @Column(length = ...) annotations and front-end validation.
| Constant | Value | Purpose |
|---|---|---|
TEN_BILLION | 10000000000 | Upper bound for monetary fields (BigDecimal precision=12, scale=2) |
TEN_BILLION_NEGATIVE | -10000000000 | Lower bound for monetary fields |
HUNDRED_BD | 100 | Used in percentage calculations |
| Constant | Value | Note |
|---|---|---|
KB | 1024 | Integer and BigDecimal variants available (e.g. KB_BD). Used for file size formatting and upload limit validation. |
MB | KB * 1024 | |
GB | MB * 1024 | |
TB | GB * 1024L (Long) |
SECONDS_PER_MINUTE = 60 | MILLIS_PER_SECOND = 1_000L |
SECONDS_PER_HOUR = 60 * 60 | MILLIS_PER_MINUTE = 60 * 1_000L |
SECONDS_PER_DAY = 3600 * 24 | MILLIS_PER_HOUR = 3_600_000L |
SECONDS_PER_WEEK = 86400 * 7 | MILLIS_PER_DAY = 86_400_000L |
MILLIS_PER_WEEK = 604_800_000L |
Each time constant has a corresponding _BD variant (BigDecimal). Used in timesheet calculations, timers, and date/time arithmetic.
| Constant | Value | Purpose |
|---|---|---|
REACT_APP_PATH | "react/" | URL path prefix for the React SPA frontend |
WICKET_APPLICATION_PATH | "wa/" | URL path prefix for legacy Wicket pages |
BUILD_DIR | "build" | Gradle build output directory (was "target" with Maven) |
Prefixed with WEB_, these constants form a link hierarchy: WEB_HOME_PAGE_LINK → WEB_DOCS_LINK → WEB_DOCS_USER_GUIDE_LINK, WEB_DOCS_ADMIN_GUIDE_LINK, etc. Used throughout the UI for help links and documentation references.
TIMESHEET_CALENDAR_ID = -1L | Special calendar ID for timesheet events |
MINYEAR = 1900, MAXYEAR = 2100 | Valid year range for date pickers and validation |
EVENT_CLASS_NAME = "timesheet" | Identifier for timesheet calendar events |
BREAK_EVENT_CLASS_NAME = "ts-break" | Identifier for break entries in timesheets |
object — Why Not a Class?A Kotlin object is a thread-safe singleton created on first access via JVM class loading guarantees. Constants declared with const val are compiled to JVM static fields and inlined at the call site — no runtime resolution overhead.
For Java interop:
@JvmField on BigDecimal fields exposes them as Constants.TEN_BILLION without synthetic getters.@JvmStatic on isTimesheetCalendarId() makes it a true static method callable from Java.CURRENCY_SYMBOL field lazily resolves from ConfigurationServiceAccessor at first access — the only non-constant value in the object.868d6abb7 2025 -> 2026 47d42a5bb AI savings: mass update of time-sheets, editing in classic page added. 63081666f Source file headers: 2024-> 2025. 1ffa5a1ef WIP: gradle... 4c04cfd65 MAJOR-CHANGE! Migration of integer id's to Long id's. b6092df09 Copyright 2023 -> 2024 ab45d51fa Copyright 2001-2022 -> 2001-2023. dcfc7c1a9 Old calendar moved to sub menu, ScriptingTask*, JiraUtils 1ea8d4062 WIP: Jobs and Bank account records. d7b3e8751 AG grid: Copy and paste and Excel export improved.