Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): migrate from dbflow to room for client #2300

Draft
wants to merge 9 commits into
base: kmp-impl
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import kotlinx.parcelize.Parcelize
*/
@Parcelize
data class ActivatePayload(
var activationDate: String? = null,
val activationDate: String? = null,

var dateFormat: String? = "dd MMMM YYYY",
val dateFormat: String? = "dd MMMM YYYY",

var locale: String? = "en",
val locale: String? = "en",
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ package com.mifos.room.entities.client
* Created by ishankhanna on 09/02/14.
*/
data class Page<T>(
var totalFilteredRecords: Int = 0,
val totalFilteredRecords: Int = 0,

var pageItems: List<T> = ArrayList(),
val pageItems: List<T> = ArrayList(),
)
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ import kotlinx.parcelize.Parcelize
*/
@Parcelize
data class DocumentType(
var id: Int? = null,
val id: Int? = null,
val name: String? = null,

var name: String? = null,
val active: Boolean? = null,

var active: Boolean? = null,
val mandatory: Boolean? = null,

var mandatory: Boolean? = null,
val description: String? = null,

var description: String? = null,

var position: Int? = null,
val position: Int? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import kotlinx.parcelize.Parcelize
*/
@Parcelize
data class Identifier(
var id: Int? = null,
val id: Int? = null,

var clientId: Int? = null,
val clientId: Int? = null,

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

var documentType: DocumentType? = null,
val documentType: DocumentType? = null,

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

var status: String? = null,
val status: String? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import kotlinx.parcelize.Parcelize
*/
@Parcelize
data class IdentifierCreationResponse(
var clientId: Int = 0,
val clientId: Int = 0,

var officeId: Int = 0,
val officeId: Int = 0,

var resourceId: Int = 0,
val resourceId: Int = 0,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import kotlinx.parcelize.Parcelize
*/
@Parcelize
data class IdentifierPayload(
var documentTypeId: Int? = null,
val documentTypeId: Int? = null,

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

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

var description: String? = null,
val description: String? = null,
) : Parcelable
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ import kotlinx.parcelize.Parcelize
*/
@Parcelize
class IdentifierTemplate(
var allowedDocumentTypes: List<DocumentType>? = ArrayList(),
val allowedDocumentTypes: List<DocumentType>? = ArrayList(),

Choose a reason for hiding this comment

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

Use emptyList() (or mutableListOf() if mutability is necessary) in instead of ArrayList(). It is more efficient to use emptyList() since it prevents needless object construction and offers superior immutability by default. For improved efficiency and clarity, use emptySet(), emptyMap(), listOf(), setOf(), and mapOf() when appropriate.

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 will do as suggested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested changes implemented

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use emptyList() (or mutableListOf() if mutability is necessary) in instead of ArrayList(). It is more efficient to use emptyList() since it prevents needless object construction and offers superior immutability by default. For improved efficiency and clarity, use emptySet(), emptyMap(), listOf(), setOf(), and mapOf() when appropriate.

@HekmatullahAmin Can you cite some resources that support these statements?


) : Parcelable
Loading