mirror of
https://github.com/andwati/ledga.git
synced 2026-10-18 03:12:55 +00:00
Two parser bugs around Fuliza auto-pay that produced wrong balance and
phantom-outstanding alerts:
1. BALANCE_REGEX required the literal "Ksh" before the amount, but the
full-clear auto-pay SMS ends "Your M-PESA balance is 8581.08." with
no Ksh prefix. Balance was lost → stored as 0 → Home's
getLatestTransactionWithBalance filter (balance > 0) fell back to a
stale older transaction. Made the Ksh optional.
2. parseFulizaAutoPay was stuffing the *available Fuliza limit* into
fulizaOutstanding. Those are opposites (available = ceiling - owed).
After a full clear that meant FulizaRule saw the full 14k limit and
raised "You owe Ksh 14,000" — incorrect. Now:
- full clear -> fulizaOutstanding = 0 (rule correctly bails)
- partial -> fulizaOutstanding = null (rule defers to the
previous Fuliza tx;
avoids reporting the
available-limit value)
Reparse all transactions
- New "Re-parse ALL transactions" entry in You → Data. Walks every
stored row through MpesaSmsParser and updates parser-derived fields
in place, preserving user fields (categoryId, accountId, note, id).
- Needed because the broken regex above silently corrupted historical
rows on import; this is the no-data-loss path back to correctness.
137 lines
4.4 KiB
Kotlin
137 lines
4.4 KiB
Kotlin
plugins {
|
|
id("com.android.application")
|
|
id("org.jetbrains.kotlin.android")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
id("org.jetbrains.kotlin.plugin.serialization")
|
|
id("com.google.devtools.ksp")
|
|
id("com.google.dagger.hilt.android")
|
|
}
|
|
|
|
android {
|
|
namespace = "com.ledga.app"
|
|
compileSdk = 36
|
|
|
|
signingConfigs {
|
|
create("release") {
|
|
val keystoreFile = rootProject.file("keystore/ledga-release.jks")
|
|
if (keystoreFile.exists()) {
|
|
storeFile = keystoreFile
|
|
storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "ledga2026"
|
|
keyAlias = System.getenv("KEY_ALIAS") ?: "ledga"
|
|
keyPassword = System.getenv("KEY_PASSWORD") ?: "ledga2026"
|
|
}
|
|
}
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId = "com.ledga.app"
|
|
minSdk = 26
|
|
targetSdk = 34
|
|
versionCode = 7
|
|
versionName = "1.3.4"
|
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = true
|
|
isShrinkResources = true
|
|
signingConfig = signingConfigs.getByName("release")
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlinOptions {
|
|
jvmTarget = "17"
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += setOf(
|
|
"META-INF/INDEX.LIST",
|
|
"META-INF/DEPENDENCIES",
|
|
"META-INF/LICENSE.md",
|
|
"META-INF/NOTICE.md"
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// Compose BOM
|
|
val composeBom = platform("androidx.compose:compose-bom:2026.03.00")
|
|
implementation(composeBom)
|
|
implementation("androidx.compose.ui:ui")
|
|
implementation("androidx.compose.ui:ui-graphics")
|
|
implementation("androidx.compose.ui:ui-tooling-preview")
|
|
implementation("androidx.compose.ui:ui-text-google-fonts")
|
|
implementation("androidx.compose.material3:material3")
|
|
implementation("androidx.compose.material:material-icons-extended")
|
|
debugImplementation("androidx.compose.ui:ui-tooling")
|
|
|
|
// Activity & Lifecycle
|
|
implementation("androidx.activity:activity-compose:1.13.0")
|
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.10.0")
|
|
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.10.0")
|
|
implementation("androidx.core:core-ktx:1.16.0")
|
|
|
|
// Navigation
|
|
implementation("androidx.navigation:navigation-compose:2.9.7")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
|
|
|
|
// Room
|
|
implementation("androidx.room:room-runtime:2.8.4")
|
|
implementation("androidx.room:room-ktx:2.8.4")
|
|
ksp("androidx.room:room-compiler:2.8.4")
|
|
|
|
// Hilt
|
|
implementation("com.google.dagger:hilt-android:2.57.1")
|
|
ksp("com.google.dagger:hilt-compiler:2.57.1")
|
|
implementation("androidx.hilt:hilt-navigation-compose:1.2.0")
|
|
|
|
// DataStore
|
|
implementation("androidx.datastore:datastore-preferences:1.2.1")
|
|
|
|
// WorkManager
|
|
implementation("androidx.work:work-runtime-ktx:2.11.1")
|
|
implementation("androidx.hilt:hilt-work:1.2.0")
|
|
ksp("androidx.hilt:hilt-compiler:1.2.0")
|
|
|
|
// Vico Charts
|
|
implementation("com.patrykandpatrick.vico:compose-m3:2.1.3")
|
|
|
|
// Google Drive Backup
|
|
implementation("com.google.android.gms:play-services-auth:21.3.0")
|
|
implementation("com.google.api-client:google-api-client-android:2.7.2")
|
|
implementation("com.google.apis:google-api-services-drive:v3-rev20241206-2.0.0")
|
|
implementation("com.google.http-client:google-http-client-gson:1.45.3")
|
|
|
|
// Splash Screen
|
|
implementation("androidx.core:core-splashscreen:1.0.1")
|
|
|
|
// Coroutines
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
|
|
|
|
// Testing
|
|
testImplementation("junit:junit:4.13.2")
|
|
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0")
|
|
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
|
androidTestImplementation(composeBom)
|
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
|
}
|