Skip to content

Commit

Permalink
Updating hmpps-approved-premises-api models from OpenAPI specification (
Browse files Browse the repository at this point in the history
#1008)

Co-authored-by: communityaccommodationtypegen[bot] <communityaccommodationtypegen[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 34b790a commit 1610cd7
Show file tree
Hide file tree
Showing 25 changed files with 194 additions and 7 deletions.
13 changes: 13 additions & 0 deletions server/@types/shared/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type { ApprovedPremisesBedSearchParameters } from './models/ApprovedPremi
export type { ApprovedPremisesBedSearchResult } from './models/ApprovedPremisesBedSearchResult';
export type { ApprovedPremisesSummary } from './models/ApprovedPremisesSummary';
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';
Expand Down Expand Up @@ -90,7 +91,17 @@ export type { Cas1OutOfServiceBedRevision } from './models/Cas1OutOfServiceBedRe
export type { Cas1OutOfServiceBedRevisionType } from './models/Cas1OutOfServiceBedRevisionType';
export type { Cas1OutOfServiceBedSortField } from './models/Cas1OutOfServiceBedSortField';
export type { Cas1OutOfServiceBedStatus } from './models/Cas1OutOfServiceBedStatus';
export type { Cas1PremisesSearchResultSummary } from './models/Cas1PremisesSearchResultSummary';
export type { Cas1ReportName } from './models/Cas1ReportName';
export type { Cas1SpaceAvailability } from './models/Cas1SpaceAvailability';
export type { Cas1SpaceBooking } from './models/Cas1SpaceBooking';
export type { Cas1SpaceBookingRequirements } from './models/Cas1SpaceBookingRequirements';
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 { Cas2Application } from './models/Cas2Application';
export type { Cas2ApplicationNote } from './models/Cas2ApplicationNote';
export type { Cas2ApplicationStatus } from './models/Cas2ApplicationStatus';
Expand Down Expand Up @@ -124,6 +135,7 @@ 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 { GenderForAp } from './models/GenderForAp';
export type { InvalidParam } from './models/InvalidParam';
export type { LatestCas2StatusUpdate } from './models/LatestCas2StatusUpdate';
export type { LocalAuthorityArea } from './models/LocalAuthorityArea';
Expand All @@ -148,6 +160,7 @@ export type { NewCancellation } from './models/NewCancellation';
export type { NewCas1Arrival } from './models/NewCas1Arrival';
export type { NewCas1OutOfServiceBed } from './models/NewCas1OutOfServiceBed';
export type { NewCas1OutOfServiceBedCancellation } from './models/NewCas1OutOfServiceBedCancellation';
export type { NewCas1SpaceBooking } from './models/NewCas1SpaceBooking';
export type { NewCas2ApplicationNote } from './models/NewCas2ApplicationNote';
export type { NewCas2Arrival } from './models/NewCas2Arrival';
export type { NewCas3Arrival } from './models/NewCas3Arrival';
Expand Down
2 changes: 2 additions & 0 deletions server/@types/shared/models/ApprovedPremisesApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import type { ApprovedPremisesApplicationStatus } from './ApprovedPremisesApplic
import type { ApType } from './ApType';
import type { AssessmentDecision } from './AssessmentDecision';
import type { Cas1ApplicationUserDetails } from './Cas1ApplicationUserDetails';
import type { GenderForAp } from './GenderForAp';
import type { PersonRisks } from './PersonRisks';
import type { PersonStatus } from './PersonStatus';
export type ApprovedPremisesApplication = (Application & {
Expand Down Expand Up @@ -37,5 +38,6 @@ export type ApprovedPremisesApplication = (Application & {
*/
caseManagerIsNotApplicant?: boolean;
caseManagerUserDetails?: Cas1ApplicationUserDetails;
genderForAp?: GenderForAp;
});

3 changes: 3 additions & 0 deletions server/@types/shared/models/ApprovedPremisesUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
/* tslint:disable */
/* eslint-disable */
import type { ApArea } from './ApArea';
import type { ApprovedPremisesUserPermission } from './ApprovedPremisesUserPermission';
import type { ApprovedPremisesUserRole } from './ApprovedPremisesUserRole';
import type { User } from './User';
import type { UserQualification } from './UserQualification';
export type ApprovedPremisesUser = (User & {
qualifications: Array<UserQualification>;
roles: Array<ApprovedPremisesUserRole>;
permissions?: Array<ApprovedPremisesUserPermission>;
apArea: ApArea;
version?: number;
});

5 changes: 5 additions & 0 deletions server/@types/shared/models/ApprovedPremisesUserPermission.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ApprovedPremisesUserPermission = 'cas1_view_assigned_assessments' | 'cas1_process_an_appeal' | 'cas1_assess_placement_application' | 'cas1_assess_placement_request' | 'cas1_assess_application' | 'cas1_assess_appealed_application';
2 changes: 1 addition & 1 deletion server/@types/shared/models/ApprovedPremisesUserRole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ApprovedPremisesUserRole = 'assessor' | 'matcher' | 'manager' | 'legacy_manager' | 'future_manager' | 'workflow_manager' | 'cru_member' | 'applicant' | 'role_admin' | 'report_viewer' | 'excluded_from_assess_allocation' | 'excluded_from_match_allocation' | 'excluded_from_placement_application_allocation' | 'appeals_manager' | 'janitor';
export type ApprovedPremisesUserRole = 'assessor' | 'matcher' | 'manager' | 'legacy_manager' | 'future_manager' | 'workflow_manager' | 'cru_member' | 'applicant' | 'role_admin' | 'report_viewer' | 'excluded_from_assess_allocation' | 'excluded_from_match_allocation' | 'excluded_from_placement_application_allocation' | 'appeals_manager' | 'janitor' | 'user_manager';
2 changes: 1 addition & 1 deletion server/@types/shared/models/CacheType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type CacheType = 'qCodeStaffMembers' | 'userAccess' | 'staffDetails' | 'teamsManagingCase' | 'ukBankHolidays' | 'offenderDetails' | 'inmateDetails';
export type CacheType = 'qCodeStaffMembers' | 'userAccess' | 'staffDetails' | 'teamsManagingCase' | 'ukBankHolidays' | 'inmateDetails';
25 changes: 25 additions & 0 deletions server/@types/shared/models/Cas1PremisesSearchResultSummary.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ApType } from './ApType';
import type { CharacteristicPair } from './CharacteristicPair';
import type { NamedId } from './NamedId';
export type Cas1PremisesSearchResultSummary = {
id?: string;
apCode?: string;
deliusQCode?: string;
apType?: ApType;
name?: string;
addressLine1?: string;
addressLine2?: string;
town?: string;
postcode?: string;
apArea?: NamedId;
/**
* The total number of spaces in this premises
*/
totalSpaceCount?: number;
premisesCharacteristics?: Array<CharacteristicPair>;
};

2 changes: 1 addition & 1 deletion server/@types/shared/models/Cas1ReportName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Cas1ReportName = 'applications' | 'applicationsV2' | 'dailyMetrics' | 'lostBeds' | 'placementApplications' | 'placementMatchingOutcomes' | 'placementMatchingOutcomesV2' | 'requestsForPlacement';
export type Cas1ReportName = 'applications' | 'applicationsV2' | 'dailyMetrics' | 'lostBeds' | 'outOfServiceBeds' | 'placementApplications' | 'placementMatchingOutcomes' | 'placementMatchingOutcomesV2' | 'requestsForPlacement';
10 changes: 10 additions & 0 deletions server/@types/shared/models/Cas1SpaceAvailability.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Cas1SpaceCharacteristic } from './Cas1SpaceCharacteristic';
export type Cas1SpaceAvailability = {
spaceCharacteristics?: Array<Cas1SpaceCharacteristic>;
durationInDays?: number;
};

20 changes: 20 additions & 0 deletions server/@types/shared/models/Cas1SpaceBooking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Cas1SpaceBookingRequirements } from './Cas1SpaceBookingRequirements';
import type { NamedId } from './NamedId';
import type { Person } from './Person';
import type { User } from './User';
export type Cas1SpaceBooking = {
id: string;
person: Person;
requirements: Cas1SpaceBookingRequirements;
premises: NamedId;
apArea: NamedId;
bookedBy: User;
arrivalDate: string;
departureDate: string;
createdAt: string;
};

14 changes: 14 additions & 0 deletions server/@types/shared/models/Cas1SpaceBookingRequirements.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ApType } from './ApType';
import type { Cas1SpaceCharacteristic } from './Cas1SpaceCharacteristic';
import type { Gender } from './Gender';
export type Cas1SpaceBookingRequirements = {
apType: ApType;
essentialCharacteristics?: Array<Cas1SpaceCharacteristic>;
desirableCharacteristics?: Array<Cas1SpaceCharacteristic>;
gender: Gender;
};

