diff --git a/script/generate-types b/script/generate-types index edd87b38d..39697812c 100755 --- a/script/generate-types +++ b/script/generate-types @@ -8,8 +8,7 @@ cd "$(dirname "$0")/.." echo "==> Generating types..." -npx openapi-typescript-codegen -i https://raw.githubusercontent.com/ministryofjustice/hmpps-approved-premises-api/main/src/main/resources/static/codegen/built-api-spec.yml -o ./server/@types/shared -c axios --exportServices false --exportCore false --useUnionTypes true -npx openapi-typescript-codegen -i https://raw.githubusercontent.com/ministryofjustice/hmpps-approved-premises-api/main/src/main/resources/static/codegen/built-cas3-api-spec.yml -o ./server/@types/shared -c axios --exportServices false --exportCore false --useUnionTypes true +npx openapi-typescript-codegen -i "http://localhost:8080/v3/api-docs/CAS3Shared" -o ./server/@types/shared -c axios --exportServices false --exportCore false --useUnionTypes true echo "==> Renaming the declaration file..." diff --git a/server/@types/shared/index.d.ts b/server/@types/shared/index.d.ts index b64592170..ad25fbefb 100644 --- a/server/@types/shared/index.d.ts +++ b/server/@types/shared/index.d.ts @@ -6,12 +6,10 @@ export type { ActiveOffence } from './models/ActiveOffence'; export type { Adjudication } from './models/Adjudication'; export type { AllocatedFilter } from './models/AllocatedFilter'; -export type { AnyValue } from './models/AnyValue'; export type { ApArea } from './models/ApArea'; export type { Appeal } from './models/Appeal'; export type { AppealDecision } from './models/AppealDecision'; export type { Application } from './models/Application'; -export type { ApplicationSortField } from './models/ApplicationSortField'; export type { ApplicationStatus } from './models/ApplicationStatus'; export type { ApplicationSummary } from './models/ApplicationSummary'; export type { ApplicationTimeline } from './models/ApplicationTimeline'; @@ -30,15 +28,6 @@ export type { ApprovedPremisesUser } from './models/ApprovedPremisesUser'; export type { ApprovedPremisesUserPermission } from './models/ApprovedPremisesUserPermission'; export type { ApprovedPremisesUserRole } from './models/ApprovedPremisesUserRole'; export type { ApType } from './models/ApType'; -export type { ArrayOfOASysOffenceDetailsQuestions } from './models/ArrayOfOASysOffenceDetailsQuestions'; -export type { ArrayOfOASysRiskContributorsQuestions } from './models/ArrayOfOASysRiskContributorsQuestions'; -export type { ArrayOfOASysRiskManagementPlanQuestions } from './models/ArrayOfOASysRiskManagementPlanQuestions'; -export type { ArrayOfOASysRiskManagementQuestions } from './models/ArrayOfOASysRiskManagementQuestions'; -export type { ArrayOfOASysRiskOfSeriousHarmSummaryQuestions } from './models/ArrayOfOASysRiskOfSeriousHarmSummaryQuestions'; -export type { ArrayOfOASysRisksToOthersQuestions } from './models/ArrayOfOASysRisksToOthersQuestions'; -export type { ArrayOfOASysRisksToTheIndividualQuestions } from './models/ArrayOfOASysRisksToTheIndividualQuestions'; -export type { ArrayOfOASysRiskToSelfQuestions } from './models/ArrayOfOASysRiskToSelfQuestions'; -export type { ArrayOfOASysSupportingInformationQuestions } from './models/ArrayOfOASysSupportingInformationQuestions'; export type { Arrival } from './models/Arrival'; export type { Assessment } from './models/Assessment'; export type { AssessmentAcceptance } from './models/AssessmentAcceptance'; @@ -61,7 +50,6 @@ export type { BedStatus } from './models/BedStatus'; export type { BedSummary } from './models/BedSummary'; export type { Booking } from './models/Booking'; export type { BookingAppealTask } from './models/BookingAppealTask'; -export type { BookingBody } from './models/BookingBody'; export type { BookingNotMade } from './models/BookingNotMade'; export type { BookingPremisesSummary } from './models/BookingPremisesSummary'; export type { BookingSearchResult } from './models/BookingSearchResult'; @@ -74,29 +62,22 @@ export type { BookingSearchResults } from './models/BookingSearchResults'; export type { BookingSearchSortField } from './models/BookingSearchSortField'; export type { BookingStatus } from './models/BookingStatus'; export type { BookingSummary } from './models/BookingSummary'; -export type { CacheType } from './models/CacheType'; export type { Cancellation } from './models/Cancellation'; export type { CancellationReason } from './models/CancellationReason'; export type { Cas1ApplicationTimelinessCategory } from './models/Cas1ApplicationTimelinessCategory'; export type { Cas1ApplicationUserDetails } from './models/Cas1ApplicationUserDetails'; export type { Cas1CruManagementArea } from './models/Cas1CruManagementArea'; export type { Cas2Application } from './models/Cas2Application'; -export type { Cas2ApplicationNote } from './models/Cas2ApplicationNote'; -export type { Cas2ApplicationStatus } from './models/Cas2ApplicationStatus'; -export type { Cas2ApplicationStatusDetail } from './models/Cas2ApplicationStatusDetail'; -export type { Cas2ApplicationSummary } from './models/Cas2ApplicationSummary'; export type { Cas2Assessment } from './models/Cas2Assessment'; -export type { Cas2AssessmentStatusUpdate } from './models/Cas2AssessmentStatusUpdate'; -export type { Cas2ReportName } from './models/Cas2ReportName'; export type { Cas2StatusUpdate } from './models/Cas2StatusUpdate'; export type { Cas2StatusUpdateDetail } from './models/Cas2StatusUpdateDetail'; -export type { Cas2SubmittedApplication } from './models/Cas2SubmittedApplication'; -export type { Cas2SubmittedApplicationSummary } from './models/Cas2SubmittedApplicationSummary'; export type { Cas2TimelineEvent } from './models/Cas2TimelineEvent'; export type { Cas3ReportType } from './models/Cas3ReportType'; +export type { Category } from './models/Category'; export type { Characteristic } from './models/Characteristic'; export type { CharacteristicPair } from './models/CharacteristicPair'; export type { ClarificationNote } from './models/ClarificationNote'; +export type { ClassesToInclude } from './models/ClassesToInclude'; export type { Confirmation } from './models/Confirmation'; export type { DateCapacity } from './models/DateCapacity'; export type { DateChange } from './models/DateChange'; @@ -106,6 +87,7 @@ export type { DepartureReason } from './models/DepartureReason'; export type { DestinationProvider } from './models/DestinationProvider'; export type { Document } from './models/Document'; export type { DocumentLevel } from './models/DocumentLevel'; +export type { ErrorResponse } from './models/ErrorResponse'; export type { ExtendedPremisesSummary } from './models/ExtendedPremisesSummary'; export type { Extension } from './models/Extension'; export type { ExternalUser } from './models/ExternalUser'; @@ -113,8 +95,9 @@ export type { FlagsEnvelope } from './models/FlagsEnvelope'; export type { FullPerson } from './models/FullPerson'; export type { FullPersonSummary } from './models/FullPersonSummary'; export type { Gender } from './models/Gender'; +export type { HmppsSubjectAccessRequestContent } from './models/HmppsSubjectAccessRequestContent'; export type { InvalidParam } from './models/InvalidParam'; -export type { LatestCas2StatusUpdate } from './models/LatestCas2StatusUpdate'; +export type { LoadError } from './models/LoadError'; export type { LocalAuthorityArea } from './models/LocalAuthorityArea'; export type { LostBed } from './models/LostBed'; export type { LostBedCancellation } from './models/LostBedCancellation'; @@ -124,17 +107,16 @@ export type { Mappa } from './models/Mappa'; export type { MappaEnvelope } from './models/MappaEnvelope'; export type { MigrationJobRequest } from './models/MigrationJobRequest'; export type { MigrationJobType } from './models/MigrationJobType'; +export type { ModelScope } from './models/ModelScope'; export type { MoveOnCategory } from './models/MoveOnCategory'; export type { NamedId } from './models/NamedId'; export type { NewAppeal } from './models/NewAppeal'; export type { NewApplication } from './models/NewApplication'; export type { NewApplicationTimelineNote } from './models/NewApplicationTimelineNote'; export type { NewArrival } from './models/NewArrival'; -export type { NewBedMove } from './models/NewBedMove'; export type { NewBooking } from './models/NewBooking'; export type { NewBookingNotMade } from './models/NewBookingNotMade'; export type { NewCancellation } from './models/NewCancellation'; -export type { NewCas2ApplicationNote } from './models/NewCas2ApplicationNote'; export type { NewCas2Arrival } from './models/NewCas2Arrival'; export type { NewCas3Arrival } from './models/NewCas3Arrival'; export type { NewClarificationNote } from './models/NewClarificationNote'; @@ -156,7 +138,6 @@ export type { NewWithdrawal } from './models/NewWithdrawal'; export type { NomisUser } from './models/NomisUser'; export type { Nonarrival } from './models/Nonarrival'; export type { NonArrivalReason } from './models/NonArrivalReason'; -export type { OASysAssessmentId } from './models/OASysAssessmentId'; export type { OASysAssessmentState } from './models/OASysAssessmentState'; export type { OASysQuestion } from './models/OASysQuestion'; export type { OASysRiskOfSeriousHarm } from './models/OASysRiskOfSeriousHarm'; @@ -184,7 +165,6 @@ export type { PlacementDates } from './models/PlacementDates'; export type { PlacementRequest } from './models/PlacementRequest'; export type { PlacementRequestDetail } from './models/PlacementRequestDetail'; export type { PlacementRequestRequestType } from './models/PlacementRequestRequestType'; -export type { PlacementRequestSortField } from './models/PlacementRequestSortField'; export type { PlacementRequestStatus } from './models/PlacementRequestStatus'; export type { PlacementRequestTask } from './models/PlacementRequestTask'; export type { PlacementRequestTaskOutcome } from './models/PlacementRequestTaskOutcome'; @@ -215,7 +195,6 @@ export type { RestrictedPersonSummary } from './models/RestrictedPersonSummary'; export type { RiskEnvelopeStatus } from './models/RiskEnvelopeStatus'; export type { RiskTier } from './models/RiskTier'; export type { RiskTierEnvelope } from './models/RiskTierEnvelope'; -export type { RiskTierLevel } from './models/RiskTierLevel'; export type { Room } from './models/Room'; export type { RoshRisks } from './models/RoshRisks'; export type { RoshRisksEnvelope } from './models/RoshRisksEnvelope'; @@ -223,24 +202,21 @@ export type { SeedFileType } from './models/SeedFileType'; export type { SeedRequest } from './models/SeedRequest'; export type { SentenceTypeOption } from './models/SentenceTypeOption'; export type { ServiceName } from './models/ServiceName'; +export type { ServiceScope } from './models/ServiceScope'; export type { SituationOption } from './models/SituationOption'; export type { SortDirection } from './models/SortDirection'; -export type { SortOrder } from './models/SortOrder'; export type { StaffMember } from './models/StaffMember'; export type { SubmitApplication } from './models/SubmitApplication'; export type { SubmitApprovedPremisesApplication } from './models/SubmitApprovedPremisesApplication'; -export type { SubmitCas2Application } from './models/SubmitCas2Application'; export type { SubmitPlacementApplication } from './models/SubmitPlacementApplication'; export type { SubmitTemporaryAccommodationApplication } from './models/SubmitTemporaryAccommodationApplication'; export type { SupervisingOfficer } from './models/SupervisingOfficer'; export type { SupervisingProvider } from './models/SupervisingProvider'; export type { SupervisingTeam } from './models/SupervisingTeam'; export type { Task } from './models/Task'; -export type { TaskSortField } from './models/TaskSortField'; export type { TaskStatus } from './models/TaskStatus'; export type { TaskType } from './models/TaskType'; export type { TaskWrapper } from './models/TaskWrapper'; -export type { Temporality } from './models/Temporality'; export type { TemporaryAccommodationApplication } from './models/TemporaryAccommodationApplication'; export type { TemporaryAccommodationApplicationSummary } from './models/TemporaryAccommodationApplicationSummary'; export type { TemporaryAccommodationAssessment } from './models/TemporaryAccommodationAssessment'; @@ -259,6 +235,8 @@ export type { TimelineEventType } from './models/TimelineEventType'; export type { TimelineEventUrlType } from './models/TimelineEventUrlType'; export type { TriggerSourceType } from './models/TriggerSourceType'; export type { Turnaround } from './models/Turnaround'; +export type { Type } from './models/Type'; +export type { Unit } from './models/Unit'; export type { UnknownPerson } from './models/UnknownPerson'; export type { UnknownPersonSummary } from './models/UnknownPersonSummary'; export type { UpdateApplication } from './models/UpdateApplication'; @@ -266,7 +244,6 @@ export type { UpdateApplicationType } from './models/UpdateApplicationType'; export type { UpdateApprovedPremisesApplication } from './models/UpdateApprovedPremisesApplication'; export type { UpdateAssessment } from './models/UpdateAssessment'; export type { UpdateCas2Application } from './models/UpdateCas2Application'; -export type { UpdateCas2Assessment } from './models/UpdateCas2Assessment'; export type { UpdatedClarificationNote } from './models/UpdatedClarificationNote'; export type { UpdateLostBed } from './models/UpdateLostBed'; export type { UpdatePlacementApplication } from './models/UpdatePlacementApplication'; @@ -276,7 +253,6 @@ export type { UpdateTemporaryAccommodationApplication } from './models/UpdateTem export type { User } from './models/User'; export type { UserQualification } from './models/UserQualification'; export type { UserRolesAndQualifications } from './models/UserRolesAndQualifications'; -export type { UserSortField } from './models/UserSortField'; export type { UserSummary } from './models/UserSummary'; export type { UserWithWorkload } from './models/UserWithWorkload'; export type { ValidationError } from './models/ValidationError'; diff --git a/server/@types/shared/models/AnyValue.ts b/server/@types/shared/models/AnyValue.ts deleted file mode 100644 index 294694a24..000000000 --- a/server/@types/shared/models/AnyValue.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * Any object that conforms to the current JSON schema for an application - */ -export type AnyValue = Record; diff --git a/server/@types/shared/models/Appeal.ts b/server/@types/shared/models/Appeal.ts index 54690f813..cd5c87ce9 100644 --- a/server/@types/shared/models/Appeal.ts +++ b/server/@types/shared/models/Appeal.ts @@ -3,7 +3,8 @@ /* tslint:disable */ /* eslint-disable */ import type { AppealDecision } from './AppealDecision'; -import type { User } from './User'; +import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; +import type { TemporaryAccommodationUser } from './TemporaryAccommodationUser'; export type Appeal = { id: string; appealDate: string; @@ -12,7 +13,7 @@ export type Appeal = { decisionDetail: string; createdAt: string; applicationId: string; + createdByUser: (ApprovedPremisesUser | TemporaryAccommodationUser); assessmentId?: string; - createdByUser: User; }; diff --git a/server/@types/shared/models/Application.ts b/server/@types/shared/models/Application.ts index 97e3aa22a..6b117d1d7 100644 --- a/server/@types/shared/models/Application.ts +++ b/server/@types/shared/models/Application.ts @@ -2,11 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Person } from './Person'; +import type { FullPerson } from './FullPerson'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; export type Application = { - type: string; id: string; - person: Person; + type: string; + person: (FullPerson | RestrictedPerson | UnknownPerson); createdAt: string; }; diff --git a/server/@types/shared/models/ApplicationSortField.ts b/server/@types/shared/models/ApplicationSortField.ts deleted file mode 100644 index 2d653810d..000000000 --- a/server/@types/shared/models/ApplicationSortField.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApplicationSortField = 'tier' | 'createdAt' | 'arrivalDate' | 'releaseType'; diff --git a/server/@types/shared/models/ApplicationSummary.ts b/server/@types/shared/models/ApplicationSummary.ts index 8cf8b2d1f..72c0718ec 100644 --- a/server/@types/shared/models/ApplicationSummary.ts +++ b/server/@types/shared/models/ApplicationSummary.ts @@ -2,12 +2,14 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Person } from './Person'; +import type { FullPerson } from './FullPerson'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; export type ApplicationSummary = { - type: string; id: string; - person: Person; - createdAt: string; + type: string; submittedAt?: string; + person: (FullPerson | RestrictedPerson | UnknownPerson); + createdAt: string; }; diff --git a/server/@types/shared/models/ApplicationTimeline.ts b/server/@types/shared/models/ApplicationTimeline.ts index cf858a30c..38703271b 100644 --- a/server/@types/shared/models/ApplicationTimeline.ts +++ b/server/@types/shared/models/ApplicationTimeline.ts @@ -3,14 +3,15 @@ /* tslint:disable */ /* eslint-disable */ import type { ApprovedPremisesApplicationStatus } from './ApprovedPremisesApplicationStatus'; +import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; +import type { TemporaryAccommodationUser } from './TemporaryAccommodationUser'; import type { TimelineEvent } from './TimelineEvent'; -import type { User } from './User'; export type ApplicationTimeline = { id: string; createdAt: string; isOfflineApplication: boolean; - status?: ApprovedPremisesApplicationStatus; - createdBy?: User; timelineEvents: Array; + status?: ApprovedPremisesApplicationStatus; + createdBy?: (ApprovedPremisesUser | TemporaryAccommodationUser); }; diff --git a/server/@types/shared/models/ApplicationTimelineNote.ts b/server/@types/shared/models/ApplicationTimelineNote.ts index 77c079a7e..4c220973a 100644 --- a/server/@types/shared/models/ApplicationTimelineNote.ts +++ b/server/@types/shared/models/ApplicationTimelineNote.ts @@ -2,14 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { User } from './User'; -/** - * Notes added to an application - */ +import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; +import type { TemporaryAccommodationUser } from './TemporaryAccommodationUser'; export type ApplicationTimelineNote = { - id?: string; - createdByUser?: User; note: string; + id?: string; + createdByUser?: (ApprovedPremisesUser | TemporaryAccommodationUser); createdAt?: string; }; diff --git a/server/@types/shared/models/ApprovedPremisesApplication.ts b/server/@types/shared/models/ApprovedPremisesApplication.ts index ec7bae953..2e9570ef7 100644 --- a/server/@types/shared/models/ApprovedPremisesApplication.ts +++ b/server/@types/shared/models/ApprovedPremisesApplication.ts @@ -2,38 +2,47 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { ApArea } from './ApArea'; -import type { Application } from './Application'; import type { ApprovedPremisesApplicationStatus } from './ApprovedPremisesApplicationStatus'; import type { ApType } from './ApType'; import type { AssessmentDecision } from './AssessmentDecision'; import type { Cas1ApplicationUserDetails } from './Cas1ApplicationUserDetails'; import type { Cas1CruManagementArea } from './Cas1CruManagementArea'; +import type { FullPerson } from './FullPerson'; import type { PersonRisks } from './PersonRisks'; import type { PersonStatus } from './PersonStatus'; -export type ApprovedPremisesApplication = (Application & { +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; +export type ApprovedPremisesApplication = { + createdByUserId: string; + schemaVersion: string; + outdatedSchema: boolean; + status: ApprovedPremisesApplicationStatus; + type: string; + id: string; + person: (FullPerson | RestrictedPerson | UnknownPerson); + createdAt: string; isWomensApplication?: boolean; /** * Use apType - * @deprecated */ isPipeApplication?: boolean; isEmergencyApplication?: boolean; /** * Use apType - * @deprecated */ isEsapApplication?: boolean; apType?: ApType; arrivalDate?: string; risks?: PersonRisks; - createdByUserId: string; - schemaVersion: string; - outdatedSchema: boolean; - data?: AnyValue; - document?: AnyValue; - status: ApprovedPremisesApplicationStatus; + /** + * Any object that conforms to the current JSON schema for an application + */ + data?: Record; + /** + * Any object that conforms to the current JSON schema for an application + */ + document?: Record; assessmentId?: string; assessmentDecision?: AssessmentDecision; assessmentDecisionDate?: string; @@ -48,5 +57,5 @@ export type ApprovedPremisesApplication = (Application & { caseManagerIsNotApplicant?: boolean; caseManagerUserDetails?: Cas1ApplicationUserDetails; licenceExpiryDate?: string; -}); +}; diff --git a/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts b/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts index cffd5fcd3..bde64d8b8 100644 --- a/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts +++ b/server/@types/shared/models/ApprovedPremisesApplicationSummary.ts @@ -7,17 +7,22 @@ import type { ApprovedPremisesApplicationStatus } from './ApprovedPremisesApplic import type { PersonRisks } from './PersonRisks'; import type { ReleaseTypeOption } from './ReleaseTypeOption'; export type ApprovedPremisesApplicationSummary = (ApplicationSummary & { + createdByUserId?: string; + status?: ApprovedPremisesApplicationStatus; + isWithdrawn?: boolean; + hasRequestsForPlacement?: boolean; isWomensApplication?: boolean; isPipeApplication?: boolean; isEmergencyApplication?: boolean; isEsapApplication?: boolean; arrivalDate?: string; risks?: PersonRisks; + tier?: string; + releaseType?: ReleaseTypeOption; +} & { createdByUserId: string; status: ApprovedPremisesApplicationStatus; - tier?: string; isWithdrawn: boolean; - releaseType?: ReleaseTypeOption; hasRequestsForPlacement: boolean; }); diff --git a/server/@types/shared/models/ApprovedPremisesAssessment.ts b/server/@types/shared/models/ApprovedPremisesAssessment.ts index 30a495765..e4a53bbaf 100644 --- a/server/@types/shared/models/ApprovedPremisesAssessment.ts +++ b/server/@types/shared/models/ApprovedPremisesAssessment.ts @@ -7,9 +7,12 @@ import type { ApprovedPremisesAssessmentStatus } from './ApprovedPremisesAssessm import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; import type { Assessment } from './Assessment'; export type ApprovedPremisesAssessment = (Assessment & { - application: ApprovedPremisesApplication; + application?: ApprovedPremisesApplication; + createdFromAppeal?: boolean; allocatedToStaffMember?: ApprovedPremisesUser; status?: ApprovedPremisesAssessmentStatus; +} & { + application: ApprovedPremisesApplication; createdFromAppeal: boolean; }); diff --git a/server/@types/shared/models/ApprovedPremisesAssessmentSummary.ts b/server/@types/shared/models/ApprovedPremisesAssessmentSummary.ts index 33b3d2cb7..e05a213ca 100644 --- a/server/@types/shared/models/ApprovedPremisesAssessmentSummary.ts +++ b/server/@types/shared/models/ApprovedPremisesAssessmentSummary.ts @@ -5,6 +5,9 @@ import type { ApprovedPremisesAssessmentStatus } from './ApprovedPremisesAssessmentStatus'; import type { AssessmentSummary } from './AssessmentSummary'; export type ApprovedPremisesAssessmentSummary = (AssessmentSummary & { + status?: ApprovedPremisesAssessmentStatus; + dueAt?: string; +} & { status: ApprovedPremisesAssessmentStatus; dueAt: string; }); diff --git a/server/@types/shared/models/ApprovedPremisesBedSearchParameters.ts b/server/@types/shared/models/ApprovedPremisesBedSearchParameters.ts index e19fb8d65..4a103edb0 100644 --- a/server/@types/shared/models/ApprovedPremisesBedSearchParameters.ts +++ b/server/@types/shared/models/ApprovedPremisesBedSearchParameters.ts @@ -5,6 +5,16 @@ import type { BedSearchParameters } from './BedSearchParameters'; import type { PlacementCriteria } from './PlacementCriteria'; export type ApprovedPremisesBedSearchParameters = (BedSearchParameters & { + /** + * The postcode district to search outwards from + */ + postcodeDistrict?: string; + /** + * Maximum number of miles from the postcode district to search, only required if more than 50 miles which is the default + */ + maxDistanceMiles?: number; + requiredCharacteristics?: Array; +} & { /** * The postcode district to search outwards from */ diff --git a/server/@types/shared/models/ApprovedPremisesBedSearchResult.ts b/server/@types/shared/models/ApprovedPremisesBedSearchResult.ts index 35fb04598..d5c3e2468 100644 --- a/server/@types/shared/models/ApprovedPremisesBedSearchResult.ts +++ b/server/@types/shared/models/ApprovedPremisesBedSearchResult.ts @@ -4,6 +4,11 @@ /* eslint-disable */ import type { BedSearchResult } from './BedSearchResult'; export type ApprovedPremisesBedSearchResult = (BedSearchResult & { + /** + * how many miles away from the postcode district the Premises this Bed belongs to is + */ + distanceMiles?: number; +} & { /** * how many miles away from the postcode district the Premises this Bed belongs to is */ diff --git a/server/@types/shared/models/ApprovedPremisesUser.ts b/server/@types/shared/models/ApprovedPremisesUser.ts index 81c3d1890..1e954fa90 100644 --- a/server/@types/shared/models/ApprovedPremisesUser.ts +++ b/server/@types/shared/models/ApprovedPremisesUser.ts @@ -9,22 +9,19 @@ import type { NamedId } from './NamedId'; import type { User } from './User'; import type { UserQualification } from './UserQualification'; export type ApprovedPremisesUser = (User & { + qualifications?: Array; + roles?: Array; + apArea?: ApArea; + cruManagementArea?: NamedId; + cruManagementAreaDefault?: NamedId; + permissions?: Array; + cruManagementAreaOverride?: NamedId; + version?: number; +} & { qualifications: Array; roles: Array; - permissions?: Array; apArea: ApArea; - /** - * CRU Management Area to use. This will be the same as cruManagementAreaDefault unless cruManagementAreaOverride is defined - */ cruManagementArea: NamedId; - /** - * The CRU Management Area used if no override is defined. This is provided to support the user configuration page. - */ cruManagementAreaDefault: NamedId; - /** - * The CRU Management Area manually set on this user. This is provided to support the user configuration page. - */ - cruManagementAreaOverride?: NamedId; - version?: number; }); diff --git a/server/@types/shared/models/ApprovedPremisesUserPermission.ts b/server/@types/shared/models/ApprovedPremisesUserPermission.ts index 6001395ab..e8bae2f9b 100644 --- a/server/@types/shared/models/ApprovedPremisesUserPermission.ts +++ b/server/@types/shared/models/ApprovedPremisesUserPermission.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type ApprovedPremisesUserPermission = 'cas1_adhoc_booking_create' | 'cas1_application_withdraw_others' | 'cas1_assess_appealed_application' | 'cas1_assess_application' | 'cas1_assess_placement_application' | 'cas1_assess_placement_request' | 'cas1_booking_create' | 'cas1_booking_change_dates' | 'cas1_booking_withdraw' | 'cas1_out_of_service_bed_create' | 'cas1_process_an_appeal' | 'cas1_user_list' | 'cas1_user_management' | 'cas1_view_assigned_assessments' | 'cas1_view_cru_dashboard' | 'cas1_view_manage_tasks' | 'cas1_view_out_of_service_beds' | 'cas1_request_for_placement_withdraw_others' | 'cas1_space_booking_create' | 'cas1_space_booking_list' | 'cas1_space_booking_record_arrival' | 'cas1_space_booking_record_departure' | 'cas1_space_booking_record_non_arrival' | 'cas1_space_booking_record_keyworker' | 'cas1_space_booking_view' | 'cas1_space_booking_withdraw' | 'cas1_premises_view_capacity' | 'cas1_premises_view_summary' | 'cas1_reports_view'; +export type ApprovedPremisesUserPermission = 'cas1_adhoc_booking_create' | 'cas1_application_withdraw_others' | 'cas1_assess_appealed_application' | 'cas1_assess_application' | 'cas1_assess_placement_application' | 'cas1_assess_placement_request' | 'cas1_booking_create' | 'cas1_booking_change_dates' | 'cas1_booking_withdraw' | 'cas1_out_of_service_bed_create' | 'cas1_process_an_appeal' | 'cas1_user_list' | 'cas1_user_management' | 'cas1_view_assigned_assessments' | 'cas1_view_cru_dashboard' | 'cas1_view_manage_tasks' | 'cas1_view_out_of_service_beds' | 'cas1_request_for_placement_withdraw_others' | 'cas1_space_booking_create' | 'cas1_space_booking_list' | 'cas1_space_booking_record_arrival' | 'cas1_space_booking_record_departure' | 'cas1_space_booking_record_non_arrival' | 'cas1_space_booking_record_keyworker' | 'cas1_space_booking_view' | 'cas1_space_booking_withdraw' | 'cas1_premises_view' | 'cas1_premises_manage' | 'cas1_reports_view'; diff --git a/server/@types/shared/models/ApprovedPremisesUserRole.ts b/server/@types/shared/models/ApprovedPremisesUserRole.ts index 1ef165260..5225291ad 100644 --- a/server/@types/shared/models/ApprovedPremisesUserRole.ts +++ b/server/@types/shared/models/ApprovedPremisesUserRole.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type ApprovedPremisesUserRole = 'assessor' | 'matcher' | 'future_manager' | 'workflow_manager' | 'cru_member' | 'cru_member_find_and_book_beta' | 'applicant' | 'role_admin' | 'report_viewer' | 'excluded_from_assess_allocation' | 'excluded_from_match_allocation' | 'excluded_from_placement_application_allocation' | 'appeals_manager' | 'janitor' | 'user_manager'; +export type ApprovedPremisesUserRole = 'assessor' | 'matcher' | 'future_manager' | 'workflow_manager' | 'cru_member' | 'cru_member_find_and_book_beta' | 'cru_member_enable_out_of_service_beds' | 'applicant' | 'role_admin' | 'report_viewer' | 'excluded_from_assess_allocation' | 'excluded_from_match_allocation' | 'excluded_from_placement_application_allocation' | 'appeals_manager' | 'janitor' | 'user_manager'; diff --git a/server/@types/shared/models/ArrayOfOASysOffenceDetailsQuestions.ts b/server/@types/shared/models/ArrayOfOASysOffenceDetailsQuestions.ts deleted file mode 100644 index ed1859243..000000000 --- a/server/@types/shared/models/ArrayOfOASysOffenceDetailsQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysOffenceDetailsQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysRiskContributorsQuestions.ts b/server/@types/shared/models/ArrayOfOASysRiskContributorsQuestions.ts deleted file mode 100644 index 78a8f48ff..000000000 --- a/server/@types/shared/models/ArrayOfOASysRiskContributorsQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysRiskContributorsQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysRiskManagementPlanQuestions.ts b/server/@types/shared/models/ArrayOfOASysRiskManagementPlanQuestions.ts deleted file mode 100644 index 062516173..000000000 --- a/server/@types/shared/models/ArrayOfOASysRiskManagementPlanQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysRiskManagementPlanQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysRiskManagementQuestions.ts b/server/@types/shared/models/ArrayOfOASysRiskManagementQuestions.ts deleted file mode 100644 index a83646670..000000000 --- a/server/@types/shared/models/ArrayOfOASysRiskManagementQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysRiskManagementQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysRiskOfSeriousHarmSummaryQuestions.ts b/server/@types/shared/models/ArrayOfOASysRiskOfSeriousHarmSummaryQuestions.ts deleted file mode 100644 index c9e81f401..000000000 --- a/server/@types/shared/models/ArrayOfOASysRiskOfSeriousHarmSummaryQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysRiskOfSeriousHarmSummaryQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysRiskToSelfQuestions.ts b/server/@types/shared/models/ArrayOfOASysRiskToSelfQuestions.ts deleted file mode 100644 index 85e1675ff..000000000 --- a/server/@types/shared/models/ArrayOfOASysRiskToSelfQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysRiskToSelfQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysRisksToOthersQuestions.ts b/server/@types/shared/models/ArrayOfOASysRisksToOthersQuestions.ts deleted file mode 100644 index 6c25705c5..000000000 --- a/server/@types/shared/models/ArrayOfOASysRisksToOthersQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysRisksToOthersQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysRisksToTheIndividualQuestions.ts b/server/@types/shared/models/ArrayOfOASysRisksToTheIndividualQuestions.ts deleted file mode 100644 index 4eccfb0de..000000000 --- a/server/@types/shared/models/ArrayOfOASysRisksToTheIndividualQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysQuestion } from './OASysQuestion'; -export type ArrayOfOASysRisksToTheIndividualQuestions = Array; diff --git a/server/@types/shared/models/ArrayOfOASysSupportingInformationQuestions.ts b/server/@types/shared/models/ArrayOfOASysSupportingInformationQuestions.ts deleted file mode 100644 index d1a1ab7f9..000000000 --- a/server/@types/shared/models/ArrayOfOASysSupportingInformationQuestions.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { OASysSupportingInformationQuestion } from './OASysSupportingInformationQuestion'; -export type ArrayOfOASysSupportingInformationQuestions = Array; diff --git a/server/@types/shared/models/Arrival.ts b/server/@types/shared/models/Arrival.ts index cce95cdec..0a282ee37 100644 --- a/server/@types/shared/models/Arrival.ts +++ b/server/@types/shared/models/Arrival.ts @@ -6,9 +6,9 @@ export type Arrival = { expectedDepartureDate: string; arrivalDate: string; arrivalTime: string; - notes?: string; - keyWorkerStaffCode?: string; bookingId: string; createdAt: string; + notes?: string; + keyWorkerStaffCode?: string; }; diff --git a/server/@types/shared/models/Assessment.ts b/server/@types/shared/models/Assessment.ts index cdcfba21b..ca42733cd 100644 --- a/server/@types/shared/models/Assessment.ts +++ b/server/@types/shared/models/Assessment.ts @@ -2,22 +2,26 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { AssessmentDecision } from './AssessmentDecision'; import type { ClarificationNote } from './ClarificationNote'; -import type { ReferralHistoryNote } from './ReferralHistoryNote'; +import type { ReferralHistoryDomainEventNote } from './ReferralHistoryDomainEventNote'; +import type { ReferralHistorySystemNote } from './ReferralHistorySystemNote'; +import type { ReferralHistoryUserNote } from './ReferralHistoryUserNote'; export type Assessment = { - service: string; + /** + * Any object that conforms to the current JSON schema for an application + */ + data?: Record; id: string; - schemaVersion: string; outdatedSchema: boolean; - createdAt: string; + clarificationNotes: Array; + rejectionRationale?: string; + schemaVersion: string; allocatedAt?: string; submittedAt?: string; decision?: AssessmentDecision; - rejectionRationale?: string; - data?: AnyValue; - clarificationNotes: Array; - referralHistoryNotes?: Array; + createdAt: string; + service: string; + referralHistoryNotes?: Array<(ReferralHistoryDomainEventNote | ReferralHistorySystemNote | ReferralHistoryUserNote)>; }; diff --git a/server/@types/shared/models/AssessmentAcceptance.ts b/server/@types/shared/models/AssessmentAcceptance.ts index aa7f604b8..047afa4ba 100644 --- a/server/@types/shared/models/AssessmentAcceptance.ts +++ b/server/@types/shared/models/AssessmentAcceptance.ts @@ -2,12 +2,17 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { ApType } from './ApType'; import type { PlacementDates } from './PlacementDates'; import type { PlacementRequirements } from './PlacementRequirements'; +/** + * Information needed to accept an assessment + */ export type AssessmentAcceptance = { - document: AnyValue; + /** + * Any object that conforms to the current JSON schema for an application + */ + document: Record; requirements?: PlacementRequirements; placementDates?: PlacementDates; apType?: ApType; diff --git a/server/@types/shared/models/AssessmentRejection.ts b/server/@types/shared/models/AssessmentRejection.ts index 1529c026d..895bd925f 100644 --- a/server/@types/shared/models/AssessmentRejection.ts +++ b/server/@types/shared/models/AssessmentRejection.ts @@ -2,9 +2,14 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; +/** + * Rejection info + */ export type AssessmentRejection = { - document: AnyValue; + /** + * Any object that conforms to the current JSON schema for an application + */ + document: Record; rejectionRationale: string; referralRejectionReasonId?: string; referralRejectionReasonDetail?: string; diff --git a/server/@types/shared/models/AssessmentSummary.ts b/server/@types/shared/models/AssessmentSummary.ts index 26f0fd4e3..f6037d0dd 100644 --- a/server/@types/shared/models/AssessmentSummary.ts +++ b/server/@types/shared/models/AssessmentSummary.ts @@ -3,17 +3,19 @@ /* tslint:disable */ /* eslint-disable */ import type { AssessmentDecision } from './AssessmentDecision'; -import type { Person } from './Person'; +import type { FullPerson } from './FullPerson'; import type { PersonRisks } from './PersonRisks'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; export type AssessmentSummary = { - type: string; id: string; + type: string; + dateOfInfoRequest?: string; applicationId: string; + person: (FullPerson | RestrictedPerson | UnknownPerson); + risks?: PersonRisks; arrivalDate?: string; - createdAt: string; - dateOfInfoRequest?: string; decision?: AssessmentDecision; - risks?: PersonRisks; - person: Person; + createdAt: string; }; diff --git a/server/@types/shared/models/AssessmentTask.ts b/server/@types/shared/models/AssessmentTask.ts index e969c7536..50da60650 100644 --- a/server/@types/shared/models/AssessmentTask.ts +++ b/server/@types/shared/models/AssessmentTask.ts @@ -5,7 +5,9 @@ import type { AssessmentDecision } from './AssessmentDecision'; import type { Task } from './Task'; export type AssessmentTask = (Task & { - createdFromAppeal: boolean; + createdFromAppeal?: boolean; outcome?: AssessmentDecision; +} & { + createdFromAppeal: boolean; }); diff --git a/server/@types/shared/models/BedDetail.ts b/server/@types/shared/models/BedDetail.ts index 6fb14a0d6..ccf2cafe6 100644 --- a/server/@types/shared/models/BedDetail.ts +++ b/server/@types/shared/models/BedDetail.ts @@ -2,9 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { BedSummary } from './BedSummary'; +import type { BedStatus } from './BedStatus'; import type { CharacteristicPair } from './CharacteristicPair'; -export type BedDetail = (BedSummary & { +export type BedDetail = { + id: string; + name: string; + roomName: string; + status: BedStatus; characteristics: Array; -}); +}; diff --git a/server/@types/shared/models/BedSearchAttributes.ts b/server/@types/shared/models/BedSearchAttributes.ts index 73236ec41..eba6d84f2 100644 --- a/server/@types/shared/models/BedSearchAttributes.ts +++ b/server/@types/shared/models/BedSearchAttributes.ts @@ -2,4 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type BedSearchAttributes = 'isSharedProperty' | 'isSingleOccupancy' | 'isWheelchairAccessible' | 'sharedProperty' | 'singleOccupancy' | 'wheelchairAccessible'; +/** + * Bedspace and property attributes to filter on + */ +export type BedSearchAttributes = 'isSharedProperty' | 'isSingleOccupancy' | 'isWheelchairAccessible'; diff --git a/server/@types/shared/models/BedSearchParameters.ts b/server/@types/shared/models/BedSearchParameters.ts index f4fe06817..c95d63662 100644 --- a/server/@types/shared/models/BedSearchParameters.ts +++ b/server/@types/shared/models/BedSearchParameters.ts @@ -3,14 +3,14 @@ /* tslint:disable */ /* eslint-disable */ export type BedSearchParameters = { - serviceName: string; - /** - * The date the Bed will need to be free from - */ - startDate: string; /** * The number of days the Bed will need to be free from the start_date until */ durationDays: number; + /** + * The date the Bed will need to be free from + */ + startDate: string; + serviceName: string; }; diff --git a/server/@types/shared/models/BedSearchResult.ts b/server/@types/shared/models/BedSearchResult.ts index c361ebe4b..55a862656 100644 --- a/server/@types/shared/models/BedSearchResult.ts +++ b/server/@types/shared/models/BedSearchResult.ts @@ -7,9 +7,9 @@ import type { BedSearchResultPremisesSummary } from './BedSearchResultPremisesSu import type { BedSearchResultRoomSummary } from './BedSearchResultRoomSummary'; import type { ServiceName } from './ServiceName'; export type BedSearchResult = { - serviceName: ServiceName; premises: BedSearchResultPremisesSummary; room: BedSearchResultRoomSummary; + serviceName: ServiceName; bed: BedSearchResultBedSummary; }; diff --git a/server/@types/shared/models/BedSearchResultPremisesSummary.ts b/server/@types/shared/models/BedSearchResultPremisesSummary.ts index 2bc393de2..ba459ba75 100644 --- a/server/@types/shared/models/BedSearchResultPremisesSummary.ts +++ b/server/@types/shared/models/BedSearchResultPremisesSummary.ts @@ -7,16 +7,16 @@ export type BedSearchResultPremisesSummary = { id: string; name: string; addressLine1: string; - addressLine2?: string; - town?: string; postcode: string; - probationDeliveryUnitName?: string; - notes?: string; characteristics: Array; /** * the total number of Beds in the Premises */ bedCount: number; + addressLine2?: string; + town?: string; + probationDeliveryUnitName?: string; + notes?: string; /** * the total number of booked Beds in the Premises */ diff --git a/server/@types/shared/models/BedSearchResults.ts b/server/@types/shared/models/BedSearchResults.ts index 14dcd00e5..320da219b 100644 --- a/server/@types/shared/models/BedSearchResults.ts +++ b/server/@types/shared/models/BedSearchResults.ts @@ -2,7 +2,8 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { BedSearchResult } from './BedSearchResult'; +import type { ApprovedPremisesBedSearchResult } from './ApprovedPremisesBedSearchResult'; +import type { TemporaryAccommodationBedSearchResult } from './TemporaryAccommodationBedSearchResult'; export type BedSearchResults = { /** * How many distinct Rooms the Beds in the results belong to @@ -16,6 +17,6 @@ export type BedSearchResults = { * How many Beds are in the results */ resultsBedCount: number; - results: Array; + results: Array<(ApprovedPremisesBedSearchResult | TemporaryAccommodationBedSearchResult)>; }; diff --git a/server/@types/shared/models/Booking.ts b/server/@types/shared/models/Booking.ts index b484f2b79..188a9d78f 100644 --- a/server/@types/shared/models/Booking.ts +++ b/server/@types/shared/models/Booking.ts @@ -3,41 +3,48 @@ /* tslint:disable */ /* eslint-disable */ import type { Arrival } from './Arrival'; -import type { BookingBody } from './BookingBody'; +import type { Bed } from './Bed'; import type { BookingPremisesSummary } from './BookingPremisesSummary'; import type { BookingStatus } from './BookingStatus'; import type { Cancellation } from './Cancellation'; import type { Confirmation } from './Confirmation'; import type { Departure } from './Departure'; import type { Extension } from './Extension'; +import type { FullPerson } from './FullPerson'; import type { Nonarrival } from './Nonarrival'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { ServiceName } from './ServiceName'; +import type { StaffMember } from './StaffMember'; import type { Turnaround } from './Turnaround'; -export type Booking = (BookingBody & { +import type { UnknownPerson } from './UnknownPerson'; +export type Booking = { + id: string; + person: (FullPerson | RestrictedPerson | UnknownPerson); + arrivalDate: string; + originalArrivalDate: string; + departureDate: string; + originalDepartureDate: string; + createdAt: string; + serviceName: ServiceName; status: BookingStatus; extensions: Array; - arrival?: Arrival | null; - /** - * The latest version of the departure, if it exists - */ - departure?: Departure | null; /** * The full history of the departure */ departures: Array; - nonArrival?: Nonarrival | null; - /** - * The latest version of the cancellation, if it exists - */ - cancellation?: Cancellation | null; /** * The full history of the cancellation */ cancellations: Array; - confirmation?: Confirmation | null; - /** - * The latest version of the turnaround, if it exists - */ - turnaround?: Turnaround | null; + premises: BookingPremisesSummary; + keyWorker?: StaffMember; + bed?: Bed; + arrival?: Arrival; + departure?: Departure; + nonArrival?: Nonarrival; + cancellation?: Cancellation; + confirmation?: Confirmation; + turnaround?: Turnaround; /** * The full history of turnarounds */ @@ -46,6 +53,5 @@ export type Booking = (BookingBody & { effectiveEndDate?: string; applicationId?: string; assessmentId?: string; - premises: BookingPremisesSummary; -}); +}; diff --git a/server/@types/shared/models/BookingBody.ts b/server/@types/shared/models/BookingBody.ts deleted file mode 100644 index 916320053..000000000 --- a/server/@types/shared/models/BookingBody.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Bed } from './Bed'; -import type { Person } from './Person'; -import type { ServiceName } from './ServiceName'; -import type { StaffMember } from './StaffMember'; -export type BookingBody = { - id: string; - person: Person; - arrivalDate: string; - originalArrivalDate: string; - departureDate: string; - originalDepartureDate: string; - createdAt: string; - /** - * KeyWorker is a legacy field only used by CAS1. It is not longer being captured or populated - * @deprecated - */ - keyWorker?: StaffMember; - serviceName: ServiceName; - bed?: Bed; -}; - diff --git a/server/@types/shared/models/BookingSearchResultPersonSummary.ts b/server/@types/shared/models/BookingSearchResultPersonSummary.ts index 339d3c06e..c6938c126 100644 --- a/server/@types/shared/models/BookingSearchResultPersonSummary.ts +++ b/server/@types/shared/models/BookingSearchResultPersonSummary.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ export type BookingSearchResultPersonSummary = { - name?: string; crn: string; + name?: string; }; diff --git a/server/@types/shared/models/BookingSearchResultPremisesSummary.ts b/server/@types/shared/models/BookingSearchResultPremisesSummary.ts index c3860d832..9e8736ae2 100644 --- a/server/@types/shared/models/BookingSearchResultPremisesSummary.ts +++ b/server/@types/shared/models/BookingSearchResultPremisesSummary.ts @@ -6,8 +6,8 @@ export type BookingSearchResultPremisesSummary = { id: string; name: string; addressLine1: string; + postcode: string; addressLine2?: string; town?: string; - postcode: string; }; diff --git a/server/@types/shared/models/BookingSummary.ts b/server/@types/shared/models/BookingSummary.ts index 61007bd51..6a7b253ca 100644 --- a/server/@types/shared/models/BookingSummary.ts +++ b/server/@types/shared/models/BookingSummary.ts @@ -2,6 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Type } from './Type'; export type BookingSummary = { id: string; premisesId: string; @@ -9,6 +10,6 @@ export type BookingSummary = { arrivalDate: string; departureDate: string; createdAt: string; - type: 'space' | 'legacy'; + type: Type; }; diff --git a/server/@types/shared/models/CacheType.ts b/server/@types/shared/models/CacheType.ts deleted file mode 100644 index 63add29f0..000000000 --- a/server/@types/shared/models/CacheType.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type CacheType = 'qCodeStaffMembers' | 'userAccess' | 'staffDetails' | 'teamsManagingCase' | 'ukBankHolidays' | 'inmateDetails'; diff --git a/server/@types/shared/models/Cancellation.ts b/server/@types/shared/models/Cancellation.ts index 1aa4d8627..cd9745e79 100644 --- a/server/@types/shared/models/Cancellation.ts +++ b/server/@types/shared/models/Cancellation.ts @@ -3,14 +3,17 @@ /* tslint:disable */ /* eslint-disable */ import type { CancellationReason } from './CancellationReason'; +/** + * The latest version of the cancellation, if it exists + */ export type Cancellation = { - id?: string; bookingId: string; date: string; reason: CancellationReason; - notes?: string; createdAt: string; premisesName: string; + id?: string; + notes?: string; otherReason?: string; }; diff --git a/server/@types/shared/models/Cas2Application.ts b/server/@types/shared/models/Cas2Application.ts index 999177bd9..a60a8f4a3 100644 --- a/server/@types/shared/models/Cas2Application.ts +++ b/server/@types/shared/models/Cas2Application.ts @@ -2,22 +2,32 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { Application } from './Application'; import type { ApplicationStatus } from './ApplicationStatus'; import type { Cas2Assessment } from './Cas2Assessment'; import type { Cas2TimelineEvent } from './Cas2TimelineEvent'; import type { NomisUser } from './NomisUser'; export type Cas2Application = (Application & { - createdBy: NomisUser; - schemaVersion: string; - outdatedSchema: boolean; - data?: AnyValue; - document?: AnyValue; - status: ApplicationStatus; + createdBy?: NomisUser; + schemaVersion?: string; + outdatedSchema?: boolean; + status?: ApplicationStatus; + /** + * Any object that conforms to the current JSON schema for an application + */ + data?: Record; + /** + * Any object that conforms to the current JSON schema for an application + */ + document?: Record; submittedAt?: string; telephoneNumber?: string; assessment?: Cas2Assessment; timelineEvents?: Array; +} & { + createdBy: NomisUser; + schemaVersion: string; + outdatedSchema: boolean; + status: ApplicationStatus; }); diff --git a/server/@types/shared/models/Cas2ApplicationNote.ts b/server/@types/shared/models/Cas2ApplicationNote.ts deleted file mode 100644 index 12ba53960..000000000 --- a/server/@types/shared/models/Cas2ApplicationNote.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * Notes added to an application - */ -export type Cas2ApplicationNote = { - id?: string; - email: string; - name: string; - body: string; - createdAt: string; -}; - diff --git a/server/@types/shared/models/Cas2ApplicationStatus.ts b/server/@types/shared/models/Cas2ApplicationStatus.ts deleted file mode 100644 index 4bbf45fee..000000000 --- a/server/@types/shared/models/Cas2ApplicationStatus.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Cas2ApplicationStatusDetail } from './Cas2ApplicationStatusDetail'; -export type Cas2ApplicationStatus = { - id: string; - name: string; - label: string; - description: string; - statusDetails: Array; -}; - diff --git a/server/@types/shared/models/Cas2ApplicationStatusDetail.ts b/server/@types/shared/models/Cas2ApplicationStatusDetail.ts deleted file mode 100644 index 5e6838714..000000000 --- a/server/@types/shared/models/Cas2ApplicationStatusDetail.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Cas2ApplicationStatusDetail = { - id: string; - name: string; - label: string; -}; - diff --git a/server/@types/shared/models/Cas2ApplicationSummary.ts b/server/@types/shared/models/Cas2ApplicationSummary.ts deleted file mode 100644 index 170c821ea..000000000 --- a/server/@types/shared/models/Cas2ApplicationSummary.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApplicationStatus } from './ApplicationStatus'; -import type { LatestCas2StatusUpdate } from './LatestCas2StatusUpdate'; -import type { PersonRisks } from './PersonRisks'; -export type Cas2ApplicationSummary = { - type: string; - id: string; - createdAt: string; - submittedAt?: string; - createdByUserId: string; - createdByUserName?: string; - status: ApplicationStatus; - latestStatusUpdate?: LatestCas2StatusUpdate; - risks?: PersonRisks; - hdcEligibilityDate?: string; - personName: string; - crn: string; - nomsNumber: string; -}; - diff --git a/server/@types/shared/models/Cas2AssessmentStatusUpdate.ts b/server/@types/shared/models/Cas2AssessmentStatusUpdate.ts deleted file mode 100644 index 1899230b7..000000000 --- a/server/@types/shared/models/Cas2AssessmentStatusUpdate.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Cas2AssessmentStatusUpdate = { - /** - * The "name" of the new status to be applied - */ - newStatus: string; - newStatusDetails?: Array; -}; - diff --git a/server/@types/shared/models/Cas2ReportName.ts b/server/@types/shared/models/Cas2ReportName.ts deleted file mode 100644 index 61993f85f..000000000 --- a/server/@types/shared/models/Cas2ReportName.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Cas2ReportName = 'submitted-applications' | 'application-status-updates' | 'unsubmitted-applications'; diff --git a/server/@types/shared/models/Cas2SubmittedApplication.ts b/server/@types/shared/models/Cas2SubmittedApplication.ts deleted file mode 100644 index b8793a7f0..000000000 --- a/server/@types/shared/models/Cas2SubmittedApplication.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AnyValue } from './AnyValue'; -import type { Cas2Assessment } from './Cas2Assessment'; -import type { Cas2TimelineEvent } from './Cas2TimelineEvent'; -import type { NomisUser } from './NomisUser'; -import type { Person } from './Person'; -export type Cas2SubmittedApplication = { - id: string; - person: Person; - createdAt: string; - submittedBy?: NomisUser; - schemaVersion: string; - outdatedSchema: boolean; - document?: AnyValue; - submittedAt?: string; - telephoneNumber?: string; - timelineEvents: Array; - assessment: Cas2Assessment; -}; - diff --git a/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts b/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts deleted file mode 100644 index 47da64dc9..000000000 --- a/server/@types/shared/models/Cas2SubmittedApplicationSummary.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Cas2SubmittedApplicationSummary = { - id: string; - createdByUserId: string; - crn: string; - nomsNumber: string; - personName: string; - createdAt: string; - submittedAt?: string; -}; - diff --git a/server/@types/shared/models/Cas2TimelineEvent.ts b/server/@types/shared/models/Cas2TimelineEvent.ts index d784c8ecc..068946be4 100644 --- a/server/@types/shared/models/Cas2TimelineEvent.ts +++ b/server/@types/shared/models/Cas2TimelineEvent.ts @@ -7,7 +7,7 @@ export type Cas2TimelineEvent = { type: TimelineEventType; occurredAt: string; label: string; - body?: string; createdByName: string; + body?: string; }; diff --git a/server/@types/shared/models/LatestCas2StatusUpdate.ts b/server/@types/shared/models/Category.ts similarity index 54% rename from server/@types/shared/models/LatestCas2StatusUpdate.ts rename to server/@types/shared/models/Category.ts index ae530a3a7..619ccc856 100644 --- a/server/@types/shared/models/LatestCas2StatusUpdate.ts +++ b/server/@types/shared/models/Category.ts @@ -2,8 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type LatestCas2StatusUpdate = { - statusId: string; - label: string; -}; - +export type Category = 'submitted' | 'unallocated' | 'in_review' | 'ready_to_place' | 'rejected' | 'completed'; diff --git a/server/@types/shared/models/Characteristic.ts b/server/@types/shared/models/Characteristic.ts index e37ef2dfc..ab1e0f9fd 100644 --- a/server/@types/shared/models/Characteristic.ts +++ b/server/@types/shared/models/Characteristic.ts @@ -2,11 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { ModelScope } from './ModelScope'; +import type { ServiceScope } from './ServiceScope'; export type Characteristic = { id: string; name: string; + serviceScope: ServiceScope; + modelScope: ModelScope; propertyName?: string; - serviceScope: 'approved-premises' | 'temporary-accommodation' | '*'; - modelScope: 'premises' | 'room' | '*'; }; diff --git a/server/@types/shared/models/CharacteristicPair.ts b/server/@types/shared/models/CharacteristicPair.ts index d1e2a1c54..225baefa9 100644 --- a/server/@types/shared/models/CharacteristicPair.ts +++ b/server/@types/shared/models/CharacteristicPair.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ export type CharacteristicPair = { - propertyName?: string; name: string; + propertyName?: string; }; diff --git a/server/@types/shared/models/ClarificationNote.ts b/server/@types/shared/models/ClarificationNote.ts index 271a88005..b21233117 100644 --- a/server/@types/shared/models/ClarificationNote.ts +++ b/server/@types/shared/models/ClarificationNote.ts @@ -5,9 +5,9 @@ export type ClarificationNote = { id: string; createdAt: string; - responseReceivedOn?: string; createdByStaffMemberId: string; query: string; + responseReceivedOn?: string; response?: string; }; diff --git a/server/@types/shared/models/ClassesToInclude.ts b/server/@types/shared/models/ClassesToInclude.ts new file mode 100644 index 000000000..27c6b73a1 --- /dev/null +++ b/server/@types/shared/models/ClassesToInclude.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { AllocatedFilter } from './AllocatedFilter'; +import type { AssessmentSortField } from './AssessmentSortField'; +import type { BookingSearchSortField } from './BookingSearchSortField'; +import type { Cas3ReportType } from './Cas3ReportType'; +import type { SortDirection } from './SortDirection'; +export type ClassesToInclude = { + allocatedFilter: AllocatedFilter; + sortDirection: SortDirection; + bookingSearchSortField: BookingSearchSortField; + cas3ReportType: Cas3ReportType; + assessmentSortField: AssessmentSortField; +}; + diff --git a/server/@types/shared/models/Confirmation.ts b/server/@types/shared/models/Confirmation.ts index ad0009ce7..a62954914 100644 --- a/server/@types/shared/models/Confirmation.ts +++ b/server/@types/shared/models/Confirmation.ts @@ -6,7 +6,7 @@ export type Confirmation = { id: string; bookingId: string; dateTime: string; - notes?: string; createdAt: string; + notes?: string; }; diff --git a/server/@types/shared/models/DatePeriod.ts b/server/@types/shared/models/DatePeriod.ts index 96306c3b3..6619a57be 100644 --- a/server/@types/shared/models/DatePeriod.ts +++ b/server/@types/shared/models/DatePeriod.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * 0, 1 or more dates can be specified depending upon the WithdrawableType + */ export type DatePeriod = { startDate: string; endDate: string; diff --git a/server/@types/shared/models/Departure.ts b/server/@types/shared/models/Departure.ts index 871286738..808426b03 100644 --- a/server/@types/shared/models/Departure.ts +++ b/server/@types/shared/models/Departure.ts @@ -5,14 +5,17 @@ import type { DepartureReason } from './DepartureReason'; import type { DestinationProvider } from './DestinationProvider'; import type { MoveOnCategory } from './MoveOnCategory'; +/** + * The latest version of the departure, if it exists + */ export type Departure = { id: string; bookingId: string; dateTime: string; reason: DepartureReason; - notes?: string; moveOnCategory: MoveOnCategory; - destinationProvider?: DestinationProvider; createdAt: string; + notes?: string; + destinationProvider?: DestinationProvider; }; diff --git a/server/@types/shared/models/DepartureReason.ts b/server/@types/shared/models/DepartureReason.ts index bad22bd7c..ef0fa65d8 100644 --- a/server/@types/shared/models/DepartureReason.ts +++ b/server/@types/shared/models/DepartureReason.ts @@ -6,7 +6,7 @@ export type DepartureReason = { id: string; name: string; serviceScope: string; - parentReasonId?: string; isActive: boolean; + parentReasonId?: string; }; diff --git a/server/@types/shared/models/Document.ts b/server/@types/shared/models/Document.ts index 08cce72f1..3176033be 100644 --- a/server/@types/shared/models/Document.ts +++ b/server/@types/shared/models/Document.ts @@ -3,9 +3,6 @@ /* tslint:disable */ /* eslint-disable */ import type { DocumentLevel } from './DocumentLevel'; -/** - * Meta Info about a file relating to an Offender - */ export type Document = { id: string; level: DocumentLevel; diff --git a/server/@types/shared/models/DocumentLevel.ts b/server/@types/shared/models/DocumentLevel.ts index 432b86568..c792221f9 100644 --- a/server/@types/shared/models/DocumentLevel.ts +++ b/server/@types/shared/models/DocumentLevel.ts @@ -2,7 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -/** - * The level at which a Document is associated - i.e. to the Offender or to a specific Conviction - */ export type DocumentLevel = 'Offender' | 'Conviction'; diff --git a/server/@types/shared/models/ErrorResponse.ts b/server/@types/shared/models/ErrorResponse.ts new file mode 100644 index 000000000..c4d824c7c --- /dev/null +++ b/server/@types/shared/models/ErrorResponse.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ErrorResponse = { + status: number; + errorCode?: string; + userMessage?: string; + developerMessage?: string; + moreInfo?: string; +}; + diff --git a/server/@types/shared/models/Extension.ts b/server/@types/shared/models/Extension.ts index 91bc5f692..b72f79251 100644 --- a/server/@types/shared/models/Extension.ts +++ b/server/@types/shared/models/Extension.ts @@ -7,7 +7,7 @@ export type Extension = { bookingId: string; previousDepartureDate: string; newDepartureDate: string; - notes?: string; createdAt: string; + notes?: string; }; diff --git a/server/@types/shared/models/FullPerson.ts b/server/@types/shared/models/FullPerson.ts index 3371bc36a..f18a07b1c 100644 --- a/server/@types/shared/models/FullPerson.ts +++ b/server/@types/shared/models/FullPerson.ts @@ -5,17 +5,22 @@ import type { Person } from './Person'; import type { PersonStatus } from './PersonStatus'; export type FullPerson = (Person & { - name: string; - dateOfBirth: string; + name?: string; + dateOfBirth?: string; + sex?: string; + status?: PersonStatus; nomsNumber?: string; pncNumber?: string; ethnicity?: string; nationality?: string; religionOrBelief?: string; - sex: string; genderIdentity?: string; - status: PersonStatus; prisonName?: string; isRestricted?: boolean; +} & { + name: string; + dateOfBirth: string; + sex: string; + status: PersonStatus; }); diff --git a/server/@types/shared/models/FullPersonSummary.ts b/server/@types/shared/models/FullPersonSummary.ts index b2e1d2965..2b8d55314 100644 --- a/server/@types/shared/models/FullPersonSummary.ts +++ b/server/@types/shared/models/FullPersonSummary.ts @@ -4,6 +4,10 @@ /* eslint-disable */ import type { PersonSummary } from './PersonSummary'; export type FullPersonSummary = (PersonSummary & { + name?: string; + isRestricted?: boolean; +} & { name: string; + isRestricted: boolean; }); diff --git a/server/@types/shared/models/HmppsSubjectAccessRequestContent.ts b/server/@types/shared/models/HmppsSubjectAccessRequestContent.ts new file mode 100644 index 000000000..228324744 --- /dev/null +++ b/server/@types/shared/models/HmppsSubjectAccessRequestContent.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type HmppsSubjectAccessRequestContent = { + /** + * The content of the subject access request response + */ + content: Record; +}; + diff --git a/server/@types/shared/models/SortOrder.ts b/server/@types/shared/models/LoadError.ts similarity index 71% rename from server/@types/shared/models/SortOrder.ts rename to server/@types/shared/models/LoadError.ts index f94edd137..f11ad7697 100644 --- a/server/@types/shared/models/SortOrder.ts +++ b/server/@types/shared/models/LoadError.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type SortOrder = 'ascending' | 'descending'; +export type LoadError = 'staff_record_not_found'; diff --git a/server/@types/shared/models/LostBed.ts b/server/@types/shared/models/LostBed.ts index 51c8f64a8..6d834b3ae 100644 --- a/server/@types/shared/models/LostBed.ts +++ b/server/@types/shared/models/LostBed.ts @@ -13,9 +13,9 @@ export type LostBed = { bedName: string; roomName: string; reason: LostBedReason; + status: LostBedStatus; referenceNumber?: string; notes?: string; - status: LostBedStatus; - cancellation?: LostBedCancellation | null; + cancellation?: LostBedCancellation; }; diff --git a/server/@types/shared/models/Temporality.ts b/server/@types/shared/models/ModelScope.ts similarity index 70% rename from server/@types/shared/models/Temporality.ts rename to server/@types/shared/models/ModelScope.ts index 7ed4e2e29..ecd373aea 100644 --- a/server/@types/shared/models/Temporality.ts +++ b/server/@types/shared/models/ModelScope.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type Temporality = 'past' | 'current' | 'future'; +export type ModelScope = 'premises' | 'room' | '*'; diff --git a/server/@types/shared/models/NamedId.ts b/server/@types/shared/models/NamedId.ts index e4c69f8a4..fc188a428 100644 --- a/server/@types/shared/models/NamedId.ts +++ b/server/@types/shared/models/NamedId.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ /** - * A generic stub for an object with a name and an ID. + * The CRU Management Area manually set on this user. This is provided to support the user configuration page. */ export type NamedId = { id: string; diff --git a/server/@types/shared/models/NewAppeal.ts b/server/@types/shared/models/NewAppeal.ts index da0034bb4..44d9dd4c7 100644 --- a/server/@types/shared/models/NewAppeal.ts +++ b/server/@types/shared/models/NewAppeal.ts @@ -3,6 +3,9 @@ /* tslint:disable */ /* eslint-disable */ import type { AppealDecision } from './AppealDecision'; +/** + * the appeal to add + */ export type NewAppeal = { appealDate: string; appealDetail: string; diff --git a/server/@types/shared/models/NewApplication.ts b/server/@types/shared/models/NewApplication.ts index e81455961..9a416cd41 100644 --- a/server/@types/shared/models/NewApplication.ts +++ b/server/@types/shared/models/NewApplication.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Information to create a blank application with + */ export type NewApplication = { crn: string; convictionId?: number; diff --git a/server/@types/shared/models/NewApplicationTimelineNote.ts b/server/@types/shared/models/NewApplicationTimelineNote.ts index 5ab372e3d..0260bafc1 100644 --- a/server/@types/shared/models/NewApplicationTimelineNote.ts +++ b/server/@types/shared/models/NewApplicationTimelineNote.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ /** - * A note to add to an application + * the note to add */ export type NewApplicationTimelineNote = { note: string; diff --git a/server/@types/shared/models/NewArrival.ts b/server/@types/shared/models/NewArrival.ts index 2a5341922..465051f1b 100644 --- a/server/@types/shared/models/NewArrival.ts +++ b/server/@types/shared/models/NewArrival.ts @@ -4,8 +4,8 @@ /* eslint-disable */ export type NewArrival = { type: string; - expectedDepartureDate: string; - notes?: string; keyWorkerStaffCode?: string; + notes?: string; + expectedDepartureDate: string; }; diff --git a/server/@types/shared/models/NewBooking.ts b/server/@types/shared/models/NewBooking.ts index c59c32ed7..59c88ff09 100644 --- a/server/@types/shared/models/NewBooking.ts +++ b/server/@types/shared/models/NewBooking.ts @@ -7,8 +7,8 @@ export type NewBooking = { crn: string; arrivalDate: string; departureDate: string; - bedId?: string; serviceName: ServiceName; + bedId?: string; enableTurnarounds?: boolean; assessmentId?: string; eventNumber?: string; diff --git a/server/@types/shared/models/NewBookingNotMade.ts b/server/@types/shared/models/NewBookingNotMade.ts index 087893a13..960d88c73 100644 --- a/server/@types/shared/models/NewBookingNotMade.ts +++ b/server/@types/shared/models/NewBookingNotMade.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Details about the failure to match + */ export type NewBookingNotMade = { notes?: string; }; diff --git a/server/@types/shared/models/NewCancellation.ts b/server/@types/shared/models/NewCancellation.ts index b706b9c8b..cf7bb4e14 100644 --- a/server/@types/shared/models/NewCancellation.ts +++ b/server/@types/shared/models/NewCancellation.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the cancellation + */ export type NewCancellation = { date: string; reason: string; diff --git a/server/@types/shared/models/NewCas2ApplicationNote.ts b/server/@types/shared/models/NewCas2ApplicationNote.ts deleted file mode 100644 index 9d96dca39..000000000 --- a/server/@types/shared/models/NewCas2ApplicationNote.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * A note to add to an application - */ -export type NewCas2ApplicationNote = { - note: string; -}; - diff --git a/server/@types/shared/models/NewCas2Arrival.ts b/server/@types/shared/models/NewCas2Arrival.ts index 36862eb34..d9300dfeb 100644 --- a/server/@types/shared/models/NewCas2Arrival.ts +++ b/server/@types/shared/models/NewCas2Arrival.ts @@ -4,6 +4,8 @@ /* eslint-disable */ import type { NewArrival } from './NewArrival'; export type NewCas2Arrival = (NewArrival & { + arrivalDate?: string; +} & { arrivalDate: string; }); diff --git a/server/@types/shared/models/NewCas3Arrival.ts b/server/@types/shared/models/NewCas3Arrival.ts index c92e393e8..ac2d4dbcf 100644 --- a/server/@types/shared/models/NewCas3Arrival.ts +++ b/server/@types/shared/models/NewCas3Arrival.ts @@ -4,6 +4,8 @@ /* eslint-disable */ import type { NewArrival } from './NewArrival'; export type NewCas3Arrival = (NewArrival & { + arrivalDate?: string; +} & { arrivalDate: string; }); diff --git a/server/@types/shared/models/NewClarificationNote.ts b/server/@types/shared/models/NewClarificationNote.ts index e0e437200..ab54d7727 100644 --- a/server/@types/shared/models/NewClarificationNote.ts +++ b/server/@types/shared/models/NewClarificationNote.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Clarification note + */ export type NewClarificationNote = { query: string; }; diff --git a/server/@types/shared/models/NewConfirmation.ts b/server/@types/shared/models/NewConfirmation.ts index b44e1423c..455c40aea 100644 --- a/server/@types/shared/models/NewConfirmation.ts +++ b/server/@types/shared/models/NewConfirmation.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the confirmation + */ export type NewConfirmation = { notes?: string; }; diff --git a/server/@types/shared/models/NewDateChange.ts b/server/@types/shared/models/NewDateChange.ts index 388a2a6d3..c5b1a4e4d 100644 --- a/server/@types/shared/models/NewDateChange.ts +++ b/server/@types/shared/models/NewDateChange.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the extension + */ export type NewDateChange = { newArrivalDate?: string; newDepartureDate?: string; diff --git a/server/@types/shared/models/NewDeparture.ts b/server/@types/shared/models/NewDeparture.ts index 9b083a77c..83c046d10 100644 --- a/server/@types/shared/models/NewDeparture.ts +++ b/server/@types/shared/models/NewDeparture.ts @@ -2,11 +2,14 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the departure + */ export type NewDeparture = { dateTime: string; reasonId: string; - notes?: string; moveOnCategoryId: string; + notes?: string; destinationProviderId?: string; }; diff --git a/server/@types/shared/models/NewExtension.ts b/server/@types/shared/models/NewExtension.ts index 8bb5f0174..b5b8a9c31 100644 --- a/server/@types/shared/models/NewExtension.ts +++ b/server/@types/shared/models/NewExtension.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the extension + */ export type NewExtension = { newDepartureDate: string; notes?: string; diff --git a/server/@types/shared/models/NewLostBed.ts b/server/@types/shared/models/NewLostBed.ts index f7e3e3adc..9036de6bf 100644 --- a/server/@types/shared/models/NewLostBed.ts +++ b/server/@types/shared/models/NewLostBed.ts @@ -2,12 +2,15 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the lost bed + */ export type NewLostBed = { startDate: string; endDate: string; reason: string; + bedId: string; referenceNumber?: string; notes?: string; - bedId: string; }; diff --git a/server/@types/shared/models/NewLostBedCancellation.ts b/server/@types/shared/models/NewLostBedCancellation.ts index ff866e7dd..b993ffa25 100644 --- a/server/@types/shared/models/NewLostBedCancellation.ts +++ b/server/@types/shared/models/NewLostBedCancellation.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the cancellation + */ export type NewLostBedCancellation = { notes?: string; }; diff --git a/server/@types/shared/models/NewPlacementApplication.ts b/server/@types/shared/models/NewPlacementApplication.ts index a5ce7b043..6ebbdacf3 100644 --- a/server/@types/shared/models/NewPlacementApplication.ts +++ b/server/@types/shared/models/NewPlacementApplication.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Details about the application + */ export type NewPlacementApplication = { applicationId: string; }; diff --git a/server/@types/shared/models/NewPlacementRequestBooking.ts b/server/@types/shared/models/NewPlacementRequestBooking.ts index 63ba57780..b7d02bdae 100644 --- a/server/@types/shared/models/NewPlacementRequestBooking.ts +++ b/server/@types/shared/models/NewPlacementRequestBooking.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Booking details + */ export type NewPlacementRequestBooking = { arrivalDate: string; departureDate: string; diff --git a/server/@types/shared/models/NewPremises.ts b/server/@types/shared/models/NewPremises.ts index 217e0a227..7fdd15362 100644 --- a/server/@types/shared/models/NewPremises.ts +++ b/server/@types/shared/models/NewPremises.ts @@ -6,14 +6,14 @@ import type { PropertyStatus } from './PropertyStatus'; export type NewPremises = { name: string; addressLine1: string; - addressLine2?: string; - town?: string; postcode: string; - notes?: string; - localAuthorityAreaId?: string; probationRegionId: string; characteristicIds: Array; status: PropertyStatus; + addressLine2?: string; + town?: string; + notes?: string; + localAuthorityAreaId?: string; pdu?: string; probationDeliveryUnitId?: string; turnaroundWorkingDayCount?: number; diff --git a/server/@types/shared/models/NewReferralHistoryUserNote.ts b/server/@types/shared/models/NewReferralHistoryUserNote.ts index 29fb0d460..62f38df64 100644 --- a/server/@types/shared/models/NewReferralHistoryUserNote.ts +++ b/server/@types/shared/models/NewReferralHistoryUserNote.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * User note + */ export type NewReferralHistoryUserNote = { message: string; }; diff --git a/server/@types/shared/models/NewRoom.ts b/server/@types/shared/models/NewRoom.ts index 0adbbdf7e..53472d28f 100644 --- a/server/@types/shared/models/NewRoom.ts +++ b/server/@types/shared/models/NewRoom.ts @@ -2,10 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the new room + */ export type NewRoom = { name: string; - notes?: string; characteristicIds: Array; + notes?: string; /** * End date of the bed availability, open for availability if not specified. */ diff --git a/server/@types/shared/models/NewTurnaround.ts b/server/@types/shared/models/NewTurnaround.ts index 75dce50a8..f2579a06b 100644 --- a/server/@types/shared/models/NewTurnaround.ts +++ b/server/@types/shared/models/NewTurnaround.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the turnaround + */ export type NewTurnaround = { workingDays: number; }; diff --git a/server/@types/shared/models/NewWithdrawal.ts b/server/@types/shared/models/NewWithdrawal.ts index 31c6de078..b8c1401ce 100644 --- a/server/@types/shared/models/NewWithdrawal.ts +++ b/server/@types/shared/models/NewWithdrawal.ts @@ -3,6 +3,9 @@ /* tslint:disable */ /* eslint-disable */ import type { WithdrawalReason } from './WithdrawalReason'; +/** + * details of the withdrawal + */ export type NewWithdrawal = { reason: WithdrawalReason; otherReason?: string; diff --git a/server/@types/shared/models/NomisUser.ts b/server/@types/shared/models/NomisUser.ts index 7a5a4cd84..d638c63af 100644 --- a/server/@types/shared/models/NomisUser.ts +++ b/server/@types/shared/models/NomisUser.ts @@ -6,7 +6,7 @@ export type NomisUser = { id: string; name: string; nomisUsername: string; - email?: string; isActive: boolean; + email?: string; }; diff --git a/server/@types/shared/models/Nonarrival.ts b/server/@types/shared/models/Nonarrival.ts index 48096ed4c..0bb389485 100644 --- a/server/@types/shared/models/Nonarrival.ts +++ b/server/@types/shared/models/Nonarrival.ts @@ -8,7 +8,7 @@ export type Nonarrival = { bookingId: string; date: string; reason: NonArrivalReason; - notes?: string; createdAt: string; + notes?: string; }; diff --git a/server/@types/shared/models/OASysAssessmentId.ts b/server/@types/shared/models/OASysAssessmentId.ts deleted file mode 100644 index 35bf1e20b..000000000 --- a/server/@types/shared/models/OASysAssessmentId.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * The ID of assessment being used. This should always be the latest Layer 3 assessment, regardless of state. - */ -export type OASysAssessmentId = number; diff --git a/server/@types/shared/models/OASysRiskOfSeriousHarm.ts b/server/@types/shared/models/OASysRiskOfSeriousHarm.ts index 1922b6a09..7bbe6e573 100644 --- a/server/@types/shared/models/OASysRiskOfSeriousHarm.ts +++ b/server/@types/shared/models/OASysRiskOfSeriousHarm.ts @@ -2,14 +2,16 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ArrayOfOASysRiskOfSeriousHarmSummaryQuestions } from './ArrayOfOASysRiskOfSeriousHarmSummaryQuestions'; -import type { OASysAssessmentId } from './OASysAssessmentId'; import type { OASysAssessmentState } from './OASysAssessmentState'; +import type { OASysQuestion } from './OASysQuestion'; export type OASysRiskOfSeriousHarm = { - assessmentId: OASysAssessmentId; + /** + * The ID of assessment being used. This should always be the latest Layer 3 assessment, regardless of state. + */ + assessmentId: number; assessmentState: OASysAssessmentState; dateStarted: string; + rosh: Array; dateCompleted?: string; - rosh: ArrayOfOASysRiskOfSeriousHarmSummaryQuestions; }; diff --git a/server/@types/shared/models/OASysRiskToSelf.ts b/server/@types/shared/models/OASysRiskToSelf.ts index b85b8fa0b..7d2c8acd4 100644 --- a/server/@types/shared/models/OASysRiskToSelf.ts +++ b/server/@types/shared/models/OASysRiskToSelf.ts @@ -2,14 +2,16 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ArrayOfOASysRiskToSelfQuestions } from './ArrayOfOASysRiskToSelfQuestions'; -import type { OASysAssessmentId } from './OASysAssessmentId'; import type { OASysAssessmentState } from './OASysAssessmentState'; +import type { OASysQuestion } from './OASysQuestion'; export type OASysRiskToSelf = { - assessmentId: OASysAssessmentId; + /** + * The ID of assessment being used. This should always be the latest Layer 3 assessment, regardless of state. + */ + assessmentId: number; assessmentState: OASysAssessmentState; dateStarted: string; + riskToSelf: Array; dateCompleted?: string; - riskToSelf: ArrayOfOASysRiskToSelfQuestions; }; diff --git a/server/@types/shared/models/OASysSections.ts b/server/@types/shared/models/OASysSections.ts index 2cbdffad5..45a31cde2 100644 --- a/server/@types/shared/models/OASysSections.ts +++ b/server/@types/shared/models/OASysSections.ts @@ -2,22 +2,21 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { ArrayOfOASysOffenceDetailsQuestions } from './ArrayOfOASysOffenceDetailsQuestions'; -import type { ArrayOfOASysRiskManagementPlanQuestions } from './ArrayOfOASysRiskManagementPlanQuestions'; -import type { ArrayOfOASysRiskOfSeriousHarmSummaryQuestions } from './ArrayOfOASysRiskOfSeriousHarmSummaryQuestions'; -import type { ArrayOfOASysRiskToSelfQuestions } from './ArrayOfOASysRiskToSelfQuestions'; -import type { ArrayOfOASysSupportingInformationQuestions } from './ArrayOfOASysSupportingInformationQuestions'; -import type { OASysAssessmentId } from './OASysAssessmentId'; import type { OASysAssessmentState } from './OASysAssessmentState'; +import type { OASysQuestion } from './OASysQuestion'; +import type { OASysSupportingInformationQuestion } from './OASysSupportingInformationQuestion'; export type OASysSections = { - assessmentId: OASysAssessmentId; + /** + * The ID of assessment being used. This should always be the latest Layer 3 assessment, regardless of state. + */ + assessmentId: number; assessmentState: OASysAssessmentState; dateStarted: string; + offenceDetails: Array; + roshSummary: Array; + supportingInformation: Array; + riskToSelf: Array; + riskManagementPlan: Array; dateCompleted?: string; - offenceDetails: ArrayOfOASysOffenceDetailsQuestions; - roshSummary: ArrayOfOASysRiskOfSeriousHarmSummaryQuestions; - supportingInformation: ArrayOfOASysSupportingInformationQuestions; - riskToSelf: ArrayOfOASysRiskToSelfQuestions; - riskManagementPlan: ArrayOfOASysRiskManagementPlanQuestions; }; diff --git a/server/@types/shared/models/OASysSupportingInformationQuestion.ts b/server/@types/shared/models/OASysSupportingInformationQuestion.ts index 74d82c29f..d6a5c3657 100644 --- a/server/@types/shared/models/OASysSupportingInformationQuestion.ts +++ b/server/@types/shared/models/OASysSupportingInformationQuestion.ts @@ -4,8 +4,8 @@ /* eslint-disable */ export type OASysSupportingInformationQuestion = { label: string; - sectionNumber?: number; questionNumber: string; + sectionNumber?: number; linkedToHarm?: boolean; linkedToReOffending?: boolean; answer?: string; diff --git a/server/@types/shared/models/Person.ts b/server/@types/shared/models/Person.ts index d61103b4d..9a17d498f 100644 --- a/server/@types/shared/models/Person.ts +++ b/server/@types/shared/models/Person.ts @@ -4,7 +4,7 @@ /* eslint-disable */ import type { PersonType } from './PersonType'; export type Person = { - crn: string; type: PersonType; + crn: string; }; diff --git a/server/@types/shared/models/PersonAcctAlert.ts b/server/@types/shared/models/PersonAcctAlert.ts index 6d64c1f8e..60636d94b 100644 --- a/server/@types/shared/models/PersonAcctAlert.ts +++ b/server/@types/shared/models/PersonAcctAlert.ts @@ -4,10 +4,10 @@ /* eslint-disable */ export type PersonAcctAlert = { alertId: number; - comment?: string; dateCreated: string; - dateExpires?: string; expired: boolean; active: boolean; + comment?: string; + dateExpires?: string; }; diff --git a/server/@types/shared/models/PersonRisks.ts b/server/@types/shared/models/PersonRisks.ts index 524590f8d..e563e2977 100644 --- a/server/@types/shared/models/PersonRisks.ts +++ b/server/@types/shared/models/PersonRisks.ts @@ -9,8 +9,8 @@ import type { RoshRisksEnvelope } from './RoshRisksEnvelope'; export type PersonRisks = { crn: string; roshRisks: RoshRisksEnvelope; - mappa?: MappaEnvelope; tier: RiskTierEnvelope; flags: FlagsEnvelope; + mappa?: MappaEnvelope; }; diff --git a/server/@types/shared/models/PersonSummary.ts b/server/@types/shared/models/PersonSummary.ts index 4f51f23c2..75c32261b 100644 --- a/server/@types/shared/models/PersonSummary.ts +++ b/server/@types/shared/models/PersonSummary.ts @@ -4,7 +4,7 @@ /* eslint-disable */ import type { PersonSummaryDiscriminator } from './PersonSummaryDiscriminator'; export type PersonSummary = { - crn: string; personType: PersonSummaryDiscriminator; + crn: string; }; diff --git a/server/@types/shared/models/PersonalTimeline.ts b/server/@types/shared/models/PersonalTimeline.ts index 8782eb110..2e69aedfa 100644 --- a/server/@types/shared/models/PersonalTimeline.ts +++ b/server/@types/shared/models/PersonalTimeline.ts @@ -3,9 +3,11 @@ /* tslint:disable */ /* eslint-disable */ import type { ApplicationTimeline } from './ApplicationTimeline'; -import type { Person } from './Person'; +import type { FullPerson } from './FullPerson'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; export type PersonalTimeline = { - person: Person; + person: (FullPerson | RestrictedPerson | UnknownPerson); applications: Array; }; diff --git a/server/@types/shared/models/PlacementApplication.ts b/server/@types/shared/models/PlacementApplication.ts index 0e5809e15..24ccd40ac 100644 --- a/server/@types/shared/models/PlacementApplication.ts +++ b/server/@types/shared/models/PlacementApplication.ts @@ -2,33 +2,38 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; -import type { NewPlacementApplication } from './NewPlacementApplication'; import type { PlacementApplicationType } from './PlacementApplicationType'; import type { PlacementDates } from './PlacementDates'; import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason'; -export type PlacementApplication = (NewPlacementApplication & { +export type PlacementApplication = { + applicationId: string; /** * If type is 'Additional', provides the PlacementApplication ID. If type is 'Initial' this field provides a PlacementRequest ID. */ id: string; createdByUserId: string; schemaVersion: string; - outdatedSchema?: boolean; createdAt: string; - submittedAt?: string; /** * If type is 'Additional', provides the PlacementApplication ID. If type is 'Initial' this field shouldn't be used. */ assessmentId: string; assessmentCompletedAt: string; applicationCompletedAt: string; - data?: AnyValue; - document?: AnyValue; canBeWithdrawn: boolean; isWithdrawn: boolean; - withdrawalReason?: WithdrawPlacementRequestReason; type: PlacementApplicationType; placementDates: Array; -}); + outdatedSchema?: boolean; + submittedAt?: string; + /** + * Any object that conforms to the current JSON schema for an application + */ + data?: Record; + /** + * Any object that conforms to the current JSON schema for an application + */ + document?: Record; + withdrawalReason?: WithdrawPlacementRequestReason; +}; diff --git a/server/@types/shared/models/PlacementApplicationDecisionEnvelope.ts b/server/@types/shared/models/PlacementApplicationDecisionEnvelope.ts index 4d542411f..847ecefae 100644 --- a/server/@types/shared/models/PlacementApplicationDecisionEnvelope.ts +++ b/server/@types/shared/models/PlacementApplicationDecisionEnvelope.ts @@ -3,6 +3,9 @@ /* tslint:disable */ /* eslint-disable */ import type { PlacementApplicationDecision } from './PlacementApplicationDecision'; +/** + * Information needed to submit a placement application + */ export type PlacementApplicationDecisionEnvelope = { decision: PlacementApplicationDecision; summaryOfChanges: string; diff --git a/server/@types/shared/models/PlacementApplicationTask.ts b/server/@types/shared/models/PlacementApplicationTask.ts index c299dffee..b22467bb5 100644 --- a/server/@types/shared/models/PlacementApplicationTask.ts +++ b/server/@types/shared/models/PlacementApplicationTask.ts @@ -9,10 +9,14 @@ import type { ReleaseTypeOption } from './ReleaseTypeOption'; import type { RiskTierEnvelope } from './RiskTierEnvelope'; import type { Task } from './Task'; export type PlacementApplicationTask = (Task & { + tier?: RiskTierEnvelope; + releaseType?: ReleaseTypeOption; + placementType?: PlacementType; + placementDates?: Array; + outcome?: PlacementApplicationDecision; +} & { tier: RiskTierEnvelope; releaseType: ReleaseTypeOption; placementType: PlacementType; - placementDates?: Array; - outcome?: PlacementApplicationDecision; }); diff --git a/server/@types/shared/models/PlacementApplicationType.ts b/server/@types/shared/models/PlacementApplicationType.ts index 0456e4687..d958ce6ea 100644 --- a/server/@types/shared/models/PlacementApplicationType.ts +++ b/server/@types/shared/models/PlacementApplicationType.ts @@ -2,10 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -/** - * 'Initial' means that the request for placement was created for the arrival date included on the original application. - * 'Additional' means the request for placement was created after the application had been assessed as suitable. - * A given application should only have, at most, one request for placement of type 'Initial'. - * - */ export type PlacementApplicationType = 'Initial' | 'Additional'; diff --git a/server/@types/shared/models/PlacementRequest.ts b/server/@types/shared/models/PlacementRequest.ts index 7cf65e502..bcdbf017d 100644 --- a/server/@types/shared/models/PlacementRequest.ts +++ b/server/@types/shared/models/PlacementRequest.ts @@ -3,19 +3,30 @@ /* tslint:disable */ /* eslint-disable */ import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; +import type { ApType } from './ApType'; import type { AssessmentDecision } from './AssessmentDecision'; import type { BookingSummary } from './BookingSummary'; -import type { Person } from './Person'; +import type { FullPerson } from './FullPerson'; +import type { Gender } from './Gender'; import type { PersonRisks } from './PersonRisks'; -import type { PlacementDates } from './PlacementDates'; +import type { PlacementCriteria } from './PlacementCriteria'; import type { PlacementRequestRequestType } from './PlacementRequestRequestType'; import type { PlacementRequestStatus } from './PlacementRequestStatus'; -import type { PlacementRequirements } from './PlacementRequirements'; import type { ReleaseTypeOption } from './ReleaseTypeOption'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason'; -export type PlacementRequest = (PlacementRequirements & PlacementDates & { +export type PlacementRequest = { + gender: Gender; + type: ApType; + location: string; + radius: number; + essentialCriteria: Array; + desirableCriteria: Array; + expectedArrival: string; + duration: number; id: string; - person: Person; + person: (FullPerson | RestrictedPerson | UnknownPerson); risks: PersonRisks; applicationId: string; assessmentId: string; @@ -26,10 +37,10 @@ export type PlacementRequest = (PlacementRequirements & PlacementDates & { applicationDate: string; assessor: ApprovedPremisesUser; isParole: boolean; + isWithdrawn: boolean; notes?: string; booking?: BookingSummary; requestType?: PlacementRequestRequestType; - isWithdrawn: boolean; withdrawalReason?: WithdrawPlacementRequestReason; -}); +}; diff --git a/server/@types/shared/models/PlacementRequestDetail.ts b/server/@types/shared/models/PlacementRequestDetail.ts index aa94830e4..09ba0bbbe 100644 --- a/server/@types/shared/models/PlacementRequestDetail.ts +++ b/server/@types/shared/models/PlacementRequestDetail.ts @@ -2,15 +2,55 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Application } from './Application'; +import type { ApprovedPremisesApplication } from './ApprovedPremisesApplication'; +import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; +import type { ApType } from './ApType'; +import type { AssessmentDecision } from './AssessmentDecision'; +import type { BookingSummary } from './BookingSummary'; import type { Cancellation } from './Cancellation'; -import type { PlacementRequest } from './PlacementRequest'; -export type PlacementRequestDetail = (PlacementRequest & { +import type { Cas2Application } from './Cas2Application'; +import type { FullPerson } from './FullPerson'; +import type { Gender } from './Gender'; +import type { OfflineApplication } from './OfflineApplication'; +import type { PersonRisks } from './PersonRisks'; +import type { PlacementCriteria } from './PlacementCriteria'; +import type { PlacementRequestRequestType } from './PlacementRequestRequestType'; +import type { PlacementRequestStatus } from './PlacementRequestStatus'; +import type { ReleaseTypeOption } from './ReleaseTypeOption'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { TemporaryAccommodationApplication } from './TemporaryAccommodationApplication'; +import type { UnknownPerson } from './UnknownPerson'; +import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason'; +export type PlacementRequestDetail = { + gender: Gender; + type: ApType; + location: string; + radius: number; + essentialCriteria: Array; + desirableCriteria: Array; + expectedArrival: string; + duration: number; + id: string; + person: (FullPerson | RestrictedPerson | UnknownPerson); + risks: PersonRisks; + applicationId: string; + assessmentId: string; + releaseType: ReleaseTypeOption; + status: PlacementRequestStatus; + assessmentDecision: AssessmentDecision; + assessmentDate: string; + applicationDate: string; + assessor: ApprovedPremisesUser; + isParole: boolean; + isWithdrawn: boolean; /** * Not used by UI. Space Booking cancellations to be provided if cancellations are required in future. - * @deprecated */ cancellations: Array; - application: Application; -}); + application: (ApprovedPremisesApplication | Cas2Application | OfflineApplication | TemporaryAccommodationApplication); + notes?: string; + booking?: BookingSummary; + requestType?: PlacementRequestRequestType; + withdrawalReason?: WithdrawPlacementRequestReason; +}; diff --git a/server/@types/shared/models/PlacementRequestSortField.ts b/server/@types/shared/models/PlacementRequestSortField.ts deleted file mode 100644 index 6079ee051..000000000 --- a/server/@types/shared/models/PlacementRequestSortField.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type PlacementRequestSortField = 'duration' | 'expected_arrival' | 'created_at' | 'application_date' | 'request_type' | 'person_name' | 'person_risks_tier'; diff --git a/server/@types/shared/models/PlacementRequestTask.ts b/server/@types/shared/models/PlacementRequestTask.ts index 7cce95050..20b33a7aa 100644 --- a/server/@types/shared/models/PlacementRequestTask.ts +++ b/server/@types/shared/models/PlacementRequestTask.ts @@ -2,16 +2,23 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { PlacementDates } from './PlacementDates'; import type { PlacementRequestStatus } from './PlacementRequestStatus'; import type { PlacementRequestTaskOutcome } from './PlacementRequestTaskOutcome'; import type { ReleaseTypeOption } from './ReleaseTypeOption'; import type { RiskTierEnvelope } from './RiskTierEnvelope'; import type { Task } from './Task'; -export type PlacementRequestTask = (Task & PlacementDates & { +export type PlacementRequestTask = (Task & { + expectedArrival?: string; + duration?: number; + tier?: RiskTierEnvelope; + releaseType?: ReleaseTypeOption; + placementRequestStatus?: PlacementRequestStatus; + outcome?: PlacementRequestTaskOutcome; +} & { + expectedArrival: string; + duration: number; tier: RiskTierEnvelope; releaseType: ReleaseTypeOption; placementRequestStatus: PlacementRequestStatus; - outcome?: PlacementRequestTaskOutcome; }); diff --git a/server/@types/shared/models/Premises.ts b/server/@types/shared/models/Premises.ts index 418871f1f..bbc066bf8 100644 --- a/server/@types/shared/models/Premises.ts +++ b/server/@types/shared/models/Premises.ts @@ -8,20 +8,20 @@ import type { LocalAuthorityArea } from './LocalAuthorityArea'; import type { ProbationRegion } from './ProbationRegion'; import type { PropertyStatus } from './PropertyStatus'; export type Premises = { - service: string; - id: string; name: string; + id: string; + characteristics?: Array; + localAuthorityArea?: LocalAuthorityArea; addressLine1: string; addressLine2?: string; + probationRegion: ProbationRegion; + apArea: ApArea; + notes?: string; town?: string; postcode: string; bedCount: number; - availableBedsForToday: number; - notes?: string; - probationRegion: ProbationRegion; - apArea: ApArea; - localAuthorityArea?: LocalAuthorityArea; - characteristics?: Array; + service: string; status: PropertyStatus; + availableBedsForToday: number; }; diff --git a/server/@types/shared/models/PremisesBooking.ts b/server/@types/shared/models/PremisesBooking.ts index c39ae38f6..6eb25e9e4 100644 --- a/server/@types/shared/models/PremisesBooking.ts +++ b/server/@types/shared/models/PremisesBooking.ts @@ -4,12 +4,14 @@ /* eslint-disable */ import type { Bed } from './Bed'; import type { BookingStatus } from './BookingStatus'; -import type { Person } from './Person'; +import type { FullPerson } from './FullPerson'; +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; export type PremisesBooking = { id?: string; arrivalDate?: string; departureDate?: string; - person?: Person; + person?: (FullPerson | RestrictedPerson | UnknownPerson); bed?: Bed; status?: BookingStatus; }; diff --git a/server/@types/shared/models/PremisesSummary.ts b/server/@types/shared/models/PremisesSummary.ts index c39519570..ec9a3e121 100644 --- a/server/@types/shared/models/PremisesSummary.ts +++ b/server/@types/shared/models/PremisesSummary.ts @@ -4,13 +4,13 @@ /* eslint-disable */ import type { PropertyStatus } from './PropertyStatus'; export type PremisesSummary = { - service: string; - id: string; name: string; + id: string; addressLine1: string; addressLine2?: string; postcode: string; bedCount: number; + service: string; status: PropertyStatus; }; diff --git a/server/@types/shared/models/ProfileResponse.ts b/server/@types/shared/models/ProfileResponse.ts index 5ba46e1a8..629170f8b 100644 --- a/server/@types/shared/models/ProfileResponse.ts +++ b/server/@types/shared/models/ProfileResponse.ts @@ -2,10 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { User } from './User'; +import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; +import type { LoadError } from './LoadError'; +import type { TemporaryAccommodationUser } from './TemporaryAccommodationUser'; export type ProfileResponse = { deliusUsername: string; - loadError?: 'staff_record_not_found'; - user?: User; + loadError?: LoadError; + user?: (ApprovedPremisesUser | TemporaryAccommodationUser); }; diff --git a/server/@types/shared/models/ReferralHistoryNote.ts b/server/@types/shared/models/ReferralHistoryNote.ts index 6e069d40f..7b0d11a9d 100644 --- a/server/@types/shared/models/ReferralHistoryNote.ts +++ b/server/@types/shared/models/ReferralHistoryNote.ts @@ -4,11 +4,11 @@ /* eslint-disable */ import type { ReferralHistoryNoteMessageDetails } from './ReferralHistoryNoteMessageDetails'; export type ReferralHistoryNote = { - id: string; - createdAt: string; message?: string; - messageDetails?: ReferralHistoryNoteMessageDetails; - createdByUserName: string; + id: string; type: string; + createdByUserName: string; + messageDetails?: ReferralHistoryNoteMessageDetails; + createdAt: string; }; diff --git a/server/@types/shared/models/ReferralHistoryNoteMessageDetails.ts b/server/@types/shared/models/ReferralHistoryNoteMessageDetails.ts index dcd268514..8b068f074 100644 --- a/server/@types/shared/models/ReferralHistoryNoteMessageDetails.ts +++ b/server/@types/shared/models/ReferralHistoryNoteMessageDetails.ts @@ -2,11 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; export type ReferralHistoryNoteMessageDetails = { rejectionReason?: string; rejectionReasonDetails?: string; isWithdrawn?: boolean; - domainEvent?: AnyValue; + /** + * Any object that conforms to the current JSON schema for an application + */ + domainEvent?: Record; }; diff --git a/server/@types/shared/models/ReferralHistorySystemNote.ts b/server/@types/shared/models/ReferralHistorySystemNote.ts index 8344ca024..8c050c076 100644 --- a/server/@types/shared/models/ReferralHistorySystemNote.ts +++ b/server/@types/shared/models/ReferralHistorySystemNote.ts @@ -2,8 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { Category } from './Category'; import type { ReferralHistoryNote } from './ReferralHistoryNote'; export type ReferralHistorySystemNote = (ReferralHistoryNote & { - category: 'submitted' | 'unallocated' | 'in_review' | 'ready_to_place' | 'rejected' | 'completed'; + category?: Category; +} & { + category: Category; }); diff --git a/server/@types/shared/models/RequestForPlacement.ts b/server/@types/shared/models/RequestForPlacement.ts index 18943111a..3d74c99eb 100644 --- a/server/@types/shared/models/RequestForPlacement.ts +++ b/server/@types/shared/models/RequestForPlacement.ts @@ -2,38 +2,34 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { PlacementDates } from './PlacementDates'; import type { RequestForPlacementStatus } from './RequestForPlacementStatus'; import type { RequestForPlacementType } from './RequestForPlacementType'; import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason'; export type RequestForPlacement = { /** - * If `type` is `"manual"`, provides the `PlacementApplication` ID. - * If `type` is `"automatic"` this field provides a `PlacementRequest` ID. - * + * If `type` is `"manual"`, provides the `PlacementApplication` ID. If `type` is `"automatic"` this field provides a `PlacementRequest` ID. */ id: string; createdByUserId: string; createdAt: string; - submittedAt?: string; - /** - * If `type` is `"manual"`, provides the value of `PlacementApplication.decisionMadeAt`. - * If `type` is `"automatic"` this field provides the value of `PlacementRequest.assessmentCompletedAt`. - * - */ - requestReviewedAt?: string; - document?: AnyValue; /** - * If true, the user making this request can withdraw this request for placement. - * If false, it may still be possible to indirectly withdraw this request for placement by withdrawing the application. - * + * If true, the user making this request can withdraw this request for placement. If false, it may still be possible to indirectly withdraw this request for placement by withdrawing the application. */ canBeDirectlyWithdrawn: boolean; isWithdrawn: boolean; - withdrawalReason?: WithdrawPlacementRequestReason; type: RequestForPlacementType; placementDates: Array; status: RequestForPlacementStatus; + submittedAt?: string; + /** + * If `type` is `"manual"`, provides the value of `PlacementApplication.decisionMadeAt`. If `type` is `"automatic"` this field provides the value of `PlacementRequest.assessmentCompletedAt`. + */ + requestReviewedAt?: string; + /** + * Any object that conforms to the current JSON schema for an application + */ + document?: Record; + withdrawalReason?: WithdrawPlacementRequestReason; }; diff --git a/server/@types/shared/models/RiskTierLevel.ts b/server/@types/shared/models/RiskTierLevel.ts deleted file mode 100644 index a9a315b11..000000000 --- a/server/@types/shared/models/RiskTierLevel.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type RiskTierLevel = 'D0' | 'D1' | 'D2' | 'D3' | 'C0' | 'C1' | 'C2' | 'C3' | 'B0' | 'B1' | 'B2' | 'B3' | 'A0' | 'A1' | 'A2' | 'A3'; diff --git a/server/@types/shared/models/Room.ts b/server/@types/shared/models/Room.ts index 0456a0de8..2ed94db3b 100644 --- a/server/@types/shared/models/Room.ts +++ b/server/@types/shared/models/Room.ts @@ -7,9 +7,9 @@ import type { Characteristic } from './Characteristic'; export type Room = { id: string; name: string; + characteristics: Array; code?: string; notes?: string; beds?: Array; - characteristics: Array; }; diff --git a/server/@types/shared/models/ServiceScope.ts b/server/@types/shared/models/ServiceScope.ts new file mode 100644 index 000000000..0acb7b2f7 --- /dev/null +++ b/server/@types/shared/models/ServiceScope.ts @@ -0,0 +1,5 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ServiceScope = 'approved-premises' | 'temporary-accommodation' | '*'; diff --git a/server/@types/shared/models/StaffMember.ts b/server/@types/shared/models/StaffMember.ts index 1fd025e97..9bda2d8d7 100644 --- a/server/@types/shared/models/StaffMember.ts +++ b/server/@types/shared/models/StaffMember.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * KeyWorker is a legacy field only used by CAS1. It is not longer being captured or populated + */ export type StaffMember = { code: string; keyWorker: boolean; diff --git a/server/@types/shared/models/SubmitApplication.ts b/server/@types/shared/models/SubmitApplication.ts index 66be5eee5..cc8868fb3 100644 --- a/server/@types/shared/models/SubmitApplication.ts +++ b/server/@types/shared/models/SubmitApplication.ts @@ -2,9 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; export type SubmitApplication = { type: string; - translatedDocument?: AnyValue; + /** + * Any object that conforms to the current JSON schema for an application + */ + translatedDocument?: Record; }; diff --git a/server/@types/shared/models/SubmitApprovedPremisesApplication.ts b/server/@types/shared/models/SubmitApprovedPremisesApplication.ts index cffe9531d..517d30d96 100644 --- a/server/@types/shared/models/SubmitApprovedPremisesApplication.ts +++ b/server/@types/shared/models/SubmitApprovedPremisesApplication.ts @@ -10,26 +10,23 @@ import type { SentenceTypeOption } from './SentenceTypeOption'; import type { SituationOption } from './SituationOption'; import type { SubmitApplication } from './SubmitApplication'; export type SubmitApprovedPremisesApplication = (SubmitApplication & { + targetLocation?: string; + releaseType?: ReleaseTypeOption; + sentenceType?: SentenceTypeOption; /** * Use apType - * @deprecated */ isPipeApplication?: boolean; isWomensApplication?: boolean; /** * noticeType should be used to indicate if this an emergency application - * @deprecated */ isEmergencyApplication?: boolean; /** * Use apType - * @deprecated */ isEsapApplication?: boolean; apType?: ApType; - targetLocation: string; - releaseType: ReleaseTypeOption; - sentenceType: SentenceTypeOption; situation?: SituationOption; arrivalDate?: string; /** @@ -43,5 +40,9 @@ export type SubmitApprovedPremisesApplication = (SubmitApplication & { reasonForShortNotice?: string; reasonForShortNoticeOther?: string; licenseExpiryDate?: string; +} & { + targetLocation: string; + releaseType: ReleaseTypeOption; + sentenceType: SentenceTypeOption; }); diff --git a/server/@types/shared/models/SubmitCas2Application.ts b/server/@types/shared/models/SubmitCas2Application.ts deleted file mode 100644 index 31b03e8fc..000000000 --- a/server/@types/shared/models/SubmitCas2Application.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AnyValue } from './AnyValue'; -export type SubmitCas2Application = { - translatedDocument: AnyValue; - /** - * Id of the application being submitted - */ - applicationId: string; - /** - * First and second preferences for where the accommodation should be located, pipe-separated - */ - preferredAreas?: string; - hdcEligibilityDate?: string; - conditionalReleaseDate?: string; - telephoneNumber: string; -}; - diff --git a/server/@types/shared/models/SubmitPlacementApplication.ts b/server/@types/shared/models/SubmitPlacementApplication.ts index 192680493..681e55983 100644 --- a/server/@types/shared/models/SubmitPlacementApplication.ts +++ b/server/@types/shared/models/SubmitPlacementApplication.ts @@ -2,11 +2,16 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { PlacementDates } from './PlacementDates'; import type { PlacementType } from './PlacementType'; +/** + * Information needed to submit a placement application + */ export type SubmitPlacementApplication = { - translatedDocument: AnyValue; + /** + * Any object that conforms to the current JSON schema for an application + */ + translatedDocument: Record; placementType: PlacementType; placementDates: Array; }; diff --git a/server/@types/shared/models/SubmitTemporaryAccommodationApplication.ts b/server/@types/shared/models/SubmitTemporaryAccommodationApplication.ts index ba7d38f88..cc0b76e2a 100644 --- a/server/@types/shared/models/SubmitTemporaryAccommodationApplication.ts +++ b/server/@types/shared/models/SubmitTemporaryAccommodationApplication.ts @@ -2,10 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { SubmitApplication } from './SubmitApplication'; export type SubmitTemporaryAccommodationApplication = (SubmitApplication & { - arrivalDate: string; + arrivalDate?: string; + /** + * Any object that conforms to the current JSON schema for an application + */ + summaryData?: Record; isRegisteredSexOffender?: boolean; needsAccessibleProperty?: boolean; hasHistoryOfArson?: boolean; @@ -22,6 +25,11 @@ export type SubmitTemporaryAccommodationApplication = (SubmitApplication & { isConcerningSexualBehaviour?: boolean; isConcerningArsonBehaviour?: boolean; prisonReleaseTypes?: Array; - summaryData: AnyValue; +} & { + arrivalDate: string; + /** + * Any object that conforms to the current JSON schema for an application + */ + summaryData: Record; }); diff --git a/server/@types/shared/models/Task.ts b/server/@types/shared/models/Task.ts index c1a1f9273..c1266d9ff 100644 --- a/server/@types/shared/models/Task.ts +++ b/server/@types/shared/models/Task.ts @@ -4,31 +4,31 @@ /* eslint-disable */ import type { ApArea } from './ApArea'; import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; -import type { PersonSummary } from './PersonSummary'; +import type { FullPersonSummary } from './FullPersonSummary'; import type { ProbationDeliveryUnit } from './ProbationDeliveryUnit'; +import type { RestrictedPersonSummary } from './RestrictedPersonSummary'; import type { TaskStatus } from './TaskStatus'; import type { TaskType } from './TaskType'; +import type { UnknownPersonSummary } from './UnknownPersonSummary'; export type Task = { - taskType: TaskType; id: string; + outcomeRecordedAt?: string; + personSummary: (FullPersonSummary | RestrictedPersonSummary | UnknownPersonSummary); applicationId: string; - personSummary: PersonSummary; - /** - * Superseded by personSummary which provides 'name' as well as 'personType' and 'crn'. - * @deprecated - */ - personName: string; - crn: string; + taskType: TaskType; /** * The Due date of the task - this is deprecated in favour of the `dueAt` field - * @deprecated */ dueDate: string; + apArea?: ApArea; + /** + * Superseded by personSummary which provides 'name' as well as 'personType' and 'crn'. + */ + personName: string; dueAt: string; - allocatedToStaffMember?: ApprovedPremisesUser; status: TaskStatus; - apArea?: ApArea; + crn: string; probationDeliveryUnit?: ProbationDeliveryUnit; - outcomeRecordedAt?: string; + allocatedToStaffMember?: ApprovedPremisesUser; }; diff --git a/server/@types/shared/models/TaskSortField.ts b/server/@types/shared/models/TaskSortField.ts deleted file mode 100644 index 1de536476..000000000 --- a/server/@types/shared/models/TaskSortField.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type TaskSortField = 'createdAt' | 'dueAt' | 'person' | 'allocatedTo' | 'completedAt' | 'taskType' | 'decision'; diff --git a/server/@types/shared/models/TaskWrapper.ts b/server/@types/shared/models/TaskWrapper.ts index 88a3251ee..64a3f103d 100644 --- a/server/@types/shared/models/TaskWrapper.ts +++ b/server/@types/shared/models/TaskWrapper.ts @@ -2,10 +2,13 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Task } from './Task'; +import type { AssessmentTask } from './AssessmentTask'; +import type { BookingAppealTask } from './BookingAppealTask'; +import type { PlacementApplicationTask } from './PlacementApplicationTask'; +import type { PlacementRequestTask } from './PlacementRequestTask'; import type { UserWithWorkload } from './UserWithWorkload'; export type TaskWrapper = { - task: Task; + task: (AssessmentTask | BookingAppealTask | PlacementApplicationTask | PlacementRequestTask); /** * Users to whom this task can be allocated */ diff --git a/server/@types/shared/models/TemporaryAccommodationApplication.ts b/server/@types/shared/models/TemporaryAccommodationApplication.ts index ab587e59f..47410ce1f 100644 --- a/server/@types/shared/models/TemporaryAccommodationApplication.ts +++ b/server/@types/shared/models/TemporaryAccommodationApplication.ts @@ -2,21 +2,32 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; -import type { Application } from './Application'; import type { ApplicationStatus } from './ApplicationStatus'; +import type { FullPerson } from './FullPerson'; import type { PersonRisks } from './PersonRisks'; -export type TemporaryAccommodationApplication = (Application & { +import type { RestrictedPerson } from './RestrictedPerson'; +import type { UnknownPerson } from './UnknownPerson'; +export type TemporaryAccommodationApplication = { createdByUserId: string; schemaVersion: string; outdatedSchema: boolean; - data?: AnyValue; - document?: AnyValue; status: ApplicationStatus; + offenceId: string; + type: string; + id: string; + person: (FullPerson | RestrictedPerson | UnknownPerson); + createdAt: string; + /** + * Any object that conforms to the current JSON schema for an application + */ + data?: Record; + /** + * Any object that conforms to the current JSON schema for an application + */ + document?: Record; risks?: PersonRisks; submittedAt?: string; arrivalDate?: string; - offenceId: string; assessmentId?: string; -}); +}; diff --git a/server/@types/shared/models/TemporaryAccommodationApplicationSummary.ts b/server/@types/shared/models/TemporaryAccommodationApplicationSummary.ts index 29d1ea733..c99e0aee1 100644 --- a/server/@types/shared/models/TemporaryAccommodationApplicationSummary.ts +++ b/server/@types/shared/models/TemporaryAccommodationApplicationSummary.ts @@ -6,8 +6,11 @@ import type { ApplicationStatus } from './ApplicationStatus'; import type { ApplicationSummary } from './ApplicationSummary'; import type { PersonRisks } from './PersonRisks'; export type TemporaryAccommodationApplicationSummary = (ApplicationSummary & { + createdByUserId?: string; + status?: ApplicationStatus; + risks?: PersonRisks; +} & { createdByUserId: string; status: ApplicationStatus; - risks?: PersonRisks; }); diff --git a/server/@types/shared/models/TemporaryAccommodationAssessment.ts b/server/@types/shared/models/TemporaryAccommodationAssessment.ts index 170f19aa1..e02e42333 100644 --- a/server/@types/shared/models/TemporaryAccommodationAssessment.ts +++ b/server/@types/shared/models/TemporaryAccommodationAssessment.ts @@ -2,17 +2,25 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { Assessment } from './Assessment'; import type { TemporaryAccommodationApplication } from './TemporaryAccommodationApplication'; import type { TemporaryAccommodationAssessmentStatus } from './TemporaryAccommodationAssessmentStatus'; import type { TemporaryAccommodationUser } from './TemporaryAccommodationUser'; export type TemporaryAccommodationAssessment = (Assessment & { - application: TemporaryAccommodationApplication; + application?: TemporaryAccommodationApplication; + /** + * Any object that conforms to the current JSON schema for an application + */ + summaryData?: Record; allocatedToStaffMember?: TemporaryAccommodationUser; status?: TemporaryAccommodationAssessmentStatus; - summaryData: AnyValue; releaseDate?: string; accommodationRequiredFromDate?: string; +} & { + application: TemporaryAccommodationApplication; + /** + * Any object that conforms to the current JSON schema for an application + */ + summaryData: Record; }); diff --git a/server/@types/shared/models/TemporaryAccommodationAssessmentSummary.ts b/server/@types/shared/models/TemporaryAccommodationAssessmentSummary.ts index 4e9015fff..4f6230f8f 100644 --- a/server/@types/shared/models/TemporaryAccommodationAssessmentSummary.ts +++ b/server/@types/shared/models/TemporaryAccommodationAssessmentSummary.ts @@ -5,7 +5,9 @@ import type { AssessmentSummary } from './AssessmentSummary'; import type { TemporaryAccommodationAssessmentStatus } from './TemporaryAccommodationAssessmentStatus'; export type TemporaryAccommodationAssessmentSummary = (AssessmentSummary & { - status: TemporaryAccommodationAssessmentStatus; + status?: TemporaryAccommodationAssessmentStatus; probationDeliveryUnitName?: string; +} & { + status: TemporaryAccommodationAssessmentStatus; }); diff --git a/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts b/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts index 96dfa3453..67ed8b26e 100644 --- a/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts +++ b/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts @@ -8,10 +8,15 @@ export type TemporaryAccommodationBedSearchParameters = (BedSearchParameters & { /** * The list of pdus Ids to search within */ - probationDeliveryUnits: Array; + probationDeliveryUnits?: Array; /** * Bedspace and property attributes to filter on */ attributes?: Array; +} & { + /** + * The list of pdus Ids to search within + */ + probationDeliveryUnits: Array; }); diff --git a/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts b/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts index 5a751c28e..5601010c5 100644 --- a/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts +++ b/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts @@ -5,6 +5,8 @@ import type { BedSearchResult } from './BedSearchResult'; import type { TemporaryAccommodationBedSearchResultOverlap } from './TemporaryAccommodationBedSearchResultOverlap'; export type TemporaryAccommodationBedSearchResult = (BedSearchResult & { + overlaps?: Array; +} & { overlaps: Array; }); diff --git a/server/@types/shared/models/TemporaryAccommodationBedSearchResultOverlap.ts b/server/@types/shared/models/TemporaryAccommodationBedSearchResultOverlap.ts index 1e953bb28..34e824d96 100644 --- a/server/@types/shared/models/TemporaryAccommodationBedSearchResultOverlap.ts +++ b/server/@types/shared/models/TemporaryAccommodationBedSearchResultOverlap.ts @@ -6,11 +6,11 @@ import type { PersonType } from './PersonType'; export type TemporaryAccommodationBedSearchResultOverlap = { name: string; crn: string; - sex?: string; personType: PersonType; days: number; bookingId: string; roomId: string; + sex?: string; assessmentId?: string; }; diff --git a/server/@types/shared/models/TemporaryAccommodationUser.ts b/server/@types/shared/models/TemporaryAccommodationUser.ts index 7a3ddb9f6..a3dcb2ce5 100644 --- a/server/@types/shared/models/TemporaryAccommodationUser.ts +++ b/server/@types/shared/models/TemporaryAccommodationUser.ts @@ -5,6 +5,8 @@ import type { TemporaryAccommodationUserRole } from './TemporaryAccommodationUserRole'; import type { User } from './User'; export type TemporaryAccommodationUser = (User & { + roles?: Array; +} & { roles: Array; }); diff --git a/server/@types/shared/models/TimelineEvent.ts b/server/@types/shared/models/TimelineEvent.ts index beb01037e..2e8b4d5ea 100644 --- a/server/@types/shared/models/TimelineEvent.ts +++ b/server/@types/shared/models/TimelineEvent.ts @@ -2,16 +2,17 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { ApprovedPremisesUser } from './ApprovedPremisesUser'; +import type { TemporaryAccommodationUser } from './TemporaryAccommodationUser'; import type { TimelineEventAssociatedUrl } from './TimelineEventAssociatedUrl'; import type { TimelineEventType } from './TimelineEventType'; import type { TriggerSourceType } from './TriggerSourceType'; -import type { User } from './User'; export type TimelineEvent = { type?: TimelineEventType; id?: string; occurredAt?: string; content?: string; - createdBy?: User; + createdBy?: (ApprovedPremisesUser | TemporaryAccommodationUser); associatedUrls?: Array; triggerSource?: TriggerSourceType; }; diff --git a/server/@types/shared/models/Turnaround.ts b/server/@types/shared/models/Turnaround.ts index 8e3606284..08efd43aa 100644 --- a/server/@types/shared/models/Turnaround.ts +++ b/server/@types/shared/models/Turnaround.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * The full history of turnarounds + */ export type Turnaround = { id: string; bookingId: string; diff --git a/server/@types/shared/models/UserSortField.ts b/server/@types/shared/models/Type.ts similarity index 77% rename from server/@types/shared/models/UserSortField.ts rename to server/@types/shared/models/Type.ts index 1c2c261a9..04350217d 100644 --- a/server/@types/shared/models/UserSortField.ts +++ b/server/@types/shared/models/Type.ts @@ -2,4 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type UserSortField = 'name'; +export type Type = 'space' | 'legacy'; diff --git a/server/@types/shared/models/NewBedMove.ts b/server/@types/shared/models/Unit.ts similarity index 65% rename from server/@types/shared/models/NewBedMove.ts rename to server/@types/shared/models/Unit.ts index 1cb5bf641..ca80e5aac 100644 --- a/server/@types/shared/models/NewBedMove.ts +++ b/server/@types/shared/models/Unit.ts @@ -2,8 +2,4 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type NewBedMove = { - bedId: string; - notes?: string; -}; - +export type Unit = Record; diff --git a/server/@types/shared/models/UpdateApplication.ts b/server/@types/shared/models/UpdateApplication.ts index e9d92b526..059eef41b 100644 --- a/server/@types/shared/models/UpdateApplication.ts +++ b/server/@types/shared/models/UpdateApplication.ts @@ -2,10 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; import type { UpdateApplicationType } from './UpdateApplicationType'; export type UpdateApplication = { + data: Record>; type: UpdateApplicationType; - data: Record; }; diff --git a/server/@types/shared/models/UpdateApprovedPremisesApplication.ts b/server/@types/shared/models/UpdateApprovedPremisesApplication.ts index 2844ececb..763e09b71 100644 --- a/server/@types/shared/models/UpdateApprovedPremisesApplication.ts +++ b/server/@types/shared/models/UpdateApprovedPremisesApplication.ts @@ -11,17 +11,14 @@ export type UpdateApprovedPremisesApplication = (UpdateApplication & { isWomensApplication?: boolean; /** * Use apType - * @deprecated */ isPipeApplication?: boolean; /** * noticeType should be used to indicate if an emergency application - * @deprecated */ isEmergencyApplication?: boolean; /** * Use apType - * @deprecated */ isEsapApplication?: boolean; apType?: ApType; diff --git a/server/@types/shared/models/UpdateAssessment.ts b/server/@types/shared/models/UpdateAssessment.ts index 61f3edfea..380b1fcc0 100644 --- a/server/@types/shared/models/UpdateAssessment.ts +++ b/server/@types/shared/models/UpdateAssessment.ts @@ -2,9 +2,11 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; +/** + * Updated assessment + */ export type UpdateAssessment = { - data: Record; + data: Record>; releaseDate?: string; accommodationRequiredFromDate?: string; }; diff --git a/server/@types/shared/models/UpdateCas2Assessment.ts b/server/@types/shared/models/UpdateCas2Assessment.ts deleted file mode 100644 index 77496ab43..000000000 --- a/server/@types/shared/models/UpdateCas2Assessment.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type UpdateCas2Assessment = { - nacroReferralId?: string; - assessorName?: string; -}; - diff --git a/server/@types/shared/models/UpdateLostBed.ts b/server/@types/shared/models/UpdateLostBed.ts index 44431b94e..996f799ae 100644 --- a/server/@types/shared/models/UpdateLostBed.ts +++ b/server/@types/shared/models/UpdateLostBed.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * details of the lost bed + */ export type UpdateLostBed = { startDate: string; endDate: string; diff --git a/server/@types/shared/models/UpdatePlacementApplication.ts b/server/@types/shared/models/UpdatePlacementApplication.ts index 1336289cd..20630fb68 100644 --- a/server/@types/shared/models/UpdatePlacementApplication.ts +++ b/server/@types/shared/models/UpdatePlacementApplication.ts @@ -2,8 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { AnyValue } from './AnyValue'; +/** + * Details about the application + */ export type UpdatePlacementApplication = { - data: Record; + data: Record>; }; diff --git a/server/@types/shared/models/UpdatePremises.ts b/server/@types/shared/models/UpdatePremises.ts index 8fecb94e3..3134b07b3 100644 --- a/server/@types/shared/models/UpdatePremises.ts +++ b/server/@types/shared/models/UpdatePremises.ts @@ -3,16 +3,19 @@ /* tslint:disable */ /* eslint-disable */ import type { PropertyStatus } from './PropertyStatus'; +/** + * Information to update the premises with + */ export type UpdatePremises = { addressLine1: string; - addressLine2?: string; - town?: string; postcode: string; - notes?: string; - localAuthorityAreaId?: string; probationRegionId: string; characteristicIds: Array; status: PropertyStatus; + addressLine2?: string; + town?: string; + notes?: string; + localAuthorityAreaId?: string; pdu?: string; probationDeliveryUnitId?: string; turnaroundWorkingDayCount?: number; diff --git a/server/@types/shared/models/UpdateRoom.ts b/server/@types/shared/models/UpdateRoom.ts index d8145ecf3..2913ba29c 100644 --- a/server/@types/shared/models/UpdateRoom.ts +++ b/server/@types/shared/models/UpdateRoom.ts @@ -2,9 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Information to update the room with + */ export type UpdateRoom = { - notes?: string; characteristicIds: Array; + notes?: string; name?: string; /** * End date of the bed availability, open for availability if not specified diff --git a/server/@types/shared/models/UpdatedClarificationNote.ts b/server/@types/shared/models/UpdatedClarificationNote.ts index 738b73d6e..0fd2744df 100644 --- a/server/@types/shared/models/UpdatedClarificationNote.ts +++ b/server/@types/shared/models/UpdatedClarificationNote.ts @@ -2,6 +2,9 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +/** + * Clarification note + */ export type UpdatedClarificationNote = { response: string; responseReceivedOn: string; diff --git a/server/@types/shared/models/User.ts b/server/@types/shared/models/User.ts index a97ae4bd7..71a96aec3 100644 --- a/server/@types/shared/models/User.ts +++ b/server/@types/shared/models/User.ts @@ -5,14 +5,14 @@ import type { ProbationDeliveryUnit } from './ProbationDeliveryUnit'; import type { ProbationRegion } from './ProbationRegion'; export type User = { - service: string; - id: string; + region: ProbationRegion; + isActive?: boolean; name: string; + id: string; deliusUsername: string; - email?: string; telephoneNumber?: string; - isActive?: boolean; - region: ProbationRegion; + email?: string; + service: string; probationDeliveryUnit?: ProbationDeliveryUnit; }; diff --git a/server/@types/shared/models/UserWithWorkload.ts b/server/@types/shared/models/UserWithWorkload.ts index 78707f408..63f621bff 100644 --- a/server/@types/shared/models/UserWithWorkload.ts +++ b/server/@types/shared/models/UserWithWorkload.ts @@ -5,19 +5,28 @@ import type { ApArea } from './ApArea'; import type { ApprovedPremisesUserRole } from './ApprovedPremisesUserRole'; import type { NamedId } from './NamedId'; -import type { User } from './User'; +import type { ProbationDeliveryUnit } from './ProbationDeliveryUnit'; +import type { ProbationRegion } from './ProbationRegion'; import type { UserQualification } from './UserQualification'; -export type UserWithWorkload = (User & { +/** + * Users to whom this task can be allocated + */ +export type UserWithWorkload = { + service: string; + id: string; + name: string; + deliusUsername: string; + region: ProbationRegion; numTasksPending?: number; numTasksCompleted7Days?: number; numTasksCompleted30Days?: number; qualifications?: Array; roles?: Array; - /** - * This is deprecated. Used cruManagementArea instead as this is used to group task management - * @deprecated - */ apArea?: ApArea; cruManagementArea?: NamedId; -}); + email?: string; + telephoneNumber?: string; + isActive?: boolean; + probationDeliveryUnit?: ProbationDeliveryUnit; +}; diff --git a/server/@types/shared/models/ValidationError.ts b/server/@types/shared/models/ValidationError.ts index 47173e5fa..803338a72 100644 --- a/server/@types/shared/models/ValidationError.ts +++ b/server/@types/shared/models/ValidationError.ts @@ -3,8 +3,12 @@ /* tslint:disable */ /* eslint-disable */ import type { InvalidParam } from './InvalidParam'; -import type { Problem } from './Problem'; -export type ValidationError = (Problem & { +export type ValidationError = { + type?: string; + title?: string; + status?: number; + detail?: string; + instance?: string; 'invalid-params'?: Array; -}); +}; diff --git a/server/@types/shared/models/WithdrawPlacementApplication.ts b/server/@types/shared/models/WithdrawPlacementApplication.ts index 0dedb9b16..35dc35e05 100644 --- a/server/@types/shared/models/WithdrawPlacementApplication.ts +++ b/server/@types/shared/models/WithdrawPlacementApplication.ts @@ -3,6 +3,9 @@ /* tslint:disable */ /* eslint-disable */ import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason'; +/** + * Withdrawal details + */ export type WithdrawPlacementApplication = { reason: WithdrawPlacementRequestReason; }; diff --git a/server/@types/shared/models/WithdrawPlacementRequest.ts b/server/@types/shared/models/WithdrawPlacementRequest.ts index ee38619e0..551dafd63 100644 --- a/server/@types/shared/models/WithdrawPlacementRequest.ts +++ b/server/@types/shared/models/WithdrawPlacementRequest.ts @@ -3,6 +3,9 @@ /* tslint:disable */ /* eslint-disable */ import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason'; +/** + * Withdrawal details + */ export type WithdrawPlacementRequest = { reason: WithdrawPlacementRequestReason; };