Welcome to ACME acounting, this codebase serves as a way for you to know how we at OSOME work and how you work through challenges while adopting an existing codebase.
There are 3 tasks that you need to do to complete this task, all of them must be done for you to move forward.
Keep things elegant, but as simple as possible.
If there are any issues, contact your hiring representative and they will clarify it with you.
If you are to use AI/LLM, DISCLOSE where and how you used it.
We have companies
, companies have users
.
Every user has a role
, which defines what this user does in the
company. There might be multiple users with the same role.
We create tickets
in a company and assign them to users.
Every ticket has
- Type - defines the work that should be done by the user
- Single assignee - the user
- Category - every type is under a particular category
- Status - open or resolved
Endpoints
GET api/v1/tickets
- returns all tickets in the system. Without pagination. This is only for creating logic testing.POST api/v1/tickets
- creates a ticket. It acceptstype
andcompanyId
GET api/v1/report
- starts the processing of existing data and builds a report.
Ticket Creation Rules
If a ticket type is managementReport
, then the ticket category
should be accounting
. The assignee is a user with the role = Accountant
.
If there are multiple accountants in the company,
take the most recently created one.
If a ticket type is registrationAddressChange
, then the ticket category
should be Corporate
. Assignee is a user with the role Corporate secretary
.
If there are multiple secretaries, throw an error.
If we cannot find an assignee with the required role, throw an error.
Before working on tasks please clone the repo to your own GitHub account
When done commit the changes and create a PR for the changes in YOUR OWN repository. Send us a link for review.
This service is old, new business requirements have come in and it requires us to change the internals of the service.
Let's generate with fixing the behaviour of the service.
Instructions
- When creating a
registrationAddressChange
ticket, if the company already has a ticket with this type, throw a duplication error. - Add a new
Director
user role. If we create aregistrationAddressChange
ticket, and we cannot find a corporate secretary, assign it to theDirector
. If there are multiple directors, throw an error.
It seems that companies are closing down more than usual, we never considered this case before. Maybe it's time to add another type of ticket.
Instructions
- Create New Ticket Type
{ "type": "strikeOff", "Category": "Management", "Assignee": "Director" }