Kodall
Exercises

Exercise 9: Music Festival

Rendering diagram...

Description

  • The property "name" in the table "performance_state" can have the values: "Scheduled", "Ongoing", "Completed" and "Canceled".
  • The property "name" in the table "time_units" can have the values: "Minutes" and "Hours".
  • In entities "time_units" and "performance_state", 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.
  • A performer performs at a festival in the time interval "start_date" and "end_date" of the festival.
  • The value of the field "total_cost" from the entity "festival" is the sum of the cost for every performer that performed in that festival.
  • Note: The value of the field "uuid" is generated automatically.

Tasks

  • performer/performer_festival/time_units/festival_state/festival/ticket/customer: Add, Edit, Delete.
    • When the performance is created, it will automatically become "Scheduled".
    • The field "Festival state" from entity "festival" will be read-only in edit view.
  • Create a catalog for entities: "festival_state", "festival", "performer", "ticket", "time_units", and "customer".
  • Create event listeners for tables that needs validations (e.g., adding a performer without a name, festival without title, etc., should not be allowed).
  • Check if the performer is occupied in the time interval of a festival (if he is at another festival in that interval), if he is → validation message.
    • To calculate when the performer ends his performance at a festival, use datetime→plusMinutes(dateStart, duration) and datetime→plusHours(dateStart, duration).
  • Check if "total_cost" of the festival is higher than the sum of total tickets price and festival's budget, if it is → validation message;
  • Add an entity action at the fesival level "Start festival":
    • First check if the festival has already been started (it already has the "Ongoing" state), if it was → validation message;
    • It will change the status from "Scheduled" → "Ongoing";
    • A festival cannot start if it is in the "Canceled" or "Completed" state → validation message.
  • Add a new entity action at the festival level “Cancel festival”:
    • It will change the festival status to "Canceled";
    • A festival cannot be canceled if it is in the "Ongoing" or "Completed" state → validation message;
    • A festival cannot be canceled if it is already in the "Canceled" state → validation message.
  • Add a new entity action at the festival level "Complete festival":
    • It will change the festival status from "Ongoing" → "Completed";
    • It can't be completed if it has the status "Scheduled" or "Canceled" → validation message;
    • If it is already in "Completed" state → validation message.
  • Performer report: festival situation at performer level (total number of festivals, ticket value).
  • Ticket report: festival situation at ticket level (total number of festivals, ticket value, total number tickets).
  • Customer report: total number of festivals, ticket value.