diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/controller/CallbackController.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/controller/CallbackController.java index 609a002..9e0e2a9 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/controller/CallbackController.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/controller/CallbackController.java @@ -22,7 +22,7 @@ import eu.europa.ec.dgc.validation.decorator.dto.CallbackRequest; import eu.europa.ec.dgc.validation.decorator.service.AccessTokenService; -import eu.europa.ec.dgc.validation.decorator.service.BookingService; +import eu.europa.ec.dgc.validation.decorator.service.BackendService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; @@ -48,7 +48,7 @@ public class CallbackController { private final AccessTokenService accessTokenService; - private final BookingService bookingService; + private final BackendService backendService; /** * Callback endpoint receives the validation result to a subject. @@ -69,14 +69,14 @@ public ResponseEntity callback( @PathVariable(value = "subject", required = true) final String subject, @RequestHeader("Authorization") final String token, @RequestHeader("X-Version") final String version, - @Valid @RequestBody CallbackRequest request) { + @Valid @RequestBody final CallbackRequest request) { log.debug("Incoming PUT request to '{}' with subject '{}'", PATH, subject); if (accessTokenService.isValid(token)) { final Map tokenContent = accessTokenService.parseAccessToken(token); if (tokenContent.containsKey("sub") && tokenContent.get("sub") != null) { - bookingService.saveResult(subject, request); + this.backendService.saveResult(subject, request); return ResponseEntity.ok().build(); } } diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/converter/CallbackRequestToBookingServiceResultRequestConverter.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/converter/CallbackRequestToServiceResultRequestConverter.java similarity index 77% rename from src/main/java/eu/europa/ec/dgc/validation/decorator/converter/CallbackRequestToBookingServiceResultRequestConverter.java rename to src/main/java/eu/europa/ec/dgc/validation/decorator/converter/CallbackRequestToServiceResultRequestConverter.java index 789a563..d4f34b5 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/converter/CallbackRequestToBookingServiceResultRequestConverter.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/converter/CallbackRequestToServiceResultRequestConverter.java @@ -22,23 +22,23 @@ import eu.europa.ec.dgc.validation.decorator.dto.CallbackRequest; import eu.europa.ec.dgc.validation.decorator.dto.CallbackRequest.Result; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceResultRequest; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceResultRequest.DccStatusRequest; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceResultRequest.DccStatusResult; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceResultRequest.DccStatusType; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceResultRequest.ResultRequest; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest.DccStatusRequest; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest.DccStatusResult; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest.DccStatusType; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest.ResultRequest; import eu.europa.ec.dgc.validation.decorator.exception.NotFoundException; import java.util.stream.Collectors; import org.springframework.core.convert.converter.Converter; import org.springframework.stereotype.Service; @Service -public class CallbackRequestToBookingServiceResultRequestConverter - implements Converter { +public class CallbackRequestToServiceResultRequestConverter + implements Converter { @Override - public BookingServiceResultRequest convert(CallbackRequest callback) { - BookingServiceResultRequest result = new BookingServiceResultRequest(); + public ServiceResultRequest convert(CallbackRequest callback) { + ServiceResultRequest result = new ServiceResultRequest(); result.setDccStatus(new DccStatusRequest()); result.getDccStatus().setIssuer(callback.getIssuer()); result.getDccStatus().setIat(callback.getIat()); diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/dto/QrCodeDto.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/dto/QrCodeDto.java index f1e7576..247eaed 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/dto/QrCodeDto.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/dto/QrCodeDto.java @@ -43,7 +43,7 @@ public class QrCodeDto { // used from application.yml // currently disabled // private String validationIdentity; - // JWT for access Validation Decorator from booking service + // JWT for access Validation Decorator from backend service private String token; // Consent text which is shown to the user by the wallet app diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/BookingServiceResultRequest.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/ServiceResultRequest.java similarity index 97% rename from src/main/java/eu/europa/ec/dgc/validation/decorator/entity/BookingServiceResultRequest.java rename to src/main/java/eu/europa/ec/dgc/validation/decorator/entity/ServiceResultRequest.java index e13ecb7..54cf464 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/BookingServiceResultRequest.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/ServiceResultRequest.java @@ -29,7 +29,7 @@ import lombok.Getter; @Data -public class BookingServiceResultRequest { +public class ServiceResultRequest { private String token; diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/BookingServiceTokenContentResponse.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/ServiceTokenContentResponse.java similarity index 84% rename from src/main/java/eu/europa/ec/dgc/validation/decorator/entity/BookingServiceTokenContentResponse.java rename to src/main/java/eu/europa/ec/dgc/validation/decorator/entity/ServiceTokenContentResponse.java index 7bd527a..ae85be5 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/BookingServiceTokenContentResponse.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/entity/ServiceTokenContentResponse.java @@ -29,18 +29,26 @@ import lombok.Data; @Data -public class BookingServiceTokenContentResponse { +public class ServiceTokenContentResponse { private String reference; private OffsetDateTime time; - private List passengers = new ArrayList<>(); + private List passengers = new ArrayList<>(); - private FlightInfoResponse flightInfo; + private OccurrenceInfoResponse flightInfo; + + public List getSubjects() { + return this.getPassengers(); + } + + public OccurrenceInfoResponse getOccurrenceInfo() { + return this.getFlightInfo(); + } @Data - public static final class PassengerResponse { + public static final class SubjectResponse { private UUID id; @@ -82,7 +90,7 @@ public static final class ResultResponse { } @Data - public static final class FlightInfoResponse { + public static final class OccurrenceInfoResponse { private String from; diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BackendRepository.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BackendRepository.java new file mode 100644 index 0000000..e6d559b --- /dev/null +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BackendRepository.java @@ -0,0 +1,54 @@ +/*- + * ---license-start + * European Digital COVID Certificate Validation Decorator Service / dgca-validation-decorator + * --- + * Copyright (C) 2021 T-Systems International GmbH and all other contributors + * --- + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ---license-end + */ + +package eu.europa.ec.dgc.validation.decorator.repository; + +import eu.europa.ec.dgc.validation.decorator.config.DgcProperties.ServiceProperties; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceTokenContentResponse; + +public interface BackendRepository { + + /** + * Booking service token content endpoint. + * + * @param subject {@link String} + * @return {@link BookingServiceTokenContentResponse} + */ + ServiceTokenContentResponse tokenContent(String subject); + + /** + * Booking service token content endpoint. + * + * @param subject {@link String} + * @param service Used service + * @return {@link BookingServiceTokenContentResponse} + */ + ServiceTokenContentResponse tokenContent(String subject, ServiceProperties service); + + /** + * Booking service result endpoint. + * + * @param subject {@link String} + * @param body {@link BookingServiceResultRequest} + */ + void result(String subject, ServiceResultRequest body); + +} \ No newline at end of file diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BookingServiceRepository.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BookingBackendRepository.java similarity index 81% rename from src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BookingServiceRepository.java rename to src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BookingBackendRepository.java index db04afc..88882fe 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BookingServiceRepository.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/repository/BookingBackendRepository.java @@ -21,8 +21,8 @@ package eu.europa.ec.dgc.validation.decorator.repository; import eu.europa.ec.dgc.validation.decorator.config.DgcProperties.ServiceProperties; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceResultRequest; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceTokenContentResponse; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceTokenContentResponse; import eu.europa.ec.dgc.validation.decorator.service.AccessTokenService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -38,7 +38,7 @@ @Slf4j @Service @RequiredArgsConstructor -public class BookingServiceRepository { +public class BookingBackendRepository implements BackendRepository { private static final String PLACEHOLDER_SUBJECT = "{subject}"; @@ -58,7 +58,8 @@ public class BookingServiceRepository { * @param subject {@link String} * @return {@link BookingServiceTokenContentResponse} */ - public BookingServiceTokenContentResponse tokenContent(final String subject) { + @Override + public ServiceTokenContentResponse tokenContent(final String subject) { return this.tokenContent(subject, null); } @@ -69,7 +70,8 @@ public BookingServiceTokenContentResponse tokenContent(final String subject) { * @param service Used service * @return {@link BookingServiceTokenContentResponse} */ - public BookingServiceTokenContentResponse tokenContent(final String subject, final ServiceProperties service) { + @Override + public ServiceTokenContentResponse tokenContent(final String subject, final ServiceProperties service) { final UriComponentsBuilder urlBuilder = UriComponentsBuilder .fromUriString(this.tokenContentUrl.replace(PLACEHOLDER_SUBJECT, subject)); if (service != null) { @@ -83,8 +85,8 @@ public BookingServiceTokenContentResponse tokenContent(final String subject, fin final HttpEntity entity = new HttpEntity<>(headers); log.debug("REST Call to '{}' starting", url); - final ResponseEntity response = this.restTpl.exchange(url, HttpMethod.GET, - entity, BookingServiceTokenContentResponse.class); + final ResponseEntity response = this.restTpl.exchange(url, HttpMethod.GET, + entity, ServiceTokenContentResponse.class); return response.getBody(); } @@ -94,13 +96,14 @@ public BookingServiceTokenContentResponse tokenContent(final String subject, fin * @param subject {@link String} * @param body {@link BookingServiceResultRequest} */ - public void result(final String subject, final BookingServiceResultRequest body) { + @Override + public void result(final String subject, final ServiceResultRequest body) { final String url = this.resultUrl.replace(PLACEHOLDER_SUBJECT, subject); final HttpHeaders headers = new HttpHeaders(); headers.add("Authorization", accessTokenService.buildHeaderToken(subject)); - final HttpEntity entity = new HttpEntity<>(body, headers); + final HttpEntity entity = new HttpEntity<>(body, headers); log.debug("REST Call to '{}' starting", url); this.restTpl.exchange(url, HttpMethod.PUT, entity, String.class); diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/BookingService.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/BackendService.java similarity index 70% rename from src/main/java/eu/europa/ec/dgc/validation/decorator/service/BookingService.java rename to src/main/java/eu/europa/ec/dgc/validation/decorator/service/BackendService.java index 2eed1d9..9cf7cc2 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/BookingService.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/BackendService.java @@ -21,17 +21,17 @@ package eu.europa.ec.dgc.validation.decorator.service; import eu.europa.ec.dgc.validation.decorator.dto.CallbackRequest; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceResultRequest; -import eu.europa.ec.dgc.validation.decorator.repository.BookingServiceRepository; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceResultRequest; +import eu.europa.ec.dgc.validation.decorator.repository.BackendRepository; import lombok.RequiredArgsConstructor; import org.springframework.core.convert.ConversionService; import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor -public class BookingService { +public class BackendService { - private final BookingServiceRepository bookingServiceRepository; + private final BackendRepository backendRepository; private final ConversionService converter; @@ -41,9 +41,8 @@ public class BookingService { * @param subject {@link String} * @param request {@link CallbackRequest} */ - public void saveResult(String subject, CallbackRequest request) { - final BookingServiceResultRequest resultRequest = this.converter - .convert(request, BookingServiceResultRequest.class); - bookingServiceRepository.result(subject, resultRequest); + public void saveResult(final String subject, final CallbackRequest request) { + final ServiceResultRequest resultRequest = this.converter.convert(request, ServiceResultRequest.class); + this.backendRepository.result(subject, resultRequest); } } diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java index 11372fc..b60a93d 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/DccTokenService.java @@ -25,13 +25,13 @@ import eu.europa.ec.dgc.validation.decorator.dto.AccessTokenPayload; import eu.europa.ec.dgc.validation.decorator.dto.AccessTokenPayload.AccessTokenConditions; import eu.europa.ec.dgc.validation.decorator.dto.DccTokenRequest; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceTokenContentResponse; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceTokenContentResponse.FlightInfoResponse; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceTokenContentResponse.PassengerResponse; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceTokenContentResponse; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceTokenContentResponse.OccurrenceInfoResponse; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceTokenContentResponse.SubjectResponse; import eu.europa.ec.dgc.validation.decorator.entity.ValidationServiceInitializeResponse; import eu.europa.ec.dgc.validation.decorator.exception.NotFoundException; import eu.europa.ec.dgc.validation.decorator.exception.NotImplementedException; -import eu.europa.ec.dgc.validation.decorator.repository.BookingServiceRepository; +import eu.europa.ec.dgc.validation.decorator.repository.BackendRepository; import eu.europa.ec.dgc.validation.decorator.repository.ValidationServiceRepository; import java.time.Instant; import java.time.OffsetDateTime; @@ -53,12 +53,12 @@ public class DccTokenService { private final ValidationServiceRepository validationServiceRepository; - private final BookingServiceRepository bookingServiceRepository; + private final BackendRepository backendRepository; private final IdentityService identityService; /** - * Request validation- and booking service to create token. + * Request validation- and backend service to create token. * * @param dccToken {@link DccTokenRequest} * @return {@link AccessTokenPayload} @@ -73,37 +73,37 @@ public AccessTokenPayload getAccessTockenForValidationService( final ValidationServiceInitializeResponse initialize = validationServiceRepository .initialize(service, dccToken, subject); - final BookingServiceTokenContentResponse tokenContent = bookingServiceRepository.tokenContent(subject, service); - if (tokenContent.getPassengers() == null || tokenContent.getPassengers().isEmpty()) { + final ServiceTokenContentResponse tokenContent = backendRepository.tokenContent(subject, service); + if (tokenContent.getSubjects() == null || tokenContent.getSubjects().isEmpty()) { throw new NotFoundException("Passenger not found by subject"); } - final PassengerResponse passenger = tokenContent.getPassengers().get(0); - final FlightInfoResponse flightInfo = tokenContent.getFlightInfo(); + final SubjectResponse subjectResponse = tokenContent.getSubjects().get(0); + final OccurrenceInfoResponse occurrenceInfo = tokenContent.getOccurrenceInfo(); - return this.buildAccessToken(subject, initialize, passenger, flightInfo); + return this.buildAccessToken(subject, initialize, subjectResponse, occurrenceInfo); } private AccessTokenPayload buildAccessToken( final String subject, final ValidationServiceInitializeResponse initialize, - final PassengerResponse passenger, - final FlightInfoResponse flightInfo) { + final SubjectResponse subjectResponse, + final OccurrenceInfoResponse occurrenceInfo) { final AccessTokenConditions accessTokenConditions = new AccessTokenConditions(); // TODO add hash - accessTokenConditions.setLang(flightInfo.getLanguage()); - accessTokenConditions.setFnt(passenger.getForename()); - accessTokenConditions.setGnt(passenger.getLastname()); - accessTokenConditions.setDob(passenger.getBirthDate().format(BIRTH_DATE_FORMATTER)); - accessTokenConditions.setCoa(flightInfo.getCountryOfArrival()); - accessTokenConditions.setCod(flightInfo.getCountryOfDeparture()); - accessTokenConditions.setRoa(flightInfo.getRegionOfArrival()); - accessTokenConditions.setRod(flightInfo.getRegionOfDeparture()); - accessTokenConditions.setType(flightInfo.getConditionTypes()); - accessTokenConditions.setCategory(flightInfo.getCategories()); - - final OffsetDateTime departureTime = flightInfo.getDepartureTime(); + accessTokenConditions.setLang(occurrenceInfo.getLanguage()); + accessTokenConditions.setFnt(subjectResponse.getForename()); + accessTokenConditions.setGnt(subjectResponse.getLastname()); + accessTokenConditions.setDob(subjectResponse.getBirthDate().format(BIRTH_DATE_FORMATTER)); + accessTokenConditions.setCoa(occurrenceInfo.getCountryOfArrival()); + accessTokenConditions.setCod(occurrenceInfo.getCountryOfDeparture()); + accessTokenConditions.setRoa(occurrenceInfo.getRegionOfArrival()); + accessTokenConditions.setRod(occurrenceInfo.getRegionOfDeparture()); + accessTokenConditions.setType(occurrenceInfo.getConditionTypes()); + accessTokenConditions.setCategory(occurrenceInfo.getCategories()); + + final OffsetDateTime departureTime = occurrenceInfo.getDepartureTime(); accessTokenConditions.setValidFrom(departureTime.format(FORMATTER)); - accessTokenConditions.setValidationClock(flightInfo.getArrivalTime().format(FORMATTER)); + accessTokenConditions.setValidationClock(occurrenceInfo.getArrivalTime().format(FORMATTER)); accessTokenConditions.setValidTo(departureTime.plusDays(2).format(FORMATTER)); final AccessTokenPayload accessTokenPayload = new AccessTokenPayload(); @@ -113,7 +113,7 @@ private AccessTokenPayload buildAccessToken( accessTokenPayload.setExp(initialize.getExp()); accessTokenPayload.setSub(subject); accessTokenPayload.setAud(initialize.getAud()); - accessTokenPayload.setType(flightInfo.getType()); + accessTokenPayload.setType(occurrenceInfo.getType()); accessTokenPayload.setConditions(accessTokenConditions); accessTokenPayload.setVersion("1.0"); return accessTokenPayload; diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/InitializeService.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/InitializeService.java index f49bafb..b3876a0 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/InitializeService.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/InitializeService.java @@ -49,5 +49,5 @@ public QrCodeDto getBySubject(String subject) { .subject(subject) .serviceProvider(properties.getServiceProvider()) .build(); - } + } } diff --git a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/ValidationStatusService.java b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/ValidationStatusService.java index 2964a90..12af531 100644 --- a/src/main/java/eu/europa/ec/dgc/validation/decorator/service/ValidationStatusService.java +++ b/src/main/java/eu/europa/ec/dgc/validation/decorator/service/ValidationStatusService.java @@ -1,6 +1,6 @@ /*- * ---license-start - * European Digital COVID Certificate Booking Demo / dgca-booking-demo-backend + * European Digital COVID Certificate Validation Decorator Service / dgca-validation-decorator * --- * Copyright (C) 2021 T-Systems International GmbH and all other contributors * --- @@ -21,12 +21,12 @@ package eu.europa.ec.dgc.validation.decorator.service; import eu.europa.ec.dgc.validation.decorator.config.DgcProperties.ServiceProperties; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceTokenContentResponse; -import eu.europa.ec.dgc.validation.decorator.entity.BookingServiceTokenContentResponse.PassengerResponse; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceTokenContentResponse; +import eu.europa.ec.dgc.validation.decorator.entity.ServiceTokenContentResponse.SubjectResponse; import eu.europa.ec.dgc.validation.decorator.entity.ValidationServiceStatusResponse; import eu.europa.ec.dgc.validation.decorator.exception.NotFoundException; import eu.europa.ec.dgc.validation.decorator.exception.UncheckedUnsupportedEncodingException; -import eu.europa.ec.dgc.validation.decorator.repository.BookingServiceRepository; +import eu.europa.ec.dgc.validation.decorator.repository.BackendRepository; import eu.europa.ec.dgc.validation.decorator.repository.ValidationServiceRepository; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; @@ -38,7 +38,7 @@ @RequiredArgsConstructor public class ValidationStatusService { - private final BookingServiceRepository bookingServiceRepository; + private final BackendRepository backendRepository; private final IdentityService identityService; @@ -51,13 +51,13 @@ public class ValidationStatusService { * @return {@link ValidationServiceStatusResponse} */ public ValidationServiceStatusResponse determineStatus(final String subject) { - final BookingServiceTokenContentResponse tokenContent = bookingServiceRepository.tokenContent(subject); - if (tokenContent.getPassengers() == null || tokenContent.getPassengers().isEmpty()) { + final ServiceTokenContentResponse tokenContent = backendRepository.tokenContent(subject); + if (tokenContent.getSubjects() == null || tokenContent.getSubjects().isEmpty()) { throw new NotFoundException("Passenger not found by subject"); } - final PassengerResponse passenger = tokenContent.getPassengers().get(0); - final String serviceId = passenger.getServiceIdUsed(); + final SubjectResponse subjectResponse = tokenContent.getSubjects().get(0); + final String serviceId = subjectResponse.getServiceIdUsed(); if (serviceId == null || serviceId.isBlank()) { throw new NotFoundException("Passenger without service ID"); }