colorstackorg / oyster

Monorepo that houses ColorStack's core product software.
MIT License
105 stars 67 forks source link

Check for Reviews Access 🧐 #313

Open tomas-salgado opened 2 weeks ago

tomas-salgado commented 2 weeks ago

Description

See #316 for project overview.

To determine if a user has access to reviews, we need to implement a function that checks if a member has posted at least one review for a work experience, or does not have any work experiences.

Acceptance Criteria

Implements a function named hasReviewsAccess that takes a member id as a parameter and checks if the user has permissions to view the companies page.

The function should return a bool with the following logic:

Additional Context:

All of the data needed is stored within the databases (specifically the tables work_experiences and company_reviews) which can be explored further with the command psql postgresql://oyster:oyster@localhost:5433/oyster. This is the command-line interface for interacting with PostgreSQL.

This function should (tentatively) be stored in a new file named has-review-access.ts in packages/core/src/modules/member/use-cases.

ciaracade commented 1 week ago

🙋🏽‍♀️