Skip to content

Commit

Permalink
feat: 전체 백신 단순 조회 - 접종완료 Response 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
h-beeen committed Mar 21, 2024
1 parent ee71212 commit d879a23
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.vacgom.backend.application.auth.dto.response

import com.vacgom.backend.domain.member.constants.HealthCondition
import com.vacgom.backend.domain.disease.HealthCondition

class HealthConditionResponse(
val code: String,
val description: String,
val code: String,
val description: String,
) {
companion object {
fun of(healthCondition: HealthCondition): HealthConditionResponse {
return HealthConditionResponse(
code = healthCondition.name,
description = healthCondition.description,
code = healthCondition.name,
description = healthCondition.description,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ class InoculationService(
}

return vaccinations.map { vaccination ->
val vaccineOrders = hashMap[vaccination.vaccineName]?.toHashSet()?.toList()
InoculationSimpleResponse(vaccination.diseaseName, vaccination.vaccineName, vaccination.minOrder, vaccination.maxOrder, vaccineOrders)
val vaccineOrders = hashMap[vaccination.vaccineName]?.toHashSet()?.toList() ?: listOf()
val isCompleted = vaccineOrders.any { order -> order == vaccination.maxOrder }
InoculationSimpleResponse(vaccination.diseaseName, vaccination.vaccineName, vaccination.minOrder, vaccination.maxOrder, isCompleted, vaccineOrders)
}.toList()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ data class InoculationSimpleResponse(
val vaccineName: String,
val minOrder: Long,
val maxOrder: Long,
val isCompleted: Boolean,
val inoculationOrders: List<Long>?
)

0 comments on commit d879a23

Please sign in to comment.