Skip to content

Commit

Permalink
feat: Member의 온보딩 여부를 검증하는 로직을 MemberCommandService로 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
amaran-th committed Jan 31, 2024
1 parent 10237dd commit d201e70
Show file tree
Hide file tree
Showing 6 changed files with 5,691 additions and 7,134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public List<InterestTagResponse> findInterestTags(final Long memberId) {
}

public void initializeInterestTags(final Member member, final List<String> tagNames) {
if (member.isOnboarded()) {
throw new MemberException(MemberExceptionType.ALREADY_ONBOARDING);
}
final List<Tag> tags = tagRepository.findByNameIn(tagNames);
final List<InterestTag> interestTags = tags.stream()
.map(tag -> new InterestTag(member, tag))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public List<MemberActivity> registerActivities(
final Member member,
final MemberActivityInitialRequest memberActivityInitialRequest
) {
if (member.isOnboarded()) {
throw new MemberException(MemberExceptionType.ALREADY_ONBOARDING);
}
final List<Long> activityIds = memberActivityInitialRequest.getActivityIds();
return saveMemberActivities(member, activityIds);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class MemberCommandService {
private final S3Client s3Client;

public void initializeMember(final Member member, final MemberActivityInitialRequest request) {
if (member.isOnboarded()) {
throw new MemberException(MemberExceptionType.ALREADY_ONBOARDING);
}
final List<MemberActivity> memberActivities = memberActivityCommandService.registerActivities(
member, request);
final List<String> activityNames = memberActivities.stream()
Expand Down
Loading

0 comments on commit d201e70

Please sign in to comment.