Skip to content

Commit

Permalink
hotfix(appointment): 약속 상태 변경 mapper 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
proHyundo committed Sep 1, 2024
1 parent cf0ae65 commit bc31f6e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions-server.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Spring Boot Gradle CICD (version 0.2.11)
name: Spring Boot Gradle CICD (version 0.2.12)

on:
push:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public PossibleDateTime throwExceptionIfAppointmentAlreadyAcceptedAtSameTime(Lon

@Override
public boolean changeStatusAsReserved(Long possibleDateTimeId) {
int updatedRows = possibleDateTimeRepository.updatePossibleDateTimeStatus(possibleDateTimeId, PossibleDateTimeStatusType.RESERVED);
int updatedRows = possibleDateTimeRepository.updatePossibleDateTimeStatusFromAvailable(possibleDateTimeId, PossibleDateTimeStatusType.RESERVED);
if (updatedRows != 1){
throw new PossibleDateTimeException(PossibleDateTimeErrorCode.POSSIBLE_DATETIME_STATUS_UPDATE_FAILED, "밥약 가능한 일정 상태 변경에 실패하였습니다.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public interface PossibleDateTimeRepository {
// 테스트 코드 작성 완료
int updatePossibleDateTimeStatus(Long possibleDateTimeId, PossibleDateTimeStatusType status);

int updatePossibleDateTimeStatusFromAvailable(Long possibleDateTimeId, PossibleDateTimeStatusType status);

// 테스트 코드 작성 완료
List<PossibleDateTime> findAllByUserId(Long userId);

Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/mapper/PossibleDateTimeMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,19 @@

<!-- ============================== UPDATE ============================== -->

<update id="updatePossibleDateTimeStatus">
<update id="updatePossibleDateTimeStatusFromAvailable">
UPDATE t_possible_datetime
SET possible_datetime_status = #{status}
WHERE possible_datetime_id = #{possibleDateTimeId}
AND possible_datetime_status = 'AVAILABLE';
</update>

<update id="updatePossibleDateTimeStatus">
UPDATE t_possible_datetime
SET possible_datetime_status = #{status}
WHERE possible_datetime_id = #{possibleDateTimeId};
</update>

<!-- ============================== DELETE ============================== -->

<delete id="deletePossibleDate">
Expand Down

0 comments on commit bc31f6e

Please sign in to comment.