compress mib cards and add prep support for bml cards

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
@@ -166,16 +166,21 @@ class BmlAccountClient {
internalId = internalId
))
} else if (accountType == "Card") {
val isVisible = item.optBoolean("account_visible", false)
if (!isVisible) continue
val isPrepaid = item.optBoolean("prepaid_card", false)
val productCode = item.optString("product_code", "")
val cardBalance = item.optJSONObject("cardBalance")
val available = cardBalance?.optDouble("AvailableLimit", 0.0) ?: 0.0
val current = cardBalance?.optDouble("CurrentBalance", 0.0) ?: 0.0
val cardProfileType = when {
isPrepaid -> "BML_PREPAID"
product.contains("CREDIT", ignoreCase = true) -> "BML_CREDIT"
else -> "BML_DEBIT"
}
prepaidCards.add(BankAccount(
bank = "BML",
profileName = profileName,
profileType = if (isPrepaid) "BML_PREPAID" else "BML_CREDIT",
profileType = cardProfileType,
cifType = productCode,
accountNumber = accountNumber,
accountBriefName = item.optString("alias").ifBlank { product },
currencyName = currency,