Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@
*/
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class ExemptionService {

private final DuesExemptionRepository exemptionRepository;
private final DuesExemptionReasonRepository reasonRepository;
private final MemberRepository memberRepository;

@Transactional(readOnly = true)
public ExemptionListResponse getExemptions() {
return new ExemptionListResponse(
exemptionRepository.findAllByOrderByIdAsc().stream().map(ExemptionResponse::from).toList());
}

@Transactional(readOnly = true)
public ExemptionReasonListResponse getReasons() {
return new ExemptionReasonListResponse(reasonRepository.findAllNames());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class LedgerEntryService {

private final LedgerEntryRepository entryRepository;
Expand All @@ -22,7 +23,6 @@ public class LedgerEntryService {
private final EvidenceLinkWriter evidenceLinkWriter;

/** 쿼리 파라미터(필터)는 받지 않는다. FE가 전체를 받아 클라이언트에서 거른다. */
@Transactional(readOnly = true)
public LedgerEntryListResponse getEntries() {
return new LedgerEntryListResponse(assembler.toResponses(entryRepository.findAllLatestFirst()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class RosterService {

private final DuesSemesterReader semesterReader;
Expand All @@ -35,7 +36,6 @@ public class RosterService {
private final MemberRepository memberRepository;
private final DuesLinkRepository linkRepository;

@Transactional(readOnly = true)
public SemesterRosterResponse getRoster(String semesterId) {
DuesSemester semester = semesterReader.get(semesterId);
List<RosterMemberResponse> members = rosterRepository
Expand All @@ -46,7 +46,6 @@ public SemesterRosterResponse getRoster(String semesterId) {
return new SemesterRosterResponse(members);
}

@Transactional(readOnly = true)
public RosterCandidateListResponse getCandidates(String semesterId) {
DuesSemester semester = semesterReader.get(semesterId);
List<RosterCandidateResponse> members = rosterRepository.findCandidates(semester.getId()).stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/
@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class SemesterService {

private final Clock clock;
Expand All @@ -29,7 +30,6 @@ public class SemesterService {
private final DuesSemesterWriter semesterWriter;
private final DuesQueryService duesQueryService;

@Transactional(readOnly = true)
public SemesterCreatableResponse getCreatable() {
Creatable creatable = creatable();
return SemesterCreatableResponse.of(creatable.current(), creatable.next(), creatable.creatable());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,19 @@

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class MemberDirectoryService {

private final MemberRepository memberRepository;
private final TrackMasterRepository trackMasterRepository;
private final PositionRepository positionRepository;
private final PhotoStorageService photoStorageService;

@Transactional(readOnly = true)
public MemberDirectoryResponse getDirectory(MemberDirectoryQuery query, Pageable pageable) {
return MemberDirectoryResponse.of(findPage(query, pageable), buildCounts());
}

/** 관리자 인명부. 일반 인명부 항목에 관리자 전용 필드(직장, 계정 유무)를 더한다. */
@Transactional(readOnly = true)
public AdminMemberDirectoryResponse getAdminDirectory(MemberDirectoryQuery query, Pageable pageable) {
return AdminMemberDirectoryResponse.of(findPage(query, pageable), buildCounts());
}
Expand Down Expand Up @@ -123,7 +122,6 @@ public void changeWithdrawal(Long memberId, boolean withdrawn) {
}
}

@Transactional(readOnly = true)
public PhotoPresignedUrlResponse issuePhotoPresignedUrl(Long memberId, PhotoPresignedUrlRequest request) {
if (!memberRepository.existsById(memberId)) {
throw new MemberException(MemberExceptionType.MEMBER_NOT_FOUND);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class MemberService {

private final MemberRepository memberRepository;
Expand All @@ -36,12 +37,10 @@ public class MemberService {
private final AuthService authService;
private final PhotoStorageService photoStorageService;

@Transactional(readOnly = true)
public MemberResponse getMe(Long memberId) {
return MemberResponse.from(getMemberOrThrow(memberId));
}

@Transactional(readOnly = true)
public MemberResponse getInitialSetupInfo(Long memberId, long tokenPasswordVersion) {
Member member = getMemberOrThrow(memberId);
if (!member.isPendingSetup()) {
Expand Down Expand Up @@ -126,7 +125,6 @@ public void changePassword(Long memberId, PasswordChangeRequest request) {
.forEach(refreshToken -> refreshToken.revoke(now));
}

@Transactional(readOnly = true)
public PhotoPresignedUrlResponse issuePhotoPresignedUrl(Long memberId, PhotoPresignedUrlRequest request) {
return photoStorageService.issuePresignedUrl(memberId, request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

@Service
@RequiredArgsConstructor
@Transactional(readOnly = true)
public class ReservationService {

private static final int MAX_DAILY_MINUTES = 180;
Expand Down Expand Up @@ -68,30 +69,26 @@ public ReservationCreateResponse create(Long memberId, ReservationCreateRequest
return createRepeat(memberId, request, now);
}

@Transactional(readOnly = true)
public DailyReservationResponse getDaily(LocalDate date, Long viewerMemberId) {
List<Reservation> reservations =
reservationRepository.findByReservationDateAndCancelledAtIsNullOrderByStartMinuteAsc(date);
Map<Long, String> namesById = viewerMemberId == null ? Map.of() : loadMemberNames(reservations);
return DailyReservationResponse.of(date, reservations, namesById, viewerMemberId);
}

@Transactional(readOnly = true)
public MonthlyOccupancyResponse getMonthlyOccupancy(YearMonth month) {
LocalDate from = month.atDay(1);
LocalDate to = month.atEndOfMonth();
return MonthlyOccupancyResponse.of(month, toDays(reservationRepository.sumReservedMinutesByDateBetween(from, to)));
}

@Transactional(readOnly = true)
public MonthlyOccupancyResponse getMyMonthlyOccupancy(Long memberId, YearMonth month) {
LocalDate from = month.atDay(1);
LocalDate to = month.atEndOfMonth();
List<Object[]> rows = reservationRepository.sumReservedMinutesByMemberIdAndDateBetween(memberId, from, to);
return MonthlyOccupancyResponse.of(month, toDays(rows));
}

@Transactional(readOnly = true)
public MyReservationResponse getMyReservations(Long memberId, String status) {
LocalDate today = LocalDate.now(clock);
List<Reservation> reservations = "past".equalsIgnoreCase(status)
Expand All @@ -104,7 +101,6 @@ public MyReservationResponse getMyReservations(Long memberId, String status) {
return MyReservationResponse.of(pickGroupRepresentatives(reservations));
}

@Transactional(readOnly = true)
public ReservationDetailResponse getDetail(Long memberId, Long reservationId) {
Reservation reservation = getOwnedReservation(memberId, reservationId);
ReservationDetailResponse.Group group = null;
Expand Down
Loading