8 changes: 8 additions & 0 deletions server/@types/shared/models/Cas1SpaceCategory.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* Spaces are categorised by these traits - 'standard' plus selected physcial and risk characteristics
*/
export type Cas1SpaceCategory = 'standard' | 'arson' | 'wheelchair' | 'sexOffender' | 'enSuite' | 'single';
8 changes: 8 additions & 0 deletions server/@types/shared/models/Cas1SpaceCharacteristic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* All of the characteristics of both premises and rooms
*/
export type Cas1SpaceCharacteristic = 'acceptsChildSexOffenders' | 'acceptsHateCrimeOffenders' | 'acceptsNonSexualChildOffenders' | 'acceptsSexOffenders' | 'hasArsonInsuranceConditions' | 'hasBrailleSignage' | 'hasCallForAssistance' | 'hasCrib7Bedding' | 'hasEnSuite' | 'hasFixedMobilityAids' | 'hasHearingLoop' | 'hasLift' | 'hasNearbySprinkler' | 'hasSmokeDetector' | 'hasStepFreeAccess' | 'hasStepFreeAccessToCommunalAreas' | 'hasTactileFlooring' | 'hasTurningSpace' | 'hasWheelChairAccessibleBathrooms' | 'hasWideAccessToCommunalAreas' | 'hasWideDoor' | 'hasWideStepFreeAccess' | 'isArsonDesignated' | 'isArsonSuitable' | 'isCatered' | 'isFullyFm' | 'isGroundFloor' | 'isGroundFloorNrOffice' | 'isIAP' | 'isSingle' | 'isStepFreeDesignated' | 'isSuitableForVulnerable' | 'isSuitedForSexOffenders' | 'isTopFloorVulnerable' | 'isWheelchairAccessible' | 'isWheelchairDesignated';
21 changes: 21 additions & 0 deletions server/@types/shared/models/Cas1SpaceSearchParameters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Cas1SpaceSearchRequirements } from './Cas1SpaceSearchRequirements';
export type Cas1SpaceSearchParameters = {
/**
* The date the space is required from
*/
startDate: string;
/**
* The number of days the space is needed, from the start date
*/
durationInDays: number;
/**
* The 'target' location, in the form of a postcode district
*/
targetPostcodeDistrict: string;
requirements: Cas1SpaceSearchRequirements;
};

