As a user
I want to add people to my household
in order to share my planner within the app
Description
Acceptance criteria
implement functionality to add people to the user's household.
ensure added individuals become part of the user's planner within the app
Tasks
[x] add to profile/friends/[id].js an add to household button, the user should receive a message
[x] switch to settings.js and implement a Household Component
[x] it renders a modal which pops up if click`n.
[x] in that modal you can scroll throw your friends and add them to your household
[x] after clicking you will be asked which planer should be default. you have to confirm the answer after that the information of the not confirms person will be deleted and gets a reference to the "householdOwner", if not the other person should get a notification
[x] you can choose the role of each household member, like "just look" or "edit rights"
[x] the component renders the names of your members and an edit button, which can also delete people from your household
[x] create a new household schema containing name, owner, members with ID and role, shopping list, calendar, default weekdays enabled setting, default number of serving setting, hascooked?
[x] update user schema to contain a list of households, activeHousehold, and populate the active household in the user API route
[x] update the next of API route to create a household associated with the user when creating a user for the first time. The default name for a new household should be the users name+"'s household".
[x] change all existing functions - calendar, shopping list and suitable settings - to utilize user.activeHousehold while checking the user role to only display contents or also allow changes
-does making changes in the populated activehousehold property directly effect the original household item in the database??
[x] in the settings page create a component to switch the active household. It should display all households that the user is a member of including the one he owns. Display the households by their name and save the ID of the selected household as activeHousehold in the users settings in the database
[x] change logic to add invited user to members array first
[x] ...and then delete it from recipient side when not wanted
[x] create component to rename household
[x] create a component for role management of household members
[x] restrict access to sensitive functions and settings for non admins- or owners: settings, assign Recipe to Calendar, Calendar-page functions, Shoppinglist functions
[x] change API to only allow users with role owner or admin to change household
[x] merge main into branch and make sure everything works with the changes shoppinglist data structure and functions
[x] check if handleItemEdit (plan) works
[x] check and fix functions to add user to and remove from household
[x] add styling
[x] convert existing users to new data structure while maintaining as much data as possible
Value proposition
As a user I want to add people to my household in order to share my planner within the app
Description
Acceptance criteria
Tasks
profile/friends/[id].js
an add to household button, the user should receive a messagesettings.js
and implement a Household Component