Skip to content

Commit

Permalink
Merge pull request #202 from GSM-MSG/201-update/exit-reservation
Browse files Browse the repository at this point in the history
# 201 예약 취소 시 회원 상태 변경
  • Loading branch information
JuuuuHong authored Mar 5, 2024
2 parents aba6246 + 652e517 commit 44ad1fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package team.msg.hiv2.domain.notice.presentation.data.web

import javax.validation.constraints.NotBlank
import javax.validation.constraints.Size

data class CreateNoticeWebRequest(
@field:NotBlank
@field:Size(max = 20)
val title: String,
@field:NotBlank
@field:Size(max = 200)
val content: String
)
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
package team.msg.hiv2.domain.notice.presentation.data.web

import javax.validation.constraints.NotEmpty
import javax.validation.constraints.Size

data class UpdateNoticeWebRequest(
@field:NotEmpty
@field:Size(max = 20)
val title: String,
@field:NotEmpty
@field:Size(max = 200)
val content: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package team.msg.hiv2.domain.reservation.application.usecase
import team.msg.hiv2.domain.reservation.application.service.ReservationService
import team.msg.hiv2.domain.reservation.exception.ForbiddenExitReservationException
import team.msg.hiv2.domain.user.application.service.UserService
import team.msg.hiv2.domain.user.domain.constant.UseStatus
import team.msg.hiv2.global.annotation.usecase.UseCase
import java.util.UUID

Expand All @@ -20,6 +21,6 @@ class ExitReservationUseCase(
if(reservation.representativeId == currentUser.id)
throw ForbiddenExitReservationException()

userService.save(currentUser.copy(reservationId = null))
userService.save(currentUser.copy(reservationId = null, useStatus = UseStatus.AVAILABLE))
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package team.msg.hiv2.domain.reservation.persistence.repository

import org.springframework.data.jpa.repository.EntityGraph
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.CrudRepository
import team.msg.hiv2.domain.homebase.persistence.entity.HomeBaseJpaEntity
import team.msg.hiv2.domain.reservation.persistence.entity.ReservationJpaEntity
import java.util.UUID
import java.util.*

interface ReservationRepository : CrudRepository<ReservationJpaEntity, UUID> {
@EntityGraph(attributePaths = ["homeBase"])
Expand Down

0 comments on commit 44ad1fe

Please sign in to comment.