-
Notifications
You must be signed in to change notification settings - Fork 3
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
APS-1857 Copied cas1 timeline api types to cas1 schema. #2902
Conversation
Can you please add something into the commit message explaining what this commit is doing? |
...lin/uk/gov/justice/digital/hmpps/approvedpremisesapi/controller/cas1/Cas1PeopleController.kt
Outdated
Show resolved
Hide resolved
It's there. may be some line break hides those. |
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.
This is looking good, i'll do a thorough review once my initial comments are addressed as i think they'll reduce the amount of code to review 👍
Apologies, i'm being a dummy and misread the github UI :) |
A minor point and don't worry about addressing on this PR. We tend to prefix our branch names with either |
2f73f74
to
d279d01
Compare
), | ||
APPROVED_PREMISES_BOOKING_MADE( | ||
DomainEventCas.CAS1, | ||
Cas1EventType.bookingMade.value, | ||
"An Approved Premises booking has been made", | ||
TimelineEventType.approvedPremisesBookingMade, | ||
Cas1TimelineEventType.bookingNotMade, |
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.
i think this should be bookingMade?
), | ||
APPROVED_PREMISES_PLACEMENT_APPLICATION_ALLOCATED( | ||
DomainEventCas.CAS1, | ||
Cas1EventType.placementApplicationAllocated.value, | ||
"An Approved Premises Request for Placement has been allocated", | ||
TimelineEventType.approvedPremisesPlacementApplicationAllocated, | ||
Cas1TimelineEventType.assessmentAllocated, |
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.
i think this should be placementApplicationAllocated?
@@ -42,4 +43,22 @@ enum class ApprovedPremisesApplicationStatus(val apiValue: ApiApprovedPremisesAp | |||
fun valueOf(apiValue: ApiApprovedPremisesApplicationStatus): ApprovedPremisesApplicationStatus = | |||
ApprovedPremisesApplicationStatus.entries.first { it.apiValue == apiValue } | |||
} | |||
|
|||
fun toCas1Status(): Cas1ApplicationStatus { | |||
return when (this) { |
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.
i like using the when here, it makes sure we've covered all mappings 👍
createdBy: | ||
$ref: '_shared.yml#/components/schemas/User' | ||
payload: | ||
$ref: '_shared.yml#/components/schemas/TimelineEventContentPayload' |
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.
i guess this should be copied into the CAS1 schemas too?
to be honest we could probably remove it from the shared.yml (and shared API) completely because the UI won't be using it yet. Hopefully that makes it easier?
@@ -1004,3 +1004,129 @@ components: | |||
- updatedReferenceNumber | |||
- updatedReason | |||
- updatedNotes | |||
Cas1TimelineEvent: |
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.
i think we can make a few fields mandatory (i appreciate they weren't before)
- type
- id
- occurredAt
- booking | ||
- assessment | ||
- assessmentAppeal | ||
- cas1SpaceBooking |
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.
this can just be spaceBooking
in this context
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.
This is looking really good, just a few comments from me
ebd633b
to
bcc0aff
Compare
Refactored services and transformers to return cas1 api types.
bcc0aff
to
6e98f66
Compare
https://dsdmoj.atlassian.net/browse/APS-1857