Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Added Checker Inbox feature #1171

Merged
merged 1 commit into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
336 changes: 177 additions & 159 deletions mifosng-android/build.gradle

Large diffs are not rendered by default.

64 changes: 26 additions & 38 deletions mifosng-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ This project is licensed under the open source MPL V2.
~ See https://github.com/openMF/android-client/blob/master/LICENSE.md
-->

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mifos.mifosxdroid">

Expand All @@ -21,17 +17,16 @@
android:allowBackup="false"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/MaterialAppTheme"
android:supportsRtl="true">
android:supportsRtl="true"
android:theme="@style/MaterialAppTheme">
<activity android:name=".online.checkerinbox.CheckerInboxPendingTasksActivity"></activity>

<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

<meta-data
android:name="io.fabric.ApiKey"
android:value="facae47316396ae7954149cc408e25b7a37ab7ea" />

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
Expand Down Expand Up @@ -59,17 +54,14 @@
android:name=".online.SurveyQuestionActivity"
android:label="Survey"
android:screenOrientation="portrait" />

<activity
android:name=".online.GroupsActivity"
android:configChanges="orientation|screenSize"
android:screenOrientation="portrait" />

<activity
android:name=".online.ClientActivity"
android:label="@string/title_activity_client"
android:screenOrientation="portrait" />

<activity
android:name=".online.CentersActivity"
android:label="@string/title_activity_centers"
Expand All @@ -78,24 +70,22 @@
android:name="android.support.PARENT_ACTIVITY"
android:value=".online.DashboardActivity" />
</activity>


<activity
android:name=".online.GenerateCollectionSheetActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_activity_generate_collection_sheet"
android:parentActivityName=".online.DashboardActivity"
android:configChanges="orientation|screenSize">
android:parentActivityName=".online.DashboardActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".online.DashboardActivity" />
</activity>

<activity android:name=".online.RunReportsActivity"
<activity
android:name=".online.RunReportsActivity"
android:label="@string/run_report"
android:parentActivityName=".online.DashboardActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".online.DashboardActivity"/>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".online.DashboardActivity" />
</activity>
<activity
android:name=".ClientListActivity"
Expand All @@ -111,48 +101,46 @@
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

<activity
android:name=".activity.pathtracking.PathTrackingActivity"
android:label="@string/track_path"
android:screenOrientation="portrait" />

<activity android:name=".offline.syncclientpayloads.SyncClientPayloadActivity"
<activity
android:name=".offline.syncclientpayloads.SyncClientPayloadActivity"
android:label="@string/sync_clients"
android:screenOrientation="portrait" />

<activity android:name=".offline.syncgrouppayloads.SyncGroupPayloadsActivity"
<activity
android:name=".offline.syncgrouppayloads.SyncGroupPayloadsActivity"
android:label="@string/sync_groups"
android:screenOrientation="portrait" />

<activity android:name=".offline.synccenterpayloads.SyncCenterPayloadActivity"
<activity
android:name=".offline.synccenterpayloads.SyncCenterPayloadActivity"
android:label="@string/sync_centers"
android:screenOrientation="portrait" />

<activity android:name=".offline.syncloanrepaymenttransacition.SyncLoanRepaymentTransactionActivity"
<activity
android:name=".offline.syncloanrepaymenttransacition.SyncLoanRepaymentTransactionActivity"
android:label="@string/sync_loanrepayments"
android:screenOrientation="portrait" />

<activity android:name=".SettingsActivity"
<activity
android:name=".SettingsActivity"
android:label="@string/settings"
android:screenOrientation="portrait" />

<activity
android:name=".offline.syncsavingsaccounttransaction.SyncSavingsAccountTransactionActivity"
android:label="@string/sync_savingsaccounttransactions"
android:screenOrientation="portrait"/>

android:screenOrientation="portrait" />
<activity
android:name=".passcode.PassCodeActivity"
android:label="@string/pass_code"
android:screenOrientation="portrait" />

<service android:name=".activity.pathtracking.PathTrackingService"
android:exported="false"/>

