Exercise 17: Fashion Design Studio
On this page
erDiagram
designer {
string name
string contact
int key PK "id_designer"
}
collection {
string title
string season
datetime release_date
decimal total_price
int key PK "id_collection"
int id_designer FK "id_designer"
int id_collection_state FK "id_collection_state"
}
garment_type {
string name
string label
string uuid
int key PK "id_garment_type"
}
garment {
string name
string material
decimal price
int key PK "id_garment"
int id_garment_type FK "id_garment_type"
int id_collection FK "id_collection"
int id_designer FK "id_designer"
}
collection_state {
string name
string label
string uuid
int key PK "id_collection_state"
}
garment_type one--many garment : has
collection_state one--many collection : has
garment one--many collection : part_of
designer one--many collection : creates
designer one--many garment : creates
Description
The property “name” in the table “collection_state” can have the values: “Planned”, “Released”, “Discontinued”.
This app manages fashion collections, garments, and designers. It tracks collections with details like title, season, release date, and total price, and associates them with a designer and collection state. Garments are linked to a collection, garment type, and designer. Designers are responsible for creating both collections and garments. The app organizes and connects designers, collections, and garments for efficient management of fashion lines.
The property “name” in the table “garment_type” can have the values: “Head”, “Body”, “Leggings”, “Shoes”.
In entities “garment_type” and “collection_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.
OBS: The value of the field “uuid” is generated automatically.
Tasks
designer/collection/garment/garment_type/collection_state: Add, Edit, Delete.
- When the collection is created, it will automatically become “Planned”.
- The field “Collection state” from entity “collection” will be read-only in edit view.
Create catalogs for all entities.
Create event listeners for tables that needs validations (e.g., adding a designer without a name, a garment without a type, etc., should not be allowed).
Add a new entity action at the collection level “Discontinue collection”:
- It will change the collection status from “Released” to “Discontinued”;
- A collection cannot be discontinued if it is in the “Planned” state → validation message.
- A collection cannot be discontinued if it is already in the “Discontinued” state → validation message.
Add a new entity action at the collection level “Release collection”:
- It can select a designer;
- After the release, the state will change from “Planned” → “Released”;
- A collection cannot be released if it is already in the “Released” state;
- If the collection doesn’t have all types of garments (Head, Body, Leggings, Shoes), it cannot be released and it will display an error through a validation;
- If the garments have different designers than the one selected, it will display an error through a validation;
- In collection, calculate the total price of garments and will update the property “total_price”.
Designer report: collection situation at designer level (total number of collections, total price).