Skip to content

Commit

Permalink
CAS1 Generated model types
Browse files Browse the repository at this point in the history
These are the changes to the model that are pulled from the auto-generated swagger docs
  • Loading branch information
daveawc committed Dec 16, 2024
1 parent 0ac748d commit 3ba078b
Show file tree
Hide file tree
Showing 240 changed files with 1,116 additions and 1,037 deletions.
4 changes: 1 addition & 3 deletions script/generate-types
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ fi

echo "==> Generating types for $branch branch..."

npx openapi-typescript-codegen -i "https://raw.githubusercontent.com/ministryofjustice/hmpps-approved-premises-api/$branch/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/$branch/src/main/resources/static/codegen/built-cas1-api-spec.yml" -o ./server/@types/shared -c axios --exportServices false --exportCore false --useUnionTypes true

npx openapi-typescript-codegen -i "https://approved-premises-api-dev.hmpps.service.justice.gov.uk/v3/api-docs/CAS1Shared" -o ./server/@types/shared -c axios --exportServices false --exportCore false --useUnionTypes true
echo "==> Renaming the declaration file..."

mv ./server/@types/shared/index.ts ./server/@types/shared/index.d.ts
Expand Down
39 changes: 8 additions & 31 deletions server/@types/shared/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
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';
Expand All @@ -30,15 +29,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';
Expand All @@ -61,7 +51,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';
Expand All @@ -74,12 +63,10 @@ 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 { Cas1ApprovedPremisesGender } from './models/Cas1ApprovedPremisesGender';
export type { Cas1AssignKeyWorker } from './models/Cas1AssignKeyWorker';
export type { Cas1CruManagementArea } from './models/Cas1CruManagementArea';
export type { Cas1KeyWorkerAllocation } from './models/Cas1KeyWorkerAllocation';
Expand All @@ -106,45 +93,35 @@ export type { Cas1PremiseDaySummary } from './models/Cas1PremiseDaySummary';
export type { Cas1PremisesBasicSummary } from './models/Cas1PremisesBasicSummary';
export type { Cas1PremisesSearchResultSummary } from './models/Cas1PremisesSearchResultSummary';
export type { Cas1PremisesSummary } from './models/Cas1PremisesSummary';
export type { Cas1ReportName } from './models/Cas1ReportName';
export type { Cas1SpaceAvailability } from './models/Cas1SpaceAvailability';
export type { Cas1SpaceBooking } from './models/Cas1SpaceBooking';
export type { Cas1SpaceBookingCancellation } from './models/Cas1SpaceBookingCancellation';
export type { Cas1SpaceBookingCharacteristic } from './models/Cas1SpaceBookingCharacteristic';
export type { Cas1SpaceBookingDates } from './models/Cas1SpaceBookingDates';
export type { Cas1SpaceBookingDaySummary } from './models/Cas1SpaceBookingDaySummary';
export type { Cas1SpaceBookingDaySummarySortField } from './models/Cas1SpaceBookingDaySummarySortField';
export type { Cas1SpaceBookingDeparture } from './models/Cas1SpaceBookingDeparture';
export type { Cas1SpaceBookingNonArrival } from './models/Cas1SpaceBookingNonArrival';
export type { Cas1SpaceBookingRequirements } from './models/Cas1SpaceBookingRequirements';
export type { Cas1SpaceBookingResidency } from './models/Cas1SpaceBookingResidency';
export type { Cas1SpaceBookingSummary } from './models/Cas1SpaceBookingSummary';
export type { Cas1SpaceBookingSummarySortField } from './models/Cas1SpaceBookingSummarySortField';
export type { Cas1SpaceBookingSummaryStatus } from './models/Cas1SpaceBookingSummaryStatus';
export type { Cas1SpaceCategory } from './models/Cas1SpaceCategory';
export type { Cas1SpaceCharacteristic } from './models/Cas1SpaceCharacteristic';
export type { Cas1SpaceSearchParameters } from './models/Cas1SpaceSearchParameters';
export type { Cas1SpaceSearchRequirements } from './models/Cas1SpaceSearchRequirements';
export type { Cas1SpaceSearchResult } from './models/Cas1SpaceSearchResult';
export type { Cas1SpaceSearchResults } from './models/Cas1SpaceSearchResults';
export type { Cas1UpdateUser } from './models/Cas1UpdateUser';
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';
Expand All @@ -154,15 +131,17 @@ 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';
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';
Expand All @@ -172,17 +151,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';
Expand All @@ -204,7 +182,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';
Expand Down Expand Up @@ -271,13 +248,13 @@ 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';
Expand Down Expand Up @@ -307,6 +284,7 @@ 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';
Expand All @@ -316,7 +294,6 @@ export type { UpdateApprovedPremisesApplication } from './models/UpdateApprovedP
export type { UpdateAssessment } from './models/UpdateAssessment';
export type { UpdateCas1OutOfServiceBed } from './models/UpdateCas1OutOfServiceBed';
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';
Expand Down
4 changes: 2 additions & 2 deletions server/@types/shared/models/ActiveOffence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
/* tslint:disable */
/* eslint-disable */
export type ActiveOffence = {
convictionId: number;
deliusEventNumber: string;
offenceDate?: string;
offenceDescription: string;
offenceId: string;
convictionId: number;
offenceDate?: string;
};

8 changes: 4 additions & 4 deletions server/@types/shared/models/Adjudication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
/* tslint:disable */
/* eslint-disable */
export type Adjudication = {
id: number;
reportedAt: string;
establishment: string;
offenceDescription: string;
hearingHeld: boolean;
finding?: string;
hearingHeld: boolean;
id: number;
offenceDescription: string;
reportedAt: string;
};

8 changes: 0 additions & 8 deletions server/@types/shared/models/AnyValue.ts

This file was deleted.

13 changes: 7 additions & 6 deletions server/@types/shared/models/Appeal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
/* 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;
appealDetail: string;
decision: AppealDecision;
decisionDetail: string;
createdAt: string;
applicationId: string;
assessmentId?: string;
createdByUser: User;
createdAt: string;
createdByUser: (ApprovedPremisesUser | TemporaryAccommodationUser);
decision: AppealDecision;
decisionDetail: string;
id: string;
};

10 changes: 6 additions & 4 deletions server/@types/shared/models/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
createdAt: string;
id: string;
person: (FullPerson | RestrictedPerson | UnknownPerson);
type: string;
};

10 changes: 6 additions & 4 deletions server/@types/shared/models/ApplicationSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
id: string;
person: (FullPerson | RestrictedPerson | UnknownPerson);
submittedAt?: string;
type: string;
};

7 changes: 4 additions & 3 deletions server/@types/shared/models/ApplicationTimeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
createdBy?: (ApprovedPremisesUser | TemporaryAccommodationUser);
id: string;
isOfflineApplication: boolean;
status?: ApprovedPremisesApplicationStatus;
createdBy?: User;
timelineEvents: Array<TimelineEvent>;
};

10 changes: 4 additions & 6 deletions server/@types/shared/models/ApplicationTimelineNote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
createdAt?: string;
createdByUser?: (ApprovedPremisesUser | TemporaryAccommodationUser);
id?: string;
createdByUser?: User;
note: string;
createdAt?: string;
};

Loading

0 comments on commit 3ba078b

Please sign in to comment.