Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
b1ce708
fix: NotificationEvent 클래스 이름 수정
polyglot-k Jul 17, 2025
bb76ba4
chore: 불필요한 알림 관련 클래스 및 전략 제거
polyglot-k Jul 17, 2025
ee94e27
feat: NotifyTemplateCode 열거형 추가 및 알림 템플릿 코드 정의
polyglot-k Jul 17, 2025
00e69e5
feat: NotifySenderResolver 클래스 추가 및 알림 전략 매핑 처리 로직 구현
polyglot-k Jul 17, 2025
5304e63
fix: NotifyEventSuccessMessageDto에서 NotifyButtonUrls를 NotificationBut…
polyglot-k Jul 17, 2025
c185161
refactor: NotifyService에서 NotifyEvent를 NotificationEvent로 변경하고 불필요한 코…
polyglot-k Jul 17, 2025
f4f22ed
feat: NotifyVariableFactory 클래스 추가 및 알림 변수 생성 로직 구현
polyglot-k Jul 17, 2025
73b9a3b
feat: 여러 알림 요청 DTO 클래스 추가 및 알림 버튼 URL 및 맵 변환 로직 구현
polyglot-k Jul 17, 2025
9b2fd62
refactor: 불필요한 메서드 주석 제거 및 쿼리에서 DTO 사용으로 변경
polyglot-k Jul 17, 2025
72724e9
refactor: RefundJpaRepository에서 쿼리 수정 및 반환 타입을 Optional로 변경
polyglot-k Jul 17, 2025
277b043
feat: 프로필 전화번호에서 하이픈을 제거하는 메서드 추가
polyglot-k Jul 17, 2025
867856e
fix: NotifyEventPublisher에서 NotifyEvent를 NotificationEvent로 수정
polyglot-k Jul 17, 2025
ab62347
refactor: NotifyEventTemplateGenerator에서 getProcessedMessage 메서드의 시그니…
polyglot-k Jul 17, 2025
33f5fa6
feat: NotifyStrategyMapping 애너테이션 추가 및 여러 상태 매핑 허용
polyglot-k Jul 17, 2025
371759f
feat: NotifySender 인터페이스 추가 및 알림 전송 메서드 정의
polyglot-k Jul 17, 2025
28274f4
feat: LunaNotifySender 클래스 추가 및 알림 전송 메서드 구현
polyglot-k Jul 17, 2025
64112f4
feat: LunaNotifyWithSmsFallbackSender 클래스 추가 및 SMS 전송 기능 구현
polyglot-k Jul 17, 2025
8977abf
feat: NotifyRedirectUrlConstants 클래스 추가 및 리다이렉트 URL 상수 정의
polyglot-k Jul 17, 2025
eb53770
feat: NotificationButtonUrls 클래스 추가 및 버튼 URL 목록 처리 기능 구현
polyglot-k Jul 17, 2025
25b002a
feat: NotificationEvent 클래스 추가 및 알림 이벤트 생성 메서드 구현
polyglot-k Jul 17, 2025
b29082c
feat: NotificationSendStatus 열거형 추가 및 상태 정의
polyglot-k Jul 17, 2025
a12023c
feat: NotificationStatus 열거형 추가 및 알림 상태 정의
polyglot-k Jul 17, 2025
71d39a4
feat: NotificationVariable 인터페이스 추가 및 버튼 URL과 맵 변환 메서드 정의
polyglot-k Jul 17, 2025
4cf6bdc
fix: NotifyEventRemindMessageDto에서 NotifyButtonUrls를 NotificationButt…
polyglot-k Jul 17, 2025
dcc9d31
Merge branch 'develop' of https://github.com/mosu-dev/mosu-server int…
polyglot-k Jul 17, 2025
ed2d96b
fix: 수정된 알림 템플릿 코드의 ID 값 교환
polyglot-k Jul 17, 2025
ee4ea39
refactor : PhoneNumber 를 가져올 떄 하이픈을 빼고 가져오도록 변경
polyglot-k Jul 17, 2025
0347fba
refactor : PhoneNumber 를 가져올 떄 하이픈을 빼고 가져오도록 변경
polyglot-k Jul 17, 2025
1dd9475
refactor : NotifyVariableFactory 에 커스텀 에러로 Throw 되도록 변경
polyglot-k Jul 17, 2025
8c3888f
fix : templateCode 이상한 부분 수정
polyglot-k Jul 17, 2025
657bce5
refactor: applicationSchool 의 lunch를 가지고 올 떄의 NPE 완화
polyglot-k Jul 17, 2025
1ec9d6f
refactor: 응집도 있도록 Status 병합 및 불 필요한 필드 제거
polyglot-k Jul 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/main/java/life/mosu/mosuserver/MosuServerApplication.java
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;
Copy link

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 NotifyEventPublisher is injected but not used anywhere in the class. Consider either:

  1. Adding documentation explaining its future use
  2. Implementing the notification logic in the run method
  3. Removing it if it's not needed yet

