Skip to content

Commit

Permalink
fix: 불필요한 repository 조회 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Sion99 committed Jun 11, 2024
1 parent 62ea1b5 commit 1712c7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/savemyreceipt/smr/domain/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ public class Group extends AuditingTimeEntity {

private Long memberCount;

private Long receiptCount;
private Long receiptCount = 0L;

@Builder
public Group(String name, String city, String organization, String description) {
this.name = name;
this.city = city;
this.organization = organization;
this.description = description;
this.memberCount = 0L;
}

public void addMember() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private Member findAccountant(Group group) {
private void check(Member member, Group group) {

// 회원이 속한 그룹의 수가 10개를 초과할 수 없다.
if (groupMemberRepository.countByMemberId(member.getId()) >= 10) {
if (groupMemberRepository.countByMemberId(member.getId()) >= 12) {
throw new CustomException(ErrorStatus.TOO_MUCH_GROUPS, ErrorStatus.TOO_MUCH_GROUPS.getMessage());
}

Expand Down

0 comments on commit 1712c7e

Please sign in to comment.