Giter Club home page Giter Club logo

fineract-client's Introduction

Fineract API Client Library Build Status Jitpack License: MPL 2.0

A Java and Retrofit2 based Fineract Client Library that you can use to interact with the Apache Fineract 1.x Platform. This library is autogenerated using Swagger Codegen. It can be used in Android or any Java and Kotlin Project.

This library duplicates & overlaps with the "official" Apache Fineract client library, see #29.

Add Dependency

Gradle

To use library in your gradle project follow the steps below:

  1. Add this in your root build.gradle at the end of repositories:
    allprojects {
        repositories {
            ...
            maven { url 'https://jitpack.io' }
        }
    }
  2. Add the dependency
    dependencies {
        def client_Version = "2.02"
        implementation "com.github.openMF:fineract-client:$client_Version"
    }

Maven

To use the library in your Maven project, follow the steps below:

  1. Add the JitPack repository to your build file:
    <repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
  2. Add the dependency
    <dependency>
        <groupId>com.github.openMF</groupId>
        <artifactId>fineract-client</artifactId>
        <version>2.0.2</version>
    </dependency>

Usage

Example code to use the Authentication API:

import io.reactivex.schedulers.Schedulers;
import org.apache.fineract.client.models.PostAuthenticationResponse;
import org.apache.fineract.client.util.FineractClient;
import org.reactivestreams.Subscriber;

public class Main {
   public static void main(String[] args) {
      FineractClient client = FineractClient.builder()
              .basicAuth("mifos", "password")
              .tenant("default")
              .build();
      
      PostAuthenticationRequest body = new PostAuthenticationRequest();
      body.setUsername("mifos");
      body.setPassword("password");
      
      client.authentication.authenticate(body, false)
              .observeOn(Schedulers.newThread()) // use scheduler based on different scenarios, in case of android use 'AndroidSchedulers.mainThread()'
              .subscribeOn(Schedulers.io())
              .subscribe(new Subscriber<PostAuthenticationResponse> (){
                 @Override
                 public void onNext(PostAuthenticationResponse postAuthenticationResponse) {
                    // handle next events here
                 }

                 @Override
                 public void onError(Throwable t) {
                    // handle error events here
                 }

                 @Override
                 public void onComplete() {
                    // handle on completed events here
                 }
              });
   }
}

Build Project

Clone the repository and import as Maven project in IntelliJ IDEA or Eclipse

Before building the project, make sure you have the following things installed.

  • Maven
  • Java 11

To install the API client library to your local Maven repository, simply execute:

mvn install

To build the library using Gradle, execute the following command

./gradlew build

Refer to the official documentation for more information.

fineract-client's People

Contributors

danishjamal104 avatar edcable avatar fynmanoj avatar grandolf49 avatar iamsh4shank avatar logoutdhaval avatar renovate-bot avatar shkr7 avatar vorburger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fineract-client's Issues

Support for RxJava, Observables and LiveData

Summary

Currently, the API response is wrapped in Call<ApiResponse> object.

Expectation

It would be very helpful for the Android Applications to get the response in either Observable or LiveData

Documentation in README to clarify how this project relates to Fineract's API client

@Grandolf49 perhaps it would be useful to add something to the top of the https://github.com/openMF/fineract-client/blob/master/README.md which clarifies how this project relates to https://github.com/apache/fineract/blob/develop/docs/developers/swagger/client.md ?

Because it's actually not clear e.g. to me (and perhaps to others, in the future). From what little I understand, this looks like it may be a Git repo containing the output of the code that one can generate by following https://github.com/apache/fineract/blob/develop/docs/developers/swagger/client.md, is that right? But you seem to also be making manual extensions here (like #11), and letting Dependabot upgrade many 3rd-parties (which, ideally, should better be made "upstream" in Swagger Codegen, which would then release new versions, which Apache Fineract would, eventually, pick up through Dependabot upgrades of Swagger Codegen).

Regenerate SDK after including changes in fineract swagger resources

The major issues with the fineract swagger resources are fixed, which need to be included here also. This issue focuses on regenerating and updating the SDK after including all those fixes.

Below are the tickets

  • FINERACT-1364: Missmatch datatype in groups field of client model "GetClientsClientIdResponse"
  • FINERACT-1365: invalid swagger annotations in DatatablesApiResource for posting datatable
  • FINERACT-1366: invalid fields in PostClientsClientIdRequest in clientsApiResourceSwagger
  • FINERACT-1369: invalid body payload in basic authentication swagger resource and generated client
  • FINERACT-1370: invalid response schema defined in SearchApiResource

Incorrect documentation in docs folder

The documentation generated by Swagger Codegen is incorrect.
Eg: AccountNumberFormatApi.md
In the documentation, the Base URL contains an additional http:// string. This was because the API Spec File was incorrect. It has been fixed now.

This might be a tedious task to solve. This file was used to generate the client library.

Possible Resolution

  1. Use the Spec File URL and generate library again.
  2. Verify if the documentation generated is correct or not.
  3. If correct, copy all the doc files and paste them in this project
  4. If not, use Mustache Templates to generate correct documentation in Swagger Codegen

Add tests for all APIs

Swagger Codegen generated blank test files to test the APIs. It is up to us to write the tests according to our needs. Currently, the APIs are not being tested although, test files are present.

[BUG] Unsupported java class used in util/Json.java file

Description
Json.java uses DateTimeFormatter class which is only supports android api >= 0reo(API 26), but the min sdk version is 15. Hence it is causing app crash in android making this library only available for device run-in non android API level 26+.

Screenshot

Screenshot 2021-06-30 at 6 44 41 PM

Add Maven Wrapper to Project

To build the project, the user is expected to have Maven installed in their system.

Ideally, the project should contain a Maven Wrapper which will allow a user to build the project by executing the command ./mvnw package

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.