Added PUML graphic

This commit is contained in:
MarcUs7i 2025-03-19 21:30:51 +01:00
parent 2678312152
commit 781f66188d

78
scratch.puml Normal file
View file

@ -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<AllergenType> 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<Review> 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