From 4f77bd488d31730cfcdc9d2c065bd5dd6c840f90 Mon Sep 17 00:00:00 2001 From: Kasim Helil Date: Mon, 8 Feb 2021 12:34:57 -0500 Subject: [PATCH 1/2] Removed duplicate co traveller from cotravellers list --- .../src/main/java/gov/gtas/services/FlightServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gtas-parent/gtas-commons/src/main/java/gov/gtas/services/FlightServiceImpl.java b/gtas-parent/gtas-commons/src/main/java/gov/gtas/services/FlightServiceImpl.java index 820ca32913..e57b38e101 100644 --- a/gtas-parent/gtas-commons/src/main/java/gov/gtas/services/FlightServiceImpl.java +++ b/gtas-parent/gtas-commons/src/main/java/gov/gtas/services/FlightServiceImpl.java @@ -285,6 +285,7 @@ public List getSeatsByFlightId(Long flightId) { vo.setPaxId(passenger.getId()); vo.setFirstName(passenger.getPassengerDetails().getFirstName()); vo.setLastName(passenger.getPassengerDetails().getLastName()); + vo.setMiddleName(passenger.getPassengerDetails().getMiddleName()); vo.setMiddleInitial(passenger.getPassengerDetails().getMiddleName()); vo.setFlightNumber(flight.getFlightNumber()); vo.setRefNumber(passenger.getPassengerTripDetails().getReservationReferenceNumber()); @@ -308,7 +309,7 @@ public List getSeatsByFlightId(Long flightId) { parentSeatVo.setCoTravellers(new String[0]); } else { parentSeatVo.setCoTravellers(seatVos.stream().filter(isCoTravelerSeat(parentSeatVo)) - .collect(Collectors.toList()).stream().map(SeatVo::getNumber).toArray(String[]::new)); + .collect(Collectors.toList()).stream().map(SeatVo::getNumber).distinct().toArray(String[]::new)); } }); From dadf71d2a4d913addf2d6753b124dcbc551993c8 Mon Sep 17 00:00:00 2001 From: Kasim Helil Date: Mon, 8 Feb 2021 12:35:41 -0500 Subject: [PATCH 2/2] Added middle name --- .../src/main/java/gov/gtas/vo/passenger/SeatVo.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gtas-parent/gtas-commons/src/main/java/gov/gtas/vo/passenger/SeatVo.java b/gtas-parent/gtas-commons/src/main/java/gov/gtas/vo/passenger/SeatVo.java index f354e29fbd..d317105bee 100644 --- a/gtas-parent/gtas-commons/src/main/java/gov/gtas/vo/passenger/SeatVo.java +++ b/gtas-parent/gtas-commons/src/main/java/gov/gtas/vo/passenger/SeatVo.java @@ -13,6 +13,7 @@ public class SeatVo implements PIIObject { private String flightNumber; private String firstName; private String lastName; + private String middleName; private Long flightId; private Long paxId; @@ -35,7 +36,7 @@ public class SeatVo implements PIIObject { * @param hasHits * @param coTravellers */ - public SeatVo(String seatNumber, Long flightId, Long paxId, String firstName, String lastName, String middleInitial, + public SeatVo(String seatNumber, Long flightId, Long paxId, String firstName, String lastName, String middleName, String middleInitial, boolean hasHits, String[] coTravellers, String refNumber, Boolean apis) { super(); this.number = seatNumber; @@ -43,6 +44,7 @@ public SeatVo(String seatNumber, Long flightId, Long paxId, String firstName, St this.paxId = paxId; this.firstName = firstName; this.lastName = lastName; + this.middleName = middleName; this.middleInitial = middleInitial; this.hasHits = hasHits; this.coTravellers = coTravellers; @@ -133,6 +135,13 @@ public String getLastName() { public void setLastName(String lastName) { this.lastName = lastName; } + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(String middleName) { + this.middleName = middleName; + } public String getRefNumber() { return refNumber;