Skip to content

chore: update versions parity with kmp-project-template#2604

Open
amanna13 wants to merge 8 commits intoopenMF:developmentfrom
amanna13:chore/update-dependencies-versions
Open

chore: update versions parity with kmp-project-template#2604
amanna13 wants to merge 8 commits intoopenMF:developmentfrom
amanna13:chore/update-dependencies-versions

Conversation

@amanna13
Copy link
Contributor

@amanna13 amanna13 commented Feb 7, 2026

Fixes - Jira-#660

This PR includes -

  • Updations of all library version as per kmp-template
  • Adoption of recent changes made to the kmp-template
  • Fixes all build failures

Screenshots

Screen_recording_20260213_111754.mp4

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the static analysis check ./gradlew check or ci-prepush.sh to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them.

Summary by CodeRabbit

  • New Features

    • Extended color scheme with fixed and variant color states in the design system for improved visual consistency.
  • Documentation

    • Comprehensive database module documentation with examples for cross-platform development.
  • Chores

    • Updated Android SDK version to 36.
    • Upgraded dependencies across Android, Compose, Firebase, and networking libraries for stability and performance.
    • Updated Gradle to version 8.13 and Kotlin to 2.2.21.

@coderabbitai
Copy link

coderabbitai bot commented Feb 7, 2026

📝 Walkthrough

Walkthrough

This PR centralizes Room annotations into a Kotlin Multiplatform core (core-base/database), replaces platform-specific MifosDatabaseFactory with AppDatabaseFactory and its fluent builder across platforms, migrates imports across DAOs/entities/typeconverters, and performs broad dependency and build-tool version upgrades.

Changes

