The property “name” in the table “mission_state” can have the values: "Planned", "Active", "Completed", "Canceled".
This app manages space missions by tracking details such as mission objectives, budget, dates, and spacecraft. It stores astronaut profiles, including their nationality, and assigns them to specific missions. The app also monitors the usage of spacecraft and the current status of missions (e.g., planned, in progress, or completed).
In entities "mission_state" and "nationality", name represents the state that will be displayed on the screen, label represents the value that programmer will use to filter the states, and the uuid represents a value to distinguish the states.
Note: The value of the field "uuid" is generated automatically.
When the mission is created, it will automatically become "Planned".
When a spacecraft is created, it will automatically set property "used" with value 0 (false), meaning that it is not used in any mission yet.
The field "Mission state" from entity "mission" will be read-only in edit view.
Create catalogs for entities: "mission_state", "spacecraft", "nationality", "astronaut" and "mission".
Create event listeners for tables that needs validations (e.g., adding an astronaut without a name, mission without title, etc., should not be allowed).
Add a new entity action at the mission level "Initiate mission":
First check if the mission has already been initiated (it has the "Active" status), if it does → validation message;
A mission must have at least one astronaut, if it doesn't → validation message;
After the initiation of the mission, the state will change from "Planned" → "Active";
The value of property "used" will become 1 (true);
If the mission is initiated and the spacecraft selected for it has its used property set to 1 (meaning it's already in use by another mission) → validation message.
Add a new entity action at the mission level “Cancel mission”, that will change the mission status to "Canceled":
A mission cannot be canceled if it is in the "Completed" state → validation message.
A mission cannot be canceled if it is already in the "Canceled" state → validation message.
Add a new entity action at the mission level "Complete mission":
It can't be completed if it is in the "Planned" state;
It can't be completed if it is in the "Canceled" state;
It can't be completed if it is already in the "Completed" state;
It will set the property "used" from spacecraft that utilizes to 0 (meaning is free to use).
Astronaut report: mission situation at astronaut level (total number of missions, budget value).
Spacecraft report: mission situation at spacecraft level (total number of missions, budget value).
Mission report: astronaut situation at mission level ( total number of astronauts, budget value).