In this exercise we will evaluate:
- How do you usually code: style, consistency, etc.
- Efficiency and suitability of the idea
- Software architecture and maintainability
The company "Helados PΓ©rez" is using an old software called "NominaPro" to calculate its payslips. They have a big problem, it is that, they can not modify the IRPF of their payroll.
They are beginning to integrate with Rollbox and we have decided to develop an independent software that can recover and simulate your payslips.
So, from Rollbox we want to develop a public API to report a list of payslips. In addition, we can modify the IRPF of these payslips.
For this, we have a data file, which is hosted on a remote server and contains a payslip report.
The composition of the file is:Β
- The name of the file will follow a pattern
payslips.YYYYMM.txt
where Y's represent the year (i.e: 2018) and M's represent the month (Example: 01) - Each line represents a payslip
- Each line will keep the following structure:
- 12 chars π ID
- 9 chars π Vat
- 8 chars π Date (Format:
YYYYMMDD
) - 8 chars π Gross (6 integers + 2 decimals)
- 4 chars π % Deductions (2 integers + 2 decimals)
- 8 chars π Amount of deductions (6 integers + 2 decimals)
- 4 chars π % IRPF (2 integers + 2 decimals)
- 8 chars π Amount IRPF (6 integers + 2 decimals)
- 8 chars π Net (6 integers + 2 decimals)
The file should be retrieved from: https://gist.githubusercontent.com/rodrigm/bf42bf2aa0f1d17381b412a3ffec7fd9/raw/201abd5ec86f60ec63025c885751ba55cdceb720/payslips.201812.txt
. This is the unique file that we have in the server at this moment.
- We require a
GET
endpoint that allows us to recover all the payroll extracted for a month and year. - We need a
PUT
endpoint that allows us to modify the % of IRPF for the payrolls of a month and year. Further, all fields of the payslips should be correctly calculated/updated.
To solve the exercise, you can use the most comfortable language and framework for you.