From 1549b90610a45d3542b659bc64d0afd9a488f543 Mon Sep 17 00:00:00 2001 From: HyungJu Date: Tue, 14 May 2024 18:57:09 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20InocluationSimple=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=EC=97=90=20type=20=EA=B8=B0=EC=A4=80=EC=9D=84=20=EB=90=98?= =?UTF-8?q?=EB=8F=8C=EB=A6=AC=EC=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/inoculation/application/InoculationService.kt | 6 ++++-- .../presentation/dto/InoculationSimpleRequest.kt | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/vacgom/backend/inoculation/application/InoculationService.kt b/src/main/kotlin/com/vacgom/backend/inoculation/application/InoculationService.kt index 315f6f7..97a6e66 100644 --- a/src/main/kotlin/com/vacgom/backend/inoculation/application/InoculationService.kt +++ b/src/main/kotlin/com/vacgom/backend/inoculation/application/InoculationService.kt @@ -40,10 +40,12 @@ class InoculationService( ): List { val vaccinations = if (request.vaccinations.isEmpty()) { - vaccinationRepository.findAll() + vaccinationRepository.findAll().filter { + it.vaccinationType == request.type + } } else { vaccinationRepository.findAll().filter { - it.vaccineName in request.vaccinations + it.vaccineName in request.vaccinations && it.vaccinationType == request.type } } diff --git a/src/main/kotlin/com/vacgom/backend/inoculation/presentation/dto/InoculationSimpleRequest.kt b/src/main/kotlin/com/vacgom/backend/inoculation/presentation/dto/InoculationSimpleRequest.kt index a6342a2..24a91b8 100644 --- a/src/main/kotlin/com/vacgom/backend/inoculation/presentation/dto/InoculationSimpleRequest.kt +++ b/src/main/kotlin/com/vacgom/backend/inoculation/presentation/dto/InoculationSimpleRequest.kt @@ -1,5 +1,8 @@ package com.vacgom.backend.inoculation.presentation.dto +import com.vacgom.backend.inoculation.domain.constants.VaccinationType + data class InoculationSimpleRequest( + val type: VaccinationType, val vaccinations: List, )