diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.java deleted file mode 100644 index 8f5e28cf2..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.java +++ /dev/null @@ -1,18 +0,0 @@ -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 - */ - -public interface AccountTransfersService { - - @GET(ApiEndPoints.ACCOUNT_TRANSFER + "/{transferId}") - Observable getAccountTransfer(@Path("transferId") long transferId); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.kt new file mode 100644 index 000000000..e828aa347 --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.kt @@ -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 +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.java deleted file mode 100644 index 554c2b6ab..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.java +++ /dev/null @@ -1,19 +0,0 @@ -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. - */ - -public interface AuthenticationService { - - @POST(ApiEndPoints.AUTHENTICATION) - Observable authenticate(@Body AuthenticationPayload authPayload); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.kt new file mode 100644 index 000000000..335fc47ee --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.kt @@ -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 +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.java deleted file mode 100644 index 400dbcf37..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.java +++ /dev/null @@ -1,41 +0,0 @@ -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.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 java.util.List; - -import okhttp3.ResponseBody; -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. - */ - -public interface BeneficiaryService { - - @GET(ApiEndPoints.BENEFICIARIES + "/tpt") - Observable> getBeneficiaryList(); - - @GET(ApiEndPoints.BENEFICIARIES + "/tpt/template") - Observable getBeneficiaryTemplate(); - - @POST(ApiEndPoints.BENEFICIARIES + "/tpt") - Observable createBeneficiary(@Body BeneficiaryPayload beneficiaryPayload); - - @PUT(ApiEndPoints.BENEFICIARIES + "/tpt/{beneficiaryId}") - Observable updateBeneficiary(@Path("beneficiaryId") long beneficiaryId, - @Body BeneficiaryUpdatePayload payload); - - @DELETE(ApiEndPoints.BENEFICIARIES + "/tpt/{beneficiaryId}") - Observable deleteBeneficiary(@Path("beneficiaryId") long beneficiaryId); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.kt new file mode 100644 index 000000000..975d909cd --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.kt @@ -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> + + @get:GET(ApiEndPoints.BENEFICIARIES + "/tpt/template") + val beneficiaryTemplate: Observable + + @POST(ApiEndPoints.BENEFICIARIES + "/tpt") + fun createBeneficiary(@Body beneficiaryPayload: BeneficiaryPayload): Observable + + @PUT(ApiEndPoints.BENEFICIARIES + "/tpt/{beneficiaryId}") + fun updateBeneficiary( + @Path("beneficiaryId") beneficiaryId: Long, + @Body payload: BeneficiaryUpdatePayload + ): Observable + + @DELETE(ApiEndPoints.BENEFICIARIES + "/tpt/{beneficiaryId}") + fun deleteBeneficiary(@Path("beneficiaryId") beneficiaryId: Long): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.java deleted file mode 100644 index fc273c69d..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.java +++ /dev/null @@ -1,56 +0,0 @@ -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.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 okhttp3.MultipartBody; -import okhttp3.ResponseBody; -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; - -public interface ClientService { - - @GET(ApiEndPoints.CLIENTS) - Observable> getClients(); - - @GET(ApiEndPoints.CLIENTS + "/{clientId}") - Observable getClientForId(@Path("clientId") long clientId); - - @PUT(ApiEndPoints.CLIENTS + "/{clientId}") - Observable updateClient(@Path("clientId") long clientId, - @Body Object payload); - - @GET(ApiEndPoints.CLIENTS + "/{clientId}/images") - Observable getClientImage(@Path("clientId") long clientId); - - @PUT(ApiEndPoints.CLIENTS + "/{clientId}/images") - Observable updateClientImage( - @Path("clientId") long clientId, - @Part() MultipartBody.Part typedFile); - - @GET(ApiEndPoints.CLIENTS + "/{clientId}/accounts") - Observable getClientAccounts(@Path("clientId") long clientId); - - @GET(ApiEndPoints.CLIENTS + "/{clientId}/accounts") - Observable getAccounts(@Path("clientId") long clientId, - @Query("fields") String accountType); - - @POST(ApiEndPoints.CLIENTS) - Observable createClient(@Body NewClient newClient); - - @POST - Observable createAccount(@Body NewAccount newAccount); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.kt new file mode 100644 index 000000000..03e4885a1 --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.kt @@ -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> + + @GET(ApiEndPoints.CLIENTS + "/{clientId}") + fun getClientForId(@Path("clientId") clientId: Long): Observable + + @PUT(ApiEndPoints.CLIENTS + "/{clientId}") + fun updateClient( + @Path("clientId") clientId: Long, + @Body payload: Any + ): Observable + + @GET(ApiEndPoints.CLIENTS + "/{clientId}/images") + fun getClientImage(@Path("clientId") clientId: Long): Observable + + @PUT(ApiEndPoints.CLIENTS + "/{clientId}/images") + fun updateClientImage( + @Path("clientId") clientId: Long, + @Part typedFile: MultipartBody.Part? + ): Observable + + @GET(ApiEndPoints.CLIENTS + "/{clientId}/accounts") + fun getClientAccounts(@Path("clientId") clientId: Long): Observable + + @GET(ApiEndPoints.CLIENTS + "/{clientId}/accounts") + fun getAccounts( + @Path("clientId") clientId: Long, + @Query("fields") accountType: String + ): Observable + + @POST(ApiEndPoints.CLIENTS) + fun createClient(@Body newClient: NewClient): Observable + + @POST + fun createAccount(@Body newAccount: NewAccount?): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.kt similarity index 59% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.java rename to core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.kt index fcf22387a..773f68bf9 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.java +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.kt @@ -1,35 +1,32 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services; +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.api.GenericResponse; -import org.mifos.mobilewallet.core.data.fineract.entity.noncore.Document; - -import java.util.List; - -import okhttp3.MultipartBody; -import okhttp3.ResponseBody; -import retrofit2.http.DELETE; -import retrofit2.http.GET; -import retrofit2.http.Multipart; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Part; -import retrofit2.http.Path; -import rx.Observable; +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.noncore.Document +import retrofit2.http.DELETE +import retrofit2.http.GET +import retrofit2.http.Multipart +import retrofit2.http.POST +import retrofit2.http.PUT +import retrofit2.http.Part +import retrofit2.http.Path +import rx.Observable /** * @author fomenkoo */ - -public interface DocumentService { - +interface DocumentService { @GET("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS) - Observable> getDocuments(@Path("entityType") String entityType, - @Path("entityId") int entityId); + fun getDocuments( + @Path("entityType") entityType: String?, + @Path("entityId") entityId: Int + ): Observable> /** * @param entityType - Type for which document is being uploaded (Client, Loan - * or Savings etc) + * or Savings etc) * @param entityId - Id of Entity * @param nameOfDocument - Document Name * @param description - Mandatory - Document Description @@ -37,13 +34,13 @@ Observable> getDocuments(@Path("entityType") String entityType, */ @POST("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS) @Multipart - Observable createDocument( - @Path("entityType") String entityType, - @Path("entityId") long entityId, - @Part("name") String nameOfDocument, - @Part("description") String description, - @Part() MultipartBody.Part typedFile); - + fun createDocument( + @Path("entityType") entityType: String, + @Path("entityId") entityId: Long, + @Part("name") nameOfDocument: String, + @Part("description") description: String, + @Part typedFile: MultipartBody.Part + ): Observable /** * This Service is for downloading the Document with EntityType and EntityId and Document Id @@ -52,15 +49,17 @@ Observable createDocument( * {documentId}/attachment * * @param entityType - Type for which document is being uploaded (Client, Loan - * or Savings etc) + * or Savings etc) * @param entityId - Id of Entity * @param documentId - Document Id * @return ResponseBody */ @GET("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS + "/{documentId}/attachment") - Observable downloadDocument(@Path("entityType") String entityType, - @Path("entityId") int entityId, - @Path("documentId") int documentId); + fun downloadDocument( + @Path("entityType") entityType: String, + @Path("entityId") entityId: Int, + @Path("documentId") documentId: Int + ): Observable /** * This Service is for Deleting the Document with EntityType and EntityId and Document Id. @@ -69,14 +68,16 @@ Observable downloadDocument(@Path("entityType") String entityType, * {documentId} * * @param entityType - Type for which document is being uploaded (Client, Loan - * or Savings etc) + * or Savings etc) * @param entityId - Id of Entity * @param documentId - Document Id */ @DELETE("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS + "/{documentId}") - Observable removeDocument(@Path("entityType") String entityType, - @Path("entityId") int entityId, - @Path("documentId") int documentId); + fun removeDocument( + @Path("entityType") entityType: String, + @Path("entityId") entityId: Int, + @Path("documentId") documentId: Int + ): Observable /** * This Service for Updating the Document with EntityType and EntityId and Document Id. @@ -86,7 +87,7 @@ Observable removeDocument(@Path("entityType") String entityType, * {documentId} * * @param entityType - Type for which document is being uploaded (Client, Loan - * or Savings etc) + * or Savings etc) * @param entityId - Id of Entity * @param documentId - Id of document * @param nameOfDocument - Document Name @@ -95,10 +96,12 @@ Observable removeDocument(@Path("entityType") String entityType, */ @PUT("{entityType}/{entityId}/" + ApiEndPoints.DOCUMENTS + "/{documentId}") @Multipart - Observable updateDocument(@Path("entityType") String entityType, - @Path("entityId") int entityId, - @Path("documentId") int documentId, - @Part("name") String nameOfDocument, - @Part("description") String description, - @Part() MultipartBody.Part typedFile); + fun updateDocument( + @Path("entityType") entityType: String, + @Path("entityId") entityId: Int, + @Path("documentId") documentId: Int, + @Part("name") nameOfDocument: String, + @Part("description") description: String, + @Part typedFile: MultipartBody.Part + ): Observable } diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.java deleted file mode 100644 index c9187c993..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.java +++ /dev/null @@ -1,46 +0,0 @@ -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.api.GenericResponse; -import org.mifos.mobilewallet.core.data.fineract.entity.Invoice; - -import java.util.List; - -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 ankur on 07/June/2018 - */ - -public interface InvoiceService { - - @POST(ApiEndPoints.DATATABLES + "/invoices/{clientId}") - Observable addInvoice( - @Path("clientId") String clientId, - @Body Invoice invoice); - - @GET(ApiEndPoints.DATATABLES + "/invoices/{clientId}") - Observable> getInvoices(@Path("clientId") String clientId); - - @GET(ApiEndPoints.DATATABLES + "/invoices/{clientId}/{invoiceId}") - Observable> getInvoice( - @Path("clientId") String clientId, - @Path("invoiceId") String invoiceId); - - @DELETE(ApiEndPoints.DATATABLES + "/invoices/{clientId}/{invoiceId}") - Observable deleteInvoice(@Path("clientId") String clientId, - @Path("invoiceId") int invoiceId); - - @PUT(ApiEndPoints.DATATABLES + "/invoices/{clientId}/{invoiceId}") - Observable updateInvoice( - @Path("clientId") String clientId, - @Path("invoiceId") long invoiceId, - @Body Invoice invoice); - -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.kt new file mode 100644 index 000000000..fc7dc24bc --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.kt @@ -0,0 +1,45 @@ +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.api.GenericResponse +import org.mifos.mobilewallet.core.data.fineract.entity.Invoice +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 ankur on 07/June/2018 + */ +interface InvoiceService { + @POST(ApiEndPoints.DATATABLES + "/invoices/{clientId}") + fun addInvoice( + @Path("clientId") clientId: String, + @Body invoice: Invoice? + ): Observable + + @GET(ApiEndPoints.DATATABLES + "/invoices/{clientId}") + fun getInvoices(@Path("clientId") clientId: String): Observable> + + @GET(ApiEndPoints.DATATABLES + "/invoices/{clientId}/{invoiceId}") + fun getInvoice( + @Path("clientId") clientId: String, + @Path("invoiceId") invoiceId: String + ): Observable> + + @DELETE(ApiEndPoints.DATATABLES + "/invoices/{clientId}/{invoiceId}") + fun deleteInvoice( + @Path("clientId") clientId: String, + @Path("invoiceId") invoiceId: Int + ): Observable + + @PUT(ApiEndPoints.DATATABLES + "/invoices/{clientId}/{invoiceId}") + fun updateInvoice( + @Path("clientId") clientId: String, + @Path("invoiceId") invoiceId: Long, + @Body invoice: Invoice? + ): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.java deleted file mode 100644 index 1f0f2aa75..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.java +++ /dev/null @@ -1,34 +0,0 @@ -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.api.GenericResponse; -import org.mifos.mobilewallet.core.data.fineract.entity.kyc.KYCLevel1Details; - -import java.util.List; - -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.POST; -import retrofit2.http.PUT; -import retrofit2.http.Path; -import rx.Observable; - -/** - * Created by ankur on 07/June/2018 - */ - -public interface KYCLevel1Service { - - @POST(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}") - Observable addKYCLevel1Details( - @Path("clientId") int clientId, - @Body KYCLevel1Details kycLevel1Details); - - @GET(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}") - Observable> fetchKYCLevel1Details(@Path("clientId") int clientId); - - @PUT(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}/") - Observable updateKYCLevel1Details( - @Path("clientId") int clientId, - @Body KYCLevel1Details kycLevel1Details); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.kt new file mode 100644 index 000000000..318193667 --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.kt @@ -0,0 +1,31 @@ +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.api.GenericResponse +import org.mifos.mobilewallet.core.data.fineract.entity.kyc.KYCLevel1Details +import retrofit2.http.Body +import retrofit2.http.GET +import retrofit2.http.POST +import retrofit2.http.PUT +import retrofit2.http.Path +import rx.Observable + +/** + * Created by ankur on 07/June/2018 + */ +interface KYCLevel1Service { + @POST(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}") + fun addKYCLevel1Details( + @Path("clientId") clientId: Int, + @Body kycLevel1Details: KYCLevel1Details + ): Observable + + @GET(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}") + fun fetchKYCLevel1Details(@Path("clientId") clientId: Int): Observable> + + @PUT(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}/") + fun updateKYCLevel1Details( + @Path("clientId") clientId: Int, + @Body kycLevel1Details: KYCLevel1Details + ): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.java deleted file mode 100644 index 7f2d059c0..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services; - -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints; -import org.mifos.mobilewallet.core.domain.model.NotificationPayload; - -import java.util.List; - -import retrofit2.http.GET; -import retrofit2.http.Path; -import rx.Observable; - -/** - * Created by ankur on 24/July/2018 - */ - -public interface NotificationService { - - @GET(ApiEndPoints.DATATABLES + "/notifications/{clientId}") - Observable> fetchNotifications(@Path("clientId") long clientId); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.kt new file mode 100644 index 000000000..a5e7f9b3b --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.kt @@ -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.domain.model.NotificationPayload +import retrofit2.http.GET +import retrofit2.http.Path +import rx.Observable + +/** + * Created by ankur on 24/July/2018 + */ +interface NotificationService { + @GET(ApiEndPoints.DATATABLES + "/notifications/{clientId}") + fun fetchNotifications(@Path("clientId") clientId: Long): Observable> +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.java deleted file mode 100644 index cd297543b..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.java +++ /dev/null @@ -1,19 +0,0 @@ -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.register.RegisterPayload; -import org.mifos.mobilewallet.core.data.fineract.entity.register.UserVerify; - -import okhttp3.ResponseBody; -import retrofit2.http.Body; -import retrofit2.http.POST; -import rx.Observable; - -public interface RegistrationService { - - @POST(ApiEndPoints.REGISTRATION) - Observable registerUser(@Body RegisterPayload registerPayload); - - @POST(ApiEndPoints.REGISTRATION + "/user") - Observable verifyUser(@Body UserVerify userVerify); -} \ No newline at end of file diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.kt new file mode 100644 index 000000000..58c4ee449 --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.kt @@ -0,0 +1,17 @@ +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.register.RegisterPayload +import org.mifos.mobilewallet.core.data.fineract.entity.register.UserVerify +import retrofit2.http.Body +import retrofit2.http.POST +import rx.Observable + +interface RegistrationService { + @POST(ApiEndPoints.REGISTRATION) + fun registerUser(@Body registerPayload: RegisterPayload): Observable + + @POST(ApiEndPoints.REGISTRATION + "/user") + fun verifyUser(@Body userVerify: UserVerify): Observable +} \ No newline at end of file diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.java deleted file mode 100644 index 132b207c3..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services; - -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints; - -import okhttp3.ResponseBody; -import retrofit2.http.GET; -import retrofit2.http.Query; -import rx.Observable; - -/** - * Created by ankur on 06/June/2018 - */ - -public interface RunReportService { - - @GET(ApiEndPoints.RUN_REPORT + "/Savings Transaction Receipt") - Observable getTransactionReceipt( - @Query("output-type") String outputType, - @Query("R_transactionId") String R_transactionId - ); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.kt new file mode 100644 index 000000000..a1a73b664 --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.kt @@ -0,0 +1,18 @@ +package org.mifos.mobilewallet.core.data.fineract.api.services + +import okhttp3.ResponseBody +import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints +import retrofit2.http.GET +import retrofit2.http.Query +import rx.Observable + +/** + * Created by ankur on 06/June/2018 + */ +interface RunReportService { + @GET(ApiEndPoints.RUN_REPORT + "/Savings Transaction Receipt") + fun getTransactionReceipt( + @Query("output-type") outputType: String, + @Query("R_transactionId") R_transactionId: String + ): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.java deleted file mode 100644 index a8de3ea23..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.java +++ /dev/null @@ -1,41 +0,0 @@ -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.api.GenericResponse; -import org.mifos.mobilewallet.core.data.fineract.entity.savedcards.Card; - -import java.util.List; - -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 ankur on 21/May/2018 - */ - -public interface SavedCardService { - - @POST(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}") - Observable addSavedCard( - @Path("clientId") int clientId, - @Body Card card); - - @GET(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}") - Observable> getSavedCards(@Path("clientId") int clientId); - - @DELETE(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}/{cardId}") - Observable deleteCard(@Path("clientId") int clientId, - @Path("cardId") int cardId); - - @PUT(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}/{cardId}") - Observable updateCard( - @Path("clientId") int clientId, - @Path("cardId") int cardId, - @Body Card card); - -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.kt new file mode 100644 index 000000000..47711a83b --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.kt @@ -0,0 +1,39 @@ +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.api.GenericResponse +import org.mifos.mobilewallet.core.data.fineract.entity.savedcards.Card +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 ankur on 21/May/2018 + */ +interface SavedCardService { + @POST(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}") + fun addSavedCard( + @Path("clientId") clientId: Int, + @Body card: Card + ): Observable + + @GET(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}") + fun getSavedCards(@Path("clientId") clientId: Int): Observable> + + @DELETE(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}/{cardId}") + fun deleteCard( + @Path("clientId") clientId: Int, + @Path("cardId") cardId: Int + ): Observable + + @PUT(ApiEndPoints.DATATABLES + "/saved_cards/{clientId}/{cardId}") + fun updateCard( + @Path("clientId") clientId: Int, + @Path("cardId") cardId: Int, + @Body card: Card + ): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.java deleted file mode 100644 index 61086333e..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.java +++ /dev/null @@ -1,44 +0,0 @@ -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.api.GenericResponse; -import org.mifos.mobilewallet.core.data.fineract.entity.Page; -import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.SavingAccount; -import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.SavingsWithAssociations; -import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.Transactions; - -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.POST; -import retrofit2.http.Path; -import retrofit2.http.Query; -import rx.Observable; - -public interface SavingsAccountsService { - - @GET(ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}") - Observable getSavingsWithAssociations( - @Path("accountId") long accountId, - @Query("associations") String associationType); - - @GET(ApiEndPoints.SAVINGS_ACCOUNTS) - Observable> getSavingsAccounts( - @Query("limit") int limit); - - @POST(ApiEndPoints.SAVINGS_ACCOUNTS) - Observable createSavingsAccount(@Body SavingAccount savingAccount); - - @POST(ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}") - Observable blockUnblockAccount( - @Path("accountId") long accountId, - @Query("command") String command); - - @GET(ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}/" + ApiEndPoints.TRANSACTIONS - + "/{transactionId}") - Observable getSavingAccountTransaction(@Path("accountId") long accountId, - @Path("transactionId") long transactionId); - - @POST(ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}/" + ApiEndPoints.TRANSACTIONS - + "?command=deposit") - Observable payViaMobile(@Path("accountId") long accountId); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.kt new file mode 100644 index 000000000..9c24e164c --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.kt @@ -0,0 +1,51 @@ +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.api.GenericResponse +import org.mifos.mobilewallet.core.data.fineract.entity.Page +import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.SavingAccount +import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.SavingsWithAssociations +import org.mifos.mobilewallet.core.data.fineract.entity.accounts.savings.Transactions +import retrofit2.http.Body +import retrofit2.http.GET +import retrofit2.http.POST +import retrofit2.http.Path +import retrofit2.http.Query +import rx.Observable + +interface SavingsAccountsService { + @GET(ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}") + fun getSavingsWithAssociations( + @Path("accountId") accountId: Long, + @Query("associations") associationType: String + ): Observable + + @GET(ApiEndPoints.SAVINGS_ACCOUNTS) + fun getSavingsAccounts( + @Query("limit") limit: Int + ): Observable> + + @POST(ApiEndPoints.SAVINGS_ACCOUNTS) + fun createSavingsAccount(@Body savingAccount: SavingAccount): Observable + + @POST(ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}") + fun blockUnblockAccount( + @Path("accountId") accountId: Long, + @Query("command") command: String? + ): Observable + + @GET( + ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}/" + ApiEndPoints.TRANSACTIONS + + "/{transactionId}" + ) + fun getSavingAccountTransaction( + @Path("accountId") accountId: Long, + @Path("transactionId") transactionId: Long + ): Observable + + @POST( + ApiEndPoints.SAVINGS_ACCOUNTS + "/{accountId}/" + ApiEndPoints.TRANSACTIONS + + "?command=deposit" + ) + fun payViaMobile(@Path("accountId") accountId: Long): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.java deleted file mode 100644 index e20954dce..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.java +++ /dev/null @@ -1,22 +0,0 @@ -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.SearchedEntity; - -import java.util.List; - -import retrofit2.http.GET; -import retrofit2.http.Query; -import rx.Observable; - -/** - * Created by naman on 19/8/17. - */ - -public interface SearchService { - - @GET(ApiEndPoints.SEARCH) - Observable> searchResources(@Query("query") String query, - @Query("resource") String resources, - @Query("exactMatch") Boolean exactMatch); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.kt new file mode 100644 index 000000000..a2a73345f --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.kt @@ -0,0 +1,19 @@ +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.SearchedEntity +import retrofit2.http.GET +import retrofit2.http.Query +import rx.Observable + +/** + * Created by naman on 19/8/17. + */ +interface SearchService { + @GET(ApiEndPoints.SEARCH) + fun searchResources( + @Query("query") query: String, + @Query("resource") resources: String, + @Query("exactMatch") exactMatch: Boolean + ): Observable> +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.java deleted file mode 100644 index 622104ea0..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.java +++ /dev/null @@ -1,24 +0,0 @@ -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.TPTResponse; -import org.mifos.mobilewallet.core.data.fineract.entity.payload.TransferPayload; -import org.mifos.mobilewallet.core.data.fineract.entity.templates.account.AccountOptionsTemplate; - -import retrofit2.http.Body; -import retrofit2.http.GET; -import retrofit2.http.POST; -import rx.Observable; - -/** - * Created by dilpreet on 21/6/17. - */ - -public interface ThirdPartyTransferService { - - @GET(ApiEndPoints.ACCOUNT_TRANSFER + "/template?type=tpt") - Observable getAccountTransferTemplate(); - - @POST(ApiEndPoints.ACCOUNT_TRANSFER + "?type=\"tpt\"") - Observable makeTransfer(@Body TransferPayload transferPayload); -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.kt new file mode 100644 index 000000000..8970d58c3 --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.kt @@ -0,0 +1,21 @@ +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.TPTResponse +import org.mifos.mobilewallet.core.data.fineract.entity.payload.TransferPayload +import org.mifos.mobilewallet.core.data.fineract.entity.templates.account.AccountOptionsTemplate +import retrofit2.http.Body +import retrofit2.http.GET +import retrofit2.http.POST +import rx.Observable + +/** + * Created by dilpreet on 21/6/17. + */ +interface ThirdPartyTransferService { + @get:GET(ApiEndPoints.ACCOUNT_TRANSFER + "/template?type=tpt") + val accountTransferTemplate: Observable + + @POST(ApiEndPoints.ACCOUNT_TRANSFER + "?type=\"tpt\"") + fun makeTransfer(@Body transferPayload: TransferPayload): Observable +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.java deleted file mode 100644 index 66d57e73c..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services; - -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints; -import org.mifos.mobilewallet.core.domain.model.twofactor.AccessToken; -import org.mifos.mobilewallet.core.domain.model.twofactor.DeliveryMethod; - -import java.util.List; - -import retrofit2.http.GET; -import retrofit2.http.POST; -import retrofit2.http.Query; -import rx.Observable; - -/** - * Created by ankur on 01/June/2018 - */ - -public interface TwoFactorAuthService { - - @GET(ApiEndPoints.TWOFACTOR) - Observable> getDeliveryMethods(); - - @POST(ApiEndPoints.TWOFACTOR) - Observable requestOTP(@Query("deliveryMethod") String deliveryMethod); - - @POST(ApiEndPoints.TWOFACTOR + "/validate") - Observable validateToken(@Query("token") String token); - -} \ No newline at end of file diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.kt new file mode 100644 index 000000000..cae307dbc --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.kt @@ -0,0 +1,23 @@ +package org.mifos.mobilewallet.core.data.fineract.api.services + +import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints +import org.mifos.mobilewallet.core.domain.model.twofactor.AccessToken +import org.mifos.mobilewallet.core.domain.model.twofactor.DeliveryMethod +import retrofit2.http.GET +import retrofit2.http.POST +import retrofit2.http.Query +import rx.Observable + +/** + * Created by ankur on 01/June/2018 + */ +interface TwoFactorAuthService { + @get:GET(ApiEndPoints.TWOFACTOR) + val deliveryMethods: Observable> + + @POST(ApiEndPoints.TWOFACTOR) + fun requestOTP(@Query("deliveryMethod") deliveryMethod: String): Observable + + @POST(ApiEndPoints.TWOFACTOR + "/validate") + fun validateToken(@Query("token") token: String): Observable +} \ No newline at end of file diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.java b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.java deleted file mode 100644 index f5d1424ad..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.java +++ /dev/null @@ -1,44 +0,0 @@ -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.api.GenericResponse; -import org.mifos.mobilewallet.core.data.fineract.entity.UserWithRole; -import org.mifos.mobilewallet.core.domain.model.user.NewUser; -import org.mifos.mobilewallet.core.domain.usecase.user.CreateUser; - -import java.util.List; - -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 ankur on 11/June/2018 - */ - -public interface UserService { - - @GET(ApiEndPoints.USER) - Observable> getUsers(); - - @POST(ApiEndPoints.USER) - Observable createUser(@Body NewUser user); - - @PUT(ApiEndPoints.USER + "/{userId}") - Observable updateUser( - @Path("userId") int userId, - @Body Object updateUserEntity); - - @DELETE(ApiEndPoints.USER + "/{userId}") - Observable deleteUser( - @Path("userId") int userId); - - @GET(ApiEndPoints.USER + "/{userId}") - Observable getUser( - @Path("userId") long userId); -} - diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.kt new file mode 100644 index 000000000..9aa10dc0c --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.kt @@ -0,0 +1,41 @@ +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.api.GenericResponse +import org.mifos.mobilewallet.core.data.fineract.entity.UserWithRole +import org.mifos.mobilewallet.core.domain.model.user.NewUser +import org.mifos.mobilewallet.core.domain.usecase.user.CreateUser +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 ankur on 11/June/2018 + */ +interface UserService { + @get:GET(ApiEndPoints.USER) + val users: Observable> + + @POST(ApiEndPoints.USER) + fun createUser(@Body user: NewUser): Observable + + @PUT(ApiEndPoints.USER + "/{userId}") + fun updateUser( + @Path("userId") userId: Int, + @Body updateUserEntity: Any + ): Observable + + @DELETE(ApiEndPoints.USER + "/{userId}") + fun deleteUser( + @Path("userId") userId: Int + ): Observable + + @GET(ApiEndPoints.USER + "/{userId}") + fun getUser( + @Path("userId") userId: Long + ): Observable +}