Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API model updates #2267

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 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 Down Expand Up @@ -93,8 +92,8 @@ export type { Cas1OverbookingRange } from './models/Cas1OverbookingRange';
export type { Cas1PremiseCapacity } from './models/Cas1PremiseCapacity';
export type { Cas1PremiseCapacityForDay } from './models/Cas1PremiseCapacityForDay';
export type { Cas1PremiseCharacteristicAvailability } from './models/Cas1PremiseCharacteristicAvailability';
export type { Cas1PremiseDaySummary } from './models/Cas1PremiseDaySummary';
export type { Cas1PremisesBasicSummary } from './models/Cas1PremisesBasicSummary';
export type { Cas1PremisesDaySummary } from './models/Cas1PremisesDaySummary';
export type { Cas1PremisesSearchResultSummary } from './models/Cas1PremisesSearchResultSummary';
export type { Cas1PremisesSummary } from './models/Cas1PremisesSummary';
export type { Cas1ReportName } from './models/Cas1ReportName';
Expand Down
8 changes: 0 additions & 8 deletions server/@types/shared/models/AnyValue.ts

This file was deleted.

6 changes: 3 additions & 3 deletions server/@types/shared/models/ApprovedPremisesApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* 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';
Expand All @@ -12,6 +11,7 @@ import type { Cas1ApplicationUserDetails } from './Cas1ApplicationUserDetails';
import type { Cas1CruManagementArea } from './Cas1CruManagementArea';
import type { PersonRisks } from './PersonRisks';
import type { PersonStatus } from './PersonStatus';
import type { Unit } from './Unit';
export type ApprovedPremisesApplication = (Application & {
isWomensApplication?: boolean;
/**
Expand All @@ -31,8 +31,8 @@ export type ApprovedPremisesApplication = (Application & {
createdByUserId: string;
schemaVersion: string;
outdatedSchema: boolean;
data?: AnyValue;
document?: AnyValue;
data?: Unit;
document?: Unit;
status: ApprovedPremisesApplicationStatus;
assessmentId?: string;
assessmentDecision?: AssessmentDecision;
Expand Down
4 changes: 2 additions & 2 deletions server/@types/shared/models/Assessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* 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 { Unit } from './Unit';
export type Assessment = {
service: string;
id: string;
Expand All @@ -16,7 +16,7 @@ export type Assessment = {
submittedAt?: string;
decision?: AssessmentDecision;
rejectionRationale?: string;
data?: AnyValue;
data?: Unit;
clarificationNotes: Array<ClarificationNote>;
referralHistoryNotes?: Array<ReferralHistoryNote>;
};
Expand Down
4 changes: 2 additions & 2 deletions server/@types/shared/models/AssessmentAcceptance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/* 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';
import type { Unit } from './Unit';
export type AssessmentAcceptance = {
document: AnyValue;
document: Unit;
requirements?: PlacementRequirements;
placementDates?: PlacementDates;
apType?: ApType;
Expand Down
4 changes: 2 additions & 2 deletions server/@types/shared/models/AssessmentRejection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnyValue } from './AnyValue';
import type { Unit } from './Unit';
export type AssessmentRejection = {
document: AnyValue;
document: Unit;
rejectionRationale: string;
referralRejectionReasonId?: string;
referralRejectionReasonDetail?: string;
Expand Down
1 change: 1 addition & 0 deletions server/@types/shared/models/Cas1OutOfServiceBedSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { Cas1OutOfServiceBedReason } from './Cas1OutOfServiceBedReason';
import type { Cas1SpaceCharacteristic } from './Cas1SpaceCharacteristic';
export type Cas1OutOfServiceBedSummary = {
id: string;
roomName?: string;
startDate: string;
endDate: string;
reason: Cas1OutOfServiceBedReason;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import type { Cas1OutOfServiceBedSummary } from './Cas1OutOfServiceBedSummary';
import type { Cas1PremiseCapacityForDay } from './Cas1PremiseCapacityForDay';
import type { Cas1SpaceBookingDaySummary } from './Cas1SpaceBookingDaySummary';
export type Cas1PremiseDaySummary = {
export type Cas1PremisesDaySummary = {
forDate: string;
previousDate: string;
nextDate: string;
Expand Down
35 changes: 27 additions & 8 deletions server/@types/shared/models/Cas1PremisesSearchResultSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,42 @@
/* tslint:disable */
/* eslint-disable */
import type { ApType } from './ApType';
import type { Cas1SpaceCharacteristic } from './Cas1SpaceCharacteristic';
import type { CharacteristicPair } from './CharacteristicPair';
import type { NamedId } from './NamedId';
export type Cas1PremisesSearchResultSummary = {
id?: string;
apCode?: string;
deliusQCode?: string;
apType?: ApType;
name?: string;
id: string;
apType: ApType;
name: string;
/**
* Full address, excluding postcode
*/
fullAddress: string;
/**
* Deprecated, use fullAddress
* @deprecated
*/
addressLine1?: string;
/**
* Deprecated, use fullAddress
* @deprecated
*/
addressLine2?: string;
/**
* Deprecated, use fullAddress
* @deprecated
*/
town?: string;
postcode?: string;
apArea?: NamedId;
apArea: NamedId;
/**
* The total number of spaces in this premises
* This is not populated. Instead, use 'characteristics'
* @deprecated
*/
totalSpaceCount?: number;
premisesCharacteristics?: Array<CharacteristicPair>;
/**
* Room and premise characteristics
*/
characteristics: Array<Cas1SpaceCharacteristic>;
};

4 changes: 2 additions & 2 deletions server/@types/shared/models/Cas1SpaceBookingDaySummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export type Cas1SpaceBookingDaySummary = {
/**
* Risk rating tier level of corresponding application
*/
tier: string;
releaseType: string;
tier?: string;
releaseType?: string;
essentialCharacteristics: Array<Cas1SpaceBookingCharacteristic>;
};

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 Cas1SpaceBookingDaySummarySortField = 'personName' | 'tier' | 'canonicalArrivalDate' | 'canonicalDepartureDate' | 'releaseType' | 'spaceType';
export type Cas1SpaceBookingDaySummarySortField = 'personName' | 'tier' | 'canonicalArrivalDate' | 'canonicalDepartureDate' | 'releaseType';
5 changes: 5 additions & 0 deletions server/@types/shared/models/Cas1SpaceSearchRequirements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ import type { ApType } from './ApType';
import type { Cas1SpaceCharacteristic } from './Cas1SpaceCharacteristic';
import type { Gender } from './Gender';
export type Cas1SpaceSearchRequirements = {
/**
* Searching on multiple types is not supported, instead use apType. If this is used, the first type wll be matched, and type 'normal' will be ignored
* @deprecated
*/
apTypes?: Array<ApType>;
apType?: ApType;
spaceCharacteristics?: Array<Cas1SpaceCharacteristic>;
/**
* gender is obtained from application's associated gender
Expand Down
6 changes: 3 additions & 3 deletions server/@types/shared/models/Cas2Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
/* 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';
import type { Unit } from './Unit';
export type Cas2Application = (Application & {
createdBy: NomisUser;
schemaVersion: string;
outdatedSchema: boolean;
data?: AnyValue;
document?: AnyValue;
data?: Unit;
document?: Unit;
status: ApplicationStatus;
submittedAt?: string;
telephoneNumber?: string;
Expand Down
4 changes: 2 additions & 2 deletions server/@types/shared/models/Cas2SubmittedApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
/* 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';
import type { Unit } from './Unit';
export type Cas2SubmittedApplication = {
id: string;
person: Person;
createdAt: string;
submittedBy?: NomisUser;
schemaVersion: string;
outdatedSchema: boolean;
document?: AnyValue;
document?: Unit;
submittedAt?: string;
telephoneNumber?: string;
timelineEvents: Array<Cas2TimelineEvent>;
Expand Down
6 changes: 3 additions & 3 deletions server/@types/shared/models/PlacementApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* 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 { Unit } from './Unit';
import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason';
export type PlacementApplication = (NewPlacementApplication & {
/**
Expand All @@ -23,8 +23,8 @@ export type PlacementApplication = (NewPlacementApplication & {
assessmentId: string;
assessmentCompletedAt: string;
applicationCompletedAt: string;
data?: AnyValue;
document?: AnyValue;
data?: Unit;
document?: Unit;
canBeWithdrawn: boolean;
isWithdrawn: boolean;
withdrawalReason?: WithdrawPlacementRequestReason;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnyValue } from './AnyValue';
import type { Unit } from './Unit';
export type ReferralHistoryNoteMessageDetails = {
rejectionReason?: string;
rejectionReasonDetails?: string;
isWithdrawn?: boolean;
domainEvent?: AnyValue;
domainEvent?: Unit;
};

4 changes: 2 additions & 2 deletions server/@types/shared/models/RequestForPlacement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
/* 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 { Unit } from './Unit';
import type { WithdrawPlacementRequestReason } from './WithdrawPlacementRequestReason';
export type RequestForPlacement = {
/**
Expand All @@ -23,7 +23,7 @@ export type RequestForPlacement = {
*
*/
requestReviewedAt?: string;
document?: AnyValue;
document?: Unit;
/**
* 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.
Expand Down
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' | 'update_users_from_api' | 'approved_premises_ap_staff_users' | 'approved_premises_cancel_bookings' | 'approved_premises_assessment_more_info_bug_fix' | 'approved_premises_redact_assessment_details' | 'approved_premises_booking_to_space_booking' | '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' | 'approved_premises_cru_management_areas' | 'approved_premises_space_planning_dry_run' | 'approved_premises_import_delius_booking_management_data' | 'approved_premises_update_space_booking' | 'temporary_accommodation_referral_rejection';
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_cancel_bookings' | 'approved_premises_assessment_more_info_bug_fix' | 'approved_premises_redact_assessment_details' | 'approved_premises_booking_to_space_booking' | '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' | 'approved_premises_cru_management_areas' | 'approved_premises_space_planning_dry_run' | 'approved_premises_import_delius_referrals' | 'approved_premises_update_space_booking' | 'temporary_accommodation_referral_rejection';
2 changes: 1 addition & 1 deletion server/@types/shared/models/SeedFromExcelFileType.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 SeedFromExcelFileType = 'approved_premises_room' | 'cas1_import_site_survey_premise';
export type SeedFromExcelFileType = 'cas1_import_site_survey_rooms' | 'cas1_import_site_survey_premises';
1 change: 0 additions & 1 deletion server/@types/shared/models/SeedFromExcelRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import type { SeedFromExcelFileType } from './SeedFromExcelFileType';
export type SeedFromExcelRequest = {
seedType: SeedFromExcelFileType;
premisesId: string;
fileName: string;
};

4 changes: 2 additions & 2 deletions server/@types/shared/models/SubmitApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnyValue } from './AnyValue';
import type { Unit } from './Unit';
export type SubmitApplication = {
type: string;
translatedDocument?: AnyValue;
translatedDocument?: Unit;
};

4 changes: 2 additions & 2 deletions server/@types/shared/models/SubmitCas2Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnyValue } from './AnyValue';
import type { Unit } from './Unit';
export type SubmitCas2Application = {
translatedDocument: AnyValue;
translatedDocument: Unit;
/**
* Id of the application being submitted
*/
Expand Down
4 changes: 2 additions & 2 deletions server/@types/shared/models/SubmitPlacementApplication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnyValue } from './AnyValue';
import type { PlacementDates } from './PlacementDates';
import type { PlacementType } from './PlacementType';
import type { Unit } from './Unit';
export type SubmitPlacementApplication = {
translatedDocument: AnyValue;
translatedDocument: Unit;
placementType: PlacementType;
placementDates: Array<PlacementDates>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnyValue } from './AnyValue';
import type { SubmitApplication } from './SubmitApplication';
import type { Unit } from './Unit';
export type SubmitTemporaryAccommodationApplication = (SubmitApplication & {
arrivalDate: string;
isRegisteredSexOffender?: boolean;
Expand All @@ -22,6 +22,6 @@ export type SubmitTemporaryAccommodationApplication = (SubmitApplication & {
isConcerningSexualBehaviour?: boolean;
isConcerningArsonBehaviour?: boolean;
prisonReleaseTypes?: Array<string>;
summaryData: AnyValue;
summaryData: Unit;
});

Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
import type { AnyValue } from './AnyValue';
import type { Application } from './Application';
import type { ApplicationStatus } from './ApplicationStatus';
import type { PersonRisks } from './PersonRisks';
import type { Unit } from './Unit';
export type TemporaryAccommodationApplication = (Application & {
createdByUserId: string;
schemaVersion: string;
outdatedSchema: boolean;
data?: AnyValue;
document?: AnyValue;
data?: Unit;
document?: Unit;
status: ApplicationStatus;
risks?: PersonRisks;
submittedAt?: string;
Expand Down
Loading
Loading