From 03bbe8b021ec5c4516b4c4029ae43ea797d2030b Mon Sep 17 00:00:00 2001 From: doyeon Date: Mon, 27 Oct 2025 13:05:42 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B0=B8=EC=97=AC=20=EC=B1=84=EB=84=90(channel?= =?UTF-8?q?)=20=ED=95=84=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 - Participant 엔티티에 channel 필드 추가 (기본값: SNS) - ParticipationRequest/Response DTO에 channel 필드 추가 - ParticipantRegisteredEvent에 channel 필드 추가 - ParticipationService에서 channel 정보 전달 - 참여 경로 분석 및 마케팅 효과 측정 가능 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../application/dto/ParticipationRequest.java | 3 +++ .../application/dto/ParticipationResponse.java | 2 ++ .../application/service/ParticipationService.java | 1 + .../participation/domain/participant/Participant.java | 10 ++++++++++ .../kafka/event/ParticipantRegisteredEvent.java | 2 ++ 5 files changed, 18 insertions(+) diff --git a/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationRequest.java b/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationRequest.java index 9ed7324..6f85b6c 100644 --- a/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationRequest.java +++ b/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationRequest.java @@ -23,6 +23,9 @@ public class ParticipationRequest { @Email(message = "이메일 형식이 올바르지 않습니다") private String email; + @Builder.Default + private String channel = "SNS"; + @Builder.Default private Boolean agreeMarketing = false; diff --git a/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationResponse.java b/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationResponse.java index 44b63d3..9ffeec4 100644 --- a/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationResponse.java +++ b/participation-service/src/main/java/com/kt/event/participation/application/dto/ParticipationResponse.java @@ -19,6 +19,7 @@ public class ParticipationResponse { private String name; private String phoneNumber; private String email; + private String channel; private LocalDateTime participatedAt; private Boolean storeVisited; private Integer bonusEntries; @@ -31,6 +32,7 @@ public class ParticipationResponse { .name(participant.getName()) .phoneNumber(participant.getPhoneNumber()) .email(participant.getEmail()) + .channel(participant.getChannel()) .participatedAt(participant.getCreatedAt()) .storeVisited(participant.getStoreVisited()) .bonusEntries(participant.getBonusEntries()) diff --git a/participation-service/src/main/java/com/kt/event/participation/application/service/ParticipationService.java b/participation-service/src/main/java/com/kt/event/participation/application/service/ParticipationService.java index ac6ace6..27b5acc 100644 --- a/participation-service/src/main/java/com/kt/event/participation/application/service/ParticipationService.java +++ b/participation-service/src/main/java/com/kt/event/participation/application/service/ParticipationService.java @@ -60,6 +60,7 @@ public class ParticipationService { .name(request.getName()) .phoneNumber(request.getPhoneNumber()) .email(request.getEmail()) + .channel(request.getChannel()) .storeVisited(request.getStoreVisited()) .bonusEntries(Participant.calculateBonusEntries(request.getStoreVisited())) .agreeMarketing(request.getAgreeMarketing()) diff --git a/participation-service/src/main/java/com/kt/event/participation/domain/participant/Participant.java b/participation-service/src/main/java/com/kt/event/participation/domain/participant/Participant.java index 7c4f1d1..4d08673 100644 --- a/participation-service/src/main/java/com/kt/event/participation/domain/participant/Participant.java +++ b/participation-service/src/main/java/com/kt/event/participation/domain/participant/Participant.java @@ -63,6 +63,13 @@ public class Participant extends BaseTimeEntity { @Column(name = "email", length = 100) private String email; + /** + * 참여 채널 + * 기본값: SNS + */ + @Column(name = "channel", length = 20, nullable = false) + private String channel; + /** * 매장 방문 여부 * true일 경우 보너스 응모권 부여 @@ -165,5 +172,8 @@ public class Participant extends BaseTimeEntity { if (this.agreeMarketing == null) { this.agreeMarketing = false; } + if (this.channel == null || this.channel.isBlank()) { + this.channel = "SNS"; + } } } diff --git a/participation-service/src/main/java/com/kt/event/participation/infrastructure/kafka/event/ParticipantRegisteredEvent.java b/participation-service/src/main/java/com/kt/event/participation/infrastructure/kafka/event/ParticipantRegisteredEvent.java index 41799e0..25ea454 100644 --- a/participation-service/src/main/java/com/kt/event/participation/infrastructure/kafka/event/ParticipantRegisteredEvent.java +++ b/participation-service/src/main/java/com/kt/event/participation/infrastructure/kafka/event/ParticipantRegisteredEvent.java @@ -21,6 +21,7 @@ public class ParticipantRegisteredEvent { private String eventId; private String name; private String phoneNumber; + private String channel; private Boolean storeVisited; private Integer bonusEntries; private LocalDateTime participatedAt; @@ -31,6 +32,7 @@ public class ParticipantRegisteredEvent { .eventId(participant.getEventId()) .name(participant.getName()) .phoneNumber(participant.getPhoneNumber()) + .channel(participant.getChannel()) .storeVisited(participant.getStoreVisited()) .bonusEntries(participant.getBonusEntries()) .participatedAt(participant.getCreatedAt())