From 781f66188d78e9467ea549d395cde1c06bdb5a99 Mon Sep 17 00:00:00 2001 From: MarcUs7i <96580944+MarcUs7i@users.noreply.github.com> Date: Wed, 19 Mar 2025 21:30:51 +0100 Subject: [PATCH] Added PUML graphic --- scratch.puml | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 scratch.puml diff --git a/scratch.puml b/scratch.puml new file mode 100644 index 0000000..b14188c --- /dev/null +++ b/scratch.puml @@ -0,0 +1,78 @@ +@startuml +hide empty methods + +class Product { + +char Separator [const] + +string Invalid [const] + +string ProductName [readonly] + +string BarCode [readonly] + +string BarCode [readonly] + +{abstract} string[] CsvColumnNames + +{abstract}string[] CsvColumnValues + + +Product(string, string, int) + +string GetCsvHeader() + +string ToCsv() + +{static} string ToCsvLine(string[], char) + +{static} bool IsBarcodeValid() + +{static} T[] AppendToArray(T[], T) +} + +class Food extends Product { + -char AllergenSeparator [const] + -SortedSet Allergens [readonly] + +AllergenType[] Allergens + + +Food(string, string, int, AllergenType[]) + +string[] CsvColumnNames [override] + +string[] CsvColumnValues [override] + +bool AddAllergen(AllergenType + +bool RemoveAllergen(AllergenType) + +bool ContainsAnyAllergen(AllergenType[]) +} + +class NonFood extends Product { + -List Reviews [readonly] + +Review[] Reviews + +double? AverageRating + +string[] CsvColumnNames [override] + +string[] CsvColumnValues [override] + + +NonFood(string, string, int) + +AddReview(Review) +} + +class Review { + -DateTime Date [readonly] + -Rating Rating [readonly] + -string Comment [readonly] + +Review(DateTime, Rating, string) +} + +enum Rating { + OneStar + TwoStars + ThreeStars + FourStars + FiveStars +} + +enum AllergenType { + A + B + C + D + E + F + G + H + L + M + N + O + P + R +} + +NonFood -> Review +@enduml \ No newline at end of file