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

♻️ Associate every Request with a Community #10331

Closed
1 task done
Tracked by #10366 ...
tristan-orourke opened this issue May 9, 2024 · 3 comments · Fixed by #10432
Closed
1 task done
Tracked by #10366 ...

♻️ Associate every Request with a Community #10331

tristan-orourke opened this issue May 9, 2024 · 3 comments · Fixed by #10432
Assignees
Labels
debt Refactor or improve existing code.

Comments

@tristan-orourke
Copy link
Member

tristan-orourke commented May 9, 2024

♻️ Debt/Refactor

Create a many-to-one relationship between Requests and Communities - every Talent Request must belong to a single community.
(A community can have many requests.) This should apply retroactively too: every existing request in the database should belong to either the Digital community or the ATIP community, and we can use Pool Stream to determine which.

🕵️ Details

When submitting a talent request, it should be submitted to one of our communities.

For existing communities, they should belong to either the Digital community or the ATIP community, based on Pool Stream.

  • ACCESS_INFORMATION_PRIVACY means ATIP community
  • any other stream means Digital
  • a request without a stream (or with conflicting ones) defaults to Digital

The Community can be accessed from the ApplicantFilter and PoolCandidateSearchRequest types:

type ApplicantFilter {
   ...
   community: Community
}

type PoolCandidateSearchRequest {
   ...
   community: Community
}

For now, this community doesn't need to affect the results of the search. A future ticket will ensure that results are scoped to the community.

🙋‍♀️ Proposed Solution

Add community_id foreign key to both the PoolCandidateSearchRequest and the ApplicantFilter entities. (Schema type, eloquent model, and database tables.) It should a required non-nullable field on the search request, but optional in the filter. It is required on the search request because we will soon use it to control access. We will also use it to scope the results, hence being on the filter.

Note: we don't need to scope the results OR change access controls in this ticket. This is just setting us up for that.

An additional challenge:
If the migration adds a required (non-nullable) community_id field to the Requests table, what do we do about running the migration on systems with requests already in the database? We can do the matching in the mutation itself, but only if the Communities already exist. We likely need to blocking merging this until #10298 has been deployed and the seeder has been run.

🌎 Localization

(optional) Provide any new copy along with translations available.

✅ Acceptance Criteria

A set of assumptions which, when tested, verify that the debt was addressed and expected functionality has not been affected.

  • All existing Requests associated with a Community in the database
  • Any new Requests required a community
  • The Community can be accessed from a Request in the api
  • Creating new requests now requires selecting a Community
  • The search page automatically sets the community on the request and filter based on the Pool Stream.
  • Search request UI is unchanged

🛑 Blockers

Issues which must be completed before this one.

Blocked By

  1. deployment
@tristan-orourke tristan-orourke added the debt Refactor or improve existing code. label May 9, 2024
@tristan-orourke tristan-orourke changed the title ♻️ Associate every Request with a Community ♻️ [WIP] Associate every Request with a Community May 9, 2024
@tristan-orourke tristan-orourke added this to the Functional Communities milestone May 9, 2024
@tristan-orourke tristan-orourke added the blocked: question Further information is requested. label May 9, 2024
Copy link

github-actions bot commented May 9, 2024

Status: Ready to merge ✔️

Issues blocking this PR:


This comment was automatically written by the Blocking Issues bot, and this PR will be monitored for further progress.

@tristan-orourke tristan-orourke added review in refinement Ready to be looked at and pulled into "ready to dev" and removed blocked: question Further information is requested. labels May 10, 2024
@tristan-orourke tristan-orourke changed the title ♻️ [WIP] Associate every Request with a Community ♻️ Associate every Request with a Community May 10, 2024
@tristan-orourke tristan-orourke added blocked: dependencies Blocked by other issues. and removed review in refinement Ready to be looked at and pulled into "ready to dev" labels May 10, 2024
@tristan-orourke
Copy link
Member Author

Blocked until some Communities exist in production.

@tristan-orourke tristan-orourke added blocked: dependencies Blocked by other issues. blocked Blocked by work that's out-of-scope of the issue itself. and removed blocked: dependencies Blocked by other issues. labels May 13, 2024
@petertgiles
Copy link
Contributor

one-to-one relationship

Should be one-to-many, right? A community will have many requests.

@tristan-orourke tristan-orourke removed the blocked Blocked by work that's out-of-scope of the issue itself. label May 16, 2024
@esizer esizer self-assigned this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debt Refactor or improve existing code.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants