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

✨Backend model for Community Interest #12253

Open
1 task done
Tracked by #12099 ...
gobyrne opened this issue Dec 11, 2024 · 1 comment
Open
1 task done
Tracked by #12099 ...

✨Backend model for Community Interest #12253

gobyrne opened this issue Dec 11, 2024 · 1 comment
Assignees
Labels
feature New feature or request.

Comments

@gobyrne
Copy link
Member

gobyrne commented Dec 11, 2024

✨ Feature

On the applicant/employee dashboard, government employees will be able to express interest in a community. When they do so, we collect some additional information about where there interests lie.

🕵️ Details

#I guess this is effectively a pivot table for user-community with a little extra info, we could rename it to UserCommunity or similar
type CommunityInterest {
  id: UUID!
  community: Community # belongsTo
  workstreamInterest: [WorkStream]  #workstreams from this community only
  
  jobInterest: Boolean
  trainingInterest: Boolean

  additionalInformation: String #input by user

  #developmentProgramInterest: [DevelopmentProgramInterest] # This doesn't exist yet, will be added in 12099
}

type EmployeeProfile {
  ...
  interestInCommunities: [CommunityInterest] @hasMany
}

Notes:

🎨 Design

https://www.figma.com/design/H1loB8WxGP6vyJTrVqcafd/Functional-communities-(Employees)?node-id=5-9&node-type=canvas&t=51PBxXT2GvAXqEZd-0

📸 Screenshot

Image

🙋‍♀️ Proposed Implementation

In terms of mutations, it may be easiest to add attach/detach/sync fields to EmployeeProfile.interestInCommunities the field.
Similarly, the CommunityInterest input should support attach/detach/sync operations for work streams.

Alternatively, we could add create and update mutations for CommunityInterest, where the input includes a userId or employeeProfileId. In this case the mutations should check the update-own-employeeProfile permission.

Validation:

Work Streams attached to a CommunityInterest belong to the correct community.
For simplicity, we should probably not allow changing the community of a CommunityInterest entity. You'd have to create a new one.
A user should not be able to create two CommunityInterests with the same Community, or add the same stream multiple times to one CommunityInterest (these should also be validated at database level, but we still want Laravel validation to return better error messages).

🌎 Localization

✅ Acceptance Criteria

  • Migration defines a community_interests table, with user_id and community_id foreign keys, and a pivot table with work streams. Constraints against the same user_id/community_id combo, or against work streams being added to to one Interest
  • Laravel model for CommunityInterest, with relationships and factory and seeder
  • CommunityInterest added to schema. It's queryable via EmployeeProfile.
  • An employee can use a mutation to add or update their CommunityInterests. Validation ensures that work streams match the proper Community, and CommunityInterests and WorkStreams aren't duplicated.
  • phpunit test for that validation

🛑 Blockers

Blocked By

Preview Give feedback
  1. feature
    esizer
@gobyrne gobyrne added the feature New feature or request. label Dec 11, 2024
@tristan-orourke tristan-orourke changed the title ✨ [WIP] Backend model for Adding a community tool ✨ [WIP] Backend model for Community Interest Dec 12, 2024
@tristan-orourke tristan-orourke added the review in refinement Ready to be looked at and pulled into "ready to dev" label Dec 16, 2024
@tristan-orourke tristan-orourke self-assigned this Dec 16, 2024
Copy link

github-actions bot commented Dec 16, 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.

@github-actions github-actions bot added the blocked: dependencies Blocked by other issues. label Dec 16, 2024
@tristan-orourke tristan-orourke removed the review in refinement Ready to be looked at and pulled into "ready to dev" label Dec 16, 2024
@tristan-orourke tristan-orourke moved this to 🏭 Ready for Estimate in GC Digital Talent Dec 16, 2024
@tristan-orourke tristan-orourke changed the title ✨ [WIP] Backend model for Community Interest ✨Backend model for Community Interest Dec 16, 2024
@tristan-orourke tristan-orourke removed their assignment Dec 17, 2024
@tristan-orourke tristan-orourke moved this from 🏭 Ready for Estimate to 🏃 Prioritized for Dev in GC Digital Talent Dec 18, 2024
@github-actions github-actions bot removed the blocked: dependencies Blocked by other issues. label Dec 31, 2024
@esizer esizer self-assigned this Dec 31, 2024
@esizer esizer moved this from 🏃 Prioritized for Dev to 🏗 In progress in GC Digital Talent Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request.
Projects
Status: 🏗 In progress
Development

No branches or pull requests

3 participants