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 Development Program #12099

Open
1 task
Tracked by #12284 ...
tristan-orourke opened this issue Nov 26, 2024 · 4 comments
Open
1 task
Tracked by #12284 ...

✨ Backend model for Development Program #12099

tristan-orourke opened this issue Nov 26, 2024 · 4 comments
Labels
blocked: dependencies Blocked by other issues. feature New feature or request.

Comments

@tristan-orourke
Copy link
Member

tristan-orourke commented Nov 26, 2024

✨ Feature

Development Programs are training programs managed by a Community. They will start as a simple model, with relationships with Communities and Classifications. Users can express interest, which will be stored in a pivot table with their EmployeeProfile model. In a later ticket, it will be possible to nominate users for programs as well.

🕵️ Details

Development programs have:

  • name
  • description for profile
  • description for nominations
  • community (a required belongsTo relationship)
  • a list of eligible classifcations (a belongsToMany relationship)

Additionally, CommunityInterest has a belongsToMany relationship to Development Programs, with additional data in the pivot table:

  • participation status (NOT_INTERESTED, INTERESTED, ENROLLED, or COMPLETED)
  • completion date

There's no need to add a top-level query for DevelopmentPrograms or the pivot records, as long as they can be queried on Communities and from CommunityInterest respectively.

We'll need to add a mutation allowing users to add or update the programs connected to their profile. The mutation should allow for syncing, connecting and detaching of multiple records to an EmployeeProfile. It should check the update-own-employeeProfile permission.

We can hold off on adding mutations to create the Development Programs themselves. I suspect the first batch will be added programmatically.

🎨 Design

@JoshBeveridge

Based on figma designs, though the current model has been simplified and I'm not sure if these designs are up to date yet.

Development Program from Applicant perspective

Development Program from Nominator perspective

📸 Screenshot

image

🙋‍♀️ Proposed Implementation

type DevelopmentProgram {
  id: UUID!
  name: LocalizedString
  descriptionForProfile: LocalizedString
  descriptionForNominations: LocalizedString
  community: Community # belongsTo 
  eligibleClassifications: [Classification] # belongsToMany
}

type Community {
  ...
  developmentPrograms: [DevelopmentPrograms] # These are public, don't require permissions to view.
}

# a pivot table for users to express interest in programs. Linked to CommunityInterest 
type DevelopmentProgramInterest { 
  program: DevelopmentProgram
  participationStatus: ParticipationStatusEnum # NOT_INTERESTED, INTERESTED, ENROLLED, COMPLETED. Maybe rename to interestStatus?
  completionDate: Date
}

type CommunityInterest {
  ...
  interestInDevelopmentPrgrams: [DevelopmentProgramInterest ] @belongsToMany # No need for extra permission check. If you can see this, you can see pivot record.
}

input DevelopmentProgramInterestInput {
  developmentProgramId: UUID!
  participationStatus: ParticipationStatusEnum
  completionDate: Date
}

input DevelopmentProgramInterestBelongsToMany {
  connect: [DevelopmentProgramInterestInput!]
  sync: [DevelopmentProgramInterestInput!]
  detach: [UUID!]
}

input UpdateCommunityInterest {
  ...
  interestInDevelopmentPrograms: DevelopmentProgramInterestBelongsToMany 
}

There's no need to add a top-level query for DevelopmentPrograms or the pivot records, they can be queried on Communities and on EmployeeProfiles.interestInCommunities respectively.

The mutation should allow for syncing, connecting and detaching of multiple records to a CommunityInterest record. It may be easiest to add fields to the mutation used in #12253 than to create a new mutation.

🌎 Localization

✅ Acceptance Criteria

  • Models defined as described in schema
    • DevelopmentPrograms can queried via Communities, visible to anyone who can view the Community
    • The connection between Programs and Users can be queries via the EmployeeProfile, via the CommunityInterest record, visible to anyone who can view the EmployeeProfile
  • Migrations for underlying tables; Laravel models; factories and seeders
  • Employees can use a mutation to update development programs associated with a EmployeeProfile, protected by the 'update-own-employeeProfile' permission
  • Validation ensures that when a DevelopmentProgramInterest is created, the CommunityInterest and the DevelopmentProgram it connects both use the same Community.

🛑 Blockers

Blocked By

Preview Give feedback
  1. 1 of 1
    feature
    esizer
@tristan-orourke
Copy link
Member Author

For additional discussion:

There should probably be a way for these programs to be hidden from applicants without deleting them. Perhaps an active flag, or open and close dates (which could potentially be left empty).

@JoshBeveridge has proposed combining this with the Training Opportunities advertised on the Instructor Led Training opportunities page, since they both represent training programs. This would mean merging the new model with the existing model:

type TrainingOpportunity {
  id: UUID!
  title: LocalizedString
  courseLanguage: LocalizedCourseLanguage 
  registrationDeadline: Date 
  registrationDeadlineStatus: LocalizedDeadlineStatus
  trainingStart: Date 
  trainingEnd: Date 
  description: LocalizedString
  applicationUrl: LocalizedString
  courseFormat: LocalizedCourseFormat 
}

We'd also have to migrate existing opportunities to belong to a community, and delegate responsibility for managing these opportunities to the CommunityAdmins. (If we don't plan to do that, I don't recommend merging the models). If we do that, we may want to consider #12086. (We made the decision to allow headers in our Rich Text editor with the explicit assumption that only Platform Admins would be using it.)

Additionally, we'd probably to want to add some additional fields controlling where the Training Opportunity / Development Program appears:

appearsOnInstructorLedOpportunities: Boolean
appearsInNominations: Boolean
appearsInCommunityInterest: Boolean # I'm not sure what to call this yet

@tristan-orourke tristan-orourke changed the title ✨ Backend model for Development Program ✨ [WIP] Backend model for Development Program Nov 26, 2024
@tristan-orourke
Copy link
Member Author

An earlier, more complex version of the data model, saved for posterity:

Data model

type DevelopmentProgram {
  id: UUID!
  title: LocalizedString
  description: LocalizedString
  community: Community
  fundingRequirement: Int # dollar value
  durationRequirement: Int # in months?
  classificationRequirement: [Classification] # optionally requires candidate to be one of these classifications
  collectCohortPreference: Boolean # I don't really know what this is about
}

# a pivot table for users to express interest. Could use a better name?
type UserDevelopmentProgram { 
  program: DevelopmentProgram
  user: User
  participationStatus: ParticipationStatusEnum # NOT_INTERESTED, INTERESTED, ENROLLED, COMPLETED
  completionDate: Date
}

Development Program model

@tristan-orourke tristan-orourke added the review in refinement Ready to be looked at and pulled into "ready to dev" label Dec 9, 2024
@gobyrne
Copy link
Member

gobyrne commented Dec 10, 2024

Thanks Tristan. This looks right to me. The list of classifications is for flagging eligibility. So "eligible classifications" or "target classifications" might serve as a better name.

Copy link

github-actions bot commented Dec 11, 2024

Status: Blocked ❌

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 11, 2024
@tristan-orourke tristan-orourke changed the title ✨ [WIP] Backend model for Development Program ✨ Backend model for Development Program Dec 11, 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 moved this from 🏭 Ready for Estimate to 🏃 Prioritized for Dev in GC Digital Talent Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: dependencies Blocked by other issues. feature New feature or request.
Projects
Status: 🏃 Prioritized for Dev
Development

No branches or pull requests

2 participants