🏁 Script executed:

#!/bin/bash
# Description: Check if NotifyEventPublisher is used elsewhere in the main application class or if there are similar patterns in other CommandLineRunner implementations.

# Search for other CommandLineRunner implementations to see usage patterns
rg -A 10 "implements CommandLineRunner" --type java

# Search for NotifyEventPublisher usage patterns
rg -A 5 -B 5 "NotifyEventPublisher" --type java

Length of output: 7013


Remove or clarify the unused NotifyEventPublisher in MosuServerApplication
The NotifyEventPublisher is injected into the main application class but never used in the run method (or elsewhere in this class). Please choose one of the following:

  • Remove the publisher field and its constructor injection if you don’t need it yet.
  • Document its intended startup use (e.g., publishing a “server started” event).
  • Implement the notification logic in the run(String... args) method.

Locations to address:

  • src/main/java/life/mosu/mosuserver/MosuServerApplication.java, line defining private final NotifyEventPublisher publisher;
🤖 Prompt for AI Agents
In src/main/java/life/mosu/mosuserver/MosuServerApplication.java at line 13, the
NotifyEventPublisher field is declared but never used. To fix this, either
remove the publisher field and its constructor injection if it is not needed, or
add a comment explaining its intended use at startup, or implement logic in the
run(String... args) method to publish a notification event indicating the server
has started.


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);
}

private NotificationVariable createExam1WeekBeforeVariable(Long targetId) {
OneWeekNotifyProjection projection = applicationSchoolJpaRepository.findOneWeekNotifyByApplicationSchoolId(
targetId);
return new Exam1WeekBeforeNotifyRequest(projection.examDate(), projection.paymentKey(),
projection.schoolName());
}

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());
}
}
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
Copy link

Choose a reason for hiding this comment

The 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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public record Exam3DayBeforeNotifyRequest(
LocalDate examDate,
String examinationNumber,
String schoolName
) implements NotificationVariable {
import jakarta.validation.constraints.NotNull;
public record Exam3DayBeforeNotifyRequest(
@NotNull
LocalDate examDate,
@NotNull
String examinationNumber,
@NotNull
String schoolName
) implements NotificationVariable {
🤖 Prompt for AI Agents
In
src/main/java/life/mosu/mosuserver/application/notify/dto/Exam3DayBeforeNotifyRequest.java
around lines 12 to 16, the record fields lack null validation which may cause
issues in notification processing. Add appropriate validation annotations such
as @NotNull to each field (examDate, examinationNumber, schoolName) to ensure
they are not null when the record is instantiated. This will enforce required
field constraints and prevent null-related errors downstream.


@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,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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Commented-out code should be removed to keep the codebase clean and avoid confusion.

String paymentMethod,
String reason
) implements NotificationVariable {
Comment on lines +11 to +18
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove commented code or clarify its purpose.

The commented out amount field suggests incomplete implementation or design uncertainty. Commented code should not remain in production code.

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public record RefundNotifyRequest(
String paymentKey,
LocalDate examDate,
String schoolName,
// String amount,
String paymentMethod,
String reason
) implements NotificationVariable {
public record RefundNotifyRequest(
String paymentKey,
LocalDate examDate,
String schoolName,
String paymentMethod,
String reason
) implements NotificationVariable {
🤖 Prompt for AI Agents
In
src/main/java/life/mosu/mosuserver/application/notify/dto/RefundNotifyRequest.java
between lines 11 and 18, remove the commented out 'amount' field to clean up the
code unless it is required. If the 'amount' field is needed, uncomment it and
add appropriate validation to ensure its correctness. Otherwise, delete the
commented line entirely to avoid confusion and maintain clean production code.


@Override
public NotificationButtonUrls getNotificationButtonUrls() {
return NotificationButtonUrls.of(
NotificationButtonUrl.of(MY_PAGE, MY_PAGE)
);
}

@Override
public Map<String, String> toMap() {
return Map.of(
"paymentKey", paymentKey,
"examDate", examDate.toString(),
"schoolName", schoolName,
"amount", String.valueOf(1000),
"paymentMethod", paymentMethod,
"reason", reason
);
}
}
Loading