Skip to content

Commit

Permalink
Update API models
Browse files Browse the repository at this point in the history
  • Loading branch information
rossjones-moj committed Jan 14, 2025
1 parent 66babc8 commit 1e82520
Show file tree
Hide file tree
Showing 7 changed files with 367 additions and 231 deletions.
32 changes: 18 additions & 14 deletions src/main/resources/static/_shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -570,20 +570,20 @@ components:
required:
- reason
WithdrawPlacementRequestReason:
type: string
enum:
- DuplicatePlacementRequest
- AlternativeProvisionIdentified
- ChangeInCircumstances
- ChangeInReleaseDecision
- NoCapacityDueToLostBed
- NoCapacityDueToPlacementPrioritisation
- NoCapacity
- ErrorInPlacementRequest
- WithdrawnByPP
- RelatedApplicationWithdrawn
- RelatedPlacementRequestWithdrawn
- RelatedPlacementApplicationWithdrawn
type: string
enum:
- DuplicatePlacementRequest
- AlternativeProvisionIdentified
- ChangeInCircumstances
- ChangeInReleaseDecision
- NoCapacityDueToLostBed
- NoCapacityDueToPlacementPrioritisation
- NoCapacity
- ErrorInPlacementRequest
- WithdrawnByPP
- RelatedApplicationWithdrawn
- RelatedPlacementRequestWithdrawn
- RelatedPlacementApplicationWithdrawn
PlacementApplicationType:
type: string
description: |
Expand Down Expand Up @@ -3726,6 +3726,8 @@ components:
- approved_premises_space_planning_dry_run
- approved_premises_import_delius_referrals
- approved_premises_update_space_booking
- approved_premises_backfill_active_space_bookings_created_in_delius
- approved_premises_create_test_applications
- temporary_accommodation_referral_rejection
SeedFromExcelFileType:
type: string
Expand Down Expand Up @@ -3759,6 +3761,7 @@ components:
- update_cas3_application_offender_name
- update_cas3_domain_event_type_for_person_departed_updated
- update_cas1_applications_licence_expiry_date
- update_cas1_backfill_offline_application_name
PlacementDates:
type: object
properties:
Expand All @@ -3779,6 +3782,7 @@ components:
$ref: '#/components/schemas/ApType'
location:
type: string
description: Postcode outcode
example: B74
radius:
type: integer
Expand Down
204 changes: 130 additions & 74 deletions src/main/resources/static/cas2v2-schemas.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

