Skip to content

[FEAT] 약관 추가 및 설정 반영 (#335)#336

Merged
lingard1234 merged 4 commits intodevfrom
feat/335-term
Feb 8, 2026
Merged

[FEAT] 약관 추가 및 설정 반영 (#335)#336
lingard1234 merged 4 commits intodevfrom
feat/335-term

Conversation

@lingard1234
Copy link
Copy Markdown
Contributor

Summary

TermName 추가 및 handleNotificationSettings 설정

Changes

TermName, AuthService

Type of Change

  • Bug fix (기존 기능에 영향을 주지 않는 버그 수정)
  • New feature (기존 기능에 영향을 주지 않는 새로운 기능 추가)
  • Breaking change (기존 기능에 영향을 주는 수정)
  • Refactoring (기능 변경 없는 코드 개선)
  • Documentation (문서 수정)
  • Chore (빌드, 설정 등 기타 변경)
  • Release (develop → main 배포)

Related Issues

Closes #335

참고 사항

@lingard1234 lingard1234 self-assigned this Feb 8, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @lingard1234, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 마케팅 동의를 위한 새로운 약관을 도입하고 알림 설정 메커니즘을 리팩토링합니다. NotificationSetting 엔티티는 일반적인 type 및 channel 열거형 대신 appPushEnabled 및 emailEnabled 플래그를 사용하여 더 세분화된 설정을 가능하게 합니다. AuthService는 회원가입 과정에서 사용자의 동의 여부에 따라 이러한 새로운 알림 설정을 자동으로 구성하도록 수정되어, 마케팅 알림이 적절하게 관리되도록 합니다.

Highlights

  • 새로운 약관명 MARKETING_CONSENT 추가: TermName.java 파일에 MARKETING_CONSENT라는 새로운 열거형 값이 추가되었습니다.
  • NotificationSetting 엔티티 리팩토링: NotificationSetting 엔티티가 크게 리팩토링되었습니다. User와의 관계가 ManyToOne에서 OneToOne으로 변경되었고, type, channel, isEnabled 필드가 appPushEnabled와 emailEnabled 불리언 플래그로 대체되었습니다. enable() 및 disable() 메서드는 update() 메서드로 통합되었습니다.
  • AuthService 통합: AuthService는 이제 사용자 회원가입 완료 시 알림 설정을 처리하는 로직을 포함합니다. 특히, MARKETING_NOTIFICATION 동의 여부를 확인하고, 동의했을 경우 해당 사용자의 NotificationSetting을 생성하거나 업데이트하여 앱 푸시 및 이메일 알림을 활성화합니다.
  • NotificationSettingRepository 업데이트: NotificationSetting 엔티티 변경 사항을 반영하여 레포지토리가 간소화되었습니다. NotificationType 및 NotificationChannel과 관련된 메서드가 제거되고 findByUserId 메서드만 남았습니다.
Changelog
  • src/main/java/com/example/RealMatch/oauth/service/AuthService.java
    • NotificationSetting 및 TermName 관련 클래스 import가 추가되었습니다.
    • NotificationSettingRepository 의존성이 주입되었습니다.
    • completeSignup 메서드 내에서 handleNotificationSettings 메서드를 호출하는 로직이 추가되었습니다.
    • 사용자의 마케팅 알림 동의 여부에 따라 NotificationSetting을 생성하거나 업데이트하는 private 메서드 handleNotificationSettings가 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/domain/entity/NotificationSetting.java
    • NotificationChannel 및 NotificationType import가 제거되었습니다.
    • User와의 관계가 @manytoone에서 @OnetoOne으로 변경되었고, unique = true 속성이 JoinColumn에 추가되었습니다.
    • 기존의 type, channel, isEnabled 필드가 appPushEnabled와 emailEnabled 불리언 필드로 대체되었습니다.
    • 생성자 시그니처가 변경되었고, enable() 및 disable() 메서드가 update(boolean appPushEnabled, boolean emailEnabled) 메서드로 통합되었습니다.
  • src/main/java/com/example/RealMatch/user/domain/entity/enums/TermName.java
    • 새로운 약관 유형인 MARKETING_CONSENT 열거형 값이 추가되었습니다.
  • src/main/java/com/example/RealMatch/user/domain/repository/NotificationSettingRepository.java
    • findByUserIdAndTypeAndChannel 및 findByUserIdAndIsEnabled 메서드가 제거되었습니다.
    • findByUserId 메서드의 반환 타입이 List에서 Optional으로 변경되었습니다.
Activity
  • 이 PR에 대한 특별한 활동(댓글, 리뷰, 진행 상황 등)은 아직 없습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 Pull Request는 새로운 약관 MARKETING_CONSENT를 추가하고, NotificationSetting 엔티티와 관련 리포지토리를 단순화하도록 리팩토링했습니다. 또한 AuthService에 마케팅 동의 여부에 따라 회원가입 시 알림 설정을 처리하는 로직이 추가되었습니다. NotificationSetting을 사용자와의 일대다 관계에서 일대일 관계로 리팩토링한 점은 모델을 더 단순하고 직관적으로 만들어주는 좋은 개선입니다.

리뷰에는 AuthService에 대한 한 가지 'high' 심각도의 제안이 포함되어 있습니다. 현재 알림 설정을 처리하는 구현에는 사용자가 마케팅에 동의하는 경우만 처리하는 논리적 결함이 있으며, 실행 불가능한 코드를 포함하고 있습니다. 모든 사용자가 회원가입 시 알림 설정 레코드를 갖도록 보장하고 마케팅 동의 여부를 정확히 반영하도록 handleNotificationSettings 메서드를 리팩토링할 것을 제안했습니다. 이를 통해 코드의 명확성과 유지보수성이 향상될 것입니다.

Comment on lines +195 to +219
private void handleNotificationSettings(User user, List<SignupCompleteRequest.TermAgreementDto> terms) {
// MARKETING_NOTIFICATION 동의 여부 확인
boolean marketingNotificationAgreed = terms.stream()
.anyMatch(term -> term.type() == TermName.MARKETING_NOTIFICATION && term.agreed());

if (marketingNotificationAgreed) {
// 기존 알림 설정 조회 또는 새로 생성
NotificationSetting notificationSetting = notificationSettingRepository
.findByUserId(user.getId())
.orElseGet(() -> NotificationSetting.builder()
.user(user)
.appPushEnabled(false)
.emailEnabled(false)
.build());

// 동의 여부에 따라 알림 설정 업데이트
if (marketingNotificationAgreed) {
notificationSetting.update(true, true);
} else {
notificationSetting.update(false, false);
}

notificationSettingRepository.save(notificationSetting);
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

현재 handleNotificationSettings 메서드의 로직은 마케팅 알림에 동의한 경우에만 알림 설정을 생성하거나 업데이트합니다. 동의하지 않은 경우에는 아무런 처리도 하지 않아, 해당 유저의 알림 설정 레코드가 생성되지 않을 수 있습니다. 또한, marketingNotificationAgreedtrue인 블록 내에 불필요한 if/else 조건문이 있어 else 구문이 실행될 수 없는 구조입니다.

모든 유저에 대해 회원가입 시점에 알림 설정 레코드를 생성하고, 마케팅 동의 여부에 따라 설정을 업데이트하도록 로직을 개선하는 것을 제안합니다. 이렇게 하면 로직이 더 명확해지고, 향후 알림 설정을 관리하기 용이해집니다.

    private void handleNotificationSettings(User user, List<SignupCompleteRequest.TermAgreementDto> terms) {
        // MARKETING_NOTIFICATION 동의 여부 확인
        boolean marketingNotificationAgreed = terms.stream()
                .anyMatch(term -> term.type() == TermName.MARKETING_NOTIFICATION && term.agreed());

        // 기존 알림 설정이 없으면 새로 생성
        NotificationSetting notificationSetting = notificationSettingRepository.findByUserId(user.getId())
                .orElseGet(() -> NotificationSetting.builder()
                        .user(user)
                        .build());

        // 동의 여부에 따라 알림 설정 업데이트
        notificationSetting.update(marketingNotificationAgreed, marketingNotificationAgreed);

        notificationSettingRepository.save(notificationSetting);
    }

@lingard1234 lingard1234 merged commit aeafcbe into dev Feb 8, 2026
1 check passed
@lingard1234 lingard1234 deleted the feat/335-term branch February 8, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 약관 테이블 수정 및 알림 설정 테이블 매핑

1 participant