Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
rudeh2926 committed Oct 29, 2024
2 parents 95650d5 + d558ab3 commit 9b877f1
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: "ko-KR" # 사용 언어를 한국어로 설정
early_access: false # 접근 프로그램에 참여하지 않음
reviews: # 리뷰 설정
profile: "strict" # 리뷰 프로필 설정 (편안한 스타일)
profile: "chill" # 리뷰 프로필 설정 (편안한 스타일)
request_changes_workflow: false # 변경 요청을 위한 워크플로우 비활성화
high_level_summary: true # 높은 수준의 요약을 활성화
poem: true # 시 작성 활성화
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,32 @@ class ChangeApplicationStatusService(
val admin = adminFacadeUseCase.currentAdmin()
if (request.status == Status.NO) {
handleStatusNo(request.idList)
}

val updateApplicationList = request.idList.map { id ->
val application = findApplicationById(id)
updateApplication(application, admin.name)
}
} else {
val updateApplicationList = request.idList.map { id ->
val application = findApplicationById(id)
updateApplication(application, admin.name)
}

val applicationStory = updateApplicationList.map { it ->
createApplicationStory(it)
}
val applicationStory = updateApplicationList.map { it ->
createApplicationStory(it)
}

val attendance = updateApplicationList.map { it ->
val attendanceId = queryAttendancePort.findByUserId(it.userId)
attendanceService.updateAttendanceToApplication(it.start, it.end!!, it.applicationType, attendanceId!!)
}.toMutableList()
val attendance = updateApplicationList.map { it ->
val attendanceId = queryAttendancePort.findByUserId(it.userId)
attendanceService.updateAttendanceToApplication(it.start, it.end!!, it.applicationType, attendanceId!!)
}.toMutableList()

saveApplicationPort.saveAll(updateApplicationList)
applicationStorySaveAllPort.saveAll(applicationStory)
saveAttendancePort.saveAll(attendance)
eventPublisher.publishEvent(ChangeStatusRequest(this, updateApplicationList.map { it.userId }))
saveApplicationPort.saveAll(updateApplicationList)
applicationStorySaveAllPort.saveAll(applicationStory)
saveAttendancePort.saveAll(attendance)
eventPublisher.publishEvent(ChangeStatusRequest(this, updateApplicationList.map { it.userId }))
}
}

private fun handleStatusNo(idList: List<UUID>) {
eventPublisher.publishEvent(ChangeStatusRequest(this, idList))
idList.forEach { id ->
val applicationList = idList.map { findApplicationById(it) }
eventPublisher.publishEvent(ChangeStatusRequest(this, applicationList.map { it.userId }))
idList.map { id ->
val application = findApplicationById(id)
deleteApplicationPort.deleteByIdAndApplicationKind(application.id!!, ApplicationKind.APPLICATION)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import dsm.pick2024.domain.schedule.domain.Schedule
import dsm.pick2024.domain.schedule.port.`in`.CreateScheduleUseCase
import dsm.pick2024.domain.schedule.port.out.SaveSchedulePort
import dsm.pick2024.domain.schedule.presentation.dto.request.CreateScheduleRequest
import dsm.pick2024.global.config.cache.CacheName
import org.springframework.cache.annotation.CacheEvict
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional

Expand All @@ -12,6 +14,7 @@ class CreateScheduleService(
private val saveSchedulePort: SaveSchedulePort
) : CreateScheduleUseCase {

@CacheEvict(value = [CacheName.SCHEDULES], allEntries = true)
@Transactional
override fun createSchedule(request: CreateScheduleRequest) {
saveSchedulePort.save(
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import dsm.pick2024.domain.meal.port.`in`.MealUseCase
import dsm.pick2024.domain.status.port.`in`.ResetStatusUseCase
import dsm.pick2024.domain.timetable.port.`in`.SaveTimetableUseCase
import dsm.pick2024.domain.timetable.port.out.DeleteTimeTablePort
import dsm.pick2024.domain.weekendmeal.port.`in`.ResetWeekendMealUseCase
import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Component

Expand All @@ -20,7 +19,6 @@ class ScheduleService(
private val deleteTimetablePort: DeleteTimeTablePort,
private val mealUseCase: MealUseCase,
private val resetAttendanceUseCase: ResetAttendanceUseCase,
private val resetWeekendMealUseCase: ResetWeekendMealUseCase,
private val resetStatusUseCase: ResetStatusUseCase,
private val saveTimetableUseCase: SaveTimetableUseCase
) {
Expand All @@ -34,7 +32,6 @@ class ScheduleService(
@Scheduled(cron = "0 0 0 25 * ?", zone = "Asia/Seoul")
fun monthSchedule() {
mealUseCase.saveNeisInfoToDatabase()
resetWeekendMealUseCase.resetWeekendMeal()
}

@Scheduled(cron = "0 00 21 * * ?", zone = "Asia/Seoul")
Expand Down

0 comments on commit 9b877f1

Please sign in to comment.