From 3b5601bbe54adc8c42ba83cc83420d4b57434cf8 Mon Sep 17 00:00:00 2001 From: coehgns Date: Thu, 9 Oct 2025 22:29:03 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat=20(=20#62=20)=20:=20KafkaTopics=20DELE?= =?UTF-8?q?TE=5FSTATUS=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/global/kafka/configuration/KafkaTopics.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaTopics.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaTopics.kt index f126dab2..0abc09d1 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaTopics.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaTopics.kt @@ -73,4 +73,6 @@ object KafkaTopics { * 상태 생성 실패 시 보상 트랜잭션을 위해 사용 */ const val CREATE_APPLICATION_STATUS_ROLLBACK = "create-application-status-rollback" + + const val DELETE_STATUS = "delete-status" } From aa5f26e88752acb7b09497cad61597313423b258 Mon Sep 17 00:00:00 2001 From: coehgns Date: Thu, 9 Oct 2025 22:29:39 +0900 Subject: [PATCH 2/7] =?UTF-8?q?feat=20(=20#62=20)=20:=20ApplicationContrac?= =?UTF-8?q?t=20delete=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/application/interfaces/ApplicationContract.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationContract.kt b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationContract.kt index efc3e2e3..e7f366e0 100644 --- a/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationContract.kt +++ b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationContract.kt @@ -9,4 +9,6 @@ interface ApplicationContract : QueryAllFirstRoundPassedApplicationContract { fun getApplicationByReceiptCode(receiptCode: Long): Application? fun updateApplicationStatus(receiptCode: Long, status: hs.kr.entrydsm.domain.status.values.ApplicationStatus) + + fun delete(application: Application) } \ No newline at end of file From 96af2c9bf90cef9a817ffce16efcccc498f2e5ec Mon Sep 17 00:00:00 2001 From: coehgns Date: Thu, 9 Oct 2025 22:29:59 +0900 Subject: [PATCH 3/7] =?UTF-8?q?feat=20(=20#62=20)=20:=20ApplicationPersist?= =?UTF-8?q?enceAdapter=20delete=20=EB=A9=94=EC=84=9C=EB=93=9C=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/domain/ApplicationPersistenceAdapter.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/domain/ApplicationPersistenceAdapter.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/domain/ApplicationPersistenceAdapter.kt index b1e9b33b..cea40ee2 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/domain/ApplicationPersistenceAdapter.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/domain/ApplicationPersistenceAdapter.kt @@ -90,4 +90,8 @@ class ApplicationPersistenceAdapter( applicationJpaRepository.save(applicationEntity) } } + + override fun delete(application: Application) { + applicationJpaRepository.delete(applicationMapper.toEntity(application)) + } } From 42ef3c7704f61c02ac0544d44e55c2113b0d74a0 Mon Sep 17 00:00:00 2001 From: coehgns Date: Thu, 9 Oct 2025 22:32:07 +0900 Subject: [PATCH 4/7] =?UTF-8?q?feat=20(=20#62=20)=20:=20KafkaProducerConfi?= =?UTF-8?q?g=EC=97=90=20deleteStatusTemplate,=20deleteStatusProducerFactor?= =?UTF-8?q?y=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../global/kafka/configuration/KafkaProducerConfig.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaProducerConfig.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaProducerConfig.kt index 9a806f05..14b730de 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaProducerConfig.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/global/kafka/configuration/KafkaProducerConfig.kt @@ -180,6 +180,16 @@ class KafkaProducerConfig( return DefaultKafkaProducerFactory(producerConfig()) } + @Bean + fun deleteStatusTemplate(): KafkaTemplate { + return KafkaTemplate(deleteStatusProducerFactory()) + } + + @Bean + fun deleteStatusProducerFactory(): DefaultKafkaProducerFactory { + return DefaultKafkaProducerFactory(producerConfig()) + } + /** * Kafka Producer의 기본 설정을 구성합니다. * From 19828ceec7646710136314d7f6fa8fa3471e6576 Mon Sep 17 00:00:00 2001 From: coehgns Date: Thu, 9 Oct 2025 22:32:21 +0900 Subject: [PATCH 5/7] =?UTF-8?q?feat=20(=20#62=20)=20:=20ApplicationEventPr?= =?UTF-8?q?oducer=EC=97=90=20deleteStatus=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../event/producer/ApplicationEventProducer.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/event/producer/ApplicationEventProducer.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/event/producer/ApplicationEventProducer.kt index 0803131f..3bdf5e6e 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/event/producer/ApplicationEventProducer.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/event/producer/ApplicationEventProducer.kt @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import hs.kr.entrydsm.application.domain.application.event.dto.CreateApplicationEvent import hs.kr.entrydsm.application.global.kafka.configuration.KafkaTopics import hs.kr.entrydsm.domain.application.interfaces.ApplicationCreateEventContract +import hs.kr.entrydsm.domain.application.interfaces.ApplicationDeleteEventContract import org.springframework.kafka.core.KafkaTemplate import org.springframework.stereotype.Component import java.util.UUID @@ -24,7 +25,8 @@ class ApplicationEventProducer( private val submitApplicationFinalTemplate: KafkaTemplate, private val createApplicationScoreRollbackTemplate: KafkaTemplate, private val updateEducationalStatusTemplate: KafkaTemplate, -) : ApplicationCreateEventContract { + private val deleteStatusTemplate: KafkaTemplate +) : ApplicationCreateEventContract, ApplicationDeleteEventContract { /** * 원서 생성 이벤트를 발행합니다. * @@ -94,4 +96,11 @@ class ApplicationEventProducer( mapper.writeValueAsString(updateEvent), ) } + + override fun deleteStatus(receiptCode: Long) { + deleteStatusTemplate.send( + KafkaTopics.DELETE_STATUS, + receiptCode + ) + } } From ce61ccf5561d098b0ffd98062ebc8adc24e657f6 Mon Sep 17 00:00:00 2001 From: coehgns Date: Thu, 9 Oct 2025 22:32:34 +0900 Subject: [PATCH 6/7] feat ( #62 ) : ApplicationDeleteEventContract --- .../application/interfaces/ApplicationDeleteEventContract.kt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationDeleteEventContract.kt diff --git a/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationDeleteEventContract.kt b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationDeleteEventContract.kt new file mode 100644 index 00000000..45bbfcd5 --- /dev/null +++ b/casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/application/interfaces/ApplicationDeleteEventContract.kt @@ -0,0 +1,5 @@ +package hs.kr.entrydsm.domain.application.interfaces + +interface ApplicationDeleteEventContract { + fun deleteStatus(receiptCode: Long) +} \ No newline at end of file From 23dc4622d4a0ac85530246bf3834fec835b69b9b Mon Sep 17 00:00:00 2001 From: coehgns Date: Thu, 9 Oct 2025 22:33:12 +0900 Subject: [PATCH 7/7] =?UTF-8?q?feat=20(=20#62=20)=20:=20=EC=9B=90=EC=84=9C?= =?UTF-8?q?=20=EC=A0=9C=EC=B6=9C=20=EC=B7=A8=EC=86=8C=20=EC=8B=9C=20?= =?UTF-8?q?=EC=99=B8=EB=B6=80=20status=EC=97=90=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=EB=90=9C=20=EC=9B=90=EC=84=9C=20=EC=83=81=ED=83=9C=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C=20=ED=9B=84,=20=EC=9B=90=EC=84=9C=20=EC=99=84?= =?UTF-8?q?=EC=A0=84=ED=9E=88=20=EC=82=AD=EC=A0=9C=ED=95=98=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/application/usecase/CancelApplicationUseCase.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/CancelApplicationUseCase.kt b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/CancelApplicationUseCase.kt index 45018f48..7f0e3c25 100644 --- a/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/CancelApplicationUseCase.kt +++ b/casper-application-infrastructure/src/main/kotlin/hs/kr/entrydsm/application/domain/application/usecase/CancelApplicationUseCase.kt @@ -4,6 +4,7 @@ import hs.kr.entrydsm.application.domain.application.exception.ApplicationCannot import hs.kr.entrydsm.application.domain.application.exception.ApplicationNotFoundException import hs.kr.entrydsm.application.global.annotation.usecase.UseCase import hs.kr.entrydsm.domain.application.interfaces.ApplicationContract +import hs.kr.entrydsm.domain.application.interfaces.ApplicationDeleteEventContract import hs.kr.entrydsm.domain.application.interfaces.CancelApplicationContract import hs.kr.entrydsm.domain.status.values.ApplicationStatus import org.springframework.transaction.annotation.Transactional @@ -13,6 +14,7 @@ import java.util.UUID @Transactional class CancelApplicationUseCase( private val applicationContract: ApplicationContract, + private val applicationDeleteEventContract: ApplicationDeleteEventContract ) : CancelApplicationContract { override fun cancelApplication( userId: UUID, @@ -25,6 +27,7 @@ class CancelApplicationUseCase( throw ApplicationCannotCancelException() } - applicationContract.updateApplicationStatus(application.receiptCode, ApplicationStatus.WRITING) + applicationDeleteEventContract.deleteStatus(application.receiptCode) + applicationContract.delete(application) } }