-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/mosu 28 : 알림톡 플로우 개선 (Luna Soft) #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b1ce708
bb76ba4
ee94e27
00e69e5
5304e63
c185161
f4f22ed
73b9a3b
9b2fd62
72724e9
277b043
867856e
ab62347
33f5fa6
371759f
28274f4
64112f4
8977abf
eb53770
25b002a
b29082c
a12023c
71d39a4
4cf6bdc
dcc9d31
ed2d96b
ee4ea39
0347fba
1dd9475
8c3888f
657bce5
1ec9d6f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,22 @@ | ||
| package life.mosu.mosuserver; | ||
|
|
||
| import life.mosu.mosuserver.infra.notify.NotifyEventPublisher; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.boot.CommandLineRunner; | ||
| import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
|
||
| @SpringBootApplication | ||
| public class MosuServerApplication { | ||
| @RequiredArgsConstructor | ||
| public class MosuServerApplication implements CommandLineRunner { | ||
|
|
||
| private final NotifyEventPublisher publisher; | ||
|
|
||
| public static void main(String[] args) { | ||
| SpringApplication.run(MosuServerApplication.class, args); | ||
| } | ||
|
|
||
| @Override | ||
| public void run(String... args) throws Exception { | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,37 @@ | ||
| package life.mosu.mosuserver.application.notify; | ||
|
|
||
| import life.mosu.mosuserver.domain.profile.ProfileJpaEntity; | ||
| import life.mosu.mosuserver.domain.profile.ProfileJpaRepository; | ||
| import life.mosu.mosuserver.global.exception.CustomRuntimeException; | ||
| import life.mosu.mosuserver.global.exception.ErrorCode; | ||
| import life.mosu.mosuserver.infra.notify.NotifyClientAdapter; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotifyEvent; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotifyEventRequest; | ||
| import life.mosu.mosuserver.infra.notify.strategy.NotifyStrategy; | ||
| import life.mosu.mosuserver.infra.notify.component.NotifySender; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationEvent; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||
| import life.mosu.mosuserver.infra.notify.resolver.NotifySenderResolver; | ||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.context.ApplicationContext; | ||
| import org.springframework.stereotype.Service; | ||
|
|
||
| @Slf4j | ||
| @Service | ||
| @RequiredArgsConstructor | ||
| public class NotifyService { | ||
|
|
||
| private final NotifyClientAdapter notifier; | ||
| private final ProfileJpaRepository profileJpaRepository; | ||
| private final ApplicationContext applicationContext; | ||
| private final NotifySenderResolver senderResolver; | ||
| private final NotifyVariableFactory notifyVariableFactory; | ||
|
|
||
| public void notify(NotifyEvent event) { | ||
| NotifyStrategy strategy = getNotifyStrategy(event.status().getStrategyName()); | ||
| public void notify(NotificationEvent event) { | ||
| String phone = retrievePhoneNumberByUserId(event.userId()); | ||
| NotificationVariable notifyVariable = notifyVariableFactory.create(event); | ||
| NotifySender<NotificationVariable> sender = senderResolver.resolve( | ||
| event.status()); | ||
|
|
||
| ProfileJpaEntity profile = profileJpaRepository.findByUserId(event.targetId()) | ||
| .orElseThrow(() -> new CustomRuntimeException(ErrorCode.PROFILE_NOT_FOUND)); | ||
| String parsedPhoneNumber = profile.getPhoneNumber().replaceAll("-", ""); | ||
|
|
||
| NotifyEventRequest request = strategy.apply(parsedPhoneNumber, event); | ||
|
|
||
| notifier.send(request); | ||
| sender.send(phone, event, notifyVariable); | ||
| } | ||
|
|
||
| private NotifyStrategy getNotifyStrategy(String strategyName) { | ||
| return (NotifyStrategy) applicationContext.getBean(strategyName); | ||
| private String retrievePhoneNumberByUserId(Long userId) { | ||
| return profileJpaRepository.findByUserId(userId) | ||
| .orElseThrow(() -> new CustomRuntimeException(ErrorCode.PROFILE_NOT_FOUND)) | ||
| .getPhoneNumberWithoutHyphen(); | ||
| } | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| package life.mosu.mosuserver.application.notify; | ||
|
|
||
| import life.mosu.mosuserver.application.notify.dto.ApplicationNotifyRequest; | ||
| import life.mosu.mosuserver.application.notify.dto.Exam1DayBeforeNotifyRequest; | ||
| import life.mosu.mosuserver.application.notify.dto.Exam1WeekBeforeNotifyRequest; | ||
| import life.mosu.mosuserver.application.notify.dto.Exam3DayBeforeNotifyRequest; | ||
| import life.mosu.mosuserver.application.notify.dto.InquiryAnswerNotifyRequest; | ||
| import life.mosu.mosuserver.application.notify.dto.RefundNotifyRequest; | ||
| import life.mosu.mosuserver.application.notify.dto.SignUpNotifyRequest; | ||
| import life.mosu.mosuserver.domain.applicationschool.ApplicationSchoolJpaEntity; | ||
| import life.mosu.mosuserver.domain.applicationschool.ApplicationSchoolJpaRepository; | ||
| import life.mosu.mosuserver.domain.applicationschool.ApplicationSchoolNotifyProjection; | ||
| import life.mosu.mosuserver.domain.applicationschool.OneWeekNotifyProjection; | ||
| import life.mosu.mosuserver.domain.inquiry.InquiryJpaEntity; | ||
| import life.mosu.mosuserver.domain.inquiry.InquiryJpaRepository; | ||
| import life.mosu.mosuserver.domain.refund.RefundJpaRepository; | ||
| import life.mosu.mosuserver.domain.refund.RefundNotifyProjection; | ||
| import life.mosu.mosuserver.global.exception.CustomRuntimeException; | ||
| import life.mosu.mosuserver.global.exception.ErrorCode; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationEvent; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||
| import lombok.RequiredArgsConstructor; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class NotifyVariableFactory { | ||
|
|
||
| private final InquiryJpaRepository inquiryJpaRepository; | ||
| private final ApplicationSchoolJpaRepository applicationSchoolJpaRepository; | ||
| private final RefundJpaRepository refundJpaRepository; | ||
|
|
||
| public NotificationVariable create(NotificationEvent event) { | ||
| return switch (event.status()) { | ||
| case INQUIRY_ANSWER_SUCCESS -> createInquiryAnswerVariable(event.targetId()); | ||
| case REFUND_SUCCESS -> createRefundVariable(event.targetId()); | ||
| case APPLICATION_SUCCESS -> createApplicationVariable(event.targetId()); | ||
| case EXAM_1WEEK_BEFORE_REMINDER_INFO -> createExam1WeekBeforeVariable(event.targetId()); | ||
| case EXAM_3DAY_BEFORE_REMINDER_INFO -> createExam3DayBeforeVariable(event.targetId()); | ||
| case EXAM_1DAY_BEFORE_REMINDER_INFO -> createExam1DayBeforeVariable(event.targetId()); | ||
| case SIGN_UP_SUCCESS -> createSignUpVariable(); | ||
| default -> | ||
| throw new IllegalArgumentException("지원하지 않는 NotifyStatus: " + event.status()); | ||
| }; | ||
| } | ||
|
|
||
| private NotificationVariable createSignUpVariable() { | ||
| return new SignUpNotifyRequest(); | ||
| } | ||
|
|
||
| private NotificationVariable createInquiryAnswerVariable(Long targetId) { | ||
| InquiryJpaEntity inquiry = inquiryJpaRepository.findById(targetId) | ||
| .orElseThrow(() -> new CustomRuntimeException(ErrorCode.INQUIRY_NOT_FOUND)); | ||
| return new InquiryAnswerNotifyRequest(inquiry.getTitle()); | ||
| } | ||
|
|
||
| private NotificationVariable createRefundVariable(Long targetId) { | ||
| RefundNotifyProjection projection = refundJpaRepository.findRefundByApplicationSchoolId( | ||
| targetId) | ||
| .orElseThrow( | ||
| () -> new CustomRuntimeException(ErrorCode.APPLICATION_SCHOOL_NOT_FOUND)); | ||
| return new RefundNotifyRequest( | ||
| projection.paymentKey(), projection.examDate(), projection.schoolName(), | ||
| projection.paymentMethod().getName(), projection.reason() | ||
| ); | ||
| } | ||
|
|
||
| private NotificationVariable createApplicationVariable(Long targetId) { | ||
| ApplicationSchoolNotifyProjection projection = applicationSchoolJpaRepository.findPaymentByApplicationSchoolId( | ||
| targetId); | ||
| return ApplicationNotifyRequest.from(projection); | ||
| } | ||
polyglot-k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| private NotificationVariable createExam1WeekBeforeVariable(Long targetId) { | ||
| OneWeekNotifyProjection projection = applicationSchoolJpaRepository.findOneWeekNotifyByApplicationSchoolId( | ||
| targetId); | ||
| return new Exam1WeekBeforeNotifyRequest(projection.examDate(), projection.paymentKey(), | ||
| projection.schoolName()); | ||
| } | ||
polyglot-k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| private NotificationVariable createExam3DayBeforeVariable(Long targetId) { | ||
| ApplicationSchoolJpaEntity entity = applicationSchoolJpaRepository.findById(targetId) | ||
| .orElseThrow( | ||
| () -> new CustomRuntimeException(ErrorCode.APPLICATION_SCHOOL_NOT_FOUND)); | ||
| return new Exam3DayBeforeNotifyRequest(entity.getExamDate(), entity.getExaminationNumber(), | ||
| entity.getSchoolName()); | ||
| } | ||
|
|
||
| private NotificationVariable createExam1DayBeforeVariable(Long targetId) { | ||
| ApplicationSchoolJpaEntity entity = applicationSchoolJpaRepository.findById(targetId) | ||
| .orElseThrow( | ||
| () -> new CustomRuntimeException(ErrorCode.APPLICATION_SCHOOL_NOT_FOUND)); | ||
| return new Exam1DayBeforeNotifyRequest(entity.getExamDate(), entity.getExaminationNumber(), | ||
| entity.getSchoolName()); | ||
| } | ||
polyglot-k marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| package life.mosu.mosuserver.application.notify.dto; | ||
|
|
||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.MY_PAGE; | ||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.WARNING_PAGE; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.util.Map; | ||
| import life.mosu.mosuserver.domain.applicationschool.ApplicationSchoolNotifyProjection; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls.NotificationButtonUrl; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||
|
|
||
| public record ApplicationNotifyRequest( | ||
| String paymentKey, | ||
| LocalDate examDate, | ||
| String schoolName, | ||
| String lunch | ||
| ) implements NotificationVariable { | ||
|
|
||
| public static ApplicationNotifyRequest from( | ||
| ApplicationSchoolNotifyProjection applicationSchool) { | ||
| return new ApplicationNotifyRequest( | ||
| applicationSchool.paymentKey(), | ||
| applicationSchool.examDate(), | ||
| applicationSchool.schoolName(), | ||
| applicationSchool.lunch() != null ? applicationSchool.lunch().getLunchName() : "" | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| public NotificationButtonUrls getNotificationButtonUrls() { | ||
| return NotificationButtonUrls.of( | ||
| NotificationButtonUrl.of(WARNING_PAGE, WARNING_PAGE), | ||
| NotificationButtonUrl.of(MY_PAGE, MY_PAGE) | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, String> toMap() { | ||
| return Map.of( | ||
| "paymentKey", paymentKey, | ||
| "examDate", examDate.toString(), | ||
| "schoolName", schoolName, | ||
| "lunch", lunch | ||
| ); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| package life.mosu.mosuserver.application.notify.dto; | ||
|
|
||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.INQUIRY_PAGE; | ||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.MY_PAGE; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.util.Map; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls.NotificationButtonUrl; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||
|
|
||
| public record Exam1DayBeforeNotifyRequest( | ||
| LocalDate examDate, | ||
| String examinationNumber, | ||
| String schoolName | ||
| ) implements NotificationVariable { | ||
|
|
||
| @Override | ||
| public NotificationButtonUrls getNotificationButtonUrls() { | ||
| return NotificationButtonUrls.of( | ||
| NotificationButtonUrl.of(INQUIRY_PAGE, INQUIRY_PAGE), | ||
| NotificationButtonUrl.of(MY_PAGE, MY_PAGE) | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, String> toMap() { | ||
| return Map.of( | ||
| "examDate", examDate.toString(), | ||
| "examinationNumber", examinationNumber, | ||
| "schoolName", schoolName | ||
| ); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package life.mosu.mosuserver.application.notify.dto; | ||
|
|
||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.INQUIRY_PAGE; | ||
|
|
||
| import java.time.LocalDate; | ||
| import java.util.Map; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls.NotificationButtonUrl; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||
|
|
||
| public record Exam1WeekBeforeNotifyRequest( | ||
| LocalDate examDate, | ||
| String paymentKey, | ||
| String schoolName | ||
| ) implements NotificationVariable { | ||
|
|
||
| @Override | ||
| public NotificationButtonUrls getNotificationButtonUrls() { | ||
| return NotificationButtonUrls.of( | ||
| NotificationButtonUrl.of(INQUIRY_PAGE, INQUIRY_PAGE) | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, String> toMap() { | ||
| return Map.of( | ||
| "examDate", examDate.toString(), | ||
| "paymentKey", paymentKey, | ||
| "schoolName", schoolName | ||
| ); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||||||||||||||
| package life.mosu.mosuserver.application.notify.dto; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.INQUIRY_PAGE; | ||||||||||||||||||||||||||||||||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.MY_PAGE; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import java.time.LocalDate; | ||||||||||||||||||||||||||||||||
| import java.util.Map; | ||||||||||||||||||||||||||||||||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls; | ||||||||||||||||||||||||||||||||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls.NotificationButtonUrl; | ||||||||||||||||||||||||||||||||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| public record Exam3DayBeforeNotifyRequest( | ||||||||||||||||||||||||||||||||
| LocalDate examDate, | ||||||||||||||||||||||||||||||||
| String examinationNumber, | ||||||||||||||||||||||||||||||||
| String schoolName | ||||||||||||||||||||||||||||||||
| ) implements NotificationVariable { | ||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adding null validation for required fields. The record fields lack validation annotations. For a notification system, null values could cause downstream issues when generating templates or sending notifications. Consider adding validation: +import jakarta.validation.constraints.NotNull;
+
public record Exam3DayBeforeNotifyRequest(
+ @NotNull
LocalDate examDate,
+ @NotNull
String examinationNumber,
+ @NotNull
String schoolName
) implements NotificationVariable {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||||
| public NotificationButtonUrls getNotificationButtonUrls() { | ||||||||||||||||||||||||||||||||
| return NotificationButtonUrls.of( | ||||||||||||||||||||||||||||||||
| NotificationButtonUrl.of(INQUIRY_PAGE, INQUIRY_PAGE), | ||||||||||||||||||||||||||||||||
| NotificationButtonUrl.of(MY_PAGE, MY_PAGE) | ||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
polyglot-k marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||||
| public Map<String, String> toMap() { | ||||||||||||||||||||||||||||||||
| return Map.of( | ||||||||||||||||||||||||||||||||
| "examDate", examDate.toString(), | ||||||||||||||||||||||||||||||||
| "examinationNumber", examinationNumber, | ||||||||||||||||||||||||||||||||
| "schoolName", schoolName | ||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package life.mosu.mosuserver.application.notify.dto; | ||
|
|
||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.INQUIRY_PAGE; | ||
|
|
||
| import java.util.Map; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls.NotificationButtonUrl; | ||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||
|
|
||
| public record InquiryAnswerNotifyRequest( | ||
| String title | ||
| ) implements NotificationVariable { | ||
|
|
||
| @Override | ||
| public NotificationButtonUrls getNotificationButtonUrls() { | ||
| return NotificationButtonUrls.of( | ||
| NotificationButtonUrl.of(INQUIRY_PAGE, INQUIRY_PAGE) | ||
| ); | ||
| } | ||
|
|
||
| @Override | ||
| public Map<String, String> toMap() { | ||
| return Map.of( | ||
| "inquiryTitle", title | ||
| ); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||||||||||||||||||||||||||||
| package life.mosu.mosuserver.application.notify.dto; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import static life.mosu.mosuserver.infra.notify.constant.NotifyRedirectUrlConstants.MY_PAGE; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| import java.time.LocalDate; | ||||||||||||||||||||||||||||||||
| import java.util.Map; | ||||||||||||||||||||||||||||||||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls; | ||||||||||||||||||||||||||||||||
| import life.mosu.mosuserver.infra.notify.dto.NotificationButtonUrls.NotificationButtonUrl; | ||||||||||||||||||||||||||||||||
| import life.mosu.mosuserver.infra.notify.dto.NotificationVariable; | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| public record RefundNotifyRequest( | ||||||||||||||||||||||||||||||||
| String paymentKey, | ||||||||||||||||||||||||||||||||
| LocalDate examDate, | ||||||||||||||||||||||||||||||||
| String schoolName, | ||||||||||||||||||||||||||||||||
| // String amount, | ||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||
| String paymentMethod, | ||||||||||||||||||||||||||||||||
| String reason | ||||||||||||||||||||||||||||||||
| ) implements NotificationVariable { | ||||||||||||||||||||||||||||||||
|
Comment on lines
+11
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove commented code or clarify its purpose. The commented out Either remove the commented line or clarify if the field is needed: public record RefundNotifyRequest(
String paymentKey,
LocalDate examDate,
String schoolName,
-// String amount,
String paymentMethod,
String reason
) implements NotificationVariable {If the amount field is needed, add it properly with validation. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||||
| public NotificationButtonUrls getNotificationButtonUrls() { | ||||||||||||||||||||||||||||||||
| return NotificationButtonUrls.of( | ||||||||||||||||||||||||||||||||
| NotificationButtonUrl.of(MY_PAGE, MY_PAGE) | ||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
polyglot-k marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| @Override | ||||||||||||||||||||||||||||||||
| public Map<String, String> toMap() { | ||||||||||||||||||||||||||||||||
| return Map.of( | ||||||||||||||||||||||||||||||||
| "paymentKey", paymentKey, | ||||||||||||||||||||||||||||||||
| "examDate", examDate.toString(), | ||||||||||||||||||||||||||||||||
| "schoolName", schoolName, | ||||||||||||||||||||||||||||||||
| "amount", String.valueOf(1000), | ||||||||||||||||||||||||||||||||
polyglot-k marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||
| "paymentMethod", paymentMethod, | ||||||||||||||||||||||||||||||||
| "reason", reason | ||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
polyglot-k marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Clarify the purpose of the unused NotifyEventPublisher field.
The
NotifyEventPublisheris injected but not used anywhere in the class. Consider either:runmethod🏁 Script executed:
Length of output: 7013
Remove or clarify the unused
NotifyEventPublisherinMosuServerApplicationThe
NotifyEventPublisheris injected into the main application class but never used in therunmethod (or elsewhere in this class). Please choose one of the following:publisherfield and its constructor injection if you don’t need it yet.run(String... args)method.Locations to address:
private final NotifyEventPublisher publisher;🤖 Prompt for AI Agents