From 22b183c87371485bcff8883edb9d72808c412a3a Mon Sep 17 00:00:00 2001 From: Jamie Briggs Date: Tue, 11 Feb 2025 15:55:29 +0000 Subject: [PATCH] CCMSPUI-379 Added to open-api-specification.yml Signed-off-by: Jamie Briggs --- data-api/open-api-specification.yml | 91 +++++++++++++++++++ .../data/controller/ClientsController.java | 10 ++ 2 files changed, 101 insertions(+) diff --git a/data-api/open-api-specification.yml b/data-api/open-api-specification.yml index c506fe76..afa61b60 100644 --- a/data-api/open-api-specification.yml +++ b/data-api/open-api-specification.yml @@ -1068,6 +1068,67 @@ paths: description: 'Forbidden' '500': description: 'Internal server error' + /clients: + get: + tags: + - clients + summary: 'Get Clients' + operationId: 'getClients' + x-spring-paginated: true + parameters: + - name: 'first-name' + in: 'query' + schema: + type: 'string' + example: 'john' + - name: 'surname' + in: 'query' + schema: + type: 'string' + example: 'smith' + - name: 'date-of-birth' + in: 'query' + schema: + type: 'string' + example: "2017-01-01" + format: date + - name: 'gender' + in: 'query' + schema: + type: 'string' + example: 'Male' + - name: 'case-reference-number' + in: 'query' + schema: + type: 'string' + example: '1234567890' + - name: 'home-office-reference' + in: 'query' + schema: + type: 'string' + example: '1234567890' + - name: 'national-insurance-number' + in: 'query' + schema: + type: 'string' + example: 'AB123456C' + responses: + '200': + description: 'Successful operation' + content: + application/json: + schema: + $ref: "#/components/schemas/clientDetails" + '400': + description: 'Bad request' + '401': + description: 'Unauthorized' + '403': + description: 'Forbidden' + '404': + description: 'Not found' + '500': + description: 'Internal server error' /clients/status/{transaction-request-id}: get: tags: @@ -1502,6 +1563,36 @@ components: type: 'string' default_code: type: 'string' + clientDetails: + allOf: + - $ref: "#/components/schemas/page" + type: 'object' + properties: + content: + type: 'array' + default: [ ] + items: + $ref: "#/components/schemas/clientSummary" + clientSummary: + allOf: + - $ref: '#/components/schemas/baseClient' + type: 'object' + properties: + surname_at_birth: + type: 'string' + full_name: + type: 'string' + date_of_birth: + type: 'string' + format: 'date' + gender: + type: 'string' + postal_code: + type: 'string' + home_office_reference: + type: 'string' + national_insurance_number: + type: 'string' baseClient: type: 'object' properties: diff --git a/data-service/src/main/java/uk/gov/laa/ccms/data/controller/ClientsController.java b/data-service/src/main/java/uk/gov/laa/ccms/data/controller/ClientsController.java index d7cb8a7d..9f25eb5b 100644 --- a/data-service/src/main/java/uk/gov/laa/ccms/data/controller/ClientsController.java +++ b/data-service/src/main/java/uk/gov/laa/ccms/data/controller/ClientsController.java @@ -1,8 +1,11 @@ package uk.gov.laa.ccms.data.controller; +import java.time.LocalDate; +import org.springframework.data.domain.Pageable; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.RestController; import uk.gov.laa.ccms.data.api.ClientsApi; +import uk.gov.laa.ccms.data.model.ClientDetails; import uk.gov.laa.ccms.data.model.TransactionStatus; import uk.gov.laa.ccms.data.service.ClientService; import uk.gov.laa.ccms.data.service.ClientServiceException; @@ -44,4 +47,11 @@ public ResponseEntity getClientTransactionStatus(String trans return ResponseEntity.internalServerError().build(); } } + + @Override + public ResponseEntity getClients(String firstName, String surname, + LocalDate dateOfBirth, String gender, String caseReferenceNumber, String homeOfficeReference, + String nationalInsuranceNumber, Pageable pageable) { + return null; + } }