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.