From bd282119d5d6c877cc75526961c3e4117dde7b0a Mon Sep 17 00:00:00 2001 From: Youngmin Park Date: Sun, 8 Oct 2023 21:03:14 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20LIMIT=20=EC=83=81=ED=83=9C=EC=9D=BC?= =?UTF-8?q?=EB=95=8C=EB=A7=8C=20=EB=AA=A8=EC=A7=91=EC=9D=B8=EC=9B=90?= =?UTF-8?q?=EC=9D=84=20=EA=B2=80=EC=82=AC=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20(#66)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 리턴 타입 capacityType 추가 (#14) * refactor: LIMIT 상태일때만 모집인원을 검사하도록 수정 (#14) --- .../domain/apply/application/service/ApplyService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/onna/onnaback/domain/apply/application/service/ApplyService.java b/src/main/java/com/onna/onnaback/domain/apply/application/service/ApplyService.java index 3e3150e..8fb0505 100644 --- a/src/main/java/com/onna/onnaback/domain/apply/application/service/ApplyService.java +++ b/src/main/java/com/onna/onnaback/domain/apply/application/service/ApplyService.java @@ -14,6 +14,7 @@ import com.onna.onnaback.domain.member.application.port.in.MemberUseCase; import com.onna.onnaback.domain.member.domain.Member; import com.onna.onnaback.domain.spark.application.port.in.SparkUseCase; +import com.onna.onnaback.domain.spark.domain.CapacityType; import com.onna.onnaback.domain.spark.domain.Spark; import com.onna.onnaback.global.exception.BaseException; import com.onna.onnaback.global.exception.ErrorCode; @@ -38,7 +39,7 @@ public String apply(Member applicant, Long sparkId) throws BaseException { if (loadApplyPort.isAlreadyApply(applicant.getMemberId(), sparkId)) { throw new BaseException(ErrorCode.APPLY_ALREADY); } - if (spark.getMemberCount() >= spark.getCapacity()) { + if (spark.getCapacityType() == CapacityType.LIMIT && spark.getMemberCount() >= spark.getCapacity()) { throw new BaseException(ErrorCode.OVER_MEMBERCOUNT); }