Skip to content

[feat] 룰랫 기능 추가 - #6

Merged
Junseung-Ock merged 7 commits into
developfrom
feat/roulette
Jul 10, 2026
Merged

[feat] 룰랫 기능 추가#6
Junseung-Ock merged 7 commits into
developfrom
feat/roulette

Conversation

@Junseung-Ock

@Junseung-Ock Junseung-Ock commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added roulette-based chore assignment, selecting responsible members according to weighted probabilities.
    • Added APIs to view roulette slices and weekly assignment results.
    • Added support for manual or roulette assignment when creating chores.
    • Added clear error handling for unavailable groups, missing members, and repeated draws.
  • Documentation

    • Added dedicated roulette endpoints to the API documentation.

# Conflicts:
#	src/main/java/com/cotato/cokerthon/domain/member/entity/Member.java
#	src/main/java/com/cotato/cokerthon/domain/member/repository/MemberRepository.java
#	src/main/java/com/cotato/cokerthon/global/config/SwaggerConfig.java
#	src/main/resources/application.yml
# Conflicts:
#	src/main/java/com/cotato/cokerthon/domain/chore/entity/AssignType.java
#	src/main/java/com/cotato/cokerthon/domain/chore/entity/Chore.java
# Conflicts:
#	src/main/java/com/cotato/cokerthon/domain/chore/repository/ChoreRepository.java
#	src/main/java/com/cotato/cokerthon/domain/chore/service/GroupChoreService.java
@Junseung-Ock
Junseung-Ock merged commit 169c336 into develop Jul 10, 2026
1 check passed
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8d3f290e-91e4-4bd9-81d9-6de26e1e5a92

📥 Commits

Reviewing files that changed from the base of the PR and between 9f233d2 and 9ba3a52.

📒 Files selected for processing (15)
  • src/main/java/com/cotato/cokerthon/CokerthonApplication.java
  • src/main/java/com/cotato/cokerthon/domain/chore/entity/Chore.java
  • src/main/java/com/cotato/cokerthon/domain/chore/repository/ChoreRepository.java
  • src/main/java/com/cotato/cokerthon/domain/chore/service/GroupChoreService.java
  • src/main/java/com/cotato/cokerthon/domain/group/repository/GroupMemberRepository.java
  • src/main/java/com/cotato/cokerthon/domain/roulette/controller/RouletteController.java
  • src/main/java/com/cotato/cokerthon/domain/roulette/dto/response/RouletteResultResponse.java
  • src/main/java/com/cotato/cokerthon/domain/roulette/dto/response/RouletteSliceResponse.java
  • src/main/java/com/cotato/cokerthon/domain/roulette/entity/RouletteResult.java
  • src/main/java/com/cotato/cokerthon/domain/roulette/exception/RouletteErrorCode.java
  • src/main/java/com/cotato/cokerthon/domain/roulette/repository/RouletteResultRepository.java
  • src/main/java/com/cotato/cokerthon/domain/roulette/service/RouletteService.java
  • src/main/java/com/cotato/cokerthon/global/config/SwaggerConfig.java
  • src/main/java/com/cotato/cokerthon/global/entity/BaseEntity.java
  • src/main/resources/application.yml

📝 Walkthrough

Walkthrough

Adds weighted roulette assignment for group chores, persists roulette results, exposes slice/result endpoints, and integrates roulette selection into chore creation. It also updates Swagger grouping, datasource defaults, and minor formatting.

Changes

Roulette assignment

Layer / File(s) Summary
Assignment state and repository contracts
src/main/java/com/cotato/cokerthon/domain/chore/entity/Chore.java, src/main/java/com/cotato/cokerthon/domain/chore/repository/ChoreRepository.java, src/main/java/com/cotato/cokerthon/domain/group/repository/GroupMemberRepository.java
Chore stores assignment type and assigned member data; repositories expose assignment-type and group-member queries.
Roulette selection and result persistence
src/main/java/com/cotato/cokerthon/domain/roulette/entity/RouletteResult.java, src/main/java/com/cotato/cokerthon/domain/roulette/repository/RouletteResultRepository.java, src/main/java/com/cotato/cokerthon/domain/roulette/service/RouletteService.java, src/main/java/com/cotato/cokerthon/domain/roulette/exception/RouletteErrorCode.java
Roulette calculates inverse-point probabilities, selects a member, stores results, retrieves historical results, and validates missing groups or members.
Roulette response API
src/main/java/com/cotato/cokerthon/domain/roulette/controller/RouletteController.java, src/main/java/com/cotato/cokerthon/domain/roulette/dto/response/*
Adds slice and date-filtered result endpoints with response records.
Chore creation and application wiring
src/main/java/com/cotato/cokerthon/domain/chore/service/GroupChoreService.java, src/main/java/com/cotato/cokerthon/global/config/SwaggerConfig.java, src/main/resources/application.yml, src/main/java/com/cotato/cokerthon/CokerthonApplication.java, src/main/java/com/cotato/cokerthon/global/entity/BaseEntity.java
Chore creation invokes roulette for roulette assignments; Swagger and datasource settings are updated, alongside formatting-only edits.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant RouletteController
  participant RouletteService
  participant GroupMemberRepository
  participant RouletteResultRepository
  Client->>RouletteController: Request roulette slices or results
  RouletteController->>RouletteService: getSlices(groupId) or getResults(groupId, nextWeekStartDate)
  RouletteService->>GroupMemberRepository: findByGroup(group)
  GroupMemberRepository-->>RouletteService: group members
  RouletteService->>RouletteResultRepository: Query persisted results
  RouletteResultRepository-->>RouletteService: roulette results
  RouletteService-->>RouletteController: Response DTO list
  RouletteController-->>Client: CommonResponse
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/roulette

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

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.

1 participant