Giter Club home page Giter Club logo

payroll's Introduction

Task

Implement an application that accepts a collection of shifts and outputs a payslip. Tooling, language and design is the choice of the implementor but it'd be reasonable to assume a command line executable or service endpoint or similar that takes an input and produces an output. It is not expected to produce a GUI for this task.

Whilst having the correct output is important, we are more interested in your approach to the solution.

Example Input

An example of the input looks like below: c

{
  "employee": {
    "name": "John Smith",
  },
  "wageLevels": {
    "1": "12.34",
    "3": "14.12"
  },
  "shifts": [
    {
      "start": "2019-06-27T12:00:00",
      "end": "2019-06-27T23:15:00",
      "wageLevel": "1",
      "breakStart": "2019-06-27T17:30:00",
      "breakDurationMinutes": "45"
    },
    {
      "start": "2019-06-28T08:00:00",
      "end": "2019-06-28T19:15:00",
      "wageLevel": "1"
    },
    {
      "start": "2019-06-29T11:00:00",
      "end": "2019-06-29T18:30:00",
      "wageLevel": "1"
    },
    {
      "start": "2019-06-30T12:00:00",
      "end": "2019-06-30T21:15:00",
      "wageLevel": "3",
      "breakStart": "2019-06-30T14:30:00",
      "breakDurationMinutes": "30"
    }
  ]
}

PaySlip Rules

  • For every hour worked the employee earns 1 hour of their base rate for the shifts wageLevel.
  • Employee's do not earn anything during breaks.
  • They earn an additional base loading of 25% for every hour worked.
  • For hours worked after 6pm from Monday to Friday the employee earns a loading of 30%.
  • Hours beyond 9 hours of work (excluding breaks) are considered overtime.
  • For hours worked as overtime the employee earns a loading of 75%.
  • For hours worked beyond 3 hours of overtime the employee earns a loading of 125%.
  • For hours worked on a Saturday the employee earns a loading of 50%.
  • For hours worked on a Sunday the employee earns a loading of 95%.
  • For overtime hours worked on a Sunday the employee earns a loading of 125%.
  • All loading values are absolute, not additive (e.g after 6pm Monday to Friday is 30%, not 25% + 30%).
  • Shifts won't ever span beyond a single day, you can ignore this scenario.

PaySlip format

  • The payslip should provide totals for the number of normal hours worked, number of overtime hours worked and total earnings.
  • For each shift, it should detail the amount of earnings, how many normal, after 6 and overtime hours were worked.
  • JSON, CSV, XML, Unit Test or simple text are valid outputs.

payroll's People

Watchers

Tim Lawrence 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.