MySQL database schema for role system

We are developing a platform for NGOs ( N ) to carry out their work through individual volunteers ( V ) or volunteers through the company ( C )

NGOs

  • An NGO can register for an account and create a profile.
  • He creates the Jobs (jobs in which he needs help from volunteers), to which Individual Volunteers or the Company (a Subgroup of their Employees who are registered as Volunteers in the system) can apply.
  • An NGO can check the candidate profile and previous work history and accept the application. Upon acceptance, they become members of the Activity.
  • Here, while they work at regular intervals, they say that 2 weeks they should enter the number of hours that they have contributed to this particular activity.
  • The NGO must confirm this time so that it can reflect in the profile of volunteers as a loan

Company

  • Company registration for the profile.
  • He uploads a list of all his employees in a specific formatted CSV file to add volunteers against himself or send an invitation link to ask his employees to register. If employees already exist in the system, we will send an email asking you to confirm the company’s approval.
  • A company can search for a specific Task and apply it by selecting all its employees or a subset.
  • While checking the time for the work done can be done in two ways. 1 A company can centrally say that V1 V2 V3 completed 2 hours 3 hours and 2 hours and sent for verification to an NGO or allowed each of its employees to process this manually and allow them to send it.

Where do I need help?

I created NGOs and individual volunteer relationships. I am confused about how to use the same tables, but allow the creation of a new organization, such as a company, between an NGO and a volunteer, and manage the time management and the management of activities.

The validity of time is very important because it will be used to show that in the Social Capital Base of NGOs, the Company, as well as volunteers (Individual work, as well as Work for a reason through the company)

I created the ER diagram below for an NGO and volunteer and you need to create a part of it.

enter image description here Link: http://i.stack.imgur.com/OMY21.png

+4
source share
1 answer

I'm not sure if you need to change your circuit much or even in general. Your circuit requires an application to work with it in order to do anything - you cannot implement all the logic here - some of them will be in your application.

As I understand it, your specification says that all actual volunteer work is done by people, some of which may be related to the company, and some not. Your circuit fixes this already.

That is almost all you need, I think. When you speak:

While the verification time for the work done can be done in two ways. 1 A company can centrally say that V1 V2 V3 was completed 2 hours 3 hours and 2 hours and sent for validation from NGOs or allowed each of its employees to process this manually and allow them to send it.

This has already been considered - each individual enters their own work records or the application allows the company to do this for them, and then the NGO checks these records in the same way, regardless of who introduced them.

I created NGOs and individual volunteer relationships. I am confused about how to use the same tables, but allow the creation of a new organization, such as a company, between an NGO and a volunteer, and manage the time management and the management of activities.

Let's look at a processed example to illustrate both use cases, to make sure everything is covered:

Working examples

Individual, not company

Individuals sign up, creating a row in the volunteers table. They register for activity by creating a row in the ngo_activity_applications table.

The NGO approves them by creating a row in the ngo_activity_members table - and either deleting a row in the ngo_activity_applications table or changing its status - specification. dont clear.

A person does some work and registers time in the application, creating rows in the ngo_activity_time_validations table.

The NGO checks the work done somehow, and then reports the application to it. This, apparently, changes the status of the rows in the ngo_activity_time_validations table and creates a single summary row or the corresponding rows in the volunteer_validated_times table. Spec is unclear where cost_per_hour from?

Company

The company signs and uploads a CSV file with 3 volunteers. This creates a row in the companies table plus three rows in the volunteers table and 3 rows in the company_volunteers binding company_volunteers .

Volunteer 1 subscribes to an individual activity, and everything happens as described above.

The company subscribes to other activities and volunteers of all three people on whom it works. This creates 3 rows in the ngo_activity_applications table.

The NGO approves all three by creating three new rows in the ngo_activity_members table - and either deleting rows in the ngo_activity_applications table or changing their status - specification. dont clear.

Volunteers do some work, and the company records the time in the application on behalf of the volunteers of companies 1 and 2, and Volunteer 3 records its time:

Volunteers of companies 1 and 2 The company uses the application to register time on their behalf - creating 2 rows in the table ngo_activity_time_validations .

Volunteer 3 Company Volunteer 3 uses an application to register its time - creating a row in the ngo_activity_time_validations table.

The NGO checks the work done somehow, and then reports the application to it. This, apparently, changes the status of the rows in the ngo_activity_time_validations table and creates a single summary row or the corresponding rows in the volunteer_validated_times table. Spec is unclear where cost_per_hour from?

Summary

You can find out how much time is checked, how many people have registered by querying the volunteer_validated_times JOIN ed table in the volunteers table. You can also find out how much time has been verified by any company by completing the same query, but also by joining the company_volunteers table.

Possible changes and questions:

You might want to add the company_entered flag to the company_entered table ngp_activity_time_validations that you can distinguish between entries entered by individuals and entries entered by a company on behalf of individuals. You can also add the identifier of the person who makes the entry in this table if the logging is related to your application.

You might want to add the hourly_rate column to the volunteers table to use cost_per_hour by default when creating rows in the volunteer_validated_times table.

+3
source

Source: https://habr.com/ru/post/1481623/


All Articles