Skip to content

[FEAT] 예약 생성 api 개발 (#286)#288

Merged
redblackblossom merged 16 commits intomainfrom
feat/#286/reservation_create
Feb 13, 2026
Merged

[FEAT] 예약 생성 api 개발 (#286)#288
redblackblossom merged 16 commits intomainfrom
feat/#286/reservation_create

Conversation

@redblackblossom
Copy link
Contributor

@redblackblossom redblackblossom commented Feb 13, 2026

📌 관련 이슈

✨ PR 세부 내용

주요 변경사항

  • POST /reservation 예약 생성 API 추가
  • ReservationService#createReservation 추가
  • ReservationFactory 도메인 서비스 추가
  • ReservationSpecification#activeReservationsOf 추가 (작가 + 날짜 + 활성 상태)
  • ReservationRepositoryJpaSpecificationExecutor 기반으로 구성
  • Program#ensureBookable 추가
  • PhotographerSchedule#ensureAvailable, getAvailableStartTimesAt 추가
  • Duration#addTo(LocalDateTime) 추가
  • ReservationTimeSlot 구조 변경
    • 기존: reservationDate + startTime + endTime
    • 변경: startDateTime + endDateTime
    • overlaps 기반 중복 검증 로직 추가
  • DomainErrorCodeNOT_FOUND, CONFLICT 추가
  • 예약 생성 요청/응답 DTO 추가

API

  • Endpoint: POST /reservation
  • Auth: @LoginModel (모델 권한 필요)
  • Request
    • programId (Long)
    • reservationDate (LocalDate)
    • startTime (LocalTime)
  • Response (201 Created)
    • reservationNumber (String)
    • amount (Long)
    • holdExpiresAt (LocalDateTime)

도메인 규칙

  • 삭제된 프로그램은 예약 불가
  • 작가 스케줄에 없는 시작 시간은 예약 불가
  • 동일 작가/동일 날짜 기준 PENDING, CONFIRMED 예약과 시간대가 겹치면 예약 불가
  • 예약 생성 시 holdExpiresAt = now + 15분

테스트

  • 추가/보강 테스트
    • Controller: 예약 생성/요청 검증/권한 검증
    • Service Integration: 성공/실패 시나리오
    • Domain: ReservationFactory, ReservationTimeSlot, Program, Duration, PhotographerSchedule
    • Repository: ReservationSpecification
  • 로컬 테스트는 실행하지 않았고 CI에서 검증 예정입니다.

Summary by CodeRabbit

  • 새로운 기능

    • 사진 프로그램 예약 생성 API 추가(예약번호·금액·보유만료 반환)
    • 예약 보유(15분 홀드) 및 DB에 대기(PENDING) 저장 처리
    • 포토그래퍼 가용성 검증과 예약 불가 시간 차단
    • 예약 시간대 겹침 자동 감지로 충돌 방지
    • 예약 시간 표현이 날짜+시간 단위로 정교화되어 시간 계산 정확도 향상
    • 삭제된 프로그램에 대한 예약 차단 및 명확한 오류 응답
  • 테스트

    • 예약 흐름, 시간대 충돌, 가용성, 경계 사례 등 단위·통합 테스트 대거 추가

@redblackblossom redblackblossom self-assigned this Feb 13, 2026
@redblackblossom redblackblossom linked an issue Feb 13, 2026 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

예약 생성 기능을 추가합니다. 애플리케이션 계층에서 Program·PhotographerSchedule 조회 후 ReservationFactory가 검증(프로그램/스케줄/중복)하여 Reservation을 생성하고 저장합니다. 시간 표현이 LocalDateTime 기반으로 변경되었습니다.

Changes

Cohort / File(s) Summary
도메인 유효성 및 VO 변경
reservation/src/main/java/.../program/domain/Program.java, reservation/src/main/java/.../program/domain/vo/Duration.java, reservation/src/main/java/.../reservation/domain/vo/ReservationTimeSlot.java
Program에 ensureBookable() 추가; Duration에 addTo(LocalDateTime) 추가; ReservationTimeSlot이 LocalDate/LocalTime 조합에서 LocalDateTime 기반으로 변경(생성자·검증·overlaps/contains/getReservationDate 등 추가)
스케줄 도메인 변경
reservation/src/main/java/.../schedule/domain/PhotographerSchedule.java
ensureAvailable(LocalDate, LocalTime, LocalDate)getAvailableStartTimesAt(LocalDate) 추가로 예약 가능성 검증 및 특정 날짜 사용 가능 시간 조회 도입(기존 isAvailableAt 대체)
예약 도메인 서비스 및 팩토리
reservation/src/main/java/.../reservation/domain/ReservationFactory.java, reservation/src/main/java/.../reservation/domain/Reservation.java
도메인 서비스 ReservationFactory 추가: program.ensureBookable(), schedule.ensureAvailable(), 기존 예약과의 겹침 검사(CONFLICT) 후 Reservation 생성; Reservation 주석(설명) 정리
애플리케이션 서비스 및 DTO
reservation/src/main/java/.../reservation/application/ReservationService.java, reservation/src/main/java/.../reservation/application/dto/request/ReservationCreateRequest.java, reservation/src/main/java/.../reservation/application/dto/response/ReservationCreateResponse.java
트랜잭션 createReservation 추가(프로그램·스케줄 조회, 활성 예약 조회, 홀드 만료 계산, 팩토리 호출) 및 요청/응답 DTO 추가
프레젠테이션 및 컨트롤러 테스트
reservation/src/main/java/.../reservation/presentation/ReservationController.java, reservation/src/test/java/.../reservation/presentation/ReservationControllerTest.java
POST /reservation 컨트롤러 추가 및 관련 단위/통합 테스트(인증·유효성·권한) 추가
저장소 및 스펙
reservation/src/main/java/.../reservation/infrastructure/repository/ReservationRepository.java, reservation/src/main/java/.../reservation/infrastructure/repository/ReservationSpecification.java, reservation/src/test/java/.../reservation/infrastructure/repository/ReservationSpecificationTest.java
Reservation용 JpaRepository 추가 및 photographer/date/active 기반 JPA Specification(activeReservationsOf) 추가 및 관련 테스트
에러 코드 확장
reservation/src/main/java/.../shared/domain/error/DomainErrorCode.java
도메인 에러 코드에 NOT_FOUND(ED001)CONFLICT(ED002) 추가
테스트·픽스처 업데이트
여러 테스트 파일 및 픽스처: reservation/src/test/java/.../program/..., reservation/src/test/java/.../reservation/..., reservation/src/test/java/.../schedule/...
Program/Duration/PhotographerSchedule 단위테스트 추가·수정, ReservationFactory/ReservationService 통합·단위 테스트 추가, ReservationFixture·ProgramFixture 업데이트( LocalDateTime 및 id 설정 )

Sequence Diagram

sequenceDiagram
    participant Client
    participant Controller as ReservationController
    participant Service as ReservationService
    participant ProgramRepo as ProgramRepository
    participant ScheduleRepo as PhotographerScheduleRepository
    participant ResRepo as ReservationRepository
    participant Factory as ReservationFactory
    participant Domain as DomainModels

    Client->>Controller: POST /reservation (programId, date, time)
    Controller->>Service: createReservation(modelId, request)
    Service->>ProgramRepo: findById(programId)
    ProgramRepo-->>Service: Program
    Service->>Domain: program.ensureBookable()
    Service->>ScheduleRepo: findByPhotographerId(...)
    ScheduleRepo-->>Service: PhotographerSchedule
    Service->>ResRepo: findAll(activeReservationsOf)
    ResRepo-->>Service: List<Reservation>
    Service->>Factory: create(modelId, program, schedule, existing, date, time, holdExpiresAt)
    Factory->>Domain: program.ensureBookable()
    Factory->>Domain: schedule.ensureAvailable(date, time, today)
    Factory->>Domain: timeSlot.overlaps(existing)
    Factory->>Domain: Reservation.hold(...)
    Factory-->>Service: Reservation
    Service->>ResRepo: save(reservation)
    Service-->>Controller: ReservationCreateResponse
    Controller-->>Client: 201 Created (reservationNumber, amount, holdExpiresAt)
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested Labels

✨feature

🚥 Pre-merge checks | ✅ 4 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Merge Conflict Detection ⚠️ Warning ⚠️ Unable to check for merge conflicts: Invalid branch name format
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 주요 변경 사항인 '예약 생성 API 개발'을 명확하게 요약하고 있으며 연관 이슈 번호를 포함하고 있습니다.
Description check ✅ Passed PR 설명은 템플릿의 필수 섹션(관련 이슈, PR 세부 내용)을 포함하고 있으며, 주요 변경사항, API 명세, 도메인 규칙, 테스트 범위를 상세히 기록하고 있습니다.
Linked Issues check ✅ Passed PR의 모든 변경사항이 연관 이슈 #286의 '예약 생성 API 개발' 목표를 충족합니다. API 엔드포인트, 도메인 검증, 도메인 서비스, 저장소 스펙, DTO, 테스트가 모두 이슈 요구사항에 부합합니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 예약 생성 API 개발 범위 내에 있습니다. 예약 관련 엔티티 구조 변경(ReservationTimeSlot), 도메인 서비스, 저장소, 컨트롤러 등이 API 기능 구현을 위해 필요한 필수적인 변경입니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#286/reservation_create
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch feat/#286/reservation_create
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 13, 2026

Test Results (reservation)

377 tests   377 ✅  9s ⏱️
 62 suites    0 💤
 62 files      0 ❌

Results for commit afbabc7.

♻️ This comment has been updated with latest results.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🤖 Fix all issues with AI agents
In
`@reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/application/dto/request/ReservationCreateRequest.java`:
- Around line 10-19: The request DTO ReservationCreateRequest currently only has
`@NotNull` for programId and reservationDate; add validation to reject negative
program IDs and past dates earlier by annotating the programId field with
`@Positive` and the reservationDate field with `@FutureOrPresent`, and add the
corresponding imports (javax.validation.constraints.Positive and
javax.validation.constraints.FutureOrPresent) so validation triggers in the
presentation layer; keep the existing `@NotNull` annotations and no other
signature changes to the ReservationCreateRequest record.

In
`@reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/application/ReservationService.java`:
- Around line 51-86: The createReservation method has a TOCTOU race between
reservationRepository.findAll(activeReservationsOf(...)) and
reservationRepository.save(...) that can allow double-booking; update this
method to address concurrency by either (a) using a pessimistic lock when
loading the photographer's schedule or reservations (e.g., replace the
findByPhotographerId / findAll calls with repository methods that perform SELECT
... FOR UPDATE on PhotographerSchedule or reservations for that photographer),
or (b) enforce a DB-level unique constraint on photographer+timeslot (and handle
unique-constraint violations by translating to a DomainException and retrying if
desired), or (c) implement optimistic locking with retries; if you cannot
implement a full fix now, add a clear TODO comment in createReservation
referencing reservationRepository.findAll(activeReservationsOf(...)) and
reservationRepository.save(...) that states concurrency handling
(pessimistic/unique-constraint/optimistic) must be implemented before
production.
- Around line 38-49: Replace the direct instantiation of ReservationFactory
inside ReservationService with constructor injection: add a ReservationFactory
parameter to the ReservationService constructor and assign it to
this.reservationFactory (remove new ReservationFactory()), and ensure
ReservationFactory is provided as a Spring bean (e.g., annotate
ReservationFactory or configure it in a `@Configuration`) so tests can mock or
inject a test double for ReservationFactory when constructing ReservationService
in unit tests.

In
`@reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/infrastructure/repository/ReservationSpecification.java`:
- Around line 53-64: onDate currently only checks Reservation_.timeSlot ->
ReservationTimeSlot_.startDateTime against the day's range so reservations that
start before midnight and end during the target date are missed; update the
Specification onDate(LocalDate) to detect any time-slot overlap with the day by
checking ReservationTimeSlot_.endDateTime as well (e.g., include predicates for
endDateTime within the day and/or a general overlap check: start <= dayEnd AND
end >= dayStart) and combine these with cb.or/cb.and so all reservations
spanning midnight are returned.

In
`@reservation/src/main/java/net/catsnap/CatsnapReservation/schedule/domain/PhotographerSchedule.java`:
- Around line 142-146: ensureAvailable currently only checks
getAvailableStartTimesAt(date) and misses rejecting past dates; update
PhotographerSchedule.ensureAvailable(LocalDate date, LocalTime startTime) to
first verify the date is not in the past (same logic used by isAvailableAt) and
throw DomainException(DomainErrorCode.DOMAIN_CONSTRAINT_VIOLATION, "해당 시간대는 예약할
수 없습니다.") when date.isBefore(LocalDate.now()) so ensureAvailable and
isAvailableAt behave consistently for past dates before checking startTime in
getAvailableStartTimesAt(date).

In
`@reservation/src/test/java/net/catsnap/CatsnapReservation/program/domain/ProgramTest.java`:
- Around line 147-155: The test uses a fully-qualified call to
org.assertj.core.api.Assertions.assertThatCode instead of the static import used
for other assertion helpers; add a static import for assertThatCode at the top
of ProgramTest (where other static imports like assertThat/assertThatThrownBy
live) and replace the fully-qualified invocation in the
활성_프로그램은_ensureBookable이_성공한다 test so it calls
assertThatCode(program::ensureBookable) to match the file's import style and
consistency for the ensureBookable assertion.

In
`@reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/application/ReservationServiceIntegrationTest.java`:
- Around line 53-58: The `@AfterEach` cleanup method (cleanup calling
reservationRepository.deleteAll(), programRepository.deleteAll(),
photographerScheduleRepository.deleteAll()) is redundant for tests annotated
with `@Transactional`; either remove the cleanup method and rely on transactional
rollback for those tests, or move `@Transactional` to the class level
(ReservationServiceIntegrationTest) and then delete the `@AfterEach` cleanup to
avoid duplicate teardown for all tests while keeping non-transactional tests
adjusted as needed (e.g., convert them to transactional or add targeted cleanup
only for those specific tests).

In
`@reservation/src/test/java/net/catsnap/CatsnapReservation/schedule/domain/PhotographerScheduleTest.java`:
- Around line 168-194: Add a test that verifies exception-rules override weekday
rules for PhotographerSchedule.ensureAvailable: create a schedule via
PhotographerSchedule.initSchedule(...), set a weekday rule with
AvailableStartTimes containing 10:00 using updateWeekdayRule(...), then set an
exception/day-off rule for the specific targetDate (use the project’s exception
rule API—e.g., updateExceptionRule or equivalent) that either marks the date as
day-off or only exposes 14:00, and finally call ensureAvailable(targetDate,
LocalTime.of(10,0)) asserting that it throws DomainException via
assertThatThrownBy(...). Ensure the new test mirrors the isAvailableAt override
scenario but uses ensureAvailable and references ensureAvailable,
PhotographerSchedule, updateWeekdayRule, and DomainException.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

예약 생성 기능을 위해 POST /reservation API를 추가하고, 예약 가능 여부(프로그램/스케줄/기존 예약 겹침) 검증을 도메인 서비스로 분리하여 예약 생성 플로우를 완성하는 PR입니다.

Changes:

  • POST /reservation 예약 생성 API(Controller/Service/DTO) 추가
  • 예약 시간대 VO를 startDateTime/endDateTime 기반으로 리팩터링하고 overlaps로 중복 검증 도입
  • 예약 조회용 Specification/Repository(JpaSpecificationExecutor) 구성 및 관련 테스트 보강

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
reservation/src/test/java/net/catsnap/CatsnapReservation/schedule/domain/PhotographerScheduleTest.java 스케줄 가용성 검증/가용 시간 조회 테스트 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/presentation/ReservationControllerTest.java 예약 생성 API 컨트롤러 요청/권한/검증 테스트 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/infrastructure/repository/ReservationSpecificationTest.java 활성 예약 조회 Specification 테스트 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/fixture/ReservationFixture.java 시간대 구조 변경(LocalDateTime 기반)에 맞춰 픽스처 수정
reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/domain/vo/ReservationTimeSlotTest.java timeSlot 구조 변경 및 overlaps 테스트 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/domain/ReservationFactoryTest.java 도메인 팩토리(예약 생성 규칙) 테스트 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/application/ReservationServiceIntegrationTest.java 예약 생성 서비스 통합 테스트 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/program/fixture/ProgramFixture.java id 주입 가능한 Program fixture 메서드 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/program/domain/vo/DurationTest.java Duration.addTo(LocalDateTime) 테스트 추가
reservation/src/test/java/net/catsnap/CatsnapReservation/program/domain/ProgramTest.java Program.ensureBookable 테스트 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/shared/domain/error/DomainErrorCode.java NOT_FOUND/CONFLICT 에러코드 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/schedule/domain/PhotographerSchedule.java ensureAvailable, getAvailableStartTimesAt 추가 및 isAvailableAt 개선
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/presentation/ReservationController.java 예약 생성 API 컨트롤러 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/infrastructure/repository/ReservationSpecification.java 활성 예약 조회용 Specification 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/infrastructure/repository/ReservationRepository.java JpaSpecificationExecutor 기반 Repository 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/domain/vo/ReservationTimeSlot.java 시간대 VO를 LocalDateTime 기반으로 변경 + overlaps 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/domain/ReservationFactory.java 예약 생성 도메인 서비스(팩토리) 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/domain/Reservation.java timeSlot 설명 주석 업데이트
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/application/dto/response/ReservationCreateResponse.java 예약 생성 응답 DTO 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/application/dto/request/ReservationCreateRequest.java 예약 생성 요청 DTO 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/application/ReservationService.java 예약 생성 애플리케이션 서비스 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/program/domain/vo/Duration.java Duration.addTo(LocalDateTime) 추가
reservation/src/main/java/net/catsnap/CatsnapReservation/program/domain/Program.java Program.ensureBookable 추가

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Fix all issues with AI agents
In
`@reservation/src/main/java/net/catsnap/CatsnapReservation/schedule/domain/PhotographerSchedule.java`:
- Around line 142-145: ensureAvailable currently calls LocalDate.now() directly
(same pattern in cleanupPastOverrides), which hinders testability; change
ensureAvailable(LocalDate date, LocalTime startTime) to accept a reference date
(e.g., LocalDate today) or a Clock parameter so the method compares against the
injected date/clock instead of LocalDate.now(), and update callers (and
cleanupPastOverrides) to pass in the current date/clock from the service layer;
ensure you update method signatures and all usages of
PhotographerSchedule.ensureAvailable and
PhotographerSchedule.cleanupPastOverrides to use the new parameter so tests can
supply deterministic dates.

In
`@reservation/src/test/java/net/catsnap/CatsnapReservation/reservation/application/ReservationServiceIntegrationTest.java`:
- Around line 196-211: Test uses a past date so it triggers the "past date"
validation instead of the intended "time slot unavailable" path; change the test
data to a future date (e.g., use LocalDate.now().plusDays(1) or a hardcoded
future year) in the test method 예약_불가능한_시간대이면_예외가_발생한다(), keep saveProgram(),
saveSchedule(date, LocalTime.of(10, 0)) and the
ReservationCreateRequest(program.getId(), date, LocalTime.of(14, 0)) logic the
same, and then assert reservationService.createReservation(MODEL_ID, request)
throws DomainException with message "해당 시간대는 예약할 수 없습니다".
- Around line 213-231: The test 기존_예약과_시간이_겹치면_예외가_발생한다() uses a hard-coded past
date (LocalDate.of(2025, 6, 16)) causing the first
reservationService.createReservation(MODEL_ID, request) to fail with a past-date
validation before the duplicate check; update the test to use a future date
(e.g., LocalDate.now().plusDays(1) or another date guaranteed to be after today)
when calling saveSchedule(...) and constructing ReservationCreateRequest so the
first reservation succeeds and the duplicate-time assertion can run.
- Around line 78-94: The tests in ReservationServiceIntegrationTest use a
hardcoded past date (LocalDate.of(2025,6,16)) which now fails because
PhotographerSchedule.ensureAvailable rejects past dates; replace every
occurrence in this file with a dynamically computed future date (e.g., a
FUTURE_DATE constant or LocalDate.now().plusDays(N) that falls on the same
weekday your saveSchedule expects) and update any assertions that validate
startDateTime/endDateTime (e.g., in 생성된_예약이_DB에_PENDING_상태로_저장된다) to compute
expected datetimes from that same FUTURE_DATE so the schedule setup
(saveSchedule) and ReservationService.createReservation still align. Ensure
references to saveSchedule, ReservationServiceIntegrationTest, and
PhotographerSchedule.ensureAvailable are used to locate and adjust all affected
tests.

In
`@reservation/src/test/java/net/catsnap/CatsnapReservation/schedule/domain/PhotographerScheduleTest.java`:
- Around line 196-209: Add a boundary test that verifies today is allowed:
create a new test (e.g., 오늘_날짜는_예약_가능하다) that initializes PhotographerSchedule
via PhotographerSchedule.initSchedule(1L), obtains LocalDate today =
LocalDate.now(), gets DayOfWeek today.getDayOfWeek(), sets an available time
with schedule.updateWeekdayRule(dayOfWeek,
AvailableStartTimes.of(List.of(LocalTime.of(10,0)))), then call
schedule.ensureAvailable(today, LocalTime.of(10,0)) and assert it does not throw
(use assertDoesNotThrow or equivalent) to confirm ensureAvailable accepts today.

@codecov
Copy link

codecov bot commented Feb 13, 2026

Codecov Report

❌ Patch coverage is 96.87500% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ion/reservation/domain/vo/ReservationTimeSlot.java 90.47% 1 Missing and 1 partial ⚠️
...ervation/schedule/domain/PhotographerSchedule.java 85.71% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@reservation/src/main/java/net/catsnap/CatsnapReservation/reservation/application/ReservationService.java`:
- Around line 67-68: The code in ReservationService calls LocalDate.now(clock)
and LocalDateTime.now(clock) separately which can yield inconsistent values
around midnight; instead capture a single LocalDateTime snapshot (e.g., now =
LocalDateTime.now(clock)) and derive both today = now.toLocalDate() and
holdExpiresAt = now.plusMinutes(HOLD_MINUTES) so both are based on the same
instant; update usages that reference today and holdExpiresAt accordingly.

@redblackblossom redblackblossom merged commit 604213d into main Feb 13, 2026
11 checks passed
@redblackblossom redblackblossom deleted the feat/#286/reservation_create branch February 13, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 예약을 생성하는 API 개발

2 participants