compress mib cards and add prep support for bml cards
Auto Tag on Version Change / check-version (push) Successful in 4s

This commit is contained in:
2026-05-23 21:03:25 +05:00
parent 268f3dada0
commit e9f0cec698
50 changed files with 249 additions and 66 deletions
@@ -21,7 +21,7 @@ import java.util.Locale
class HistoryFetcher(private val account: BankAccount) {
private val isMib get() = account.bank == "MIB"
private val isBmlCard get() = account.profileType == "BML_PREPAID" || account.profileType == "BML_CREDIT"
private val isBmlCard get() = account.profileType == "BML_PREPAID" || account.profileType == "BML_CREDIT" || account.profileType == "BML_DEBIT"
private val isBmlLoan get() = account.profileType == "BML_LOAN"
private val isFahipay get() = account.bank == "FAHIPAY"
@@ -0,0 +1,45 @@
package sh.sar.basedbank.util.bmlapi
import sh.sar.basedbank.api.models.BankAccount
object BmlCardParser {
/**
* Returns the asset path for the card image.
* The product code is stored in [BankAccount.cifType] for BML Card accounts.
*/
fun cardImageAsset(account: BankAccount): String =
productCodeToAsset(account.cifType)
fun productCodeToAsset(productCode: String): String = when (productCode) {
"C8201" -> "cards/bml/master_prepaid.png"
"C8205" -> "cards/bml/master_prepaid_travel.png"
"C3007" -> "cards/bml/amex_debit_green.png"
"C1007" -> "cards/bml/visa_debit.png"
"C1003" -> "cards/bml/visa_gold.png"
"C8022" -> "cards/bml/master_gold.png"
"C1020" -> "cards/bml/visa_debit_platinum.png"
"C8902" -> "cards/bml/master_islamic.png"
"C8101" -> "cards/bml/master_masveriyaa.png"
// "?????" -> "cards/bml/amex_credit_gold.png"
// "?????" -> "cards/bml/amex_credit_green.png"
// "?????" -> "cards/bml/amex_debit_gold.png"
// "?????" -> "cards/bml/amex_platinum.png"
// "?????" -> "cards/bml/master.png"
// "?????" -> "cards/bml/master_business_debit.png"
// "?????" -> "cards/bml/master_odiveriyaa.png"
// "?????" -> "cards/bml/master_passport.png"
// "?????" -> "cards/bml/master_platinum.png"
// "?????" -> "cards/bml/master_prepaid_business.png"
// "?????" -> "cards/bml/master_world.png"
// "?????" -> "cards/bml/visa_corporate.png"
// "?????" -> "cards/bml/visa_credit.png"
// "?????" -> "cards/bml/visa_debit_generic.png"
// "?????" -> "cards/bml/visa_debit_islamic.png"
// "?????" -> "cards/bml/visa_infinite.png"
// "?????" -> "cards/bml/visa_platinum.png"
// "?????" -> "cards/bml/visa_student_black.png"
// "?????" -> "cards/bml/visa_student_blue.png"
else -> "cards/bml/defaultcard.png"
}
}
@@ -12,7 +12,7 @@ object BmlDashboardParser {
*/
fun displayData(account: BankAccount): AccountListDisplay? {
if (account.profileType == "BML_LOAN") return null // Loans shown on financing page only
val isCard = account.profileType == "BML_PREPAID" || account.profileType == "BML_CREDIT"
val isCard = account.profileType == "BML_PREPAID" || account.profileType == "BML_CREDIT" || account.profileType == "BML_DEBIT"
return if (isCard) {
val isActive = account.statusDesc.equals("Active", ignoreCase = true)
AccountListDisplay(