You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In it's current form, the frontend fetches all reviews per job and computes the average on render [side eye embarrassed emoji]. As half of cooper was at the beginning of the semester, this is an artifact of me creating some usable prototype for our first showcase.
We will move forward by storing the average / total statistics in the database.
For example, if we want to show the average overall rating for a job, we will keep a "running average" in the Roles table.
The first subtask of this epic is to update the database schema. We want to keep running averages for the RolesandCompanies tables. Take a look at the schema for Reviews and see what values are added when somebody creates a Review. These will be precisely the ones we add to the Roles and Companies tables.
The next subtask of this epic is to update these new values in the Roles and Companies tables when Reviews are 1) Added, 2) Updated, and 3) Deleted. We will need to update all three at once. One way we can ensure they are all added at once are using drizzle transactions. These operate on an "all or nothing" basis, so we can make sure the actual review averages and the values stored in the Roles and Companies tables stay in sync.
When we do this we will most likely need to wipe the database of all its reviews to make sure the running averages are actually in-line with the actual review averages.
Conditions of Satisfaction:
Schema captures all necessary 'aggregatable' data
API updates all three tables at once xor all fail at once
The text was updated successfully, but these errors were encountered:
In it's current form, the frontend fetches all reviews per job and computes the average on render [side eye embarrassed emoji]. As half of cooper was at the beginning of the semester, this is an artifact of me creating some usable prototype for our first showcase.
We will move forward by storing the average / total statistics in the database.
For example, if we want to show the average overall rating for a job, we will keep a "running average" in the
Roles
table.The first subtask of this epic is to update the database schema. We want to keep running averages for the
Roles
andCompanies
tables. Take a look at the schema forReviews
and see what values are added when somebody creates a Review. These will be precisely the ones we add to theRoles
andCompanies
tables.The next subtask of this epic is to update these new values in the
Roles
andCompanies
tables when Reviews are 1) Added, 2) Updated, and 3) Deleted. We will need to update all three at once. One way we can ensure they are all added at once are using drizzle transactions. These operate on an "all or nothing" basis, so we can make sure the actual review averages and the values stored in theRoles
andCompanies
tables stay in sync.When we do this we will most likely need to wipe the database of all its reviews to make sure the running averages are actually in-line with the actual review averages.
Conditions of Satisfaction:
The text was updated successfully, but these errors were encountered: