From d8d5e92dc4d449a5ccbd83028b5240f5d68b16f1 Mon Sep 17 00:00:00 2001 From: Danie Humphreys Date: Fri, 17 Jan 2025 16:21:14 +0000 Subject: [PATCH 1/2] Type updates. --- server/@types/shared/index.d.ts | 6 +++--- .../models/ApprovedPremisesBedSearchResult.ts | 16 -------------- server/@types/shared/models/Assessment.ts | 2 -- .../shared/models/BedSearchParameters.ts | 16 -------------- .../@types/shared/models/BedSearchResult.ts | 15 ------------- .../@types/shared/models/BedSearchResults.ts | 4 ++-- .../@types/shared/models/BedspaceFilters.ts | 9 ++++++++ .../models/Cas1SpaceBookingDaySummary.ts | 4 ++-- .../models/DashboardPlacementRequest.ts | 21 +++++++++++++++++++ .../@types/shared/models/MigrationJobType.ts | 2 +- .../shared/models/PlacementRequirements.ts | 3 +++ .../@types/shared/models/PremisesFilters.ts | 9 ++++++++ server/@types/shared/models/SeedFileType.ts | 2 +- ...mporaryAccommodationBedSearchParameters.ts | 15 ++++++++++--- .../TemporaryAccommodationBedSearchResult.ts | 11 +++++++--- 15 files changed, 71 insertions(+), 64 deletions(-) delete mode 100644 server/@types/shared/models/ApprovedPremisesBedSearchResult.ts delete mode 100644 server/@types/shared/models/BedSearchParameters.ts delete mode 100644 server/@types/shared/models/BedSearchResult.ts create mode 100644 server/@types/shared/models/BedspaceFilters.ts create mode 100644 server/@types/shared/models/DashboardPlacementRequest.ts create mode 100644 server/@types/shared/models/PremisesFilters.ts diff --git a/server/@types/shared/index.d.ts b/server/@types/shared/index.d.ts index f0e7568b7e..8f8367e8db 100644 --- a/server/@types/shared/index.d.ts +++ b/server/@types/shared/index.d.ts @@ -22,7 +22,6 @@ export type { ApprovedPremisesApplicationSummary } from './models/ApprovedPremis export type { ApprovedPremisesAssessment } from './models/ApprovedPremisesAssessment'; export type { ApprovedPremisesAssessmentStatus } from './models/ApprovedPremisesAssessmentStatus'; export type { ApprovedPremisesAssessmentSummary } from './models/ApprovedPremisesAssessmentSummary'; -export type { ApprovedPremisesBedSearchResult } from './models/ApprovedPremisesBedSearchResult'; export type { ApprovedPremisesSummary } from './models/ApprovedPremisesSummary'; export type { ApprovedPremisesUser } from './models/ApprovedPremisesUser'; export type { ApprovedPremisesUserPermission } from './models/ApprovedPremisesUserPermission'; @@ -40,12 +39,11 @@ export type { AssessmentTask } from './models/AssessmentTask'; export type { Bed } from './models/Bed'; export type { BedDetail } from './models/BedDetail'; export type { BedSearchAttributes } from './models/BedSearchAttributes'; -export type { BedSearchParameters } from './models/BedSearchParameters'; -export type { BedSearchResult } from './models/BedSearchResult'; export type { BedSearchResultBedSummary } from './models/BedSearchResultBedSummary'; export type { BedSearchResultPremisesSummary } from './models/BedSearchResultPremisesSummary'; export type { BedSearchResultRoomSummary } from './models/BedSearchResultRoomSummary'; export type { BedSearchResults } from './models/BedSearchResults'; +export type { BedspaceFilters } from './models/BedspaceFilters'; export type { BedStatus } from './models/BedStatus'; export type { BedSummary } from './models/BedSummary'; export type { Booking } from './models/Booking'; @@ -136,6 +134,7 @@ export type { Characteristic } from './models/Characteristic'; export type { CharacteristicPair } from './models/CharacteristicPair'; export type { ClarificationNote } from './models/ClarificationNote'; export type { Confirmation } from './models/Confirmation'; +export type { DashboardPlacementRequest } from './models/DashboardPlacementRequest'; export type { DateCapacity } from './models/DateCapacity'; export type { DateChange } from './models/DateChange'; export type { DatePeriod } from './models/DatePeriod'; @@ -230,6 +229,7 @@ export type { PlacementRequirements } from './models/PlacementRequirements'; export type { PlacementType } from './models/PlacementType'; export type { Premises } from './models/Premises'; export type { PremisesBooking } from './models/PremisesBooking'; +export type { PremisesFilters } from './models/PremisesFilters'; export type { PremisesSummary } from './models/PremisesSummary'; export type { PrisonCaseNote } from './models/PrisonCaseNote'; export type { ProbationDeliveryUnit } from './models/ProbationDeliveryUnit'; diff --git a/server/@types/shared/models/ApprovedPremisesBedSearchResult.ts b/server/@types/shared/models/ApprovedPremisesBedSearchResult.ts deleted file mode 100644 index 3c48134549..0000000000 --- a/server/@types/shared/models/ApprovedPremisesBedSearchResult.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { BedSearchResult } from './BedSearchResult'; -/** - * This is no longer returned by any APIs so should be removed once removed from UI Code - * @deprecated - */ -export type ApprovedPremisesBedSearchResult = (BedSearchResult & { - /** - * how many miles away from the postcode district the Premises this Bed belongs to is - */ - distanceMiles: number; -}); - diff --git a/server/@types/shared/models/Assessment.ts b/server/@types/shared/models/Assessment.ts index c2a6b773b7..5b1e71db27 100644 --- a/server/@types/shared/models/Assessment.ts +++ b/server/@types/shared/models/Assessment.ts @@ -4,7 +4,6 @@ /* eslint-disable */ 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; @@ -18,6 +17,5 @@ export type Assessment = { rejectionRationale?: string; data?: Unit; clarificationNotes: Array; - referralHistoryNotes?: Array; }; diff --git a/server/@types/shared/models/BedSearchParameters.ts b/server/@types/shared/models/BedSearchParameters.ts deleted file mode 100644 index f4fe068177..0000000000 --- a/server/@types/shared/models/BedSearchParameters.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* 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; -}; - diff --git a/server/@types/shared/models/BedSearchResult.ts b/server/@types/shared/models/BedSearchResult.ts deleted file mode 100644 index c361ebe4b4..0000000000 --- a/server/@types/shared/models/BedSearchResult.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { BedSearchResultBedSummary } from './BedSearchResultBedSummary'; -import type { BedSearchResultPremisesSummary } from './BedSearchResultPremisesSummary'; -import type { BedSearchResultRoomSummary } from './BedSearchResultRoomSummary'; -import type { ServiceName } from './ServiceName'; -export type BedSearchResult = { - serviceName: ServiceName; - premises: BedSearchResultPremisesSummary; - room: BedSearchResultRoomSummary; - bed: BedSearchResultBedSummary; -}; - diff --git a/server/@types/shared/models/BedSearchResults.ts b/server/@types/shared/models/BedSearchResults.ts index 14dcd00e52..8798600db9 100644 --- a/server/@types/shared/models/BedSearchResults.ts +++ b/server/@types/shared/models/BedSearchResults.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { BedSearchResult } from './BedSearchResult'; +import type { TemporaryAccommodationBedSearchResult } from './TemporaryAccommodationBedSearchResult'; export type BedSearchResults = { /** * How many distinct Rooms the Beds in the results belong to @@ -16,6 +16,6 @@ export type BedSearchResults = { * How many Beds are in the results */ resultsBedCount: number; - results: Array; + results: Array; }; diff --git a/server/@types/shared/models/BedspaceFilters.ts b/server/@types/shared/models/BedspaceFilters.ts new file mode 100644 index 0000000000..0c65a59dfc --- /dev/null +++ b/server/@types/shared/models/BedspaceFilters.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type BedspaceFilters = { + includedCharacteristicIds?: Array; + excludedCharacteristicIds?: Array; +}; + diff --git a/server/@types/shared/models/Cas1SpaceBookingDaySummary.ts b/server/@types/shared/models/Cas1SpaceBookingDaySummary.ts index 2f11a4afa3..35c66cfe1d 100644 --- a/server/@types/shared/models/Cas1SpaceBookingDaySummary.ts +++ b/server/@types/shared/models/Cas1SpaceBookingDaySummary.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Cas1SpaceBookingCharacteristic } from './Cas1SpaceBookingCharacteristic'; +import type { Cas1SpaceCharacteristic } from './Cas1SpaceCharacteristic'; import type { PersonSummary } from './PersonSummary'; export type Cas1SpaceBookingDaySummary = { id: string; @@ -20,6 +20,6 @@ export type Cas1SpaceBookingDaySummary = { */ tier?: string; releaseType?: string; - essentialCharacteristics: Array; + essentialCharacteristics: Array; }; diff --git a/server/@types/shared/models/DashboardPlacementRequest.ts b/server/@types/shared/models/DashboardPlacementRequest.ts new file mode 100644 index 0000000000..5a0566b315 --- /dev/null +++ b/server/@types/shared/models/DashboardPlacementRequest.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BookingSummary } from './BookingSummary'; +import type { Person } from './Person'; +import type { PersonRisks } from './PersonRisks'; +import type { PlacementDates } from './PlacementDates'; +import type { PlacementRequestStatus } from './PlacementRequestStatus'; +import type { PlacementRequirements } from './PlacementRequirements'; +export type DashboardPlacementRequest = (PlacementRequirements & PlacementDates & { + id: string; + person: Person; + risks: PersonRisks; + applicationId: string; + status: PlacementRequestStatus; + applicationDate: string; + isParole: boolean; + booking?: BookingSummary; +}); + diff --git a/server/@types/shared/models/MigrationJobType.ts b/server/@types/shared/models/MigrationJobType.ts index e665421f28..be27b8cee2 100644 --- a/server/@types/shared/models/MigrationJobType.ts +++ b/server/@types/shared/models/MigrationJobType.ts @@ -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_task_due_dates' | 'update_users_pdu_by_api' | 'update_cas2_applications_with_assessments' | 'update_cas2_status_updates_with_assessments' | 'update_cas2_notes_with_assessments' | 'update_cas1_fix_placement_app_links' | 'update_cas1_notice_types' | 'update_cas1_backfill_user_ap_area' | 'update_cas3_application_offender_name' | 'update_cas3_domain_event_type_for_person_departed_updated' | 'update_cas1_applications_licence_expiry_date'; +export type MigrationJobType = 'update_all_users_from_community_api' | 'update_sentence_type_and_situation' | 'update_booking_status' | 'update_task_due_dates' | 'update_users_pdu_by_api' | 'update_cas2_applications_with_assessments' | 'update_cas2_status_updates_with_assessments' | 'update_cas2_notes_with_assessments' | 'update_cas1_fix_placement_app_links' | 'update_cas1_notice_types' | 'update_cas1_backfill_user_ap_area' | 'update_cas3_application_offender_name' | 'update_cas3_domain_event_type_for_person_departed_updated' | 'update_cas1_applications_licence_expiry_date' | 'update_cas1_backfill_offline_application_name'; diff --git a/server/@types/shared/models/PlacementRequirements.ts b/server/@types/shared/models/PlacementRequirements.ts index 5f1762675f..59194aa747 100644 --- a/server/@types/shared/models/PlacementRequirements.ts +++ b/server/@types/shared/models/PlacementRequirements.ts @@ -8,6 +8,9 @@ import type { PlacementCriteria } from './PlacementCriteria'; export type PlacementRequirements = { gender: Gender; type: ApType; + /** + * Postcode outcode + */ location: string; radius: number; essentialCriteria: Array; diff --git a/server/@types/shared/models/PremisesFilters.ts b/server/@types/shared/models/PremisesFilters.ts new file mode 100644 index 0000000000..062edadef8 --- /dev/null +++ b/server/@types/shared/models/PremisesFilters.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PremisesFilters = { + includedCharacteristicIds?: Array; + excludedCharacteristicIds?: Array; +}; + diff --git a/server/@types/shared/models/SeedFileType.ts b/server/@types/shared/models/SeedFileType.ts index a9dc24f225..a31a3aaf71 100644 --- a/server/@types/shared/models/SeedFileType.ts +++ b/server/@types/shared/models/SeedFileType.ts @@ -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_referrals' | 'approved_premises_update_space_booking' | 'approved_premises_backfill_active_space_bookings_created_in_delius' | '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' | 'approved_premises_backfill_active_space_bookings_created_in_delius' | 'approved_premises_create_test_applications' | 'approved_premises_delete_application_timeline_notes' | 'temporary_accommodation_referral_rejection'; diff --git a/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts b/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts index 96dfa34536..d709999b8c 100644 --- a/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts +++ b/server/@types/shared/models/TemporaryAccommodationBedSearchParameters.ts @@ -3,15 +3,24 @@ /* tslint:disable */ /* eslint-disable */ import type { BedSearchAttributes } from './BedSearchAttributes'; -import type { BedSearchParameters } from './BedSearchParameters'; -export type TemporaryAccommodationBedSearchParameters = (BedSearchParameters & { +import type { BedspaceFilters } from './BedspaceFilters'; +import type { PremisesFilters } from './PremisesFilters'; +export type TemporaryAccommodationBedSearchParameters = { + serviceName?: string; + startDate: string; + /** + * The number of days the Bed will need to be free from the start_date until + */ + durationDays: number; /** * The list of pdus Ids to search within */ probationDeliveryUnits: Array; + premisesFilters?: PremisesFilters; + bedspaceFilters?: BedspaceFilters; /** * Bedspace and property attributes to filter on */ attributes?: Array; -}); +}; diff --git a/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts b/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts index 5a751c28e6..9dbce307e0 100644 --- a/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts +++ b/server/@types/shared/models/TemporaryAccommodationBedSearchResult.ts @@ -2,9 +2,14 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { BedSearchResult } from './BedSearchResult'; +import type { BedSearchResultBedSummary } from './BedSearchResultBedSummary'; +import type { BedSearchResultPremisesSummary } from './BedSearchResultPremisesSummary'; +import type { BedSearchResultRoomSummary } from './BedSearchResultRoomSummary'; import type { TemporaryAccommodationBedSearchResultOverlap } from './TemporaryAccommodationBedSearchResultOverlap'; -export type TemporaryAccommodationBedSearchResult = (BedSearchResult & { +export type TemporaryAccommodationBedSearchResult = { + premises: BedSearchResultPremisesSummary; + room: BedSearchResultRoomSummary; + bed: BedSearchResultBedSummary; overlaps: Array; -}); +}; From bd669982fb3cdaab58caa891945a6ec2c973b1e4 Mon Sep 17 00:00:00 2001 From: Danie Humphreys Date: Fri, 17 Jan 2025 16:21:47 +0000 Subject: [PATCH 2/2] Change dashboard to use new DashboardPlacementRequest type. --- server/data/placementRequestClient.ts | 5 +++-- server/services/placementRequestService.ts | 6 +++--- server/utils/placementRequests/table.ts | 22 +++++++++++----------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/server/data/placementRequestClient.ts b/server/data/placementRequestClient.ts index a40dea773e..7ccd0d4b69 100644 --- a/server/data/placementRequestClient.ts +++ b/server/data/placementRequestClient.ts @@ -1,6 +1,7 @@ import { BookingNotMade, Cas1CruManagementArea, + DashboardPlacementRequest, NewBookingNotMade, NewPlacementRequestBooking, NewPlacementRequestBookingConfirmation, @@ -48,7 +49,7 @@ export default class PlacementRequestClient { page = 1, sortBy: PlacementRequestSortField = 'created_at', sortDirection: SortDirection = 'asc', - ): Promise> { + ): Promise> { const params: DashboardQueryParams = {} Object.keys(allParams).forEach(key => { @@ -61,7 +62,7 @@ export default class PlacementRequestClient { params.crnOrName = normaliseCrn(allParams.crnOrName) } - return this.restClient.getPaginatedResponse({ + return this.restClient.getPaginatedResponse({ path: paths.placementRequests.dashboard.pattern, page: page.toString(), query: { ...params, sortBy, sortDirection }, diff --git a/server/services/placementRequestService.ts b/server/services/placementRequestService.ts index 772632582d..26db95856e 100644 --- a/server/services/placementRequestService.ts +++ b/server/services/placementRequestService.ts @@ -1,9 +1,9 @@ import { PaginatedResponse, PlacementRequestDashboardSearchOptions } from '@approved-premises/ui' import { + DashboardPlacementRequest, NewBookingNotMade, NewPlacementRequestBooking, NewPlacementRequestBookingConfirmation, - PlacementRequest, PlacementRequestDetail, PlacementRequestSortField, SortDirection, @@ -21,7 +21,7 @@ export default class PlacementRequestService { page: number = 1, sortBy: PlacementRequestSortField = 'created_at', sortDirection: SortDirection = 'asc', - ): Promise> { + ): Promise> { const placementRequestClient = this.placementRequestClientFactory(token) return placementRequestClient.dashboard(filters, page, sortBy, sortDirection) @@ -33,7 +33,7 @@ export default class PlacementRequestService { page: number = 1, sortBy: PlacementRequestSortField = 'created_at', sortDirection: SortDirection = 'asc', - ): Promise> { + ): Promise> { const placementRequestClient = this.placementRequestClientFactory(token) return placementRequestClient.dashboard(searchParams, page, sortBy, sortDirection) diff --git a/server/utils/placementRequests/table.ts b/server/utils/placementRequests/table.ts index 7b627bc80d..097bc0a771 100644 --- a/server/utils/placementRequests/table.ts +++ b/server/utils/placementRequests/table.ts @@ -1,6 +1,6 @@ import { addDays } from 'date-fns' import { - PlacementRequest, + DashboardPlacementRequest, PlacementRequestSortField, PlacementRequestStatus, PlacementRequestTask, @@ -33,10 +33,10 @@ export const tableRows = (tasks: Array): Array = } export const dashboardTableRows = ( - placementRequests: Array, + placementRequests: Array, status: PlacementRequestStatus | undefined, ): Array => { - return placementRequests.map((placementRequest: PlacementRequest) => { + return placementRequests.map((placementRequest: DashboardPlacementRequest) => { return [ nameCell(placementRequest), tierCell(placementRequest.risks), @@ -50,25 +50,25 @@ export const dashboardTableRows = ( }) } -export const statusCell = (placementRequest: PlacementRequest): TableCell => { +export const statusCell = (placementRequest: DashboardPlacementRequest): TableCell => { return { text: placementRequestStatus[placementRequest.status], } } -export const requestTypeCell = (placementRequest: PlacementRequest): TableCell => { +export const requestTypeCell = (placementRequest: DashboardPlacementRequest): TableCell => { return { text: placementRequest.isParole ? 'Parole' : 'Standard release', } } -export const premisesNameCell = (placementRequest: PlacementRequest): TableCell => { +export const premisesNameCell = (placementRequest: DashboardPlacementRequest): TableCell => { return { text: placementRequest.booking?.premisesName, } } -export const durationCell = (placementRequest: PlacementRequest): TableCell => { +export const durationCell = (placementRequest: DashboardPlacementRequest): TableCell => { return { text: DateFormats.formatDuration(daysToWeeksAndDays(placementRequest.duration), ['weeks', 'days']) } } @@ -84,21 +84,21 @@ export const dueDateCell = (task: PlacementRequestTask, differenceBetweenDueDate } export const expectedArrivalDateCell = ( - item: PlacementRequestTask | PlacementRequest, + item: PlacementRequestTask | DashboardPlacementRequest, format: 'short' | 'long' = 'long', ): TableCell => ({ text: DateFormats.isoDateToUIDate(item.expectedArrival, { format }), }) -export const actualArrivalDateCell = (item: PlacementRequest): TableCell => ({ +export const actualArrivalDateCell = (item: DashboardPlacementRequest): TableCell => ({ text: item.booking?.arrivalDate ? DateFormats.isoDateToUIDate(item.booking?.arrivalDate, { format: 'short' }) : 'N/A', }) -export const applicationDateCell = (item: PlacementRequest): TableCell => ({ +export const applicationDateCell = (item: DashboardPlacementRequest): TableCell => ({ text: DateFormats.isoDateToUIDate(item.applicationDate, { format: 'short' }), }) -export const nameCell = (item: PlacementRequestTask | PlacementRequest): TableCell => { +export const nameCell = (item: PlacementRequestTask | DashboardPlacementRequest): TableCell => { if ('personName' in item && item.personName) { return { html: linkTo(matchPaths.placementRequests.show({ id: item.id }), {