13 changes: 13 additions & 0 deletions server/@types/shared/models/Cas1SpaceSearchRequirements.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { ApType } from './ApType';
import type { Cas1SpaceCharacteristic } from './Cas1SpaceCharacteristic';
import type { Gender } from './Gender';
export type Cas1SpaceSearchRequirements = {
apTypes?: Array<ApType>;
spaceCharacteristics?: Array<Cas1SpaceCharacteristic>;
genders?: Array<Gender>;
};

12 changes: 12 additions & 0 deletions server/@types/shared/models/Cas1SpaceSearchResult.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Cas1PremisesSearchResultSummary } from './Cas1PremisesSearchResultSummary';
import type { Cas1SpaceAvailability } from './Cas1SpaceAvailability';
export type Cas1SpaceSearchResult = {
premises?: Cas1PremisesSearchResultSummary;
distanceInMiles?: number;
spacesAvailable?: Array<Cas1SpaceAvailability>;
};

12 changes: 12 additions & 0 deletions server/@types/shared/models/Cas1SpaceSearchResults.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Cas1SpaceSearchParameters } from './Cas1SpaceSearchParameters';
import type { Cas1SpaceSearchResult } from './Cas1SpaceSearchResult';
export type Cas1SpaceSearchResults = {
searchCriteria?: Cas1SpaceSearchParameters;
resultsCount: number;
results: Array<Cas1SpaceSearchResult>;
};

5 changes: 5 additions & 0 deletions server/@types/shared/models/GenderForAp.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type GenderForAp = 'male' | 'female';
2 changes: 1 addition & 1 deletion server/@types/shared/models/MigrationJobType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type MigrationJobType = 'update_all_users_from_community_api' | 'update_sentence_type_and_situation' | 'update_booking_status' | 'update_application_ap_areas' | 'update_task_due_dates' | 'update_cas2_applications_with_assessments' | 'update_cas2_status_updates_with_assessments' | 'update_cas2_notes_with_assessments' | 'update_cas1_user_details' | 'update_cas1_fix_placement_app_links' | 'update_cas1_notice_types' | 'update_cas1_backfill_user_ap_area' | 'update_cas1_out_of_service_bed_reasons' | 'update_cas1_lost_beds_to_out_of_service_beds' | 'update_cas3_application_offender_name' | 'update_cas3_users_pdu_from_community_api' | 'update_cas1_populate_app_reason_for_short_notice_metadata' | 'update_cas3_domain_event_type_for_person_departed_updated';
export type MigrationJobType = 'update_all_users_from_community_api' | 'update_sentence_type_and_situation' | 'update_booking_status' | 'update_application_ap_areas' | 'update_task_due_dates' | 'update_users_pdu_from_community_api' | 'update_cas2_applications_with_assessments' | 'update_cas2_status_updates_with_assessments' | 'update_cas2_notes_with_assessments' | 'update_cas1_user_details' | 'update_cas1_fix_placement_app_links' | 'update_cas1_notice_types' | 'update_cas1_backfill_user_ap_area' | 'update_cas1_out_of_service_bed_reasons' | 'update_cas1_lost_beds_to_out_of_service_beds' | 'update_cas3_application_offender_name' | 'update_cas1_populate_app_reason_for_short_notice_metadata' | 'update_cas3_domain_event_type_for_person_departed_updated' | 'update_cas1_manager_to_future_manager';
13 changes: 13 additions & 0 deletions server/@types/shared/models/NewCas1SpaceBooking.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { Cas1SpaceBookingRequirements } from './Cas1SpaceBookingRequirements';
export type NewCas1SpaceBooking = {
arrivalDate: string;
departureDate: string;
premisesId: string;
placementRequestId: string;
requirements: Cas1SpaceBookingRequirements;
};

