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

Adjust1-102 Delete tagged bail adjustment #152

Merged
merged 4 commits into from
Feb 9, 2024

Conversation

pavilionsahota
Copy link
Contributor

No description provided.

@pavilionsahota pavilionsahota requested a review from a team as a code owner February 9, 2024 14:46
Copy link
Contributor

@ldlharper ldlharper left a comment

Choose a reason for hiding this comment

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

A couple of minor comments.

const sentencesForCaseSequence = sentencesByCaseSequence.find(
it => it.caseSequence === adjustment.taggedBail.caseSequence,
)
const sentenceAndOffence = sentencesForCaseSequence.sentences.sort(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this sort function could be refactored somewhere. It appears a lot through all the tagged bail journeys. (Similar to getActiveSentencesByCaseSequence)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've created the method getMostRecentSentenceAndOffence(sentencesAndOffences: PrisonApiOffenderSentenceAndOffences[]) in utils.ts and have replaced all usages of the sort with the call to this new utility method 👍

public prisonerDetail: PrisonApiPrisoner,
public adjustment: Adjustment,
public adjustmentType: AdjustmentType,
public sentenceAndOffense: PrisonApiOffenderSentenceAndOffences,
Copy link
Contributor

Choose a reason for hiding this comment

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

minor spelling mistake should be sentenceAndOffence

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have corrected the spelling for this 👍

Copy link
Contributor

@ldlharper ldlharper left a comment

Choose a reason for hiding this comment

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

LGTM

@pavilionsahota pavilionsahota merged commit d16a05d into main Feb 9, 2024
4 checks passed
@pavilionsahota pavilionsahota deleted the ADJUST1-102-Delete-Tagged-Bail-Adjustment branch February 9, 2024 15:47
@pavilionsahota pavilionsahota restored the ADJUST1-102-Delete-Tagged-Bail-Adjustment branch February 9, 2024 16:30
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.

None yet

2 participants