-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: refactor run report fragment to compose
- Loading branch information
1 parent
8fa9130
commit 865ecb6
Showing
27 changed files
with
617 additions
and
212 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
9 changes: 4 additions & 5 deletions
9
...eportcategory/ReportCategoryRepository.kt → ...ta/repository/ReportCategoryRepository.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,17 +1,16 @@ | ||
package com.mifos.mifosxdroid.online.runreports.reportcategory | ||
package com.mifos.core.data.repository | ||
|
||
import com.mifos.core.objects.runreports.client.ClientReportTypeItem | ||
import rx.Observable | ||
|
||
/** | ||
* Created by Aditya Gupta on 12/08/23. | ||
*/ | ||
interface ReportCategoryRepository { | ||
|
||
fun getReportCategories( | ||
reportCategory: String?, | ||
suspend fun getReportCategories( | ||
reportCategory: String, | ||
genericResultSet: Boolean, | ||
parameterType: Boolean | ||
): Observable<List<ClientReportTypeItem>> | ||
): List<ClientReportTypeItem> | ||
|
||
} |
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
26 changes: 26 additions & 0 deletions
26
core/domain/src/main/java/com/mifos/core/domain/use_cases/GetReportCategoryUseCase.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.mifos.core.domain.use_cases | ||
|
||
import com.mifos.core.common.utils.Resource | ||
import com.mifos.core.data.repository.ReportCategoryRepository | ||
import com.mifos.core.objects.runreports.client.ClientReportTypeItem | ||
import kotlinx.coroutines.flow.Flow | ||
import kotlinx.coroutines.flow.flow | ||
import javax.inject.Inject | ||
|
||
class GetReportCategoryUseCase @Inject constructor(private val repository: ReportCategoryRepository) { | ||
|
||
suspend operator fun invoke( | ||
reportCategory: String, | ||
genericResultSet: Boolean, | ||
parameterType: Boolean | ||
): Flow<Resource<List<ClientReportTypeItem>>> = flow { | ||
try { | ||
emit(Resource.Loading()) | ||
val response = | ||
repository.getReportCategories(reportCategory, genericResultSet, parameterType) | ||
emit(Resource.Success(response)) | ||
} catch (exception: Exception) { | ||
emit(Resource.Error(exception.message.toString())) | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
plugins { | ||
alias(libs.plugins.mifos.android.feature) | ||
alias(libs.plugins.mifos.android.library.compose) | ||
alias(libs.plugins.mifos.android.library.jacoco) | ||
} | ||
|
||
android { | ||
namespace = "com.mifos.feature.report" | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(projects.core.domain) | ||
|
||
//DBFlow dependencies | ||
kapt(libs.dbflow.processor) | ||
implementation(libs.dbflow) | ||
kapt(libs.github.dbflow.processor) | ||
testImplementation(libs.hilt.android.testing) | ||
testImplementation(projects.core.testing) | ||
|
||
androidTestImplementation(projects.core.testing) | ||
} |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
feature/report/src/androidTest/java/com/mifos/feature/report/ExampleInstrumentedTest.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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.mifos.feature.report | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("com.mifos.feature.report.test", appContext.packageName) | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
|
||
</manifest> |
Oops, something went wrong.