Coder Social home page Coder Social logo

money-transfer-assignment's Introduction

Money Transfer Build Status

An assignment for FinTech company for a simple money transfer service project, the challenge is not to use Spring Framework & Hibernate.

What dependencies I have used ?

  • JOOQ: a fluent API for typesafe SQL query construction and execution.

  • JavaLin: a very lightweight web framework for Kotlin and Java which supports WebSockets, HTTP2 and async requests. Javalin’s main goals are simplicity, a great developer experience, and first class interoperability between Kotlin and Java.

  • HikariCP: Fast, simple, reliable connection pool

  • h2database: Embeddable RDBMS written in Java

  • flywaydb: open-source database migration tool. It strongly favors simplicity and convention over configuration

  • mockito: Tasty mocking framework for unit tests in Java

  • rest-assured: Java library that provides a domain-specific language (DSL) for writing powerful, maintainable tests for RESTful APIs

  • codearte.catch-exception: catches exceptions in a single line of code and makes them available for further analysis.

API Endpoints

API end points are managed in a simple Java Constants file, ApiConstants.

/api/v1/accounts

By default anything under /api/v1/accounts is where your clients interact with your services.

  1. /Transfer : returns 200 OK for successful transfer, 400 Bad Request otherwise.

Error Response Codes:

  • BR001: Unauthorized User To The Account
  • BR002: Illegal transaction to same account
  • BR003: Sender account is not active
  • BR004: Receiver account is not active
  • BR005: Funds Insufficient

Json Request

acc_from: Sender account

acc_to: Receiver Account

amount: Amount to send

user_id: Sender account user id

{
  "acc_from" : 1000, 
  "acc_to" : 2000, 
  "amount" : 250, 
  "user_id" : 1 
}

Json Response

{
  "success" : false, 
  "error" : {
      "id" : "125ad45-cef122-237846-e1341234a",
      "code" : "BR001",
      "description" : "Unauthorized User To The Account"
  }
}

2 . /transactions/:trx_id : returns 200 OK with response body for successful get, 204 no content otherwise.

Path Param

trx_id: Transaction Id.

Json Response

[
    {
        "id": "04250760-ec2e-11e9-81b4-2a2ae2dbcce4",
        "acc_from": "1000",
        "acc_to": "2000",
        "amount": "20.000",
        "date": "2019-10-11 17:55:38.237447",
        "status": "SUCCESS",
        "remarks": "Remarks here"
    }
]

Testing

  • Unit Tests - your typical mocked tests

  • Integration Tests - run with the JavaLin context initialised

money-transfer-assignment's People

Contributors

ahmad-alk avatar

Stargazers

Shefeeque Mohammed avatar

Watchers

James Cloos avatar  avatar

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.