-
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.
fixed NPE and added soring to transactions
- Loading branch information
Showing
11 changed files
with
93 additions
and
66 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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/suyash/creditmanager/domain/util/order/CreditCardOrder.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
5 changes: 3 additions & 2 deletions
5
app/src/main/java/com/suyash/creditmanager/domain/util/order/EMIOrder.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
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
19 changes: 16 additions & 3 deletions
19
app/src/main/java/com/suyash/creditmanager/domain/util/order/TransactionOrder.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 |
---|---|---|
@@ -1,6 +1,19 @@ | ||
package com.suyash.creditmanager.domain.util.order | ||
|
||
sealed class TransactionOrder(val orderType: OrderType) { | ||
class Date(orderType: OrderType): TransactionOrder(orderType) | ||
class Amount(orderType: OrderType): TransactionOrder(orderType) | ||
sealed class TransactionOrder( | ||
override var orderType: OrderType, | ||
override val label: String | ||
) : Order { | ||
class Date(orderType: OrderType, label: String = "Date") : TransactionOrder(orderType, label) | ||
class Amount(orderType: OrderType, label: String = "Amount") : | ||
TransactionOrder(orderType, label) | ||
|
||
companion object { | ||
fun getOrderList(): List<TransactionOrder> { | ||
return listOf( | ||
Date(OrderType.Descending), | ||
Amount(OrderType.Ascending), | ||
) | ||
} | ||
} | ||
} |
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
2 changes: 2 additions & 0 deletions
2
app/src/main/java/com/suyash/creditmanager/presentation/emis/EMIsState.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
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
2 changes: 2 additions & 0 deletions
2
app/src/main/java/com/suyash/creditmanager/presentation/transactions/TransactionsState.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