2 changes: 1 addition & 1 deletion server/@types/shared/models/ReleaseTypeOption.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type ReleaseTypeOption = 'licence' | 'rotl' | 'hdc' | 'pss' | 'in_community' | 'not_applicable' | 'extendedDeterminateLicence' | 'paroleDirectedLicence';
export type ReleaseTypeOption = 'licence' | 'rotl' | 'hdc' | 'pss' | 'in_community' | 'not_applicable' | 'extendedDeterminateLicence' | 'paroleDirectedLicence' | 'reReleasedPostRecall';
2 changes: 1 addition & 1 deletion server/@types/shared/models/SeedFileType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type SeedFileType = 'approved_premises' | 'approved_premises_rooms' | 'temporary_accommodation_premises' | 'temporary_accommodation_bedspace' | 'user' | 'nomis_users' | 'external_users' | 'cas2_applications' | 'temporary_accommodation_users' | 'approved_premises_users' | 'characteristics' | 'update_noms_number' | 'approved_premises_ap_staff_users' | 'approved_premises_offline_applications' | 'approved_premises_bookings' | 'approved_premises_cancel_bookings' | 'approved_premises_ap_area_email_addresses' | 'approved_premises_booking_adhoc_property' | 'approved_premises_assessment_more_info_bug_fix' | 'approved_premises_redact_assessment_details' | 'approved_premises_withdraw_placement_request' | 'approved_premises_replay_domain_events' | 'approved_premises_duplicate_application' | 'approved_premises_update_event_number' | 'approved_premises_link_booking_to_placement_request';
export type SeedFileType = 'approved_premises' | 'approved_premises_rooms' | 'temporary_accommodation_premises' | 'temporary_accommodation_bedspace' | 'user' | 'nomis_users' | 'external_users' | 'cas2_applications' | 'temporary_accommodation_users' | 'approved_premises_users' | 'characteristics' | 'update_noms_number' | 'update_users_from_api' | 'approved_premises_ap_staff_users' | 'approved_premises_offline_applications' | 'approved_premises_cancel_bookings' | 'approved_premises_ap_area_email_addresses' | 'approved_premises_booking_adhoc_property' | 'approved_premises_assessment_more_info_bug_fix' | 'approved_premises_redact_assessment_details' | 'approved_premises_withdraw_placement_request' | 'approved_premises_replay_domain_events' | 'approved_premises_duplicate_application' | 'approved_premises_update_event_number' | 'approved_premises_link_booking_to_placement_request' | 'approved_premises_out_of_service_beds';
2 changes: 1 addition & 1 deletion server/@types/shared/models/SubmitApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import type { AnyValue } from './AnyValue';
export type SubmitApplication = {
type: string;
translatedDocument: AnyValue;
translatedDocument?: AnyValue;
};

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type SubmitTemporaryAccommodationApplication = (SubmitApplication & {
dutyToReferLocalAuthorityAreaName?: string;
personReleaseDate?: string;
pdu?: string;
probationDeliveryUnitId?: string;
isHistoryOfSexualOffence?: boolean;
isConcerningSexualBehaviour?: boolean;
isConcerningArsonBehaviour?: boolean;
Expand Down
2 changes: 2 additions & 0 deletions server/@types/shared/models/Task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import type { ApArea } from './ApArea';
import type { ApprovedPremisesUser } from './ApprovedPremisesUser';
import type { PersonSummary } from './PersonSummary';
import type { ProbationDeliveryUnit } from './ProbationDeliveryUnit';
import type { TaskStatus } from './TaskStatus';
import type { TaskType } from './TaskType';
export type Task = {
Expand All @@ -27,6 +28,7 @@ export type Task = {
allocatedToStaffMember?: ApprovedPremisesUser;
status: TaskStatus;
apArea?: ApArea;
probationDeliveryUnit?: ProbationDeliveryUnit;
outcomeRecordedAt?: string;
};

0 comments on commit 1610cd7

Please sign in to comment.