Feature/appointments time selection#41
Conversation
| [[appointment-create-normal]] | ||
| === 일반 예약 생성 | ||
|
|
||
| ==== HTTP Request | ||
|
|
||
| include::{snippets}/appointment-create/http-request.adoc[] | ||
| include::{snippets}/appointment-create-normal/http-request.adoc[] | ||
|
|
||
| ==== Request Fields | ||
|
|
||
| include::{snippets}/appointment-create-normal/request-fields.adoc[] | ||
|
|
||
| ==== HTTP Response | ||
|
|
||
| include::{snippets}/appointment-create-normal/http-response.adoc[] | ||
| include::{snippets}/appointment-create-normal/response-fields.adoc[] | ||
|
|
||
| [[appointment-create-special]] | ||
| === 섬세 예약 생성 | ||
|
|
||
| ==== HTTP Request | ||
|
|
||
| include::{snippets}/appointment-create-special/http-request.adoc[] |
There was a problem hiding this comment.
다른 doc 확인해서 포멧 맞춰주세요 ! (예: ==== Request Fields 이건 다 뺏습니다 !)
- api docs 결과물 확인하여 저희 입장이 아닌 프론트 입장에서 불필요하거나 더 필요한게 있는지 확인하는 작업도 하면 좋습니다 !
There was a problem hiding this comment.
==== Request Fields 지웠으나
==== Request Parts 부분은 참고할 부분이 없어 유지하겠습니다.
|
|
||
| public UUID createAppointment(AppointmentCreateRequest request, | ||
| MultipartFile requirementsImage) { | ||
| private AppointmentEntity createBaseAppointment(UUID requestShopId, UUID requestDesignerId, |
There was a problem hiding this comment.
private 함수는 일반적으로 public 함수들 밑으로 두는걸로 알고있습니다
| return createBaseAppointment(request.shopId(), request.designerId(), | ||
| request.appointmentDate(), request.appointmentTime(), request.serviceName()).getId(); | ||
| } | ||
|
|
||
| public UUID createSpecialAppointment(SpecialAppointmentCreateRequest request, | ||
| MultipartFile requirementsImage) { | ||
| AppointmentEntity appointment = createBaseAppointment(request.shopId(), request.designerId(), |
There was a problem hiding this comment.
request 다형성의 연장선으로 createBaseAppointment 함수에 request 통채로 보내는게 더 좋을 것 같습니다!
| import jakarta.validation.constraints.NotNull; | ||
|
|
||
| public record AppointmentCreateRequest( | ||
| public record SpecialAppointmentCreateRequest( |
There was a problem hiding this comment.
request 부분에서 다형성 이용해서 겹치는 필드는 implements 받아서 할 수 있겠죠 ?
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
|
|
||
| public record NormalAppointmentCreateRequest( |
There was a problem hiding this comment.
request 부분에서 다형성 이용해서 겹치는 필드는 implements 받아서 할 수 있겠죠 ?
| clientRepository.deleteAll(); | ||
| } | ||
|
|
||
| @DisplayName("헤어 예약 생성 시, appointmentId를 반환한다. (Client, DesignerShop 있음 + 이미지 없음)") |
There was a problem hiding this comment.
저는 main 서비스 테스트 (정상적인 flow의 테스트)를 먼저 올리고 그 밑에 예외 테스트를 작성하는게 보기 좋다고 생각합니다 ! 추가로 서비스 로직을 조금 손 봤을 때 테스트를 수정하지 않고(메인 로직) 정상 작동했다는건 테스트를 잘 역할하고 있구나 라고 알 수 있는 부분일 것 같습니다 :)
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
|
|
||
| public interface AppointmentBaseRequest { |
There was a problem hiding this comment.
고생하셨습니다 ! interface에서도 valid가 적용되나요 ?
No description provided.