Skip to content

Conversation

@toychip
Copy link
Member

@toychip toychip commented Jul 18, 2025

요약

  • AI 기반 추천 제거 및 도메인 알고리즘 적용
  • API, 클라이언트, 컨트롤러, DTO 전반 수정

작업 내용

  • AI 모델 관련 코드·엔드포인트 삭제
  • SandwichCalculator 구현 추가
  • getSandwich 시그니처 및 DTO 매핑 변경
  • printlnlogger, retry 30회, 보안 설정 조정

리뷰 포인트

  • 알고리즘 정확성
  • API/DTO 호환

Summary by CodeRabbit

  • 신규 기능

    • 휴가 추천(샌드위치 휴가) 계산 로직이 내부 서비스로 전환되어, 외부 의존성 없이 추천 결과를 제공합니다.
  • 기능 개선

    • 샌드위치 휴가 추천 API가 더 이상 사용자 ID 등 개인 정보를 요구하지 않으며, 실제 데이터 기반으로 결과를 반환합니다.
    • 샌드위치 휴가 추천 관련 응답 형식이 단순화되고 명확해졌습니다.
  • 버그 수정

    • 샌드위치 휴가 추천 요청 시 재시도 횟수가 10회에서 30회로 증가하여, 실패 시 더 안정적으로 동작합니다.
  • 기타

    • 불필요한 모델 및 API 코드가 정리되어 코드가 간결해졌습니다.

@toychip toychip requested a review from mkSpace as a code owner July 18, 2025 08:18
@coderabbitai
Copy link

coderabbitai bot commented Jul 18, 2025

Walkthrough

이 변경은 기존의 샌드위치 휴가 추천 기능에서 외부 MCP 클라이언트 호출 및 관련 데이터 클래스를 제거하고, 내부적으로 SandwichCalculator를 사용하여 샌드위치 휴가 추천을 계산하도록 서비스 및 컨트롤러를 대폭 리팩토링합니다. 이에 따라 API 시그니처, 데이터 모델, 의존성, 내부 로직이 일관되게 수정되었습니다.

Changes

파일/경로 그룹 변경 요약
.../client-mcp/recommend/RecommendApi.kt
.../client-mcp/recommend/RecommendClient.kt
.../client-mcp/recommend/model/Sandwich.kt
getSandwich 메서드 및 관련 데이터 클래스(SandwichRequest, BridgeVacationPeriod 등) 삭제
.../core-api/controller/v1/RecommendController.kt
.../core-api/controller/v1/docs/RecommendControllerDocs.kt
.../core-api/controller/v1/response/SandwichResponse.kt
컨트롤러 및 문서화 인터페이스에서 getSandwich 시그니처 변경(사용자 ID 제거), 응답 모델 신규 정의 및 적용
.../core-api/controller/TempController.kt 생성자에 recommendService 의존성 주입 추가
.../core-api/domain/recommend/RecommendService.kt
.../core-api/domain/recommend/RecommendServiceImpl.kt
서비스 인터페이스 및 구현에서 getSandwich 시그니처 변경(사용자 ID 제거), 외부 호출 제거, 내부 계산 적용
.../core-domain/sandwich/Sandwich.kt
.../core-domain/sandwich/SandwichCalculator.kt
샌드위치 휴가 계산기 및 관련 데이터 클래스(Sandwich) 신규 추가
.../mcp-host/controller/request/SandwichRequest.kt SandwichRequest에서 birthDay, remainingAnnualLeave 필드 제거
.../mcp-host/service/ChatbotService.kt getSandwich 함수의 재시도 횟수 10회 → 30회로 증가, 관련 로그 및 예외 메시지 수정

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant RecommendController
    participant RecommendServiceImpl
    participant SandwichCalculator

    Client->>RecommendController: GET /getSandwich
    RecommendController->>RecommendServiceImpl: getSandwich()
    RecommendServiceImpl->>SandwichCalculator: recommendSandwich(holidays, weekends, ...)
    SandwichCalculator-->>RecommendServiceImpl: List<Sandwich>
    RecommendServiceImpl-->>RecommendController: SandwichApiResponse
    RecommendController-->>Client: ApiResponse<SandwichApiResponse>
Loading

Possibly related PRs

  • #45: 외부 MCP 클라이언트 호출 및 관련 데이터 클래스 추가와 본 PR의 제거/내부화가 정반대 관계임.
  • #67: getSandwich 메서드와 관련 클래스의 외부 클라이언트 호출 추가와 본 PR의 내부 계산 방식 전환이 충돌 관계임.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91945d9 and 9b82c59.

📒 Files selected for processing (1)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/TempController.kt (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/TempController.kt
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 4

🧹 Nitpick comments (1)
noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/sandwich/Sandwich.kt (1)

5-5: 간단하고 명확한 도메인 모델입니다.

날짜 범위를 나타내는 간단한 데이터 클래스로 적절하게 구현되었습니다. 필요시 시작일이 종료일보다 앞서야 한다는 비즈니스 규칙을 추가하는 것을 고려해볼 수 있습니다.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eeaad38 and 91945d9.

📒 Files selected for processing (14)
  • noweekend-clients/client-mcp/src/main/kotlin/noweekend/client/mcp/recommend/RecommendApi.kt (0 hunks)
  • noweekend-clients/client-mcp/src/main/kotlin/noweekend/client/mcp/recommend/RecommendClient.kt (0 hunks)
  • noweekend-clients/client-mcp/src/main/kotlin/noweekend/client/mcp/recommend/model/Sandwich.kt (0 hunks)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/api/config/SecurityConfig.kt (1 hunks)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/TempController.kt (3 hunks)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/RecommendController.kt (2 hunks)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/docs/RecommendControllerDocs.kt (2 hunks)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/response/SandwichResponse.kt (1 hunks)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/recommend/RecommendService.kt (1 hunks)
  • noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/recommend/RecommendServiceImpl.kt (4 hunks)
  • noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/sandwich/Sandwich.kt (1 hunks)
  • noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/sandwich/SandwichCalculator.kt (1 hunks)
  • noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/controller/request/SandwichRequest.kt (0 hunks)
  • noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/service/ChatbotService.kt (2 hunks)
💤 Files with no reviewable changes (4)
  • noweekend-clients/client-mcp/src/main/kotlin/noweekend/client/mcp/recommend/RecommendApi.kt
  • noweekend-clients/client-mcp/src/main/kotlin/noweekend/client/mcp/recommend/model/Sandwich.kt
  • noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/controller/request/SandwichRequest.kt
  • noweekend-clients/client-mcp/src/main/kotlin/noweekend/client/mcp/recommend/RecommendClient.kt
🔇 Additional comments (12)
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/config/SecurityConfig.kt (1)

33-33: 개발 환경에서의 샌드위치 엔드포인트 허용 설정이 적절합니다.

개발 환경에서만 /sandwich 경로를 허용하여 테스트와 개발 워크플로우를 지원하는 설정이 보안 측면에서 적절합니다.

noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/service/ChatbotService.kt (2)

337-337: 로그 메시지가 일관되게 업데이트되었습니다.

재시도 횟수 변경에 따른 로그 메시지 업데이트가 적절합니다.


340-340: 예외 메시지가 일관되게 업데이트되었습니다.

재시도 횟수 변경에 따른 예외 메시지 업데이트가 적절합니다.

noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/recommend/RecommendService.kt (2)

5-5: 임포트 경로가 올바르게 업데이트되었습니다.

외부 클라이언트 모델에서 내부 응답 패키지로 임포트가 변경되어 아키텍처 개선과 일치합니다.


13-13: 구현체 및 컨트롤러에서 getSandwich 시그니처 일관 적용 확인됨

RecommendService 인터페이스 변경 사항이 RecommendServiceImpl.ktRecommendController.kt에 모두 반영되어, getSandwich() 메서드가 파라미터 없이 일관되게 호출되고 있습니다. 추가 수정은 필요 없어 보입니다.

noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/docs/RecommendControllerDocs.kt (1)

11-11: 임포트 경로가 올바르게 업데이트되었습니다.

외부 클라이언트 모델에서 내부 응답 패키지로 임포트가 변경되어 아키텍처 개선과 일치합니다.

noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/response/SandwichResponse.kt (1)

1-14: DTO 구조가 명확하고 적절합니다!

휴가 추천 응답을 위한 데이터 클래스가 깔끔하게 구현되었습니다.

noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/TempController.kt (1)

49-53: 샌드위치 추천 엔드포인트가 잘 구현되었습니다.

RecommendService를 통해 추천 결과를 반환하는 구조가 적절합니다.

이 엔드포인트가 인증 없이 접근 가능한 점을 확인해주세요. TempController가 임시 컨트롤러라고 해도 보안 관점에서 검토가 필요할 수 있습니다.

noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/RecommendController.kt (1)

50-54: 사용자 ID 의존성이 성공적으로 제거되었습니다.

기존의 하드코딩된 mock 응답이 제거되고 서비스 레이어를 직접 호출하는 구조로 개선되었습니다.

noweekend-core/core-api/src/main/kotlin/noweekend/core/domain/recommend/RecommendServiceImpl.kt (2)

52-52: SandwichCalculator 의존성 주입이 적절합니다.

생성자 주입을 통해 calculator가 올바르게 주입되었습니다.


211-248: 샌드위치 휴가 추천 로직이 잘 구현되었습니다.

AI 기반 추천에서 도메인 특화 알고리즘으로의 전환이 성공적으로 이루어졌습니다. 특히:

  • 공휴일과 주말 데이터를 활용한 계산 로직이 명확합니다
  • 연차 사용일 계산이 공휴일과 주말을 제외하고 정확히 수행됩니다
  • 전체 휴가 일수 계산에 inclusive 방식(+1)이 올바르게 적용되었습니다
noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/sandwich/SandwichCalculator.kt (1)

15-108: Sandwich 추천 알고리즘 및 30회 재시도 로직 확인 완료

알고리즘 구현이 복잡하지만 논리적으로 타당합니다.

  • 공휴일 전후 갭을 고려한 후보 날짜 생성
  • 최소 기간 및 최대 갭 제약 검증
  • 중복 기간 그룹화 및 랜덤 선택
  • PR 설명에 언급된 30회 재시도 메커니즘은
    noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/service/ChatbotService.kt
    repeat(30) { … println("getSandwich retry ${attempt + 1}/30") … } 블록에서 이미 구현되어 있습니다.

위 사항 확인되었으므로 추가 수정은 필요 없습니다.


var lastException: Throwable? = null
repeat(10) { attempt ->
repeat(30) { attempt ->
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

재시도 횟수가 과도하고 백오프 전략이 없습니다.

30번의 재시도는 과도할 수 있으며, 연속적인 실패 시 리소스 낭비가 발생할 수 있습니다. 백오프 전략을 추가하는 것을 권장합니다.

다음과 같이 백오프 전략을 추가하는 것을 고려해보세요:

+val backoff = listOf(1000L, 2000L, 4000L, 8000L, 16000L)
 repeat(30) { attempt ->
     try {
         // ... 기존 로직 ...
     } catch (e: Throwable) {
         lastException = e
         println("getSandwich retry ${attempt + 1}/30: ${e.message}")
+        if (attempt < 29) {
+            Thread.sleep(backoff.getOrElse(attempt) { backoff.last() })
+        }
     }
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
repeat(30) { attempt ->
// simple exponential backoff delays (in milliseconds)
val backoff = listOf(1000L, 2000L, 4000L, 8000L, 16000L)
repeat(30) { attempt ->
try {
// ... 기존 로직 ...
} catch (e: Throwable) {
lastException = e
println("getSandwich retry ${attempt + 1}/30: ${e.message}")
if (attempt < 29) {
// delay before next retry
Thread.sleep(backoff.getOrElse(attempt) { backoff.last() })
}
}
}
🤖 Prompt for AI Agents
In
noweekend-mcp/mcp-host/src/main/kotlin/noweekend/mcphost/service/ChatbotService.kt
at line 310, the current retry loop repeats 30 times without any backoff
strategy, which can lead to resource waste on continuous failures. Modify the
retry logic to include an exponential backoff delay between attempts, increasing
the wait time progressively after each failure to reduce resource strain and
improve stability.

fun getSandwich(
@Parameter(hidden = true) @CurrentUserId userId: String,
): ApiResponse<SandwichApiResponse>
fun getSandwich(): ApiResponse<SandwichApiResponse>
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

메서드 시그니처 변경이 적절하지만 문서화 내용과 불일치합니다.

userId 파라미터가 제거된 것은 내부 계산 로직으로의 변경과 일치하지만, 문서화 내용에서 여전히 "유저의 남은 연차"를 언급하고 있어 실제 구현과 일치하지 않습니다.

문서화 내용을 실제 구현에 맞게 수정하세요:

@Operation(
-    summary = "유저의 남은 연차와 올해 남은 공휴일/주말로 샌드위치 휴가(bridge vacation) 추천",
+    summary = "올해 남은 공휴일/주말로 샌드위치 휴가(bridge vacation) 추천",
    description = """
-유저의 남은 연차, 올해 남은 공휴일/주말을 바탕으로, 연속으로 쉴 수 있는 휴가(샌드위치 휴가) 구간을 추천합니다.
+올해 남은 공휴일/주말을 바탕으로, 연속으로 쉴 수 있는 휴가(샌드위치 휴가) 구간을 추천합니다.
각 휴가 구간별 실제 사용 연차 일수와 전체 휴가 일수도 반환됩니다.
""",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fun getSandwich(): ApiResponse<SandwichApiResponse>
@Operation(
- summary = "유저의 남은 연차와 올해 남은 공휴일/주말로 샌드위치 휴가(bridge vacation) 추천",
+ summary = "올해 남은 공휴일/주말로 샌드위치 휴가(bridge vacation) 추천",
- description = """
-유저의 남은 연차, 올해 남은 공휴일/주말을 바탕으로, 연속으로 쉴 수 있는 휴가(샌드위치 휴가) 구간을 추천합니다.
+ description = """
+올해 남은 공휴일/주말을 바탕으로, 연속으로 쉴 수 있는 휴가(샌드위치 휴가) 구간을 추천합니다.
+각 휴가 구간별 실제 사용 연차 일수와 전체 휴가 일수도 반환됩니다.
""",
)
fun getSandwich(): ApiResponse<SandwichApiResponse>
🤖 Prompt for AI Agents
In
noweekend-core/core-api/src/main/kotlin/noweekend/core/api/controller/v1/docs/RecommendControllerDocs.kt
at line 323, the method signature for getSandwich no longer includes the userId
parameter, but the documentation still references "user's remaining annual
leave." Update the documentation to remove any mention of userId or
user-specific data and align the description with the current implementation
that does not require user identification.

Comment on lines +129 to +181
private fun extendPeriod(
startDate: LocalDate,
holidays: Set<LocalDate>,
weekends: Set<LocalDate>,
globalMaxGap: Int,
until: LocalDate,
specials: List<LocalDate>,
): Sandwich {
val isPreGapStart = startDate !in holidays && startDate !in weekends

var gapCount = 0
var contigCount = 0
var lastWasGap = false

var current = startDate
var endDate = startDate

while (!current.isAfter(until)) {
val isHoliday = current in holidays
val isWeekend = current in weekends

if (isHoliday || isWeekend) {
// reset gap, increment contiguous holiday/weekend count
contigCount = if (lastWasGap) 1 else contigCount + 1
gapCount = 0
lastWasGap = false
endDate = current
} else {
if (!lastWasGap) gapCount = 0
gapCount++

val currentGapMax = when {
contigCount >= 3 && isPreGapStart -> 0
contigCount >= 3 -> 1
else -> globalMaxGap
}
if (gapCount > currentGapMax) break

if (contigCount < 3) {
val nextSpecial = specials.firstOrNull { it > current }
val window = (currentGapMax - gapCount + 1).toLong()
if (nextSpecial == null || nextSpecial.isAfter(current.plusDays(window))) {
break
}
}

lastWasGap = true
endDate = current
}
current = current.plusDays(1)
}
return Sandwich(startDate, endDate)
}
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

extendPeriod 메서드의 복잡한 로직에 주석 추가를 권장합니다.

이 메서드는 휴가 기간을 확장하는 핵심 로직을 담고 있지만, 특히 lines 160-164의 조건부 갭 최대값 설정 부분이 이해하기 어렵습니다.

                 val currentGapMax = when {
+                    // 3일 이상 연속 휴일 블록 + pre-gap 시작인 경우: 추가 갭 허용 안 함
                     contigCount >= 3 && isPreGapStart -> 0
+                    // 3일 이상 연속 휴일 블록인 경우: 1일 갭만 허용
                     contigCount >= 3 -> 1
+                    // 그 외의 경우: 전역 최대 갭 허용
                     else -> globalMaxGap
                 }
🤖 Prompt for AI Agents
In
noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/sandwich/SandwichCalculator.kt
between lines 129 and 181, the extendPeriod method contains complex logic,
especially around lines 160-164 where the conditional setting of currentGapMax
occurs. Add clear, concise comments explaining the purpose of each condition in
this section and the overall intent of the gap counting and contiguous count
logic to improve code readability and maintainability.

Comment on lines +76 to +105
holidays.forEach { holiday ->
print(holiday)
print(" ")
}
logger.info("")
logger.info("=========================== HOLIDAY ===========================")

logger.info("=========================== WEEKEND ===========================")
weekends.forEach { weekend ->
print(weekend)
print(" ")
}
logger.info("")
logger.info("=========================== WEEKEND ===========================")
logger.info("")
logger.info("=========================== rawPeriods ===========================")
rawPeriods.forEach {
print(it.startDate)
print(" ~ ")
logger.info(it.endDate.toString())
}
logger.info("=========================== rawPeriods ===========================")

logger.info("=========================== response ===========================")
response.forEach {
print(it.startDate)
print(" ~ ")
logger.info(it.endDate.toString())
}
logger.info("=========================== response ===========================")
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

로깅 구현을 개선해야 합니다.

print() 문을 사용하는 대신 일관되게 logger를 사용해야 합니다. 현재 구현은 로그 출력이 분산되어 관리가 어렵습니다.

-        logger.info("=========================== HOLIDAY ===========================")
-        holidays.forEach { holiday ->
-            print(holiday)
-            print(" ")
-        }
-        logger.info("")
-        logger.info("=========================== HOLIDAY ===========================")
+        logger.info("=========================== HOLIDAY ===========================")
+        logger.info("Holidays: ${holidays.joinToString(", ")}")
+        logger.info("=========================== HOLIDAY ===========================")

-        logger.info("=========================== WEEKEND ===========================")
-        weekends.forEach { weekend ->
-            print(weekend)
-            print(" ")
-        }
-        logger.info("")
-        logger.info("=========================== WEEKEND ===========================")
+        logger.info("=========================== WEEKEND ===========================")
+        logger.info("Weekends: ${weekends.joinToString(", ")}")
+        logger.info("=========================== WEEKEND ===========================")

-        logger.info("")
-        logger.info("=========================== rawPeriods ===========================")
-        rawPeriods.forEach {
-            print(it.startDate)
-            print("     ~    ")
-            logger.info(it.endDate.toString())
-        }
-        logger.info("=========================== rawPeriods ===========================")
+        logger.info("=========================== rawPeriods ===========================")
+        rawPeriods.forEach {
+            logger.info("${it.startDate} ~ ${it.endDate}")
+        }
+        logger.info("=========================== rawPeriods ===========================")

-        logger.info("=========================== response ===========================")
-        response.forEach {
-            print(it.startDate)
-            print("     ~    ")
-            logger.info(it.endDate.toString())
-        }
-        logger.info("=========================== response ===========================")
+        logger.info("=========================== response ===========================")
+        response.forEach {
+            logger.info("${it.startDate} ~ ${it.endDate}")
+        }
+        logger.info("=========================== response ===========================")

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
noweekend-core/core-domain/src/main/kotlin/noweekend/core/domain/sandwich/SandwichCalculator.kt
between lines 76 and 105, replace all print() statements with appropriate
logger.info() calls to ensure consistent and centralized logging. This means
converting each print(holiday) and print(" ") to logger.info() with properly
formatted messages, and similarly for weekends, rawPeriods, and response
iterations, so all output is managed through the logger instead of standard
output.

@toychip toychip merged commit dd75686 into develop Jul 18, 2025
2 checks passed
@toychip toychip deleted the feat/sandwich-caching branch July 18, 2025 08:25
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.

2 participants