From 51b8619363b293ff8e22ac616c4cba32f69cc4e5 Mon Sep 17 00:00:00 2001 From: coehgns Date: Tue, 7 Oct 2025 22:49:35 +0900 Subject: [PATCH 1/7] feat ( #60 ) : GetApplicationStatusResponse --- .../dto/response/GetApplicationStatusResponse.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/dto/response/GetApplicationStatusResponse.kt diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/dto/response/GetApplicationStatusResponse.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/dto/response/GetApplicationStatusResponse.kt new file mode 100644 index 00000000..446c77b3 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/dto/response/GetApplicationStatusResponse.kt @@ -0,0 +1,11 @@ +package hs.kr.entrydsm.application.domain.application.presentation.dto.response + +data class GetApplicationStatusResponse( + val receiptCode: Long, + val phoneNumber: String?, + val name: String?, + val isSubmitted: Boolean, + val isPrintedArrived: Boolean, + val selfIntroduce: String?, + val studyPlan: String? +) From a426565de2ad6b2ce5c81118ac8b39fc40a7d198 Mon Sep 17 00:00:00 2001 From: coehgns Date: Tue, 7 Oct 2025 22:49:46 +0900 Subject: [PATCH 2/7] feat ( #60 ) : GetMyApplicationStatusUseCase --- .../usecase/GetMyApplicationStatusUseCase.kt | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/GetMyApplicationStatusUseCase.kt diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/GetMyApplicationStatusUseCase.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/GetMyApplicationStatusUseCase.kt new file mode 100644 index 00000000..778d9543 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/GetMyApplicationStatusUseCase.kt @@ -0,0 +1,44 @@ +package hs.kr.entrydsm.application.domain.application.usecase + +import hs.kr.entrydsm.application.domain.application.exception.ApplicationNotFoundException +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.GetApplicationStatusResponse +import hs.kr.entrydsm.application.global.annotation.usecase.ReadOnlyUseCase +import hs.kr.entrydsm.application.global.security.SecurityAdapter +import hs.kr.entrydsm.domain.application.interfaces.ApplicationContract +import hs.kr.entrydsm.domain.status.exception.StatusExceptions +import hs.kr.entrydsm.domain.status.interfaces.StatusContract +import hs.kr.entrydsm.domain.user.interfaces.UserContract + +@ReadOnlyUseCase +class GetMyApplicationStatusUseCase( + private val securityAdapter: SecurityAdapter, + private val applicationContract: ApplicationContract, + private val userContract: UserContract, + private val statusContract: StatusContract +) { + fun execute(): GetApplicationStatusResponse { + val userId = securityAdapter.getCurrentUserId() + + val application = applicationContract.getApplicationByUserId(userId) + ?: throw ApplicationNotFoundException() + + val status = statusContract.queryStatusByReceiptCode(application.receiptCode) + ?: throw StatusExceptions.StatusNotFoundException() + + val user = userContract.queryUserByUserId(userId) + + val phoneNumber = if (user.isParent) application.parentTel else application.applicantTel + val name = if ( user.isParent && application.applicantName == null) + application.parentName else application.applicantName + + return GetApplicationStatusResponse( + receiptCode = application.receiptCode, + phoneNumber = phoneNumber, + name = name, + isSubmitted = status.isSubmitted, + isPrintedArrived = status.isPrintsArrived, + selfIntroduce = application.selfIntroduce, + studyPlan = application.studyPlan + ) + } +} \ No newline at end of file From 0fb69b9e305514f6bccd071beee32e5434bf4ad6 Mon Sep 17 00:00:00 2001 From: coehgns Date: Tue, 7 Oct 2025 22:49:56 +0900 Subject: [PATCH 3/7] feat ( #60 ) : WebApplicationApiDocument --- .../application/WebApplicationApiDocument.kt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/WebApplicationApiDocument.kt diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/WebApplicationApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/WebApplicationApiDocument.kt new file mode 100644 index 00000000..debd8e1c --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/application/WebApplicationApiDocument.kt @@ -0,0 +1,38 @@ +package hs.kr.entrydsm.application.global.document.application + +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.GetApplicationStatusResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +import io.swagger.v3.oas.annotations.tags.Tag + +@Tag(name = "Application", description = "Application API") +interface WebApplicationApiDocument { + + @Operation( + summary = "지원정보 상태 조회", + description = "현재 로그인한 사용자의 지원정보 상태를 조회합니다.", + ) + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "지원정보 상태 조회 성공", + content = [Content(schema = Schema(implementation = GetApplicationStatusResponse::class))] + ), + ApiResponse( + responseCode = "403", + description = "인증되지 않은 사용자", + content = [Content(schema = Schema(hidden = true))], + ), + ApiResponse( + responseCode = "404", + description = "원서 또는 지원자 상태 정보를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))], + ), + ] + ) + fun getMyApplicationStatus(): GetApplicationStatusResponse +} \ No newline at end of file From e6f5417a50fee6405a3f1d54288492dbfe24ca31 Mon Sep 17 00:00:00 2001 From: coehgns Date: Tue, 7 Oct 2025 22:50:02 +0900 Subject: [PATCH 4/7] feat ( #60 ) : WebApplicationAdapter --- .../presentation/WebApplicationAdapter.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt new file mode 100644 index 00000000..0beb5e81 --- /dev/null +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/presentation/WebApplicationAdapter.kt @@ -0,0 +1,18 @@ +package hs.kr.entrydsm.application.domain.application.presentation + +import hs.kr.entrydsm.application.domain.application.presentation.dto.response.GetApplicationStatusResponse +import hs.kr.entrydsm.application.domain.application.usecase.GetMyApplicationStatusUseCase +import hs.kr.entrydsm.application.global.document.application.WebApplicationApiDocument +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/application") +class WebApplicationAdapter( + private val getMyApplicationStatusUseCase: GetMyApplicationStatusUseCase, +) : WebApplicationApiDocument { + + @GetMapping("/status") + override fun getMyApplicationStatus(): GetApplicationStatusResponse = getMyApplicationStatusUseCase.execute() +} \ No newline at end of file From 62c961198bed63bcf8e2837b574d1d80fd79aeaa Mon Sep 17 00:00:00 2001 From: coehgns Date: Tue, 7 Oct 2025 22:50:18 +0900 Subject: [PATCH 5/7] =?UTF-8?q?feat=20(=20#60=20)=20:=20Status=20isPrintsA?= =?UTF-8?q?rrived=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hs/kr/entrydsm/domain/status/aggregates/Status.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/status/aggregates/Status.kt b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/status/aggregates/Status.kt index 2432fe97..0a9075d6 100644 --- a/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/status/aggregates/Status.kt +++ b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/status/aggregates/Status.kt @@ -32,4 +32,10 @@ data class Status( val isSubmitted: Boolean get() = applicationStatus != ApplicationStatus.NOT_APPLIED && applicationStatus != ApplicationStatus.WRITING + + val isPrintsArrived: Boolean + get() = applicationStatus != ApplicationStatus.NOT_APPLIED && + applicationStatus != ApplicationStatus.WRITING && + applicationStatus != ApplicationStatus.SUBMITTED && + applicationStatus != ApplicationStatus.WAITING_DOCUMENTS } From 534092bf9b14131ea22356504a6ff8185756f5d0 Mon Sep 17 00:00:00 2001 From: coehgns Date: Tue, 7 Oct 2025 22:50:26 +0900 Subject: [PATCH 6/7] chore ( #60 ) : SecurityConfig --- .../hs/kr/entrydsm/application/global/config/SecurityConfig.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/config/SecurityConfig.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/config/SecurityConfig.kt index fb45c7bc..4ca1048e 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/config/SecurityConfig.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/config/SecurityConfig.kt @@ -59,6 +59,7 @@ class SecurityConfig( .requestMatchers("/api/v1/applications/**").hasRole(UserRole.USER.name) .requestMatchers("/photo").hasRole(UserRole.USER.name) .requestMatchers("/pass/**").hasRole(UserRole.USER.name) + .requestMatchers("/application/**").hasRole(UserRole.USER.name) .anyRequest().authenticated() } .with(filterConfig) { } From f4e66d5fd98c9950ff8db7784e7ac5bfa601f2ce Mon Sep 17 00:00:00 2001 From: coehgns Date: Tue, 7 Oct 2025 22:50:33 +0900 Subject: [PATCH 7/7] chore ( #60 ) : PassApiDocument --- .../global/document/pass/PassApiDocument.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/pass/PassApiDocument.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/pass/PassApiDocument.kt index 3545fb20..2a94d33c 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/pass/PassApiDocument.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/document/pass/PassApiDocument.kt @@ -22,8 +22,16 @@ interface PassApiDocument { description = "합격 여부 조회 성공", content = [Content(schema = Schema(implementation = QueryIsFirstRoundPassResponse::class))] ), - ApiResponse(responseCode = "403", description = "인증되지 않은 사용자"), - ApiResponse(responseCode = "404", description = "지원자 또는 전형 정보를 찾을 수 없음"), + ApiResponse( + responseCode = "403", + description = "인증되지 않은 사용자", + content = [Content(schema = Schema(hidden = true))], + ), + ApiResponse( + responseCode = "404", + description = "지원자 또는 전형 정보를 찾을 수 없음", + content = [Content(schema = Schema(hidden = true))], + ), ] ) suspend fun queryIsFirstRound(): QueryIsFirstRoundPassResponse