Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
2 changes: 1 addition & 1 deletion infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ locals {
env_to_deploy = 1
env_long_name = var.env == "sbox" ? "sandbox" : var.env == "stg" ? "staging" : var.env
apim_service_url = var.env == "prod" ? "https://pre-api.platform.hmcts.net" : "https://pre-api.${local.env_long_name}.platform.hmcts.net"
api_revision = "126"
api_revision = "127"
}

data "azurerm_client_config" "current" {}
Expand Down
4 changes: 4 additions & 0 deletions pre-api-stg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2654,6 +2654,10 @@ paths:
in: query
name: hasRecordings
type: boolean
- description: Include bookings marked as deleted
in: query
name: includeDeleted
type: boolean
- description: >-
Search bookings with at least one associated capture session with
one of the statuses listed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public void testSearchBookingsNotSuperUser() {
null,
null,
null,
null,
Pageable.unpaged(Sort.by(Sort.Order.asc("scheduledFor")))
);
assertEquals(1, findAllSharedWithUser.toList().size(), "Should find 1 booking");
Expand Down Expand Up @@ -197,6 +198,7 @@ public void testSearchBookings() {
null,
null,
null,
null,
Pageable.unpaged(Sort.by(Sort.Order.asc("scheduledFor")))
);
assertEquals(2, findByCaseReferenceResult.getContent().size(), "Should find 2 bookings");
Expand All @@ -212,6 +214,7 @@ public void testSearchBookings() {
null,
null,
null,
null,
Pageable.unpaged(Sort.by(Sort.Order.asc("scheduledFor")))
);
assertEquals(1, findByScheduledForResult.getContent().size(), "Should find 1 bookings");
Expand All @@ -229,6 +232,7 @@ public void testSearchBookings() {
null,
null,
null,
null,
null);
assertEquals(1, findByParticipantResult.getContent().size());
assertEquals(
Expand All @@ -245,6 +249,7 @@ public void testSearchBookings() {
null,
null,
null,
null,
null).toList();
assertEquals(1, findByCourtIdResult.size());
assertEquals(
Expand All @@ -262,6 +267,7 @@ public void testSearchBookings() {
false,
null,
null,
null,
Pageable.unpaged(Sort.by(Sort.Order.asc("scheduledFor")))
).toList();
assertEquals(findByHasRecordingsFalse.size(), 1);
Expand All @@ -279,6 +285,7 @@ public void testSearchBookings() {
true,
null,
null,
null,
Pageable.unpaged(Sort.by(Sort.Order.asc("scheduledFor")))
).toList();
assertEquals(findByHasRecordingsTrue.size(), 1);
Expand Down Expand Up @@ -366,6 +373,7 @@ void testSearchByCaptureSessionStatus() {
Optional.empty(),
null,
null,
null,
List.of(RecordingStatus.STANDBY),
null,
null).getContent();
Expand All @@ -378,6 +386,7 @@ void testSearchByCaptureSessionStatus() {
Optional.empty(),
null,
null,
null,
List.of(RecordingStatus.PROCESSING),
null,
null).getContent();
Expand All @@ -390,6 +399,7 @@ void testSearchByCaptureSessionStatus() {
Optional.empty(),
null,
null,
null,
List.of(
RecordingStatus.STANDBY,
RecordingStatus.PROCESSING
Expand All @@ -408,6 +418,7 @@ void testSearchByCaptureSessionStatus() {
Optional.empty(),
null,
null,
null,
List.of(RecordingStatus.NO_RECORDING),
null,
null).getContent();
Expand All @@ -420,6 +431,7 @@ void testSearchByCaptureSessionStatus() {
null,
null,
null,
null,
List.of(RecordingStatus.STANDBY),
null).getContent();
assertThat(findOnlyWithProcessing).hasSize(1);
Expand All @@ -432,6 +444,7 @@ void testSearchByCaptureSessionStatus() {
null,
null,
null,
null,
List.of(
RecordingStatus.STANDBY,
RecordingStatus.PROCESSING
Expand Down Expand Up @@ -661,6 +674,7 @@ void searchBookingsEnableMigratedDataToggleNonSuperUser() {
null,
null,
null,
null,
null
);

Expand Down Expand Up @@ -698,6 +712,7 @@ void searchBookingsEnableMigratedDataToggleSuperUser() {
null,
null,
null,
null,
null
);

Expand Down Expand Up @@ -759,6 +774,7 @@ void searchBookingsEnableMigratedDataToggleNonSuperUser() {
null,
null,
null,
null,
null
);

Expand Down Expand Up @@ -799,6 +815,7 @@ void searchBookingsEnableMigratedDataToggleSuperUser() {
null,
null,
null,
null,
null
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ public BookingController(final BookingService bookingService, final ShareBooking
description = "If the booking has any recordings",
schema = @Schema(implementation = Boolean.class)
)

@Parameter(
name = "includeDeleted",
description = "Include bookings marked as deleted",
schema = @Schema(implementation = Boolean.class)
)
@Parameter(
name = "captureSessionStatusIn",
description = "Search bookings with at least one associated capture session with one of the statuses listed",
Expand Down Expand Up @@ -144,12 +150,14 @@ public HttpEntity<PagedModel<EntityModel<BookingDTO>>> searchByCaseId(
: Optional.empty(),
params.getParticipantId(),
params.getHasRecordings(),
params.getIncludeDeleted() != null && params.getIncludeDeleted(),
params.getCaptureSessionStatusIn() == null || params.getCaptureSessionStatusIn().isEmpty()
? null
: params.getCaptureSessionStatusIn(),
params.getCaptureSessionStatusNotIn() == null || params.getCaptureSessionStatusNotIn().isEmpty()
? null
: params.getCaptureSessionStatusNotIn(),

pageable
);
if (pageable.getPageNumber() > resultPage.getTotalPages()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class SearchBookings {
private LocalDate scheduledFor;
private UUID participantId;
private Boolean hasRecordings;
private Boolean includeDeleted;
private List<RecordingStatus> captureSessionStatusIn;
private List<RecordingStatus> captureSessionStatusNotIn;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public interface BookingRepository extends JpaRepository<Booking, UUID> {
(:reference IS NULL OR b.caseId.reference ILIKE %:reference%)
AND (CAST(:caseId as uuid) IS NULL OR b.caseId.id = :caseId)
AND (CAST(:courtId as uuid) IS NULL OR b.caseId.court.id = :courtId)
AND (:includeDeleted = TRUE OR b.deletedAt IS NULL)
AND (CAST(:scheduledForFrom as Timestamp) IS NULL OR
CAST(:scheduledForUntil as Timestamp) IS NULL OR
CAST(FUNCTION('TIMEZONE', 'Europe/London', b.scheduledFor) as Timestamp)
Expand Down Expand Up @@ -79,6 +80,7 @@ Page<Booking> searchBookingsBy(
@Param("authorisedBookings") List<UUID> authorisedBookings,
@Param("authCourtId") UUID authCourtId,
@Param("hasRecordings") Boolean hasRecordings,
@Param("includeDeleted") Boolean includeDeleted,
@Param("statuses") List<RecordingStatus> statuses,
@Param("notStatuses") List<RecordingStatus> notStatuses,
@Param("includeVodafone") boolean includeVodafone,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public Page<BookingDTO> searchBy(
Optional<Timestamp> scheduledFor,
UUID participantId,
Boolean hasRecordings,
Boolean includeDeleted,
List<RecordingStatus> statuses,
List<RecordingStatus> notStatuses,
Pageable pageable
Expand All @@ -114,6 +115,7 @@ public Page<BookingDTO> searchBy(
authorisedBookings,
authorisedCourt,
hasRecordings,
includeDeleted,
statuses,
notStatuses,
enableMigratedData || auth.hasRole("ROLE_SUPER_USER"),
Expand Down Expand Up @@ -252,6 +254,7 @@ public List<BookingDTO> findAllBookingsForToday() {
null,
null,
null,
null,
Pageable.unpaged()
)
.toList();
Expand Down
Loading
Loading