@startuml
'https://plantuml.com/class-diagram
!pragma layout smetana

Package User{
class Account
class AccountUsers
class AccountHandler
class User

'Label on relations
Account <|-- AccountUsers
AccountHandler *-- Account
AccountUsers *-- User

'Methods and attributes
Account : - String mail;
Account : - String password;
Account : + void getMail();
Account : + void getPassword();

AccountUsers : - User[] userNames = new User [5]];
AccountUsers : + void createUser();
AccountUsers : + void deleteUser();

AccountHandler : + void login();
AccountHandler : + void createAccount();
AccountHandler : - Set<Account> accounts;
AccountHandler : - void chooseName();
AccountHandler : - void createName();

User : - String name;
User : - int age;
User : + User(String name, int age);
User : + String getName();
User : + int getAge();

}

Package Mealplan{
class Mealplan
Mealplan : - HashMap<Date, Recipe> ListOfMeals
Mealplan : + Mealplan(HashMap<Date, DailyMealplan> ListOfMeals)

class DailyMealplan
DailyMealplan : - Recipe dinner
DailyMealplan : - Recipe lunch
DailyMealplan : - Recipe breakfast
DailyMealplan : + DailyMealplan(Recipe dinner)
DailyMealplan : + DailyMealplan(Recipe dinner, Recipe lunch)
DailyMealplan : + DailyMealplan(Recipe breakfast, Recipe lunch, Recipe dinner)

class Recipe
Recipe : - String title
Recipe : - int prepTime
Recipe : - HashMap<Ingredient i, double amount>
Recipe : Recipe(String title, int time, HashMap<Ingredient i, double amount>)

class Ingredient
Ingredient : - String name
Ingredient : - String category
Ingredient : - HashMap<String nutrition, double content>

class Grocerylist
Grocerylist : HashSet<Ingredient> list

'Label on relations
Mealplan "1" *-- "has 1..many" DailyMealplan
DailyMealplan "1" *-- "has 1..3" Recipe
Recipe *-- Ingredient
Grocerylist *-- Ingredient
}

Package Filters{
class Diet
'behøves felter vedr. diæt typer?
'Diet : - String lowCarb;
'Diet : - String keto;

Diet : + Set<Recipe> getDietType(String dietType);
Diet : + Set<Recipe> getAllergies(String allergiesOf);
'evt i fremtiden en liste hvor begge kriterier indgår

class Recommendation
Recommendation : + Set<Recipe> getRandomRecipe();
Recommendation : + Set<Recipe> getRandomRecipe(String dontLike);

class FoodHandler
FoodHandler : - List<Ingredient> ownRecipe;
FoodHandler : + addIngredientsToList();
FoodHandler : + removeIngredientFromList();

}



Package Utility{
'class IO
class UI
interface DBConnector
class DBUser
class DBRecipe
class DBIngredients


UI : - Scanner scan = new Scanner(System.in);
UI : + void displayMessage(String msg);
UI : + String getInput(String msg);

DBConnector : - DBPassword;
DBConnector : - static final String DB_URL;
DBConnector : - static final String USER;
DBConnector : + void saveData();
DBConnector : + Set<Object> readData();

DBUser : + void saveData(String username, password)
DBUser : + Set<User> readUserData();

DBRecipe : + Set<Recipe> readRecipe();
DBRecipe : + void saveData(Recipe dinner);

DBIngredients : + Set<Ingredient> readRecipe();
DBIngredients : + void saveData(Ingredients ingredient);

}


'Label on relations
DBConnector <|-- DBUser
DBConnector <|-- DBRecipe
DBConnector <|-- DBIngredients

'User *-- Grocerylist
'Recipe *-- Diet
'Recipe *-- DBConnector
'Ingredient *-- DBConnector
@enduml