Git Product home page Git Product logo

income-service's Introduction

income-service

About The Project

Terms

  1. A regular amount consists of a frequency and amount. Regular amounts are used to collect the value of regular payments or income for a citizen.
  2. A frequency defines a regular interval at which a payment is made or income received. Frequency may be one of:
    • WEEK
    • TWO_WEEK
    • FOUR_WEEK
    • MONTH
    • QUARTER
    • YEAR
  3. An amount contains a value of pounds and pence entered as a String with an optional decimal point. Assume that amount is being validated by a different JSR-303 annotation.

Requirements

  1. Create a JSR-303 annotation and associated ConstraintValidator
  2. Annotation must validate a regular amount instance:
    • If frequency is a multiple of a week, monetary amount must be divisible to a weekly value that is a whole number of pence.
  3. The annotation should not require knowledge of the specific value to be entered, only that it may be divided exactly to a weekly value, when entered at a multiple of one week frequency.

Running the application locally

  • Download the zip or clone the Git repository. Unzip the zip file (if you downloaded one)
  • Open Command Prompt and Change directory (cd) to folder containing pom.xml and run the command to install all the dependencies
mvn clean install

To run in local

mvn clean spring-boot:run

After this you can access the application from following url: POST http://localhost:8000/api/v1/income

Request Body: { "frequency": "QUARTER", "amount": "100" }

Success Response: 200 OK "Success"

Error Response: 400 Bad Request { "errors": [ { "code": "BAD_REQUEST", "message": "Invalid Amount! Not a whole number." } ] }

income-service's People

Contributors

gauravbhambhanineom avatar gaurav4083 avatar

Watchers

 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.