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

DMP-4366: Add and adjust admin portal API validations #2409

Merged
merged 10 commits into from
Jan 13, 2025
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package uk.gov.hmcts.darts.testutils.stubs;

import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import uk.gov.hmcts.darts.common.entity.CourtCaseEntity;
import uk.gov.hmcts.darts.common.entity.CourtroomEntity;
Expand Down Expand Up @@ -96,8 +97,8 @@ public List<TranscriptionDocumentEntity> generateTranscriptionEntities(int count
.getQueryString(UUID.randomUUID() + Integer.toString(transriptionDocumentCount)), userAccountRepository.getReferenceById(0));

for (int i = 0; i < caseCount; i++) {
caseEntity = courtCaseStub.createAndSaveMinimalCourtCase(TranscriptionDocumentSubStringQueryEnum.COURT_HOUSE.getQueryString(
UUID.randomUUID() + "Case Number" + transriptionDocumentCount + i), courtroomEntity.getCourthouse().getId());
caseEntity = courtCaseStub.createAndSaveMinimalCourtCase(StringUtils.right(TranscriptionDocumentSubStringQueryEnum.COURT_HOUSE.getQueryString(
UUID.randomUUID() + "Case Number" + transriptionDocumentCount + i), 32), courtroomEntity.getCourthouse().getId());
caseEntityList.add(caseEntity);
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/openapi/audio.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ components:
courtroom_name:
type: string
example: "1"
maxLength: 64
hearing_start_at:
type: string
format: date
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/openapi/audiorequests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,12 @@ components:
media_request_id:
type: integer
description: 'The media request id'
minimum: 1
maximum: 2147483647
case_number:
type: string
description: 'The case number'
maxLength: 32
courthouse_display_name:
type: String
description: 'The court house display name'
Expand All @@ -841,9 +844,11 @@ components:
owner:
type: string
description: 'The media owner'
maxLength: 2000
requested_by:
type: string
description: 'The person that requested the media'
maxLength: 2000
requested_at_from:
type: date
description: 'The start date range that the media was requested'
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/openapi/cases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ components:
courtroom_name:
type: string
example: "1"
maxLength: 64
hearing_start_at:
type: string
format: date
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/openapi/courthouse.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ components:
properties:
courthouse_name:
type: string
maxLength: 255
display_name:
type: string
region_id:
Expand All @@ -170,6 +171,7 @@ components:
properties:
courthouse_name:
type: string
maxLength: 255
display_name:
type: string
region_id:
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/openapi/event.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ components:
type: string
courtroom_name:
type: string
maxLength: 64
hearing_start_at:
type: string
format: date
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/openapi/hearings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ components:
courtroom_name:
type: string
example: some_courthouse
maxLength: 64
hearing_start_at:
type: string
format: date
Expand Down
8 changes: 8 additions & 0 deletions src/main/resources/openapi/transcriptions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1032,9 +1032,12 @@ components:
transcription_id:
type: integer
example: 1234
minimum: 1
maximum: 2147483647
case_number:
type: string
example: C123
maxLength: 32
courthouse_display_name:
type: string
example: some_courthouse
Expand All @@ -1045,9 +1048,11 @@ components:
owner:
type: string
example: 'some-user-name'
maxLength: 2000
requested_by:
type: string
example: 'some-user-name'
maxLength: 2000
requested_at_from:
type: string
format: date
Expand Down Expand Up @@ -1562,6 +1567,7 @@ components:
case_number:
type: string
description: 'The case number'
maxLength: 32
courthouse_display_name:
type: String
description: 'The court house display name'
Expand All @@ -1571,9 +1577,11 @@ components:
owner:
type: string
description: 'The media owner'
maxLength: 2000
requested_by:
type: string
description: 'The person that requested the media'
maxLength: 2000
requested_at_from:
type: date
description: 'The start date range that the media was requested'
Expand Down
Loading