components:
schemas:
SubmitCas2v2Application:
Expand All @@ -25,9 +24,9 @@ components:
telephoneNumber:
type: string
required:
- translatedDocument
- applicationId
- telephoneNumber
- translatedDocument
- applicationId
- telephoneNumber
Cas2v2Assessment:
type: object
properties:
Expand All @@ -41,43 +40,43 @@ components:
statusUpdates:
type: array
items:
$ref: '_shared.yml#/components/schemas/Cas2StatusUpdate'
$ref: '#/components/schemas/Cas2v2StatusUpdate'
required:
- id
- id
Cas2v2Application:
allOf:
- $ref: '#/components/schemas/Application'
- type: object
properties:
createdBy:
$ref: '#/components/schemas/Cas2v2User'
schemaVersion:
type: string
format: uuid
outdatedSchema:
type: boolean
data:
$ref: '#/components/schemas/Unit'
document:
$ref: '#/components/schemas/Unit'
status:
$ref: '#/components/schemas/ApplicationStatus'
submittedAt:
type: string
format: date-time
telephoneNumber:
type: string
assessment:
$ref: '_shared.yml#/components/schemas/Cas2v2Assessment'
timelineEvents:
type: array
items:
$ref: '_shared.yml#/components/schemas/Cas2TimelineEvent'
required:
- createdBy
- schemaVersion
- outdatedSchema
- status
- $ref: '#/components/schemas/Application'
- type: object
properties:
createdBy:
$ref: '#/components/schemas/Cas2v2User'
schemaVersion:
type: string
format: uuid
outdatedSchema:
type: boolean
data:
$ref: '#/components/schemas/Unit'
document:
$ref: '#/components/schemas/Unit'
status:
$ref: '#/components/schemas/ApplicationStatus'
submittedAt:
type: string
format: date-time
telephoneNumber:
type: string
assessment:
$ref: '#/components/schemas/Cas2v2Assessment'
timelineEvents:
type: array
items:
$ref: '_shared.yml#/components/schemas/Cas2TimelineEvent'
required:
- createdBy
- schemaVersion
- outdatedSchema
- status
Cas2v2SubmittedApplication:
type: object
properties:
Expand Down Expand Up @@ -109,17 +108,17 @@ components:
$ref: '_shared.yml#/components/schemas/Cas2TimelineEvent'
assessment:
type: object
$ref: '_shared.yml#/components/schemas/Cas2v2Assessment'
$ref: '#/components/schemas/Cas2v2Assessment'
required:
- id
- person
- createdAt
- createdBy
- schemaVersion
- outdatedSchema
- status
- timelineEvents
- assessment
- id
- person
- createdAt
- createdBy
- schemaVersion
- outdatedSchema
- status
- timelineEvents
- assessment
Cas2v2ApplicationSummary:
type: object
properties:
Expand Down Expand Up @@ -155,14 +154,14 @@ components:
nomsNumber:
type: string
required:
- type
- id
- createdAt
- createdByUserId
- status
- personName
- crn
- nomsNumber
- type
- id
- createdAt
- createdByUserId
- status
- personName
- crn
- nomsNumber
Cas2v2SubmittedApplicationSummary:
type: object
properties:
Expand All @@ -185,14 +184,14 @@ components:
type: string
format: date-time
required:
- createdByUserId
- status
- id
- person
- createdAt
- personName
- crn
- nomsNumber
- createdByUserId
- status
- id
- person
- createdAt
- personName
- crn
- nomsNumber
Cas2v2ApplicationNote:
type: object
properties:
Expand All @@ -211,11 +210,11 @@ components:
type: string
format: date-time
required:
- username
- email
- name
- body
- createdAt
- username
- email
- name
- body
- createdAt
description: Notes added to a Cas2v2Application
Cas2v2User:
type: object
Expand All @@ -239,8 +238,65 @@ components:
type: boolean
example: true
required:
- id
- name
- username
- authSource
- isActive
- id
- name
- username
- authSource
- isActive
Cas2v2StatusUpdate:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
example: 'moreInfoRequested'
label:
type: string
example: 'More information requested'
description:
type: string
example: 'More information about the application has been requested from the HMPPS user.'
updatedBy:
$ref: '#/components/schemas/Cas2v2User'
updatedAt:
type: string
format: date-time
statusUpdateDetails:
type: array
items:
$ref: '#/components/schemas/Cas2v2StatusUpdateDetail'
required:
- id
- name
- label
- description
Cas2v2StatusUpdateDetail:
type: object
properties:
id:
type: string
format: uuid
name:
type: string
example: 'moreInfoRequested'
label:
type: string
example: 'More information requested'
required:
- id
- name
- label
LatestCas2v2StatusUpdate:
type: object
properties:
statusId:
type: string
format: uuid
label:
type: string
example: 'More information requested'
required:
- statusId
- label
32 changes: 18 additions & 14 deletions src/main/resources/static/codegen/built-api-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4871,20 +4871,20 @@ components:
required:
- reason
WithdrawPlacementRequestReason:
type: string
enum:
- DuplicatePlacementRequest
- AlternativeProvisionIdentified
- ChangeInCircumstances
- ChangeInReleaseDecision
- NoCapacityDueToLostBed
- NoCapacityDueToPlacementPrioritisation
- NoCapacity
- ErrorInPlacementRequest
- WithdrawnByPP
- RelatedApplicationWithdrawn
- RelatedPlacementRequestWithdrawn
- RelatedPlacementApplicationWithdrawn
type: string
enum:
- DuplicatePlacementRequest
- AlternativeProvisionIdentified
- ChangeInCircumstances
- ChangeInReleaseDecision
- NoCapacityDueToLostBed
- NoCapacityDueToPlacementPrioritisation
- NoCapacity
- ErrorInPlacementRequest
- WithdrawnByPP
- RelatedApplicationWithdrawn
- RelatedPlacementRequestWithdrawn
- RelatedPlacementApplicationWithdrawn
PlacementApplicationType:
type: string
description: |
Expand Down Expand Up @@ -8027,6 +8027,8 @@ components:
- approved_premises_space_planning_dry_run
- approved_premises_import_delius_referrals
- approved_premises_update_space_booking
- approved_premises_backfill_active_space_bookings_created_in_delius
- approved_premises_create_test_applications
- temporary_accommodation_referral_rejection
SeedFromExcelFileType:
type: string
Expand Down Expand Up @@ -8060,6 +8062,7 @@ components:
- update_cas3_application_offender_name
- update_cas3_domain_event_type_for_person_departed_updated
- update_cas1_applications_licence_expiry_date
- update_cas1_backfill_offline_application_name
PlacementDates:
type: object
properties:
Expand All @@ -8080,6 +8083,7 @@ components:
$ref: '#/components/schemas/ApType'
location:
type: string
description: Postcode outcode
example: B74
radius:
type: integer
Expand Down
Loading

0 comments on commit 1e82520

Please sign in to comment.