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

Calculate total mentor training hours for a mentor for a given provider #473

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

gms-gs
Copy link
Contributor

@gms-gs gms-gs commented Apr 12, 2024

Context

We should not allow a mentor to submit over 20 hours of training hours. Currently a mentor can submit 20 hours per claim meaning they can submit over 20 hours in total.

Changes proposed in this pull request

This change creates a service Claims::CalculateTotalMentorTrainingHoursForProvider which returns the total number of mentor training hours for a mentor. This logic will be used in the scenario where a mentor already has submitted 20 hours on a claim, and potentially attempts to submit another 20 hours on another claim for the same provider.

NOTE: They can submit 20 hours in total per provider

Guidance to review

  • Run the tests

Link to Trello card

https://trello.com/c/B637194w/372-set-up-logic-to-only-allow-a-mentor-to-claim-up-to-20-hours-per-provider

@gms-gs gms-gs changed the title WIP: Calculate total mentor training hours for a mentor for a given provider Calculate total mentor training hours for a mentor for a given provider Apr 12, 2024
@gms-gs gms-gs marked this pull request as ready for review April 12, 2024 14:09
@gms-gs gms-gs requested a review from a team as a code owner April 12, 2024 14:09
@gms-gs gms-gs self-assigned this Apr 12, 2024
end

def call
mentor.mentor_trainings.where(provider:).sum(:hours_completed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this service should also calculate hours per academic year. But for now this is enough I think

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should. But we'll ignore the concept of academic years for now. We'll be addressing academic years after the private beta.

@gms-gs gms-gs merged commit a4022ef into main Apr 15, 2024
7 checks passed
@gms-gs gms-gs deleted the gs/calc-training-hours-for-mentor-provider branch April 15, 2024 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants