Skip to content

Commit

Permalink
made suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsPronay committed Jan 30, 2025
1 parent 42d6ae5 commit 2167ae3
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 138 deletions.
8 changes: 4 additions & 4 deletions core/database/schemas/com.mifos.room.db.MifosDatabase/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"formatVersion": 1,
"database": {
"version": 1,
"identityHash": "4e8e4598d16a3d4b03fdf53aa320cf8b",
"identityHash": "be50121d7afe08c6200f3cea98d17b8a",
"entities": [
{
"tableName": "ColumnValue",
Expand Down Expand Up @@ -695,7 +695,7 @@
},
{
"tableName": "PaymentTypeOption",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `description` TEXT, `is_cash_payment` INTEGER, `position` INTEGER, PRIMARY KEY(`id`))",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `description` TEXT, `isCashPayment` INTEGER, `position` INTEGER, PRIMARY KEY(`id`))",
"fields": [
{
"fieldPath": "id",
Expand All @@ -716,7 +716,7 @@
},
{
"fieldPath": "isCashPayment",
"columnName": "is_cash_payment",
"columnName": "isCashPayment",
"affinity": "INTEGER"
},
{
Expand Down Expand Up @@ -1172,7 +1172,7 @@
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '4e8e4598d16a3d4b03fdf53aa320cf8b')"
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'be50121d7afe08c6200f3cea98d17b8a')"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,27 @@ package com.mifos.room.entities

import android.os.Parcel
import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.google.gson.annotations.SerializedName
import com.mifos.core.model.MifosBaseModel

@Entity(tableName = "PaymentTypeOption")
data class PaymentTypeOption(
@SerializedName("id")
@PrimaryKey
@ColumnInfo(name = "id")
val id: Int = 0,

@SerializedName("name")
@ColumnInfo(name = "name")
val name: String = "",

@SerializedName("description")
@ColumnInfo(name = "description")
val description: String? = null,

@SerializedName("isCashPayment")
@ColumnInfo(name = "is_cash_payment")
val isCashPayment: Boolean? = null,

@SerializedName("position")
@ColumnInfo(name = "position")
val position: Int? = null,

) : MifosBaseModel(), Comparable<PaymentTypeOption>, Parcelable {

override fun compareTo(another: PaymentTypeOption): Int {
return position?.compareTo(another.position ?: 0) ?: 0
override fun compareTo(other: PaymentTypeOption): Int {
return position?.compareTo(other.position ?: 0) ?: 0
}

override fun toString(): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package com.mifos.room.entities.accounts.loans

import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import kotlinx.parcelize.Parcelize
Expand All @@ -20,13 +19,7 @@ import kotlinx.parcelize.Parcelize
data class ActualDisbursementDate(
@PrimaryKey
val loanId: Int? = null,

@ColumnInfo(name = "year")
val year: Int? = null,

@ColumnInfo(name = "month")
val month: Int? = null,

@ColumnInfo(name = "date")
val date: Int? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ data class Loan(

val isNPA: Boolean? = null,

val overdueCharges: List<Any> = ArrayList(),
val overdueCharges: List<Any> = emptyList(),

private val additionalProperties: MutableMap<String, Any> = HashMap(),
private val additionalProperties: MutableMap<String, Any> = mutableMapOf(),
)
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,27 @@ data class LoanAccount(
@PrimaryKey
val id: Int? = null,

@ColumnInfo(name = "clientId")
val clientId: Long = 0,

@ColumnInfo(name = "groupId")
val groupId: Long = 0,

@ColumnInfo(name = "centerId")
val centerId: Long = 0,

@ColumnInfo(name = "accountNo")
val accountNo: String? = null,

@ColumnInfo(name = "externalId")
val externalId: String? = null,

@ColumnInfo(name = "productId")
val productId: Int? = null,

@ColumnInfo(name = "productName")
val productName: String? = null,

@ColumnInfo(name = "status", index = true)
@ColumnInfo(index = true)
val status: Status? = null,

@ColumnInfo(name = "loanType", index = true)
@ColumnInfo(index = true)
val loanType: LoanType? = null,

@ColumnInfo(name = "loanCycle")
val loanCycle: Int? = null,

@ColumnInfo(name = "inArrears")
val inArrears: Boolean? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package com.mifos.room.entities.accounts.loans

import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.Entity
import kotlinx.parcelize.Parcelize
import kotlinx.serialization.Serializable
Expand All @@ -19,12 +18,7 @@ import kotlinx.serialization.Serializable
@Serializable
@Parcelize
data class LoanType(

val id: Int? = null,

@ColumnInfo("code")
val code: String? = null,

@ColumnInfo("value")
val value: String? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -68,46 +68,33 @@ data class LoanWithAssociations(
@PrimaryKey(autoGenerate = true)
val id: Int = 0,

@ColumnInfo(name = "accountNo")
val accountNo: String = "",

@ColumnInfo(name = "status", index = true)
@ColumnInfo(index = true)
val status: Status = Status(),

@ColumnInfo(name = "clientId")
val clientId: Int = 0,

@ColumnInfo(name = "clientName")
val clientName: String = "",

@ColumnInfo(name = "clientOfficeId")
val clientOfficeId: Int = 0,

@ColumnInfo(name = "loanProductId")
val loanProductId: Int = 0,

@ColumnInfo(name = "loanProductName")
val loanProductName: String = "",

@ColumnInfo(name = "loanProductDescription")
val loanProductDescription: String = "",

@ColumnInfo(name = "fundId")
val fundId: Int = 0,

@ColumnInfo(name = "fundName")
val fundName: String = "",

@ColumnInfo(name = "loanPurposeId")
val loanPurposeId: Int = 0,

@ColumnInfo(name = "loanPurposeName")
val loanPurposeName: String = "",

@ColumnInfo(name = "loanOfficerId")
val loanOfficerId: Int = 0,

@ColumnInfo(name = "loanOfficerName")
val loanOfficerName: String = "",

@Embedded(prefix = "LoanType_")
Expand All @@ -116,34 +103,27 @@ data class LoanWithAssociations(
@Embedded(prefix = "Currency_")
val currency: Currency = Currency(),

@ColumnInfo(name = "principal")
val principal: Double = 0.0,

@ColumnInfo(name = "approvedPrincipal")
val approvedPrincipal: Double = 0.0,

@ColumnInfo(name = "termFrequency")
val termFrequency: Int = 0,

@Embedded(prefix = "termPeriodFrequencyType_")
val termPeriodFrequencyType: TermPeriodFrequencyType = TermPeriodFrequencyType(),

@ColumnInfo(name = "numberOfRepayments")
val numberOfRepayments: Int = 0,

@ColumnInfo(name = "repaymentEvery")
val repaymentEvery: Int = 0,

@Embedded(prefix = "repaymentFrequencyType_")
val repaymentFrequencyType: RepaymentFrequencyType = RepaymentFrequencyType(),

@ColumnInfo(name = "interestRatePerPeriod")
val interestRatePerPeriod: Double = 0.0,

@Embedded(prefix = "interestRateFrequencyType_")
val interestRateFrequencyType: InterestRateFrequencyType = InterestRateFrequencyType(),

@ColumnInfo(name = "annualInterestRate")
val annualInterestRate: Double = 0.0,

@Embedded(prefix = "amortization_type_")
Expand All @@ -155,48 +135,36 @@ data class LoanWithAssociations(
@Embedded(prefix = "interestCalculationPeriodType_")
val interestCalculationPeriodType: InterestCalculationPeriodType = InterestCalculationPeriodType(),

@ColumnInfo(name = "transactionProcessingStrategyId")
val transactionProcessingStrategyId: Int = 0,

@ColumnInfo(name = "transactionProcessingStrategyName")
val transactionProcessingStrategyName: String = "",

@ColumnInfo(name = "syncDisbursementWithMeeting")
val syncDisbursementWithMeeting: Boolean = false,

@ColumnInfo(name = "timeline", index = true)
@ColumnInfo(index = true)
val timeline: Timeline = Timeline(),

@ColumnInfo(name = "summary", index = true)
@ColumnInfo(index = true)
val summary: Summary = Summary(),

@Embedded(prefix = "repaymentSchedule_")
val repaymentSchedule: RepaymentSchedule = RepaymentSchedule(),

@ColumnInfo(name = "transactions")
val transactions: List<Transaction> = ArrayList(),
val transactions: List<Transaction> = emptyList(),

@ColumnInfo(name = "feeChargesAtDisbursementCharged")
val feeChargesAtDisbursementCharged: Double = 0.0,

@ColumnInfo(name = "totalOverpaid")
val totalOverpaid: Double = 0.0,

@ColumnInfo(name = "loanCounter")
val loanCounter: Int = 0,

@ColumnInfo(name = "loanProductCounter")
val loanProductCounter: Int = 0,

@ColumnInfo(name = "multiDisburseLoan")
val multiDisburseLoan: Boolean = false,

@ColumnInfo(name = "canDisburse")
val canDisburse: Boolean = false,

@ColumnInfo(name = "inArrears")
val inArrears: Boolean = false,

@ColumnInfo(name = "isNPA")
val isNPA: Boolean = false,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
package com.mifos.room.entities.accounts.loans

import android.os.Parcelable
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import kotlinx.parcelize.Parcelize
Expand All @@ -23,33 +22,23 @@ data class Status(
@PrimaryKey
val id: Int? = null,

@ColumnInfo(name = "code")
val code: String? = null,

@ColumnInfo(name = "value")
val value: String? = null,

@ColumnInfo(name = "pendingApproval")
val pendingApproval: Boolean? = null,

@ColumnInfo(name = "waitingForDisbursal")
val waitingForDisbursal: Boolean? = null,

@ColumnInfo(name = "active")
val active: Boolean? = null,

@ColumnInfo(name = "closedObligationsMet")
val closedObligationsMet: Boolean? = null,

@ColumnInfo(name = "closedWrittenOff")
val closedWrittenOff: Boolean? = null,

@ColumnInfo(name = "closedRescheduled")
val closedRescheduled: Boolean? = null,

@ColumnInfo(name = "closed")
val closed: Boolean? = null,

@ColumnInfo(name = "overpaid")
val overpaid: Boolean? = null,
) : Parcelable
Loading

0 comments on commit 2167ae3

Please sign in to comment.