Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: 예약 수정 API #287

Merged
merged 15 commits into from
Nov 18, 2024
Merged

Feat: 예약 수정 API #287

merged 15 commits into from
Nov 18, 2024

Conversation

gitseoyeon
Copy link
Member

@gitseoyeon gitseoyeon commented Oct 22, 2024

Summary

Key Changes

  • 수정할 데이터를 담을 ReserveModifyReqeust 요청 클래스와 dto 클래스를 추가했습니다.
  • BoothReservation과 BoothReservationDetail 엔티티에 데이터를 수정하기 위한 update 메소드를 각각 추가했습니다.
  • 시간을 변경하기 위한 add 리스트와 delete 리스트를 이용해서 비어있는지 판별하게 구현했습니다.
  • 부스 태그 데이터 수정하는 것처럼 delete 수정은 id 값들을 리스트로 받아 제거하도록 했습니다.
  • 시간을 추가하기 전 existsByLinkedReservationAndTime 메소드를 repository에 추가해서 이미 존재하는 시간을 추가하는지 판별하게 했습니다. 이를 위해 ALREADY_RESERVED_TIME 에러 메세지를 추가했습니다.

Testing

테스트1 (날짜와 이름을 수정 할 경우)

📌 수정 전
image
📌 요청 값
image
📌 수정 후
image

테스트2 (시간을 수정할 경우)

📌 수정 전
image
📌 요청 값
image
📌 수정 후
image

To Reviewers

  • 질문이나 수정 사항 있으면 말씀해주세요!

@gitseoyeon gitseoyeon added the feature 기능 개발과 관련된 내용입니다. label Oct 22, 2024
@gitseoyeon gitseoyeon requested a review from muncool39 October 22, 2024 08:14
@gitseoyeon gitseoyeon self-assigned this Oct 22, 2024
Copy link
Member

@muncool39 muncool39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다! 수고하셨습니다 👍 몇가지 코멘트 남겼습니다!

Comment on lines +164 to +171
reservation.updateReservation(BoothReservationUpdateData.builder()
.name(request.name())
.description(request.description())
.image((request.image()!=null) ? s3Service.uploadFileAndGetUrl(request.image()):null)
.price(request.price())
.date(request.date())
.build()
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 수정할 경우 똑같은 서비스의 다른 날짜의 내용은 변경되지 않을 것 같은데 괜찮을까요?
예시 사진입니다!

image

전에 말씀드린 것처럼 아예 정보 엔티티를 분리해서 수정하거나 예약 생성 구현하신 것 처럼 전부 순환해 수정하는 방법이 있을 것 같네요! 😃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

똑같은 서비스의 다른날짜의 내용이 변경되지 않을 것 같다는 말씀이 한 요청에 다른 날짜들을 한번에 수정하는 경우를 말씀하신 걸까요??
제가 개발한 API는 수정하고자 하는 예약ID 하나씩 수정하는 방향으로 진행 되었습니다. 현재 프론트 사항을 보고 개발해본건데 참고 사진 올리겠습니다!
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

프론트에서 저렇게 구현했군요! 그런데 저 예약 날짜들을 생성할 때 같은 서비스로 묶고 싶어서 한번에 생성한 걸텐데 정작 보이는건 다른 서비스처럼 보여서 이상하긴 하네요 그럼 결국 서비스의 내용을 수정하는 것이 아니라 선택한 서비스를 그냥 다른 서비스로 분리하는 것처럼 될 것 같습니다.

만약 '아이스크림 만들기' 서비스의 설명을 수정하고 싶을 경우 지금처럼 구현한다면(프론트, 백 둘 다) 저기 있는 아이스크림 서비스의 날짜들을 일일히 선택해 수정해야 되니까 그 경우 안 좋을 것 같다는 의견이였습니다!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

프론트분들께도 말씀드리면 좋을 것 같은 내용이네요 사실 처음에 엔티티 나눴으면 됐는데 넘기다 보니 처리가 어렵게 된 느낌도 있는 것 같습니다 지금 뜯어 고치기에 시간이 걸릴 수 있으니 그냥 진행하는 방법도 있을 것 같아요! 하지만 발표 이후에라도 수정하면 좋을 것 같은 내용이네요 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그 부분은 추후 회의를 통해 조정해보겠습니다! 의견 감사합니다 👍🏻

Copy link
Member

@muncool39 muncool39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빠른 수정 확인했습니다! 추가하신 에러 코드 관련해서 의견 남겼습니다! 😀

@gitseoyeon
Copy link
Member Author

말씀해주신 사항을 참고해서 에러 코드와 메세지를 변경했습니다!

Copy link
Member

@muncool39 muncool39 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

변경 확인했습니다 수고하셨습니다! 😃 일단 승인했습니다! 위 내용은 다음 회의 때 얘기해보면 될 것 같네요~

@gitseoyeon gitseoyeon merged commit 5572454 into dev Nov 18, 2024
2 checks passed
@gitseoyeon gitseoyeon deleted the feat/#285 branch November 18, 2024 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 기능 개발과 관련된 내용입니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 예약 수정하는 API
2 participants