Skip to content

Commit

Permalink
Change properties from var to val and remove unnecessary annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
HekmatullahAmin committed Jan 10, 2025
1 parent bd20f14 commit b89d071
Show file tree
Hide file tree
Showing 138 changed files with 1,121 additions and 1,325 deletions.
10 changes: 1 addition & 9 deletions core/model/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,12 @@ android {
kotlin {
androidTarget {
compilerOptions {
freeCompilerArgs.addAll("-P", "plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=org.mifos.mobile.core.model.MyParcelize")
freeCompilerArgs.addAll("-P", "plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=org.mifos.mobile.core.model.Parcelize")
}
}
sourceSets {
androidMain.dependencies {
implementation(libs.jetbrains.kotlin.jdk7)
implementation(libs.squareup.retrofit.converter.gson)
}
commonMain.dependencies {
implementation(libs.kotlinx.serialization.json)
}
desktopMain.dependencies {
implementation(libs.jetbrains.kotlin.jdk7)
implementation(libs.squareup.retrofit.converter.gson)
}
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
package org.mifos.mobile.core.model

annotation class MyParcelize()
annotation class Parcelize()

expect interface Parcelable

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
*/
package org.mifos.mobile.core.model.entity

import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

@MyParcelize
@Parcelize
data class Charge(
val clientId: Int? = null,
val chargeId: Int? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
package org.mifos.mobile.core.model.entity

import kotlinx.serialization.Serializable
import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

@MyParcelize
@Parcelize
@Serializable
data class ChargeCalculationType(
var id: Int = 0,
var code: String? = null,
var value: String? = null,
val id: Int = 0,
val code: String? = null,
val value: String? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
*/
package org.mifos.mobile.core.model.entity

import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

/**
* Created by michaelsosnick on 12/11/16.
*/

@MyParcelize
@Parcelize
data class ChargeTimeType(
var id: Int = 0,
var code: String? = null,
var value: String? = null,
val id: Int = 0,
val code: String? = null,
val value: String? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@
*/
package org.mifos.mobile.core.model.entity

import org.mifos.mobile.core.model.OverloadSupport

/**
* Created by dilpreet on 3/7/17.
*/

data class CheckboxStatus @OverloadSupport constructor(
var status: String?,
var color: Int,
var isChecked: Boolean = false,
data class CheckboxStatus constructor(
val status: String?,
val color: Int,
val isChecked: Boolean = false,
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
*/
package org.mifos.mobile.core.model.entity

import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

/**
* Created by michaelsosnick on 12/11/16.
*/

@MyParcelize
@Parcelize
data class Currency(
var code: String? = null,
var name: String? = null,
var decimalPlaces: Int = 0,
var displaySymbol: String? = null,
var nameCode: String? = null,
var displayLabel: String? = null,
val code: String? = null,
val name: String? = null,
val decimalPlaces: Int = 0,
val displaySymbol: String? = null,
val nameCode: String? = null,
val displayLabel: String? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
*/
package org.mifos.mobile.core.model.entity

import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.OverloadSupport
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

/**
* Created by dilpreet on 12/8/17.
*/

@MyParcelize
data class FAQ @OverloadSupport constructor(
var question: String? = null,
var answer: String? = null,
var isSelected: Boolean = false,
@Parcelize
data class FAQ constructor(
val question: String? = null,
val answer: String? = null,
val isSelected: Boolean = false,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
package org.mifos.mobile.core.model.entity

import kotlinx.serialization.Serializable
import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

@MyParcelize
@Parcelize
@Serializable
data class MifosNotification(
var timeStamp: Long,
var msg: String? = null,
var read: Boolean? = null,
val timeStamp: Long,
val msg: String? = null,
val read: Boolean? = null,
) : Parcelable {
fun isRead(): Boolean {
return read == true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ package org.mifos.mobile.core.model.entity
*/
data class Page<T>(

var totalFilteredRecords: Int = 0,
var pageItems: List<T> = ArrayList(),
val totalFilteredRecords: Int = 0,
val pageItems: List<T> = ArrayList(),
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
*/
package org.mifos.mobile.core.model.entity

import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

/**
* Created by ishankhanna for mifos android-client on 09/02/14.
Expand All @@ -22,18 +22,18 @@ import org.mifos.mobile.core.model.Parcelable
* See https://github.com/openMF/android-client/blob/master/LICENSE.md
*/

@MyParcelize
@Parcelize
data class Timeline(
var submittedOnDate: List<Int> = ArrayList(),
var submittedByUsername: String? = null,
var submittedByFirstname: String? = null,
var submittedByLastname: String? = null,
var activatedOnDate: List<Int> = ArrayList(),
var activatedByUsername: String? = null,
var activatedByFirstname: String? = null,
var activatedByLastname: String? = null,
var closedOnDate: List<Int> = ArrayList(),
var closedByUsername: String? = null,
var closedByFirstname: String? = null,
var closedByLastname: String? = null,
val submittedOnDate: List<Int> = ArrayList(),
val submittedByUsername: String? = null,
val submittedByFirstname: String? = null,
val submittedByLastname: String? = null,
val activatedOnDate: List<Int> = ArrayList(),
val activatedByUsername: String? = null,
val activatedByFirstname: String? = null,
val activatedByLastname: String? = null,
val closedOnDate: List<Int> = ArrayList(),
val closedByUsername: String? = null,
val closedByFirstname: String? = null,
val closedByLastname: String? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@
*/
package org.mifos.mobile.core.model.entity

import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize
import org.mifos.mobile.core.model.entity.client.Type

/**
* @author Vishwajeet
* @since 10/8/16.
*/

@MyParcelize
@Parcelize
data class Transaction(

var id: Long? = null,
val id: Long? = null,

var officeId: Long? = null,
val officeId: Long? = null,

var officeName: String? = null,
val officeName: String? = null,

var type: Type,
val type: Type,

var date: List<Int> = ArrayList(),
val date: List<Int> = ArrayList(),

var currency: Currency? = null,
val currency: Currency? = null,

var amount: Double? = null,
val amount: Double? = null,

var submittedOnDate: List<Int> = ArrayList(),
val submittedOnDate: List<Int> = ArrayList(),

var reversed: Boolean? = null,
val reversed: Boolean? = null,

) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ package org.mifos.mobile.core.model.entity
*/
class UpdatePasswordPayload {

var password: String? = null
val password: String? = null

var repeatPassword: String? = null
val repeatPassword: String? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
package org.mifos.mobile.core.model.entity

import kotlinx.serialization.SerialName
import org.mifos.mobile.core.model.MyParcelize
import org.mifos.mobile.core.model.Parcelable
import org.mifos.mobile.core.model.Parcelize

/**
* @author Vishwajeet
* @since 12/06/16
*/
@MyParcelize
@Parcelize
data class User(
val userId: Long = 0,
@SerialName("authenticated")
Expand All @@ -32,7 +32,7 @@ data class User(
val isTwoFactorAuthenticationRequired: Boolean = false,
) : Parcelable

@MyParcelize
@Parcelize
data class Role(
@SerialName("id")
val id: Long = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
package org.mifos.mobile.core.model.entity.accounts

/**
* This class contains variables which are used for implementing Comparator and are common to loan,
* This class contains valiables which are used for implementing Comparator and are common to loan,
* savings and share account.
* Created by dilpreet on 14/6/17.
*/
abstract class Account {
var id: Long = 0
val id: Long = 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ package org.mifos.mobile.core.model.entity.accounts
import org.mifos.mobile.core.model.entity.accounts.loan.LoanAccount

data class LoanAccountsListResponse(
var loanAccounts: List<LoanAccount> = ArrayList(),
val loanAccounts: List<LoanAccount> = ArrayList(),
)
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ package org.mifos.mobile.core.model.entity.accounts
import org.mifos.mobile.core.model.entity.accounts.savings.SavingAccount

data class SavingAccountsListResponse(
var savingsAccounts: List<SavingAccount> = ArrayList(),
val savingsAccounts: List<SavingAccount> = ArrayList(),
)
Loading

0 comments on commit b89d071

Please sign in to comment.