Skip to content

활동 기반 배지 구현#165

Open
Junad-Park wants to merge 3 commits intofeature/badge-list-and-representativefrom
feature/activity-badges
Open

활동 기반 배지 구현#165
Junad-Park wants to merge 3 commits intofeature/badge-list-and-representativefrom
feature/activity-badges

Conversation

@Junad-Park
Copy link
Copy Markdown
Contributor

✨ 작업 내용

1️⃣ 활동 기반 뱃지 5종 획득 조건 구현

  • 사용자의 다양한 앱 내 활동을 기반으로 한 뱃지 5종의 획득 조건을 구현
    • 완벽주의 (Perfectionist) : 등록된 루틴 10개 이상
    • 까마귀 (Crow) : 서로 다른 루틴 카테고리 5개 이상 사용
    • 꽥꽥 (QuackQuack) : 소셜 게시글 15개 이상 작성
    • 집중천재 (FocusGenius) : 타이머 집중 횟수 합계 15회 이상
    • 하루일기 (DailyDiary) : 해당 월의 감정일기 작성률 50% 이상 달성

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 18, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'auto_resolve_threads', 'spring_specific'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/activity-badges

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Member

@wafla wafla left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

Copy link
Copy Markdown
Member

@Seol-JY Seol-JY left a comment

Choose a reason for hiding this comment

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

p3: 이벤트 발행 위치와 관련해서, 현재 Service 레이어에서 직접 이벤트를 발행하고 있는데, 프로젝트의 레이어 구조가 UseCase → Service인 것을 감안하면 UseCase 레이어에서 발행하는 게 더 일관되지 않을까 싶습니다.
Service가 다른 도메인(배지)의 이벤트를 트리거하는 형태가 되면 의존 방향이 조금 어색해질 수 있을 것 같은데, 어떻게 생각하시나요?

Copy link
Copy Markdown
Member

@Seol-JY Seol-JY left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

Comment on lines +29 to +39
@Override
public boolean checkCondition(final User user) {
YearMonth currentMonth = YearMonth.now();
LocalDate startDate = currentMonth.atDay(FIRST_DAY_OF_MONTH);
LocalDate endDate = currentMonth.atEndOfMonth();
int daysInMonth = currentMonth.lengthOfMonth();

long writtenDays = diaryRepository.countDistinctDateByUserAndDateBetween(user, startDate, endDate);

return writtenDays >= daysInMonth * MINIMUM_WRITTEN_RATIO;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

p4:

YearMonth.now()를 직접 호출하고 있어서, 월말/월초 경계에서 테스트가 flaky해질 가능성이 있지 않을까요?

예를 들어 테스트가 1월 31일 23:59에 시작되었는데 실제 쿼리 시점에 2월 1일로 넘어가면, now()가 반환하는 월과 DB에 넣은 데이터의 월이 달라져서 테스트가 실패할 수 있을 것 같아요. 또한 2월(28일)과 7월(31일)에서 50% 기준 일수가 다르기 때문에 특정 월에서만 실패하는 케이스도 생길 수 있고요.

당장은 큰 문제가 없어 보여서 참고차 남깁니다..!

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.

3 participants