core-reminders: shared reminder-lead plumbing (ReminderUnit, override model + codec)

Pure-Kotlin module, drawn from the duplicate reminder logic in Agendula and
Calendula: the lead-time unit model (ReminderUnit / decomposeReminderMinutes),
the per-target override model (ReminderOverride + reminderLeadFor /
applyReminderOverride) and the stored-format codec (ReminderOverrideCodec).

The codec's separators are configurable so each app keeps its on-disk format
(Agendula stores id:minutes, Calendula id=minutes) without a data migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-28 14:11:55 +02:00
parent 0db0e3883f
commit 367a8ff8af
8 changed files with 252 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
// core-reminders — pure-Kotlin reminder-lead plumbing shared across the family:
// the lead-time unit model (ReminderUnit / decomposeReminderMinutes), the
// per-target override model (ReminderOverride + resolution helpers) and the
// stored-format codec (ReminderOverrideCodec, separators configurable so each
// app keeps its on-disk format). No Android, no third-party deps — a plain JVM
// library, like core-time; each app layers its own DataStore + string labels on
// top.
plugins {
alias(libs.plugins.kotlin.jvm)
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
dependencies {
testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(libs.junit.jupiter.engine)
testRuntimeOnly(libs.junit.platform.launcher)
testImplementation(libs.truth)
}
tasks.test {
useJUnitPlatform()
}