<service
android:name=".activity.pathtracking.PathTrackingService"
android:exported="false" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.mifos.api.services.AuthService;
import com.mifos.api.services.CenterService;
import com.mifos.api.services.ChargeService;
import com.mifos.api.services.CheckerInboxService;
import com.mifos.api.services.ClientAccountsService;
import com.mifos.api.services.ClientService;
import com.mifos.api.services.CollectionSheetService;
Expand Down Expand Up @@ -58,6 +59,7 @@ public class BaseApiManager {
private static RunReportsService runreportsService;
private static NoteService noteService;
private static CollectionSheetService collectionSheetService;
private static CheckerInboxService checkerInboxService;

public BaseApiManager() {
createService();
Expand All @@ -81,6 +83,7 @@ public static void init() {
runreportsService = createApi(RunReportsService.class);
noteService = createApi(NoteService.class);
collectionSheetService = createApi(CollectionSheetService.class);
checkerInboxService = createApi(CheckerInboxService.class);
}

private static <T> T createApi(Class<T> clazz) {
Expand Down Expand Up @@ -169,4 +172,8 @@ public NoteService getNoteApi() {
public CollectionSheetService getCollectionSheetApi() {
return collectionSheetService;
}

public CheckerInboxService getCheckerInboxApi() {
return checkerInboxService;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.mifos.api.datamanager

import com.mifos.api.BaseApiManager
import com.mifos.api.GenericResponse
import com.mifos.objects.CheckerTask
import com.mifos.objects.checkerinboxandtasks.CheckerInboxSearchTemplate
import com.mifos.objects.checkerinboxandtasks.RescheduleLoansTask
import rx.Observable
import javax.inject.Inject


class DataManagerCheckerInbox @Inject constructor() {
//class DataManagerCheckerInbox {
val mBaseApiManager = BaseApiManager()

fun getCheckerTaskList(actionName: String? = null, entityName: String? = null,
resourceId: Int? = null): Observable<List<CheckerTask>> {
return mBaseApiManager.checkerInboxApi.getCheckerList(
actionName, entityName, resourceId)
}

fun approveCheckerEntry(auditId: Int): Observable<GenericResponse> {
return mBaseApiManager.checkerInboxApi.approveCheckerEntry(auditId)
}

fun rejectCheckerEntry(auditId: Int): Observable<GenericResponse> {
return mBaseApiManager.checkerInboxApi.rejectCheckerEntry(auditId)
}

fun deleteCheckerEntry(auditId: Int): Observable<GenericResponse> {
return mBaseApiManager.checkerInboxApi.deleteCheckerEntry(auditId)
}

fun getRechdeduleLoansTaskList(): Observable<List<RescheduleLoansTask>> {
return mBaseApiManager.checkerInboxApi.getRescheduleLoansTaskList()
}

fun getCheckerInboxSearchTemplate(): Observable<CheckerInboxSearchTemplate> {
return mBaseApiManager.checkerInboxApi.getCheckerInboxSearchTempalate()
}

fun getCheckerTaskFromResourceId(actionName: String? = null, entityName: String? = null,
resourceId: Int? = null): Observable<List<CheckerTask>> {
return mBaseApiManager.checkerInboxApi.getCheckerTasksFromResourceId(
actionName, entityName, resourceId)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ public class APIEndPoint {

public static final String DISBURSE = "disburse";
public static final String NOTES = "notes";
public static final String MAKERCHECKER = "makercheckers";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.mifos.api.services

import com.mifos.api.GenericResponse
import com.mifos.api.model.APIEndPoint
import com.mifos.objects.CheckerTask
import com.mifos.objects.checkerinboxandtasks.CheckerInboxSearchTemplate
import com.mifos.objects.checkerinboxandtasks.RescheduleLoansTask
import retrofit2.http.*
import rx.Observable

interface CheckerInboxService {

@GET(APIEndPoint.MAKERCHECKER)
fun getCheckerList(@Query("actionName") actionName: String? = null,
@Query("entityName") entityName: String? = null,
@Query("resourceId") resourceId: Int? = null)
: Observable<List<CheckerTask>>

@POST(APIEndPoint.MAKERCHECKER + "/{auditId}?command=approve")
fun approveCheckerEntry(@Path("auditId") auditId: Int): Observable<GenericResponse>

@POST(APIEndPoint.MAKERCHECKER + "/{auditId}?command=reject")
fun rejectCheckerEntry(@Path("auditId") auditId: Int): Observable<GenericResponse>

@DELETE(APIEndPoint.MAKERCHECKER + "/{auditId}")
fun deleteCheckerEntry(@Path("auditId") auditId: Int): Observable<GenericResponse>

@GET("rescheduleloans?command=pending")
fun getRescheduleLoansTaskList(): Observable<List<RescheduleLoansTask>>

@GET(APIEndPoint.MAKERCHECKER + "/searchtemplate?fields=entityNames,actionNames")
fun getCheckerInboxSearchTempalate(): Observable<CheckerInboxSearchTemplate>

@GET(APIEndPoint.MAKERCHECKER)
fun getCheckerTasksFromResourceId(@Query("actionName") actionName: String? = null,
@Query("entityName") entityName: String? = null,
@Query("resourceId") resourceId: Int? = null)
: Observable<List<CheckerTask>>

}
Loading