-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor #1520: migrated api services from java to kotlin
- Loading branch information
1 parent
a212150
commit 09dfa02
Showing
31 changed files
with
495 additions
and
523 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
.../java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
...in/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.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,15 @@ | ||
package org.mifos.mobilewallet.core.data.fineract.api.services | ||
|
||
import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints | ||
import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.TransferDetail | ||
import retrofit2.http.GET | ||
import retrofit2.http.Path | ||
import rx.Observable | ||
|
||
/** | ||
* Created by ankur on 05/June/2018 | ||
*/ | ||
interface AccountTransfersService { | ||
@GET(ApiEndPoints.ACCOUNT_TRANSFER + "/{transferId}") | ||
fun getAccountTransfer(@Path("transferId") transferId: Long): Observable<TransferDetail> | ||
} |
19 changes: 0 additions & 19 deletions
19
...in/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.java
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
...main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.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,16 @@ | ||
package org.mifos.mobilewallet.core.data.fineract.api.services | ||
|
||
import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints | ||
import org.mifos.mobilewallet.core.data.fineract.entity.UserEntity | ||
import org.mifos.mobilewallet.core.data.fineract.entity.authentication.AuthenticationPayload | ||
import retrofit2.http.Body | ||
import retrofit2.http.POST | ||
import rx.Observable | ||
|
||
/** | ||
* Created by naman on 17/6/17. | ||
*/ | ||
interface AuthenticationService { | ||
@POST(ApiEndPoints.AUTHENTICATION) | ||
fun authenticate(@Body authPayload: AuthenticationPayload): Observable<UserEntity> | ||
} |
41 changes: 0 additions & 41 deletions
41
.../main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.java
This file was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
...rc/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.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,38 @@ | ||
package org.mifos.mobilewallet.core.data.fineract.api.services | ||
|
||
import okhttp3.ResponseBody | ||
import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints | ||
import org.mifos.mobilewallet.core.data.fineract.entity.beneficary.Beneficiary | ||
import org.mifos.mobilewallet.core.data.fineract.entity.beneficary.BeneficiaryPayload | ||
import org.mifos.mobilewallet.core.data.fineract.entity.beneficary.BeneficiaryUpdatePayload | ||
import org.mifos.mobilewallet.core.data.fineract.entity.templates.beneficiary.BeneficiaryTemplate | ||
import retrofit2.http.Body | ||
import retrofit2.http.DELETE | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.PUT | ||
import retrofit2.http.Path | ||
import rx.Observable | ||
|
||
/** | ||
* Created by dilpreet on 14/6/17. | ||
*/ | ||
interface BeneficiaryService { | ||
@get:GET(ApiEndPoints.BENEFICIARIES + "/tpt") | ||
val beneficiaryList: Observable<List<Beneficiary>> | ||
|
||
@get:GET(ApiEndPoints.BENEFICIARIES + "/tpt/template") | ||
val beneficiaryTemplate: Observable<BeneficiaryTemplate> | ||
|
||
@POST(ApiEndPoints.BENEFICIARIES + "/tpt") | ||
fun createBeneficiary(@Body beneficiaryPayload: BeneficiaryPayload): Observable<ResponseBody> | ||
|
||
@PUT(ApiEndPoints.BENEFICIARIES + "/tpt/{beneficiaryId}") | ||
fun updateBeneficiary( | ||
@Path("beneficiaryId") beneficiaryId: Long, | ||
@Body payload: BeneficiaryUpdatePayload | ||
): Observable<ResponseBody> | ||
|
||
@DELETE(ApiEndPoints.BENEFICIARIES + "/tpt/{beneficiaryId}") | ||
fun deleteBeneficiary(@Path("beneficiaryId") beneficiaryId: Long): Observable<ResponseBody> | ||
} |
56 changes: 0 additions & 56 deletions
56
...a/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.java
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
...ata/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.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,58 @@ | ||
package org.mifos.mobilewallet.core.data.fineract.api.services | ||
|
||
import okhttp3.MultipartBody | ||
import okhttp3.ResponseBody | ||
import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints | ||
import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse | ||
import org.mifos.mobilewallet.core.data.fineract.entity.Page | ||
import org.mifos.mobilewallet.core.data.fineract.entity.client.Client | ||
import org.mifos.mobilewallet.core.data.fineract.entity.client.ClientAccounts | ||
import org.mifos.mobilewallet.core.domain.model.NewAccount | ||
import org.mifos.mobilewallet.core.domain.model.client.NewClient | ||
import org.mifos.mobilewallet.core.domain.usecase.client.CreateClient | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.PUT | ||
import retrofit2.http.Part | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
import rx.Observable | ||
|
||
interface ClientService { | ||
@get:GET(ApiEndPoints.CLIENTS) | ||
val clients: Observable<Page<Client>> | ||
|
||
@GET(ApiEndPoints.CLIENTS + "/{clientId}") | ||
fun getClientForId(@Path("clientId") clientId: Long): Observable<Client> | ||
|
||
@PUT(ApiEndPoints.CLIENTS + "/{clientId}") | ||
fun updateClient( | ||
@Path("clientId") clientId: Long, | ||
@Body payload: Any | ||
): Observable<ResponseBody> | ||
|
||
@GET(ApiEndPoints.CLIENTS + "/{clientId}/images") | ||
fun getClientImage(@Path("clientId") clientId: Long): Observable<ResponseBody> | ||
|
||
@PUT(ApiEndPoints.CLIENTS + "/{clientId}/images") | ||
fun updateClientImage( | ||
@Path("clientId") clientId: Long, | ||
@Part typedFile: MultipartBody.Part? | ||
): Observable<GenericResponse> | ||
|
||
@GET(ApiEndPoints.CLIENTS + "/{clientId}/accounts") | ||
fun getClientAccounts(@Path("clientId") clientId: Long): Observable<ClientAccounts> | ||
|
||
@GET(ApiEndPoints.CLIENTS + "/{clientId}/accounts") | ||
fun getAccounts( | ||
@Path("clientId") clientId: Long, | ||
@Query("fields") accountType: String | ||
): Observable<ClientAccounts> | ||
|
||
@POST(ApiEndPoints.CLIENTS) | ||
fun createClient(@Body newClient: NewClient): Observable<CreateClient.ResponseValue> | ||
|
||
@POST | ||
fun createAccount(@Body newAccount: NewAccount?): Observable<GenericResponse> | ||
} |
Oops, something went wrong.