Challenge for selecting Software engineers.
To complete this challenge you will need to:
- Fork this repository.
- Create an application.
- Implement CI pipeline.
They have been always here, but we have never seen them. This API will be used by the Human Air Forces to defend the world against the alian invasion.
The API needs to have three entities:
- Mothership {ship capacity: 9}
- Ship {crew member capacity: 5}
- CrewMember
Mothership has many ships. Ships has Mana CrewMembers.
- Given that the officer wants to add a mothership, when he adds a mothership, then the mothership will be created with three ships
- Given that the mothership was created, when the ship is created, then ship will create three crew members
- Given that the officer wants to add a ship to a mothership, when he sends which mother ship and how much ships he wants to add, then ships will be created with three crew members each one if the mothership contains less than 9 ships
- Given that the officer wants to remove a ship, when he tries he send which ship he wants to remove, then the ship will be removed along with all its crew members
- Given that the officer wants to add a crew member, when he sends the name of the member and the ship he wants to add, then the crew member is added if the ship contains less than 5 crew members
- When the officer tries to add more ships or crew members over the capacities, then an error is raised pointing out what is wrong
- Given that the officer wants to switch a crew member between the ships, when he sends the from_ship and the to_ship and the name of the crew member, then the action will be allowed only if the to_ship will not exceed the capacity
Complete the following checklist
- Remove duplicated or unnecessary code
- Avoid hardcoded values
- No unnecessary comments
- Unit test implemented checking custom behaviors and business rules
- API Documentation
- Action | route
- Description
- URL Parameters
- Request Params
- Request body
- Response body
- Status code