- Рефакторинг: апи, логика и доступ к данным разнесены на разные уровни
- Вынес настройки в appsettings
- Оптимизации: уменьшил количество запросов в базу, распараллелил запросы к сторонним сервисам (бухгалтерия, зарплаты)
- Для упрощения разработки обновил среду исполнения на net8
- Переделал логику по составлению отчёта. Ориентировался на пример формата из README, а не на старую логику в коде
- Постарался исправить описанные в README ошибки
- Над отловом непредвиденных ошибок (не видно сервис, отвалились по таймауту и тп) не корпел
- Добавил в компоуз базу, но сервисы бухгалтерии и зарплат мокать в компоузе уже поленился. Если есть настроенная среда, их будет легко добавить на компе проверяющего. Конфиги для подключения к сервисам указываются в appsettings
- Добавил микротестик для проверки формата генерируемого отчёта
Imagine you're asked to fix a report service that was originally built by a now-departed developer.
All you know about the service is that it’s supposed to generate an accounting report for a selected month,
listing all employees of the company. The report service has no other functionality.
January 2017
| Name | Salary |
|---|---|
| Andrew Barnes | 2,200 € |
| Gregory Evans | 2,000 € |
| Jacob Smith | 2,500 € |
| Alex Ryan | 2,700 € |
Department Total: 9,400 €
| Name | Salary |
|---|---|
| William Johnson | 1,800 € |
| Damian Carter | 2,000 € |
| Michael Anderson | 1,500 € |
Department Total: 5,300 €
| Name | Salary |
|---|---|
| Philip Rogers | 2,700 € |
| Dmitry Collins | 3,500 € |
| Andrew Miller | 3,200 € |
| Arvid Nelson | 3,500 € |
Department Total: 12,900 €
The report service is already in production but behaves very unreliably. At some point, it stopped working altogether.
Your task is to bring the report service back to life, fix known bugs, and clean up the project,
as the previous developer was not very tidy in their work.
The list of employees by department can be retrieved from the
employeedatabase.
An employee’s monthly salary can be obtained from the accounting department’s web service,
but you must provide it with the employee code from the HR service.
- Sometimes the system does not return the report and instead throws an error
- It is very slow
- Not all employees appear in the report
- The “Company Total” line is missing
- Revive the report service
- Fix all known issues
- Refactor and organize the codebase
- Add automated tests to avoid future breakdowns
⚠️ You don't have access to the real database or web services, since the information is strictly confidential.
Mocks or stubs should be used for testing and development.