-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add support for Primary education phase #1326
Conversation
New (optional) StageTaughtId parameter + updated tests
Kudos, SonarCloud Quality Gate passed! 0 Bugs 96.3% Coverage The version of Java (11.0.21) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few questions. Some of them for my understanding also :-)
@@ -81,12 +82,12 @@ public class TeachingEventsController : ControllerBase | |||
var typeIds = request.TypeIds == null ? string.Empty : string.Join(",", request.TypeIds); | |||
|
|||
_metrics.TeachingEventSearchResults | |||
.WithLabels(typeIds, request.Radius.ToString()) | |||
.WithLabels(typeIds, String.Format(CultureInfo.InvariantCulture, "{0}", request.Radius)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my info, why has String.Format(CultureInfo.InvariantCulture, "{0}"
been added ? Seems unrelated to the change in this PR. Might just be my understanding !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this change is unrelated to this issue; the change was flagged by the code linter:
using Radius.ToString() does not guarantee the format of the integer->string conversion, it could vary with culture.
Using String.Format with an invariant culture guarantees the format of the string. Its a very minor issue, but one the linter flagged 🤷
candidate.PastTeachingPositions.Add(new CandidatePastTeachingPosition() | ||
{ | ||
Id = PastTeachingPositionId, | ||
SubjectTaughtId = SubjectTaughtId, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a Typo ? It looks like self assignment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes, you are right, sorry for that - this line is not required. I'll push an update shortly. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asatwal actually, on reflection (and tests) - this parameter SubjectTaughtId
is required. Its part of the initialisation of the CandidatePastTeachingPosition instance:
new CandidatePastTeachingPosition()
{
Id = PastTeachingPositionId,
SubjectTaughtId = SubjectTaughtId,
EducationPhaseId = (int)CandidatePastTeachingPosition.EducationPhase.Secondary,
}
which translates to create a new CandidatePastTeachingPosition
instance setting it's SubjectTaughtId to the request's SubjectTaughtId. I agree its not terribly clear... but that is the c# syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
New (optional) StageTaughtId parameter + updated tests
This adds support for an improved RTTA process to capture interest in primary stage teaching
Requires changes to be pulled through into https://github.com/DFE-Digital/get-into-teaching-api-ruby-client and https://github.com/DFE-Digital/get-into-teaching-api-csharp-client