Skip to content

Domain Documentation

hamed shirbandi edited this page Jan 19, 2022 · 40 revisions

Project subject

Customer wants an application to let people manage their tasks so people can freely register an account and define their tasks to manage them by the app. this is the whole of scenario that the customer told us: I need to first create an organization then create some projects in it, every project must have some boards and every boards can have some cards. I need to define my tasks in that cards and then move the tasks between them. I also need to add any other people to my account as team member to perform changes to the boards. Every member can leave a comment on the tasks and I need to people can see every activity for the tasks like moving between cards and so on.

Find some knowledge through Event Storming

Customer needs a Website to introduce the product and a User Panel for the main purpose of product to let people manage their tasks and needs an Admin Panel to manage whole data. We have found the following Entities and Behaviors and Rules through Event Storming. You can get more information about the domain by reading the following explanation about it. Also we prepared some ER diagrams to show the relations between entities but consider that it's not the design for Domain Model. It's just to get more knowledge about it.

Entities

Er-0

Owner

Owners are those want to use the app to manage their tasks. They must register at the first then can login and use the features. There are some important rules about owners:

  • First name, last name, phone number, password and email are required.
  • Email needs to validate.
  • Email uses as UserName to login.
  • Each owner can add organizations up to 5.
  • Owners can add another owner to their account as a team owner to have access to the boards and manage its tasks.
  • Owner can have team owners up to 10.
  • It doesn't need to have team definition. A team owner just refer to someone who has access to another owner's account but just to manage the tasks.
  • We can ban owners in admin panel so they cant get login.

Organization

Organization is top level category to hold the tasks. it can be a company name for example. It helps Owners who work in more than one company to manages their tasks separately so for managing tasks, the first thing is creating an organization. There are some important rules about organizations:

  • Name and OwnerOwnerId are required.
  • OwnerOwnerId is the identity of owner who created the organization.
  • Each organization can have up to 5 projects.
  • Owner can add/delete/update own organizations.

Project

Each organization can have some projects to categorize the tasks as a subcategory. It helps Owners who are engaged in more than one project in an organization to manages their tasks separately. There are some important rules about projects:

  • Name and OrganizationId are required.
  • Each project can have up to 4 boards.
  • Just organization owner can add/delete/update projects.

Board

Each Project can have some boards to categorize the tasks as a subcategory. For example if we work on a web application project we might have 3 boards for it like: Admin Panel, Web Site and UX. There are some important rules about boards:

  • Name and ProjectId are required.
  • Each board can have up to 4 cards.
  • Each board can have up to 10,000 tasks.
  • Just organization owner can add/delete/update boards.

Card

Each board can have some cards to categorize the tasks as a subcategory. For example in admin panel board we can have 3 cards like: to do, doing, done. There are some important rules about cards:

  • Name, Description, BoardId and Type are required.
  • Valid values for Type are ToDo, Doing, Done.
  • Each card can have up to 2000 tasks.
  • Just organization owner can add/delete/update cards.

Task

Each card can have some tasks and owners who have access to the boards can add new task to a card or move a task between cards. For example if we finished a task we can move it from Doing card to Done card. We need to have all changes history about task's current state and owner who made the changes on it. There are some important rules about tasks:

  • Name, Description, CardId are required.
  • Just organization owner can delete tasks.

Comment

Each task can have some comments created by board members. There are some important rules about Comment:

  • content and memberId is required.
  • Just board members can create comment on the tasks.

Activity

Each task can have some activities created by system through the task events. for example, creating the task is an activity and move it to another card is a new activity. There are some important rules about Activity:

  • name is required.

Er-1

Operator

Operators are admin panel users. They can manage all data about the app in admin panel. There are some important rules about operators:

  • First name, last name,Username, password and email are required.
  • Email needs to validate.
  • Operator can have some Roles.

Role

Role is used to specify admin panel operator's access level. There are some important rules about roles:

  • Name is required.
  • Role can have some Permissions.

Permission

Each permission refer to a feature in admin panel that operator can use it to do something. There are some important rules about permissions:

  • Name, SystemName and GroupName are required. Name is for display, SystemName is for using in the code as access filters and GroupName is just to categorize permissions to display.

Public Rules

This document is just for developers how want to know more about the domain and actually its not a complete and real domain documentation so when you check the code you can see any other rules out of this doc but you always can help us to make everything update. There are some public rules that must followed for each entity in the model:

  • Check null or empty for required items.
  • check input for string items to be valid. for example first name and last name must just contain alphabet chars.
  • Check input for email and phone number and so on items to be valid.
  • Prevent duplicate data. For example prevent to exist organization with same name for a owner.
  • Some logical rules that must be done by any clean coder. For example prevent to add data for a owner by another authorized owner.
  • ...

Attention

This is an open source project an some times it can have some differences between docs and the source so if you had a problem please tell us in issues or feel free to fix it by a pull request