Skip to content

Commit

Permalink
refactor #1520: migrated api services from java to kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
PratyushSingh07 authored and therajanmaurya committed Feb 14, 2024
1 parent a212150 commit 09dfa02
Show file tree
Hide file tree
Showing 31 changed files with 495 additions and 523 deletions.

This file was deleted.

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>
}

This file was deleted.

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>
}

This file was deleted.

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>
}

This file was deleted.

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>
}
Loading

0 comments on commit 09dfa02

Please sign in to comment.