Cohort / File(s) Summary
Build config & tooling
build-logic/convention/src/main/kotlin/org/mifos/KotlinAndroid.kt, build-logic/convention/src/main/kotlin/org/mifos/KotlinMultiplatform.kt, gradle/libs.versions.toml, gradle/wrapper/gradle-wrapper.properties, gradle.properties, gradle/...
Updated compileSdk (35→36), added Kotlin opt-in compiler args, bumped many version catalog entries and Gradle wrapper, removed an experimental lint property.
Core-base database (multiplatform API + docs)
core-base/database/README.md, core-base/database/src/commonMain/kotlin/.../Room.kt, core-base/database/src/nonJsCommonMain/kotlin/.../Room.nonJsCommon.kt, core-base/database/src/commonMain/kotlin/.../TypeConverter.kt
Adds expect Room annotation types and constants (Dao, Query, Insert, Entity, PrimaryKey, ForeignKey, ColumnInfo, TypeConverters, OnConflictStrategy, affinities, etc.) and rewrites docs; consolidates TypeConverter into Room.kt (removed separate files).
AppDatabaseFactory adoption & MifosDatabaseFactory removals
core/database/src/*/kotlin/com/mifos/room/di/DatabaseModule.*.kt, core/database/src/*/kotlin/com/mifos/room/utils/MifosDatabaseFactory.kt
Replaced MifosDatabaseFactory with AppDatabaseFactory across android/desktop/native, changed creation to typed/generic call with Constants.DATABASE_NAME, added builder calls (setDriver, setQueryCoroutineContext, build); removed platform-specific MifosDatabaseFactory implementations.
Module API / dependency exposure
core/database/build.gradle.kts
Added api(projects.coreBase.database) to commonMain dependencies to re-export the core-base database API.
DAO & TypeConverter imports
core/database/src/commonMain/kotlin/com/mifos/room/dao/*, core/database/src/commonMain/kotlin/com/mifos/room/typeconverters/*
Updated all DAO and typeconverter imports to use template.core.base.database.* annotations/types instead of com.mifos.room.utils.*.
Entity import & metadata updates
core/database/src/commonMain/kotlin/com/mifos/room/entities/...
Migrated entity annotations (Entity, PrimaryKey, ColumnInfo, ForeignKey) to template.core.base.database.*; added explicit foreignKey arrays/metadata for several entities (loan/savings/transaction tables).
Designsystem color/theme changes
core-base/designsystem/src/commonMain/kotlin/.../KptComponent.kt, KptColorSchemeImpl.kt, KptTopAppBar.kt, KptThemeExtensions.kt
Expanded KptColorScheme with fixed-variant color properties and updated implementations; unified TopAppBar default colors; formatting refactors.
Date formatting
core/common/src/commonMain/kotlin/com/mifos/core/common/utils/FormatDate.kt
Changed formatDate to produce numeric dd/MM/yyyy zero-padded output instead of month name.
Dependency lock / runtime classpath files
cmp-android/dependencies/*RuntimeClasspath.txt, cmp-android/build.gradle.kts, feature/groups/build.gradle.kts
Reflected broad dependency upgrades across AndroidX/Compose/Ktor/Koin/Coil/OkHttp/Firebase etc.; added compose icons dependency for groups feature; minor build file whitespace fix.
Version marker
version.txt
Updated project version string.

Sequence Diagram(s)

sequenceDiagram
  participant App as App Code / DI
  participant PlatformModule as PlatformSpecificModule
  participant Factory as AppDatabaseFactory
  participant Driver as BundledSQLiteDriver / Platform Driver
  participant DB as MifosDatabase

  App->>PlatformModule: request Database instance (Module)
  PlatformModule->>Factory: createDatabase<DB>(Constants.DATABASE_NAME)
  Factory->>Driver: setDriver(...)
  Factory->>Factory: setQueryCoroutineContext(ioContext)
  Factory->>Factory: build()
  Factory-->>PlatformModule: return DB instance
  PlatformModule-->>App: provide DB via DI
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • biplab1
  • revanthkumarJ
  • HekmatullahAmin

"🐰 With twitchy nose I hop and cheer,
New Room annotations now appear.
Factories swapped and colors fixed,
Dependency bumps — the patch is mixed.
Databases build and tests draw near!"

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'chore: update versions parity with kmp-project-template' directly and clearly describes the main change in the changeset: updating library versions to match the kmp-project-template.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into development

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@amanna13 amanna13 marked this pull request as ready for review February 13, 2026 06:13
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/KptThemeExtensions.kt (1)

330-367: ⚠️ Potential issue | 🟡 Minor

toKptColorScheme() omits the 12 fixed color tokens.

While toMaterial3ColorScheme() correctly maps all 12 fixed color properties (primaryFixed, primaryFixedDim, onPrimaryFixed, onPrimaryFixedVariant, and equivalents for secondary and tertiary), the reverse function ColorScheme.toKptColorScheme() omits them. This creates an asymmetric conversion where a round-trip KptColorScheme → ColorScheme → KptColorScheme silently loses the fixed-color values, falling back to KptColorSchemeImpl defaults.

Add the missing mappings to toKptColorScheme():

Proposed fix
 fun ColorScheme.toKptColorScheme(): KptColorScheme = KptColorSchemeImpl(
     ...
     surfaceContainerLow = this.surfaceContainerLow,
     surfaceContainerLowest = this.surfaceContainerLowest,
+    primaryFixed = this.primaryFixed,
+    primaryFixedDim = this.primaryFixedDim,
+    onPrimaryFixed = this.onPrimaryFixed,
+    onPrimaryFixedVariant = this.onPrimaryFixedVariant,
+    secondaryFixed = this.secondaryFixed,
+    secondaryFixedDim = this.secondaryFixedDim,
+    onSecondaryFixed = this.onSecondaryFixed,
+    onSecondaryFixedVariant = this.onSecondaryFixedVariant,
+    tertiaryFixed = this.tertiaryFixed,
+    tertiaryFixedDim = this.tertiaryFixedDim,
+    onTertiaryFixed = this.onTertiaryFixed,
+    onTertiaryFixedVariant = this.onTertiaryFixedVariant,
 )
core/database/src/commonMain/kotlin/com/mifos/room/entities/accounts/savings/SavingsAccountTransactionEntity.kt (1)

29-54: ⚠️ Potential issue | 🟠 Major

Foreign key definitions have inverted parent/child semantics and dangerous CASCADE deletes.

All three foreign keys declare childColumns = ["id"] (this entity's PK) matching parent tables' PKs, forcing every transaction's id to match an existing type/currency/date record id. This breaks insertion for any transaction whose id doesn't coincidentally match a type/currency/date id.

Additionally:

  • CASCADE deletes are backwards: onDelete = CASCADE will delete transactions when a type, currency, or date record is deleted — the opposite of the intended relationship for reference/lookup data.
  • Missing FK columns: The entity defines nested objects (transactionType, currency, savingsTransactionDate) but no corresponding FK columns (transactionTypeId, currencyId, dateId). These FKs are declaring constraints on the transaction's own id rather than on actual foreign key columns.

If the nested objects are being serialized (e.g., as JSON via TypeConverter), these FK constraints should be removed entirely. If the intent is to store relationships in the database, create dedicated FK columns (transactionTypeId, etc.) on this entity and declare FKs on those columns instead, with CASCADE only on child tables that this transaction owns.

🤖 Fix all issues with AI agents
In
`@core/database/src/commonMain/kotlin/com/mifos/room/di/DatabaseModule.common.kt`:
- Around line 14-15: The expect val PlatformSpecificDatabaseModule currently
suppresses missing actuals while the appleMain (DatabaseModule.apple.kt), jsMain
(PlatformSpecificModule.kt) and wasmJsMain (PlatformSpecificModule.kt) files
contain TODOs that will crash at runtime; either replace those TODOs with real
platform-specific Koin Module implementations that initialize the DB (implement
the actual val PlatformSpecificDatabaseModule in each platform file), or remove
the expect suppression and gate module registration so the Koin graph never
loads PlatformSpecificDatabaseModule on unsupported targets (introduce and check
a compile-time/target-specific flag or function like isDatabaseSupported()
before including PlatformSpecificDatabaseModule in your DI setup). Ensure the
symbols to update are the actual declarations named
PlatformSpecificDatabaseModule and the platform files DatabaseModule.apple.kt,
PlatformSpecificModule.kt in jsMain and wasmJsMain.

In
`@core/database/src/commonMain/kotlin/com/mifos/room/entities/organisation/OfficeEntity.kt`:
- Around line 12-16: The import list in OfficeEntity.kt mixes packages: Entity,
ForeignKey, and PrimaryKey are imported from template.core.base.database while
ForeignKeyAction is still imported from com.mifos.room.utils; update the
OfficeEntity.kt import to use ForeignKeyAction from the new base package
(template.core.base.database.ForeignKeyAction) so all database annotations come
from the same package, or if the symbol wasn’t yet moved, add/move the
ForeignKeyAction definition into template.core.base.database and then update
references in OfficeEntity and any other classes that still import
com.mifos.room.utils.ForeignKeyAction to the new package.

In
`@core/database/src/commonMain/kotlin/com/mifos/room/typeconverters/GroupTypeConverters.kt`:
- Line 16: GroupTypeConverters.kt fails on JS/Wasm because it imports
template.core.base.database.TypeConverter but the base module has no actual for
JS/wasmJs; add actual declarations for the TypeConverter expect (from Room.kt)
into the base module's jsMain and wasmJsMain (or a shared jsWasmMain) providing
a typealias or stub compatible with Room for those targets, or alternatively
update GroupTypeConverters.kt to use the legacy stub package
(com.mifos.room.utils.TypeConverter) behind a platform-specific source set so
JS/Wasm compile paths don't import the android-specific annotation; locate the
expect in Room.kt and ensure corresponding actual typealiases are created for
JS/Wasm or adjust imports in GroupTypeConverters.kt to conditional platform
sources to avoid importing template.core.base.database.TypeConverter on JS/Wasm.

In `@feature/groups/build.gradle.kts`:
- Line 42: Remove the unused dependency
implementation(libs.androidx.compose.material.iconsExtended) from the module's
Gradle KTS so the large, unused material-icons-extended artifact is not pulled
in; after removing that line, run a Gradle sync/build and search for any
references to material.icons.extended (or symbols that would come exclusively
from that artifact) to confirm nothing else breaks, and ensure all icon usages
rely on the standard Material Icons (e.g., MifosIcons,
Icons.Default/Filled/Outlined/Rounded).
🧹 Nitpick comments (4)
core-base/designsystem/src/commonMain/kotlin/template/core/base/designsystem/theme/KptColorSchemeImpl.kt (1)

258-310: KptColorSchemeBuilder doesn't expose the 12 new fixed color properties.

The builder has no var fields for the new tokens (primaryFixed, secondaryFixed, tertiaryFixed, etc.), so users of the kptTheme { colors { … } } DSL cannot customize them. They'll silently fall back to the KptColorSchemeImpl constructor defaults.

This is fine to defer given the scope of this sync PR, but worth tracking so the builder stays in sync with the interface. Based on learnings, functional fixes in synced template code are intentionally deferred to follow-up issues.

Would you like me to open a follow-up issue to add the missing builder properties?

core/database/src/commonMain/kotlin/com/mifos/room/entities/PaymentTypeOptionEntity.kt (1)

36-51: Consider removing commented-out code.

This block of dead code (Comparable implementation, toString) adds noise. If it's no longer needed, remove it; if it's planned for future use, track it in an issue instead.

build-logic/convention/src/main/kotlin/org/mifos/KotlinMultiplatform.kt (1)

30-31: Clean up redundant opt-in flags for Kotlin 2.2.21.

  • kotlin.RequiresOptIn has been stable since Kotlin 1.7; opting in to it is unnecessary in Kotlin 2.2.21.
  • kotlin.time.ExperimentalTime still exists in the Kotlin standard library and remains a valid opt-in flag (though may be unnecessary depending on usage). The annotation was not removed; what changed in Kotlin 1.6.0 was that the Duration API itself became stable.

Remove these flags if the code doesn't rely on experimental time APIs.

core-base/database/src/nonJsCommonMain/kotlin/template/core/base/database/Room.nonJsCommon.kt (1)

146-162: Minor inconsistency: FQN used for BuiltInTypeConverters and AutoMigration while other typealiases use imported short names.

Lines 150 and 162 use fully qualified androidx.room.BuiltInTypeConverters and androidx.room.AutoMigration, while all other typealiases reference their short imported names. Adding the missing imports would make the file consistent.

Suggested diff for consistency
 import androidx.room.ColumnInfo
 import androidx.room.Dao
 import androidx.room.Database
 import androidx.room.DatabaseView
 import androidx.room.Delete
 import androidx.room.Embedded
 import androidx.room.Entity
 import androidx.room.ForeignKey
 import androidx.room.Ignore
 import androidx.room.Index
 import androidx.room.Insert
 import androidx.room.Junction
 import androidx.room.PrimaryKey
 import androidx.room.Query
 import androidx.room.Relation
 import androidx.room.Transaction
 import androidx.room.TypeConverter
 import androidx.room.TypeConverters
 import androidx.room.Update
 import androidx.room.Upsert
+import androidx.room.AutoMigration
+import androidx.room.BuiltInTypeConverters

Then:

-actual typealias BuiltInTypeConverters = androidx.room.BuiltInTypeConverters
+actual typealias BuiltInTypeConverters = BuiltInTypeConverters
-actual typealias AutoMigration = androidx.room.AutoMigration
+actual typealias AutoMigration = AutoMigration

@amanna13 amanna13 marked this pull request as draft February 13, 2026 06:32
@amanna13 amanna13 marked this pull request as ready for review February 13, 2026 08:55
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@core/database/src/commonMain/kotlin/com/mifos/room/entities/client/ClientAddressEntity.kt`:
- Around line 12-17: The imports in ClientAddressEntity.kt are inconsistent with
the migrated annotation package: replace or align the constants usage so
annotations in template.core.base.database compile—either (A) update the code
that references UNDEFINED, UNSPECIFIED and VALUE_UNSPECIFIED to use the migrated
object-qualified names (e.g., ColumnInfoTypeAffinity.UNDEFINED,
CollationSequence.UNSPECIFIED) where relevant and remove the
com.mifos.room.utils imports, or (B) add plain exported constants to
template.core.base.database (define VALUE_UNSPECIFIED and re-export UNDEFINED
and UNSPECIFIED at package level) so the current unqualified imports work;
locate usages around the ColumnInfo annotation and PrimaryKey/Entity
declarations in ClientAddressEntity.kt and apply one consistent approach across
those annotations.

@sonarqubecloud
Copy link

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure this file should be part of this PR. Even if it is required, the versioning changes don’t seem to make sense.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't touched this file part though. No idea how it get edited. Anyways I will revert this

targetSdk=36
compileSdk=36

android.experimental.lint.version=8.8.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this could break a workflow - Android build and publish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants