|
|
|
|
@ -4,6 +4,7 @@ import io.realm.Realm |
|
|
|
|
import io.realm.RealmObject |
|
|
|
|
import io.realm.annotations.Ignore |
|
|
|
|
import io.realm.annotations.PrimaryKey |
|
|
|
|
import io.realm.kotlin.where |
|
|
|
|
import net.pokeranalytics.android.R |
|
|
|
|
import net.pokeranalytics.android.model.filter.Filterable |
|
|
|
|
import net.pokeranalytics.android.model.filter.QueryCondition |
|
|
|
|
@ -75,10 +76,6 @@ open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSo |
|
|
|
|
return bankroll != null && type != null && amount != 0.0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun alreadyExists(realm: Realm): Boolean { |
|
|
|
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates. |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun getFailedSaveMessage(status: SaveValidityStatus): Int { |
|
|
|
|
return if (bankroll == null) { |
|
|
|
|
R.string.no_br_popup_message |
|
|
|
|
@ -89,6 +86,10 @@ open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSo |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun alreadyExists(realm: Realm): Boolean { |
|
|
|
|
return realm.where<Transaction>().equalTo("id", id).findFirst()!= null |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun isValidForDelete(realm: Realm): Boolean { |
|
|
|
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates. |
|
|
|
|
} |
|
|
|
|
@ -97,4 +98,10 @@ open class Transaction : RealmObject(), Manageable, StaticRowRepresentableDataSo |
|
|
|
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates. |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun getSaveValidityStatus(realm: Realm): SaveValidityStatus { |
|
|
|
|
if (bankroll == null || type == null || amount == 0.0) { |
|
|
|
|
return SaveValidityStatus.DATA_INVALID |
|
|
|
|
} |
|
|
|
|
return SaveValidityStatus.VALID |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|