Kodall
Exercises

Exercise 3: Pet Clinic

Rendering diagram...

Description

  • Create an application for managing services within a pet clinic. The application should keep track of services, registered animals for appointments, and their owners.
  • An animal is identified by breed, birth date, weight, sex, and an owner. An owner can have multiple animals.
  • The assistant should see all available appointments and prices for each service, as well as the state of each appointment.
  • Before finalizing an appointment registration, the application should check availability based on date and time. The appointment is finalized by converting it into a consultation.
  • The property "name" in the table "appointment_state" can have the values: "Pending", "Processed" and "Canceled".
  • In entity "appointment_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.
  • Note: The value of the field "uuid" is generated automatically.

Tasks

  • service/appointment_state/appointment/consultation/owner/animal: Add, Edit, Delete.
    • When the appointment is created, it will automatically become "Pending".
    • The field "Appointment state" from entity "appointment" will be read-only in edit view.
  • Create a catalog for entities: "appointment_state", "appointment", "service", "owner" and "animal".
  • Create event listeners for tables that needs validations (e.g., adding a service without a name, animal without breed, etc., should not be allowed).
  • Check if a new appointment is available at a specific time. It should not overlap with an existing one, if it does overlap → validation message.
  • Add a new entity action at the appointment level "Cancel appointment”:
    • It will change the appointment state to "Canceled";
    • An appointment cannot be canceled if it is in the "Processed" state → validation message;
    • An appointment cannot be canceled if it is already in the "Canceled" state → validation message.
  • Add a new entity action at the appointment level "Generate consultation":
    • First check if a consultation has already been generated from the same appointment, if it was → validation message;
    • After creating the consultation, the appointment will have the "Processed" state;
    • It can't be generated if it is "Canceled" → validation message;
  • Owner report: situation of owners (total number of animals, contact details).
  • Animal report: situation of animals (total number of consultations and details per animal).