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())