Giter Club home page Giter Club logo

go-payroll's Introduction

Payroll application

External Dependencies

The following are required to build the project

  • golang-migrate
  • postgres@13
  • make

Running the application

  • run make to compile the code
  • run make migrate_up
  • to put some data in the database run make database_seed
  • All the variables can be overridden with make to ensure you can connect to the database
  • source ./scripts/dbcredentials.sh this is a best guess at database credentials

Endpoints

  • GET api/payroll?userid=<int>&month=<int>
  • POST api/payroll requires a payload of: {"forename": <string>, "surname": <string>, "grossSalary": <F64>, "countryCode": <int>}

Country Codes

  • Italy: 1
  • France: 2

Limitations

  • You can get one month at a time for a person, not all months of the year
  • Cannot add anymore countries (well you can with SQL, but not through the API)
  • Real / Future payroll is not handled whatsoever (would be done predicated on the month)
  • I have not used an ORM, mainly due to my unfamiliarity with golang's ecosphere
  • There are absolutely no tests, though things have been setup in a way that would make testing fairly straight forward

Payroll Challenge

Each employee has a yearly gross salary, and on top of that, the company can give a net monthly bonus at his discretion.

Pento is a multinational corporation based in Italy, and it is expanding in France, and the employee can be hired only in one of those two countries, to calculate the net salary each of the countries has a different process:

Italy:
    The employee has 14 salaries per year; August and December have an extra salary
    The employee pays 25% of taxes
    The employee pays 7% for the national health insurance
France:
    The employee has 12 salaries per year
    The employee pays 30% of taxes
    The employee does not pay for a national health insurance

Have a payroll summary each month for every employee with the gross/net salary breakdown.

Keep in mind that there are two kinds of payrolls current/past payrolls named "Real Payroll" and future payrolls named "Future Preview".

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.