Here you'll find a short description and requirements for every part of the Domain reflected into the model
- gets valid session by its identifier
- returns all users data for the current company
- gets valid session by its identifier
- error if current user is not an admin
- error if password specified is not a valid one
- switches admin for the current user's company to the user referenced by id
- saves changed company
- gets valid session by its identifier
- error if current user is not an admin
- error if email provided is already registered in the system
- generates new random password of length 8 for the new user
- creates new non admin user account based on the email and name provided, password generated
- adds new user account to the current company
- saves the new user in the data storage
- sends an email for the new user with their login and password
- gets valid session by its identifier
- gets current user from the session
- error if provided current user's password is not valid
- error if new password provided twice is not repeated correctly
- changes current user's password
- saves the user in the data storage
- finds the subscription plan by its identifier in the data storage
- error if the plan is for some reason not found
- error if two passwords provided are not equal
- error if email is already registered in the system
- creates new user admin account based on the email, name and password provided
- creates company based on company name provided, new admin user and the subscription plan found
- saves the new company in the data storage
- sends a confirmation email to confirm the email address
- finds company by its identifier
- error if company isn't found
- activates company with the confirmation code given and security salt
- persists changes in the data storage
- finds user by email passed
- error if user is not found
- error if found user in is not activated
- checks if password is a valid one
- error if password is not valid
- starts new session for the user
- persists session in the data storage
- returns new session data
- gets valid session by its identifier
- removes session from data storage
- gets valid session by its identifier
- returns session data
- there is a way to retrieve a valid session by its id
- finds session by its id
- error if session isn't found
- error if session isn't valid
- refreshes session
- persists changes
- returns session
- has a secure unique identifier, string of 32 random characters, used to refer it
- there is a way to find out a session identifier
- there is a way to find out whether a session is valid or not
- session stays valid for one day since it was last used
- has last used time, the time when it was created or used last time.
- there is a way to prolong session being valid.
- is associated with the user who started the session
- there is a way to find out the user who started the session
- has a unique identifier for reference
- has a name
- has a valid email
- has a password set on creation
- may be either admin or not admin (admin has some special privileges)
- is not admin by default
- there is a way to define whether a user is an admin or not
- there is a way to find out user email
- there is a way to find out user unique identifier
- there is a way to find out user name
- there is a way to find out whether a user is activated
- user is considered activated if the company they're in is activated
- there is a way to set a password
- not shorter than 6 characters, hashed
- belongs to a single company
- there is a way to revoke admin rights from a user
- error if the user is not an admin
- there is a way to grant a user administrative permissions
- error if the user is already an admin
- has a unique identifier for reference
- has a not empty name
- has an associated subscription plan
- has at least one user and that user must be an administrator
- may be either activated or not activated
- is not activated by default
- has a collection of users belonging to it
- there is a way to calculate the code required for company registration confirmation
- to calculate the code security salt is required
- code is a hash function from company id, security salt and company name
- may be activated with a confirmation code and security salt
- error if attempt to activate an already activated company
- error if confirmation code is not valid
- activates company
- there is a way to figure out whether a company is activated
- there is a way to figure out who's the administrator of a company
- there is a way define a company's unique identifier
- there is a way to add a user to a company
- error if user is admin
- error if users limit for the company subscription is reached
- associates user with the company
- adds user to the collection of users belonging to it
- there is a way to switch administrator for the company to a user referenced by id
- error if the user referenced by id is not a member of the company
- removes admin rights from the current user
- grants admin privileges to the new user
- there is a way to get all company's users
- has a unique identifier for reference
- has a name
- has a certain number of users allowed
- has a certain number of clients allowed
- there is a way to get users limit
- there is a way to get clients limit