forked from openMF/mifos-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core:database): Migrate database module to KMP (openMF#2752)
Co-authored-by: Sk Niyaj Ali <[email protected]>
- Loading branch information
1 parent
c67f9d4
commit c759137
Showing
46 changed files
with
810 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
core/database/src/androidMain/kotlin/org/mifos/mobile/core/database/AppDatabase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright 2025 Mifos Initiative | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
* | ||
* See https://github.com/openMF/mobile-mobile/blob/master/LICENSE.md | ||
*/ | ||
package org.mifos.mobile.core.database | ||
|
||
import androidx.room.Database | ||
import androidx.room.RoomDatabase | ||
import androidx.room.TypeConverters | ||
import org.mifos.mobile.core.database.dao.ChargeDao | ||
import org.mifos.mobile.core.database.dao.MifosNotificationDao | ||
import org.mifos.mobile.core.database.entity.ChargeEntity | ||
import org.mifos.mobile.core.database.entity.MifosNotificationEntity | ||
import org.mifos.mobile.core.database.utils.ChargeTypeConverters | ||
|
||
@Database( | ||
entities = [ | ||
ChargeEntity::class, | ||
MifosNotificationEntity::class, | ||
], | ||
version = AppDatabase.VERSION, | ||
exportSchema = true, | ||
autoMigrations = [], | ||
) | ||
@TypeConverters(ChargeTypeConverters::class) | ||
actual abstract class AppDatabase : RoomDatabase() { | ||
actual abstract val mifosNotificationDao: MifosNotificationDao | ||
actual abstract val chargeDao: ChargeDao | ||
|
||
companion object { | ||
const val VERSION = 1 | ||
const val DATABASE_NAME = "mifos_database.db" | ||
} | ||
} |
Oops, something went wrong.