Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor apartment and user registration workflow #478

Open
vladyslavyarets opened this issue Aug 3, 2022 · 0 comments
Open

Refactor apartment and user registration workflow #478

vladyslavyarets opened this issue Aug 3, 2022 · 0 comments
Labels
Epic Epic

Comments

@vladyslavyarets
Copy link
Contributor

vladyslavyarets commented Aug 3, 2022

Apartment

Description:

For correct process of cooperation workflow there required for all apartments in the cooperation should be filled. Every apartment should have all ownerships filled. So, for correct apartment registration required following payload:

{
  "number": "15",
  "area": 75.28,
  "ownerships": [
    {
      "type": "person",
      "first_name": "Ivan",
      "last_name": "Ivanov",
      "middle_name": "Ivanovich",
      "ovnership_part": 0.3
    },
    {
      "type": "legal_entity"
      "name": "Company Inc.",
      "edrpou": "12345678",
      "ovnership_part": 0.7
    }
  ]
}

New field ownerships(array) required. There 2 types of ownership can exist. person - is a physical user or non-legal-entity user, human. legal_entity - in this case owner can be a not physical person but legal entity. Due to this there different required fields in every case:

  • for person:
    • first_name - string
    • last_name - string
    • middle_name - string
  • for legal_entity:
    • name - string (official legal entity name)
    • edrpou - integer (unique identifier of this entity according to registration documents)

Required field for every ownership:

  • type - string (type of ownership person or legal_entity)
  • ownership_part - string (numeric coefficient of part of property owning). Constraint: Sum of all ownership parts for one apartment should be exactly 1.

Tasks:

  1. Change OpenApi specification due to requirements described above.

  2. Change Service workflow. Now users should be created in the Database during apartment creation by information contains in ownership part. This new user should be created as disabled and contains following information: first name, middle, name, last name if this is person registered or name and edrpou if this owner is legal_entity.

  3. Rewrite api tests due to new logic


User

Description

Every user in our application should be an owner of some apartment. Once apartment created it should already have a list of ownerships (see ticket #478). Important user information as full name should be filled by cooperation admin during apartment creation. In this way during registration process user should not change it. There 2 types of owners can be created. Person and New workflow depends with other steps:

  • Cooperation admin crates apartment where filled users information. User's information with data saves into Database
  • After this by owner request cooperation admin can create invitation for user by concrete email. During this process registration token generates and sends to user with email

If user is a person:

  • user set the following fields: registration token, email, password and phone number.

If user is a legal_state:

  • user set all fields for a person and his full name.

  • After user confirm registration and there is no exception situations user record into Database updates and user becomes active

Tasks:

  1. Rewrite OpenApi specification due to new model. Example of required payload present below:

For person:

{
  "user_id": 4
  "registration_token": "7b3a32f0-1326-11ed-b2e2-b51ca8f90a82",
  "email": "[email protected]",
  "password": "Passw0rd",
  "phone_number": 380501112233
}

For legal_state user:

{
  "user_id": 4
  "registration_token": "7b3a32f0-1326-11ed-b2e2-b51ca8f90a82",
  "email": "[email protected]",
  "password": "Passw0rd",
  "phone_number": 380501112233
}
  1. Rewrite service layer due to new logic.

  2. Optimize user' contact information storage in the database

  3. Rewrite api tests due to new logic


Versioning workflow

  1. Create feature/Issue#478... from dev

  2. Create feature/Issue#482... from branch Refactor apartment and user registration workflow #478

3.1. Create feature/Issue#480... from branch #482 and implement task. Merge into #482 branch

3.2. Create feature/Issue#481... from branch #482 and implement task. Merge into #482 branch

  1. Close Issue Release testing instance of application #482 and merge it in branch Refactor apartment and user registration workflow #478

5.1. Create new branch from #478 for implementing new service logic for user and apartment registration and merge it back

5.2. Create new branch from #478 and cover all new logic with api tests and change tests already created and merge it back

  1. Test all functionality manually and merge branch Refactor apartment and user registration workflow #478 into dev
@vladyslavyarets vladyslavyarets added the Epic Epic label Aug 3, 2022
@vladyslavyarets vladyslavyarets changed the title Refactor apartment registration workflow Refactor apartment and user registration workflow Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic Epic
Projects
None yet
Development

No branches or pull requests

1 participant