Git Product home page Git Product logo

gradle_springboot_microservice's Introduction

Microservice - Payslip

Build Status

Supports employees retrieving there payslip information.

Interface Specification

Individual Monthly Payslip

POST - /payslip/monthly/summary

This endpoint is used to return an employee payslip with is calculated with the income and month details provided.

Request Body

{
  "employee": {
    "firstName": "Sample",
    "lastName": "User"
  },
  "month": "JUNE",
  "income": {
    "gross": 60050,
    "superannuationPercentage": 9
  }
}

Response Body

{
  "employee": {
    "firstName": "Sample",
    "lastName": "User"
  },
  "month": "JUNE",
  "salary": {
    "gross": 5004,
    "net": 4082,
    "tax": 922,
    "superannuation": 450
  }
}

Group Monthly Payslip

POST - /payslip/monthly/summaries

This endpoint is used to return an array of employee payslip with is calculated with the income and month details provided.

Request Body

{
  "incomeSummaries": [{
    "employee": {
      "firstName": "Sample",
      "lastName": "User"
    },
    "month": "JUNE",
    "income": {
      "gross": 60050,
      "superannuationPercentage": 9
    }
  },
  {
    "employee": {
      "firstName": "Test",
      "lastName": "User"
    },
    "month": "JULY",
    "income": {
      "gross": 120000,
      "superannuationPercentage": 10
    }
  }]
}

Response Body

{
  "payslipSummaries": [
    {
      "employee": {
        "firstName": "Sample",
        "lastName": "User"
      },
      "month": "JUNE",
      "salary": {
        "gross": 5004,
        "net": 4082,
        "tax": 922,
        "superannuation": 450
      }
    },
    {
      "employee": {
        "firstName": "Test",
        "lastName": "User"
      },
      "month": "JULY",
      "salary": {
        "gross": 10000,
        "net": 7304,
        "tax": 2696,
        "superannuation": 1000
      }
    }
  ]
}

Group Monthly Payslip (Batch)

POST - /payslip/monthly/summaries/batch

This endpoint is used to return an csv of employee payslips with is calculated with the income and month details provided.

Request

This request must be sent as form-data. It expects it to be sent across with the key being 'file' and the value as File of type text/csv or application/csv.

Example Data

David,Rudd,60050,9,MARCH
Ryan,Chen,120000,10,MARCH

Response

This response will either return a attachment file of type text/csv

Example Data

David,Rudd,MARCH,5004,922,4082,450
Ryan,Chen,MARCH,10000,2696,7304,1000

Setup

The following is required to build:

  • gradle 2.14.1
  • Java 8 (Oracle)

Userful commands

Build

Run all unit and functional tests, and build a war file.

gradle build

Run the server stand alone

Useful during development. Needs to be manually restarted if the war changes.

gradle bootRun

Locally logs will come out in the build/logs directory. This is set using a system property in the build.gradle file. You can tail the log file when running to startServer to get consistent logging in your terminal.

Code Coverage

To get code coverage run the following command after your build.

gradle jacocoTestReport

Additional Information

Swagger

http://localhost:8080/v2/api-docs

http://localhost:8080/_admin/swagger/index.html

Donations

How you can help?

Any donations received will be able to assist me provide more blog entries and examples via GitHub, any contributions provided is greatly appreciated.

Thanks for your support.

paypal

gradle_springboot_microservice's People

Contributors

rob-leggett avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.