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

πŸ”€ :: (#224) - standard λΆ€λΆ„ λ„€νŠΈμ›Œν¬ μ„ΈνŒ…μ„ ν–ˆμŠ΅λ‹ˆλ‹€. #225

Merged
merged 9 commits into from
Nov 30, 2024

Conversation

audgns10
Copy link
Member

@audgns10 audgns10 commented Nov 30, 2024

πŸ’‘ κ°œμš”

  • κΈ°λŠ₯ κ°œλ°œμ„ ν•˜κΈ° μœ„ν•΄μ„œλŠ” standard λΆ€λΆ„ λ„€νŠΈμ›Œν¬ μ„ΈνŒ…μ΄ ν•„μš”ν•΄λ³΄μ˜€μŠ΅λ‹ˆλ‹€.

πŸ“ƒ μž‘μ—…λ‚΄μš©

  • standard λΆ€λΆ„ λ„€νŠΈμ›Œν¬ μ„ΈνŒ…μ„ ν–ˆμŠ΅λ‹ˆλ‹€.
    • add Standard DTO
    • add Standard Model, Entity
    • add Standard Mapper
    • chore NetworkModule
    • add StandardDataSource(Impl)
    • chore RemoteDataSourceModule
    • add StandardRepository(Impl)
    • chore RepositoryModule
    • add StandardUseCase
    • add StandardUiState
    • chore ExpoViewModel

πŸ”€ 변경사항

스크란샷 2024-12-01 α„‹α…©α„Œα…₯ᆫ 12 48 34

πŸ™‹β€β™‚οΈ μ§ˆλ¬Έμ‚¬ν•­

  • κ°œμ„ ν•  점, μ˜€νƒ€, μ½”λ“œμ— μ΄μƒν•œ 뢀뢄이 μžˆλ‹€λ©΄ Comment λ‹¬μ•„μ£Όμ„Έμš”.

🍴 μ‚¬μš©λ°©λ²•

  • x

🎸 기타

  • x

Summary by CodeRabbit

  • μƒˆλ‘œμš΄ κΈ°λŠ₯
    • ν‘œμ€€ ν”„λ‘œκ·Έλž¨ 등둝 및 관리 κΈ°λŠ₯을 μœ„ν•œ μƒˆλ‘œμš΄ μΈν„°νŽ˜μ΄μŠ€ 및 데이터 λͺ¨λΈ μΆ”κ°€.
    • ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘μ„ λ“±λ‘ν•˜λŠ” κΈ°λŠ₯을 μ§€μ›ν•˜λŠ” μƒˆλ‘œμš΄ UI μƒνƒœ 관리 μΆ”κ°€.
  • 버그 μˆ˜μ •
    • UI μƒνƒœ 관리 κ°œμ„ μœΌλ‘œ μΈν•œ μ‚¬μš©μž κ²½ν—˜ ν–₯상.
  • λ¬Έμ„œν™”
    • μƒˆλ‘œμš΄ API 및 데이터 λͺ¨λΈμ— λŒ€ν•œ λ¬Έμ„œν™” μ—…λ°μ΄νŠΈ.

Copy link

coderabbitai bot commented Nov 30, 2024

Walkthrough

이 λ³€κ²½ 사항은 StandardRepository와 κ΄€λ ¨λœ μƒˆλ‘œμš΄ κΈ°λŠ₯을 λ„μž…ν•©λ‹ˆλ‹€. RepositoryModule ν΄λž˜μŠ€μ— StandardRepositoryImpl을 StandardRepository μΈν„°νŽ˜μ΄μŠ€μ— λ°”μΈλ”©ν•˜λŠ” 좔상 ν•¨μˆ˜ bindStandardRepositoryκ°€ μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ, μ—¬λŸ¬ ν‘œμ€€ ν”„λ‘œκ·Έλž¨μ„ κ΄€λ¦¬ν•˜λŠ” λ©”μ„œλ“œλ₯Ό μ •μ˜ν•˜λŠ” StandardRepository μΈν„°νŽ˜μ΄μŠ€μ™€ 이λ₯Ό κ΅¬ν˜„ν•˜λŠ” StandardRepositoryImpl ν΄λž˜μŠ€κ°€ λ„μž…λ˜μ—ˆμŠ΅λ‹ˆλ‹€. μΆ”κ°€μ μœΌλ‘œ, ν‘œμ€€ ν”„λ‘œκ·Έλž¨ 등둝 및 μˆ˜μ •κ³Ό κ΄€λ ¨λœ μ—¬λŸ¬ μœ μŠ€μΌ€μ΄μŠ€ ν΄λž˜μŠ€κ°€ μƒμ„±λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Changes

파일 경둜 λ³€κ²½ μš”μ•½
core/data/src/main/java/com/school_of_company/data/di/RepositoryModule.kt StandardRepositoryλ₯Ό μœ„ν•œ μƒˆλ‘œμš΄ 바인딩 λ©”μ„œλ“œ bindStandardRepository μΆ”κ°€
core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepository.kt StandardRepository μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€ 및 μ—¬λŸ¬ λ©”μ„œλ“œ μ •μ˜
core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepositoryImpl.kt StandardRepository μΈν„°νŽ˜μ΄μŠ€ κ΅¬ν˜„ 및 λ©”μ„œλ“œ μ •μ˜
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/DeleteStandardProgramListUseCase.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ μ‚­μ œλ₯Ό μœ„ν•œ μœ μŠ€μΌ€μ΄μŠ€ 클래슀 μΆ”κ°€
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/ModifyStandardProgramUseCase.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ μˆ˜μ •μ„ μœ„ν•œ μœ μŠ€μΌ€μ΄μŠ€ 클래슀 μΆ”κ°€
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardListProgramUseCase.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘ 등둝을 μœ„ν•œ μœ μŠ€μΌ€μ΄μŠ€ 클래슀 μΆ”κ°€
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardProgramUseCase.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ 등둝을 μœ„ν•œ μœ μŠ€μΌ€μ΄μŠ€ 클래슀 μΆ”κ°€
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramAttendListUseCase.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ 참석 λͺ©λ‘ 쑰회λ₯Ό μœ„ν•œ μœ μŠ€μΌ€μ΄μŠ€ 클래슀 μΆ”κ°€
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramListUseCase.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘ 쑰회λ₯Ό μœ„ν•œ μœ μŠ€μΌ€μ΄μŠ€ 클래슀 μΆ”κ°€
core/model/src/main/java/com/school_of_company/model/entity/standard/StandardAttendListResponseEntity.kt 참석 λͺ©λ‘ 응닡을 μœ„ν•œ 데이터 클래슀 μΆ”κ°€
core/model/src/main/java/com/school_of_company/model/entity/standard/StandardProgramListResponseEntity.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘ 응닡을 μœ„ν•œ 데이터 클래슀 μΆ”κ°€
core/model/src/main/java/com/school_of_company/model/model/standard/StandardRequestModel.kt ν‘œμ€€ μš”μ²­ λͺ¨λΈμ„ μœ„ν•œ 데이터 클래슀 μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/api/StandardAPI.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ APIλ₯Ό μœ„ν•œ μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSource.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ 데이터 μ†ŒμŠ€λ₯Ό μœ„ν•œ μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSourceImpl.kt StandardDataSource μΈν„°νŽ˜μ΄μŠ€ κ΅¬ν˜„
core/network/src/main/java/com/school_of_company/network/di/NetworkModule.kt StandardAPI 제곡 λ©”μ„œλ“œ μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/di/RemoteDataSourceModule.kt StandardDataSourceImpl을 StandardDataSource에 λ°”μΈλ”©ν•˜λŠ” λ©”μ„œλ“œ μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/dto/standard/request/StandardRequest.kt ν‘œμ€€ μš”μ²­μ„ μœ„ν•œ 데이터 클래슀 μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardAttendListResponse.kt 참석 λͺ©λ‘ 응닡을 μœ„ν•œ 데이터 클래슀 μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardProgramListResponse.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘ 응닡을 μœ„ν•œ 데이터 클래슀 μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/mapper/standard/request/StandardRequestMapper.kt StandardRequestModel을 StandardRequest DTO둜 λ³€ν™˜ν•˜λŠ” ν™•μž₯ ν•¨μˆ˜ μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardAttendListResponseMapper.kt StandardAttendListResponseλ₯Ό StandardAttendListResponseEntity둜 λ³€ν™˜ν•˜λŠ” ν™•μž₯ ν•¨μˆ˜ μΆ”κ°€
core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardProgramListResponseMapper.kt StandardProgramListResponseλ₯Ό StandardProgramListResponseEntity둜 λ³€ν™˜ν•˜λŠ” ν™•μž₯ ν•¨μˆ˜ μΆ”κ°€
feature/expo/src/main/java/com/school_of_company/expo/viewmodel/ExpoViewModel.kt RegisterStandardListProgramUseCaseλ₯Ό μ£Όμž…ν•˜κ³  μƒˆλ‘œμš΄ μƒνƒœ 흐름 μΆ”κ°€
feature/expo/src/main/java/com/school_of_company/expo/viewmodel/uistate/RegisterStandardProgramListUiState.kt ν‘œμ€€ ν”„λ‘œκ·Έλž¨ 등둝 UI μƒνƒœλ₯Ό μœ„ν•œ μΈν„°νŽ˜μ΄μŠ€ μΆ”κ°€

Possibly related PRs

Suggested labels

1️⃣ Priority: High, βš™ Setting, ✨ Feature

Suggested reviewers

  • Chaejongin12
  • diejdkll
  • kimjeakwan
  • Xixn2

🐰 λ³€ν™”μ˜ λ°”λžŒμ΄ λΆˆμ–΄μ™€,
ν‘œμ€€ ν”„λ‘œκ·Έλž¨μ΄ μƒˆλ‘œ νƒœμ–΄λ‚˜.
μš”μ²­κ³Ό 응닡이 좀을 μΆ”κ³ ,
데이터 흐름이 즐겁게 ν˜λŸ¬κ°€.
ν•¨κ»˜ν•˜λŠ” λͺ¨λ“  이여,
이 기쁨을 λ‚˜λˆ„μž, 우리 λͺ¨λ‘! πŸŽ‰

Warning

Rate limit exceeded

@audgns10 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 22 minutes and 44 seconds before requesting another review.

βŒ› How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 531432e and 016cc8e.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❀️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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

🧹 Outside diff range and nitpick comments (19)
core/model/src/main/java/com/school_of_company/model/entity/standard/StandardAttendListResponseEntity.kt (2)

9-10: μ‹œκ°„ ν•„λ“œμ˜ νƒ€μž…κ³Ό 검증 둜직 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

entryTimeκ³Ό leaveTime을 String νƒ€μž…μœΌλ‘œ μ²˜λ¦¬ν•˜κ³  μžˆλŠ”λ°, λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ κ³ λ €ν•΄λ³΄μ‹œκΈ° λ°”λžλ‹ˆλ‹€:

  1. LocalDateTimeμ΄λ‚˜ ZonedDateTime μ‚¬μš©μ„ κ³ λ €ν•΄λ³΄μ„Έμš”.
  2. μ‹œκ°„ ν˜•μ‹μ— λŒ€ν•œ μœ νš¨μ„± 검사가 ν•„μš”ν•  것 κ°™μŠ΅λ‹ˆλ‹€.

8-8: status ν•„λ“œμ˜ 의미λ₯Ό λͺ…ν™•νžˆ ν•΄μ£Όμ„Έμš”.

statusλΌλŠ” ν•„λ“œλͺ…이 뢈λͺ…ν™•ν•©λ‹ˆλ‹€. 참석 μƒνƒœλ₯Ό λ‚˜νƒ€λ‚΄λŠ” 것이라면 isPresentλ‚˜ isAttendingκ³Ό 같이 더 ꡬ체적인 이름을 μ‚¬μš©ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

core/domain/src/main/java/com/school_of_company/domain/usecase/standard/DeleteStandardProgramListUseCase.kt (1)

9-11: μ˜ˆμ™Έ 처리λ₯Ό 더 ꡬ체적으둜 κ°œμ„ ν•΄ μ£Όμ„Έμš”

runCatching을 μ‚¬μš©ν•œ 기본적인 μ˜ˆμ™Έ μ²˜λ¦¬λŠ” μ’‹μŠ΅λ‹ˆλ‹€λ§Œ, νŠΉμ • μ˜ˆμ™Έ 상황(예: ν”„λ‘œκ·Έλž¨μ΄ μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” 경우)에 λŒ€ν•œ μ²˜λ¦¬κ°€ μ—†μŠ΅λ‹ˆλ‹€. ꡬ체적인 μ˜ˆμ™Έ 처리λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

 operator fun invoke(standardProId: Long) = runCatching {
     repository.deleteStandardProgram(standardProId = standardProId)
+}.onFailure { throwable ->
+    when (throwable) {
+        is NoSuchElementException -> throw StandardProgramNotFoundException(standardProId)
+        else -> throw throwable
+    }
 }
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramListUseCase.kt (1)

8-10: KDoc λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€

ν΄λž˜μŠ€μ™€ λ©”μ„œλ“œμ— λŒ€ν•œ λ¬Έμ„œν™”κ°€ μ—†μŠ΅λ‹ˆλ‹€. μ‚¬μš© λͺ©μ κ³Ό λ§€κ°œλ³€μˆ˜μ— λŒ€ν•œ μ„€λͺ…을 μΆ”κ°€ν•΄ μ£Όμ„Έμš”.

+/**
+ * ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘μ„ μ‘°νšŒν•˜λŠ” UseCase
+ *
+ * @property repository ν‘œμ€€ ν”„λ‘œκ·Έλž¨ μ €μž₯μ†Œ
+ */
 class StandardProgramListUseCase @Inject constructor(
     private val repository: StandardRepository
 )
core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramAttendListUseCase.kt (1)

8-10: μ•„ν‚€ν…μ²˜ κ΄€μ μ—μ„œ μ±…μž„ 뢄리λ₯Ό κ²€ν† ν•΄ μ£Όμ„Έμš”

μΆœμ„ λͺ©λ‘ μ‘°νšŒλŠ” λ³„λ„μ˜ λ„λ©”μΈμœΌλ‘œ λΆ„λ¦¬ν•˜λŠ” 것이 쒋을 수 μžˆμŠ΅λ‹ˆλ‹€. AttendanceRepositoryλ₯Ό μƒˆλ‘œ λ§Œλ“€μ–΄ κ΄€λ¦¬ν•˜λŠ” 것을 κ³ λ €ν•΄ λ³΄μ„Έμš”.

core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardListProgramUseCase.kt (1)

10-18: μ—λŸ¬ 처리 및 λ‘œκΉ… κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

λŒ€λŸ‰μ˜ 데이터λ₯Ό μ²˜λ¦¬ν•˜λŠ” 만큼, 더 μƒμ„Έν•œ μ—λŸ¬ μ²˜λ¦¬μ™€ λ‘œκΉ…μ΄ ν•„μš”ν•©λ‹ˆλ‹€:

  1. κ°œλ³„ ν•­λͺ© μ‹€νŒ¨ μ‹œ 처리 방법
  2. λΆ€λΆ„ 성곡에 λŒ€ν•œ 처리
  3. 진행 상황 λͺ¨λ‹ˆν„°λ§
core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardAttendListResponseMapper.kt (1)

6-15: 널 μ•ˆμ „μ„± κ°œμ„ μ„ κ³ λ €ν•΄λ³΄μ„Έμš”.

ν˜„μž¬ κ΅¬ν˜„μ€ κ°„λ‹¨ν•˜μ§€λ§Œ, λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

  • 각 ν•„λ“œμ— λŒ€ν•œ 널 체크 μΆ”κ°€
  • κΈ°λ³Έκ°’ 섀정을 ν†΅ν•œ μ•ˆμ „ν•œ 데이터 λ³€ν™˜

μ˜ˆμ‹œ μ½”λ“œ:

 fun StandardAttendListResponse.toModel(): StandardAttendListResponseEntity =
     StandardAttendListResponseEntity(
-        name = this.name,
+        name = this.name ?: "",
-        affiliation = this.affiliation,
+        affiliation = this.affiliation ?: "",
-        position = this.position,
+        position = this.position ?: "",
         // ... λ‚˜λ¨Έμ§€ ν•„λ“œλ“€λ„ λ™μΌν•˜κ²Œ 적용
     )
core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSource.kt (2)

8-15: μΈν„°νŽ˜μ΄μŠ€ λ¬Έμ„œν™” 및 λ§€κ°œλ³€μˆ˜ 이름 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

각 λ©”μ„œλ“œμ˜ λͺ©μ κ³Ό λ™μž‘μ„ λͺ…ν™•νžˆ 이해할 수 μžˆλ„λ‘ KDoc λ¬Έμ„œν™”λ₯Ό μΆ”κ°€ν•˜κ³ , λ§€κ°œλ³€μˆ˜ 이름을 더 ꡬ체적으둜 λ³€κ²½ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

μ˜ˆμ‹œ:

interface StandardDataSource {
    /**
     * μƒˆλ‘œμš΄ ν‘œμ€€ ν”„λ‘œκ·Έλž¨μ„ λ“±λ‘ν•©λ‹ˆλ‹€.
     * @param expositionId λ°•λžŒνšŒ 고유 μ‹λ³„μž
     * @param programRequest 등둝할 ν”„λ‘œκ·Έλž¨ 정보
     * @return 등둝 성곡 μ—¬λΆ€
     */
    fun registerStandardProgram(
        expositionId: String,
        programRequest: StandardRequest
    ): Flow<Unit>
    
    // λ‚˜λ¨Έμ§€ λ©”μ„œλ“œλ“€λ„ λ™μΌν•˜κ²Œ λ¬Έμ„œν™” 적용
}

9-12: λ©”μ„œλ“œ λ°˜ν™˜ νƒ€μž…μ— λŒ€ν•œ κ²€ν† κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

ν˜„μž¬ λͺ¨λ“  λ³€κ²½ μž‘μ—…(등둝, μˆ˜μ •, μ‚­μ œ)이 Flow<Unit>을 λ°˜ν™˜ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€. μž‘μ—… κ²°κ³Όλ‚˜ μƒνƒœλ₯Ό 더 λͺ…ν™•νžˆ μ „λ‹¬ν•˜κΈ° μœ„ν•΄ λ‹€μŒκ³Ό 같은 κ°œμ„ μ„ κ³ λ €ν•΄λ³΄μ„Έμš”:

  • 성곡/μ‹€νŒ¨ μ—¬λΆ€λ₯Ό λ‚˜νƒ€λ‚΄λŠ” Result νƒ€μž… μ‚¬μš©
  • μž‘μ—… μ™„λ£Œ ν›„ μ—…λ°μ΄νŠΈλœ 데이터 λ°˜ν™˜

μ˜ˆμ‹œ:

fun registerStandardProgram(
    expoId: String,
    body: StandardRequest
): Flow<Result<StandardProgramResponse>>
core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepository.kt (1)

8-15: μΈν„°νŽ˜μ΄μŠ€ 섀계가 κΉ”λ”ν•˜κ³  일관성이 μžˆμŠ΅λ‹ˆλ‹€!

Flowλ₯Ό μ‚¬μš©ν•œ 비동기 μ²˜λ¦¬μ™€ ν•¨κ»˜ ν‘œμ€€ ν”„λ‘œκ·Έλž¨ 관리λ₯Ό μœ„ν•œ CRUD μž‘μ—…μ΄ 잘 μ •μ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

λ‹€λ§Œ, λ‹€μŒ 사항듀을 κ³ λ €ν•΄λ³΄μ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€:

  • λ©”μ„œλ“œμ— λŒ€ν•œ KDoc λ¬Έμ„œν™” μΆ”κ°€
  • 각 λ©”μ„œλ“œμ˜ μ˜ˆμ™Έ 처리 방식 λͺ…μ‹œ
core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSourceImpl.kt (1)

1-43: μ—λŸ¬ 처리 κ°œμ„  ν•„μš”

ν˜„μž¬ performApiRequestλ₯Ό ν†΅ν•œ 기본적인 μ—λŸ¬ 처리만 λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€. νŠΉμ • λΉ„μ¦ˆλ‹ˆμŠ€ μΌ€μ΄μŠ€μ— λŒ€ν•œ 좔가적인 μ—λŸ¬ μ²˜λ¦¬κ°€ ν•„μš”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒ 사항듀을 κ³ λ €ν•΄λ³΄μ‹œκΈ° λ°”λžλ‹ˆλ‹€:

  1. λ„€νŠΈμ›Œν¬ νƒ€μž„μ•„μ›ƒ μ„€μ •
  2. μž¬μ‹œλ„ μ •μ±… κ΅¬ν˜„
  3. λΉ„μ¦ˆλ‹ˆμŠ€ 둜직 κ΄€λ ¨ μ˜ˆμ™Έ 처리 (예: 쀑볡 등둝, κΆŒν•œ λΆ€μ‘± λ“±)
core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepositoryImpl.kt (3)

47-49: 캐싱 μ „λž΅ λ„μž… κ³ λ €

standardProgramList λ©”μ„œλ“œμ˜ 경우 자주 호좜될 수 μžˆμœΌλ―€λ‘œ, 캐싱을 ν†΅ν•œ μ„±λŠ₯ μ΅œμ ν™”λ₯Ό κ³ λ €ν•΄λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 캐싱 μ „λž΅μ„ κ³ λ €ν•΄λ³΄μ„Έμš”:

  1. λ©”λͺ¨λ¦¬ μΊμ‹œ μΆ”κ°€
  2. μΊμ‹œ 만료 μ •μ±… μ„€μ •
  3. μΊμ‹œ λ¬΄νš¨ν™” 쑰건 μ •μ˜ (예: ν”„λ‘œκ·Έλž¨ μˆ˜μ •/μ‚­μ œ μ‹œ)

51-53: μ—λŸ¬ 처리 및 λ‘œκΉ… κ°œμ„  ν•„μš”

standardProgramAttendList λ©”μ„œλ“œμ—μ„œ λ°œμƒν•  수 μžˆλŠ” μ˜ˆμ™Έ 상황에 λŒ€ν•œ μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 κ°œμ„ μ„ μ œμ•ˆν•©λ‹ˆλ‹€:

 override fun standardProgramAttendList(standardProId: Long): Flow<List<StandardAttendListResponseEntity>> {
+    require(standardProId > 0) { "standardProId must be positive" }
     return dataSource.standardProgramAttendList(standardProId = standardProId)
+        .catch { exception ->
+            // λ‘œκΉ… μΆ”κ°€
+            throw exception
+        }
         .transform { list -> emit(list.map { it.toModel() }) }
 }

23-31: λŒ€λŸ‰ 데이터 처리 μ΅œμ ν™” ν•„μš”

registerStandardListProgram λ©”μ„œλ“œμ—μ„œ λŒ€λŸ‰μ˜ 데이터λ₯Ό μ²˜λ¦¬ν•  λ•Œ λ°œμƒν•  수 μžˆλŠ” μ„±λŠ₯ 이슈λ₯Ό κ³ λ €ν•΄μ•Ό ν•©λ‹ˆλ‹€.

λ‹€μŒ 사항듀을 κ³ λ €ν•΄λ³΄μ‹œκΈ° λ°”λžλ‹ˆλ‹€:

  1. 배치 처리 크기 μ œν•œ
  2. 청크 λ‹¨μœ„ 처리 κ΅¬ν˜„
  3. 진행 상황 λͺ¨λ‹ˆν„°λ§
feature/expo/src/main/java/com/school_of_company/expo/viewmodel/ExpoViewModel.kt (1)

339-358: ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘ 등둝 둜직 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

ν˜„μž¬ κ΅¬ν˜„μ€ κΈ°λŠ₯μ μœΌλ‘œλŠ” λ¬Έμ œκ°€ μ—†μœΌλ‚˜, λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

  1. μ—λŸ¬ 처리λ₯Ό 더 ꡬ체적으둜 ν•  ν•„μš”κ°€ μžˆμŠ΅λ‹ˆλ‹€.
  2. 빈 λͺ©λ‘μ— λŒ€ν•œ μœ νš¨μ„± 검사가 ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

 internal fun registerStandardProgramList(
     expoId: String,
     body: List<StandardRequestModel>
 ) = viewModelScope.launch {
+    if (body.isEmpty()) {
+        _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Error(
+            IllegalArgumentException("ν”„λ‘œκ·Έλž¨ λͺ©λ‘μ΄ λΉ„μ–΄μžˆμŠ΅λ‹ˆλ‹€.")
+        )
+        return@launch
+    }
     _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Loading
     registerStandardProgramListUseCase(
         expoId = expoId,
         body = body
     )
         .onSuccess {
             it.catch { remoteError ->
+                val errorMessage = when (remoteError) {
+                    is IllegalStateException -> "등둝 처리 쀑 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€"
+                    is IllegalArgumentException -> "잘λͺ»λœ 데이터가 μ „λ‹¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€"
+                    else -> "μ•Œ 수 μ—†λŠ” 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€"
+                }
                 _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Error(remoteError)
             }.collect {
                 _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Success
             }
         }
         .onFailure { error ->
             _registerStandardProgramListUiState.value = RegisterStandardProgramListUiState.Error(error)
         }
 }
core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardProgramListResponse.kt (2)

10-11: λ‚ μ§œ 처리 방식 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€

startedAtκ³Ό endedAt이 λ‹¨μˆœ String νƒ€μž…μœΌλ‘œ 처리되고 μžˆμŠ΅λ‹ˆλ‹€. λ‚ μ§œ λ°μ΄ν„°μ˜ μ•ˆμ „ν•œ 처리λ₯Ό μœ„ν•΄ μ μ ˆν•œ λ‚ μ§œ νƒ€μž… μ‚¬μš©μ„ ꢌμž₯λ“œλ¦½λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 κ°œμ„ μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

  1. java.time.LocalDateTime λ˜λŠ” java.time.Instant μ‚¬μš©
  2. Moshi μ–΄λŒ‘ν„°λ₯Ό ν†΅ν•œ λ‚ μ§œ 직렬화/역직렬화 처리

μ˜ˆμ‹œ μ½”λ“œ:

@JsonClass(generateAdapter = true)
data class StandardProgramListResponse(
    @Json(name = "id") val id: Long?,
    @Json(name = "title") val title: String?,
    @Json(name = "startedAt") @ISO8601DateTime val startedAt: Instant?,
    @Json(name = "endedAt") @ISO8601DateTime val endedAt: Instant?,
)

6-7: 클래슀 λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€

클래슀의 λͺ©μ κ³Ό μ‚¬μš© 사둀λ₯Ό μ„€λͺ…ν•˜λŠ” KDoc λ¬Έμ„œν™”κ°€ λˆ„λ½λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 λ¬Έμ„œν™”λ₯Ό μΆ”κ°€ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

/**
 * ν‘œμ€€ ν”„λ‘œκ·Έλž¨ λͺ©λ‘ API 응닡을 μœ„ν•œ DTO
 *
 * @property id ν”„λ‘œκ·Έλž¨ 고유 μ‹λ³„μž
 * @property title ν”„λ‘œκ·Έλž¨ 제λͺ©
 * @property startedAt ν”„λ‘œκ·Έλž¨ μ‹œμž‘ μ‹œκ°„ (ISO-8601 ν˜•μ‹)
 * @property endedAt ν”„λ‘œκ·Έλž¨ μ’…λ£Œ μ‹œκ°„ (ISO-8601 ν˜•μ‹)
 */
@JsonClass(generateAdapter = true)
data class StandardProgramListResponse(
core/network/src/main/java/com/school_of_company/network/mapper/standard/request/StandardRequestMapper.kt (1)

6-11: KDoc λ¬Έμ„œν™” μΆ”κ°€λ₯Ό μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€.

ν•¨μˆ˜μ˜ λͺ©μ κ³Ό μ‚¬μš© 사둀λ₯Ό λͺ…ν™•νžˆ ν•˜κΈ° μœ„ν•΄ KDoc λ¬Έμ„œλ₯Ό μΆ”κ°€ν•˜λŠ” 것이 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 λ¬Έμ„œν™”λ₯Ό μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

+/**
+ * StandardRequestModel을 λ„€νŠΈμ›Œν¬ ν†΅μ‹ μš© DTO인 StandardRequest둜 λ³€ν™˜ν•©λ‹ˆλ‹€.
+ *
+ * @return λ³€ν™˜λœ StandardRequest 객체
+ */
fun StandardRequestModel.toDto(): StandardRequest =
core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardProgramListResponseMapper.kt (1)

6-12: 맀핑 둜직이 λͺ…ν™•ν•˜κ²Œ κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

ν™•μž₯ ν•¨μˆ˜λ₯Ό μ‚¬μš©ν•œ κ΅¬ν˜„μ΄ κΉ”λ”ν•˜λ©°, 각 속성이 μ˜¬λ°”λ₯΄κ²Œ λ§€ν•‘λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. λ‹€λ§Œ, λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

ν•¨μˆ˜μ— KDoc λ¬Έμ„œλ₯Ό μΆ”κ°€ν•˜λ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€:

+/**
+ * StandardProgramListResponse DTOλ₯Ό StandardProgramListResponseEntity둜 λ³€ν™˜ν•©λ‹ˆλ‹€.
+ *
+ * @return StandardProgramListResponseEntity λ³€ν™˜λœ μ—”ν‹°ν‹° 객체
+ */
fun StandardProgramListResponse.toModel(): StandardProgramListResponseEntity =
    StandardProgramListResponseEntity(
        id = this.id,
        title = this.title,
        startedAt = this.startedAt,
        endedAt = this.endedAt,
    )
πŸ“œ Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 531432e and 016cc8e.

πŸ“’ Files selected for processing (25)
  • core/data/src/main/java/com/school_of_company/data/di/RepositoryModule.kt (2 hunks)
  • core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepository.kt (1 hunks)
  • core/data/src/main/java/com/school_of_company/data/repository/standard/StandardRepositoryImpl.kt (1 hunks)
  • core/domain/src/main/java/com/school_of_company/domain/usecase/standard/DeleteStandardProgramListUseCase.kt (1 hunks)
  • core/domain/src/main/java/com/school_of_company/domain/usecase/standard/ModifyStandardProgramUseCase.kt (1 hunks)
  • core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardListProgramUseCase.kt (1 hunks)
  • core/domain/src/main/java/com/school_of_company/domain/usecase/standard/RegisterStandardProgramUseCase.kt (1 hunks)
  • core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramAttendListUseCase.kt (1 hunks)
  • core/domain/src/main/java/com/school_of_company/domain/usecase/standard/StandardProgramListUseCase.kt (1 hunks)
  • core/model/src/main/java/com/school_of_company/model/entity/standard/StandardAttendListResponseEntity.kt (1 hunks)
  • core/model/src/main/java/com/school_of_company/model/entity/standard/StandardProgramListResponseEntity.kt (1 hunks)
  • core/model/src/main/java/com/school_of_company/model/model/standard/StandardRequestModel.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/api/StandardAPI.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSource.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSourceImpl.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/di/NetworkModule.kt (2 hunks)
  • core/network/src/main/java/com/school_of_company/network/di/RemoteDataSourceModule.kt (2 hunks)
  • core/network/src/main/java/com/school_of_company/network/dto/standard/request/StandardRequest.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardAttendListResponse.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardProgramListResponse.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/mapper/standard/request/StandardRequestMapper.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardAttendListResponseMapper.kt (1 hunks)
  • core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardProgramListResponseMapper.kt (1 hunks)
  • feature/expo/src/main/java/com/school_of_company/expo/viewmodel/ExpoViewModel.kt (5 hunks)
  • feature/expo/src/main/java/com/school_of_company/expo/viewmodel/uistate/RegisterStandardProgramListUiState.kt (1 hunks)
βœ… Files skipped from review due to trivial changes (2)
  • core/model/src/main/java/com/school_of_company/model/entity/standard/StandardProgramListResponseEntity.kt
  • core/model/src/main/java/com/school_of_company/model/model/standard/StandardRequestModel.kt
πŸ”‡ Additional comments (15)
feature/expo/src/main/java/com/school_of_company/expo/viewmodel/uistate/RegisterStandardProgramListUiState.kt (1)

3-7: UI μƒνƒœ 관리가 잘 κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€!

UI μƒνƒœλ₯Ό Loading, Success, Error둜 λͺ…ν™•ν•˜κ²Œ κ΅¬λΆ„ν•˜μ—¬ μ²˜λ¦¬ν•œ 점이 μ’‹μŠ΅λ‹ˆλ‹€. 특히 Error μƒνƒœμ—μ„œ Throwable을 ν¬ν•¨ν•˜μ—¬ μ˜ˆμ™Έ 처리λ₯Ό ν•  수 μžˆλ„λ‘ ν•œ 것이 μ μ ˆν•©λ‹ˆλ‹€.

core/network/src/main/java/com/school_of_company/network/dto/standard/request/StandardRequest.kt (1)

6-11: Moshi μ–΄λ…Έν…Œμ΄μ…˜μ΄ 잘 μ μš©λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

JSON 직렬화λ₯Ό μœ„ν•œ Moshi 섀정이 μ μ ˆν•˜κ²Œ λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. generateAdapterλ₯Ό true둜 μ„€μ •ν•˜μ—¬ μ„±λŠ₯ μ΅œμ ν™”λ„ 잘 λ˜μ–΄ μžˆλ„€μš”.

core/network/src/main/java/com/school_of_company/network/dto/standard/response/StandardAttendListResponse.kt (1)

8-14: Nullable ν•„λ“œ κ²€ν† κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

ν˜„μž¬ λͺ¨λ“  ν•„λ“œκ°€ non-null둜 μ •μ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ‹€μ œ API μ‘λ‹΅μ—μ„œ 일뢀 ν•„λ“œκ°€ null일 수 μžˆλŠ” 경우λ₯Ό κ³ λ €ν•˜μ—¬, ν•΄λ‹Ή ν•„λ“œλ“€μ„ nullable둜 μ •μ˜ν•˜λŠ” 것이 μ•ˆμ „ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

core/domain/src/main/java/com/school_of_company/domain/usecase/standard/ModifyStandardProgramUseCase.kt (1)

7-20: 클린 μ•„ν‚€ν…μ²˜ νŒ¨ν„΄μ„ 잘 μ€€μˆ˜ν–ˆμŠ΅λ‹ˆλ‹€!

UseCase κ΅¬ν˜„μ΄ κΉ”λ”ν•˜λ©°, λ‹€μŒκ³Ό 같은 μž₯점듀이 μžˆμŠ΅λ‹ˆλ‹€:

  • μ˜μ‘΄μ„± μ£Όμž…μ„ ν†΅ν•œ λŠμŠ¨ν•œ κ²°ν•©
  • runCatching을 μ‚¬μš©ν•œ μ μ ˆν•œ μ—λŸ¬ 처리
  • operator ν•¨μˆ˜λ₯Ό ν™œμš©ν•œ 가독성 μžˆλŠ” μΈν„°νŽ˜μ΄μŠ€
core/network/src/main/java/com/school_of_company/network/api/StandardAPI.kt (1)

32-45: 응닡 νƒ€μž…κ³Ό μ—λŸ¬ 처리 κ²€ν† κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒ 사항듀을 κ³ λ €ν•΄λ³΄μ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€:

  1. μ‚­μ œ μž‘μ—… 성곡/μ‹€νŒ¨ μ—¬λΆ€λ₯Ό λͺ…ν™•νžˆ ν•˜κΈ° μœ„ν•œ 응닡 νƒ€μž… μΆ”κ°€
  2. ν‘œμ€€ μ—λŸ¬ 응닡 νƒ€μž… μ •μ˜
  3. HTTP μƒνƒœ μ½”λ“œμ— λ”°λ₯Έ μ˜ˆμ™Έ 처리 방식 λ¬Έμ„œν™”

μ•„λž˜ 슀크립트둜 ν˜„μž¬ μ—λŸ¬ 처리 방식을 ν™•μΈν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€:

core/data/src/main/java/com/school_of_company/data/di/RepositoryModule.kt (1)

48-52: Repository 바인딩이 κΈ°μ‘΄ νŒ¨ν„΄μ„ 잘 λ”°λ₯΄κ³  μžˆμŠ΅λ‹ˆλ‹€!

SingletonComponentλ₯Ό μ‚¬μš©ν•œ μ˜μ‘΄μ„± μ£Όμž… 섀정이 μ μ ˆν•˜κ²Œ κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.

core/network/src/main/java/com/school_of_company/network/di/RemoteDataSourceModule.kt (1)

48-52: 바인딩 κ΅¬ν˜„μ΄ μ μ ˆν•©λ‹ˆλ‹€!

기쑴의 λ‹€λ₯Έ DataSource 바인딩과 μΌκ΄€λœ νŒ¨ν„΄μ„ λ”°λ₯΄κ³  있으며, Dagger/Hilt DI κ΅¬ν˜„μ΄ μ˜¬λ°”λ₯΄κ²Œ λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€.

core/network/src/main/java/com/school_of_company/network/datasource/standard/StandardDataSourceImpl.kt (1)

14-18: πŸ› οΈ Refactor suggestion

λ§€κ°œλ³€μˆ˜ μœ νš¨μ„± 검사 μΆ”κ°€ ν•„μš”

expoIdκ°€ λΉ„μ–΄μžˆκ±°λ‚˜ μœ νš¨ν•˜μ§€ μ•Šμ€ κ²½μš°μ— λŒ€ν•œ μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 μœ νš¨μ„± 검사 μΆ”κ°€λ₯Ό μ œμ•ˆν•©λ‹ˆλ‹€:

 override fun registerStandardProgram(expoId: String, body: StandardRequest): Flow<Unit> =
+    require(expoId.isNotBlank()) { "expoId must not be blank" }
     performApiRequest { service.registerStandardProgram(
         expoId = expoId,
         body = body
     ) }
core/network/src/main/java/com/school_of_company/network/di/NetworkModule.kt (1)

11-11: μ½”λ“œκ°€ 적절히 κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€!

StandardAPIλ₯Ό μ œκ³΅ν•˜λŠ” λ©”μ„œλ“œκ°€ κΈ°μ‘΄ API 제곡 λ©”μ„œλ“œλ“€κ³Ό μΌκ΄€λœ νŒ¨ν„΄μœΌλ‘œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Also applies to: 112-115

feature/expo/src/main/java/com/school_of_company/expo/viewmodel/ExpoViewModel.kt (3)

16-16: μ˜μ‘΄μ„± μΆ”κ°€κ°€ μ μ ˆν•©λ‹ˆλ‹€!

ν•„μš”ν•œ UseCase와 λͺ¨λΈ ν΄λž˜μŠ€λ“€μ΄ μ˜¬λ°”λ₯΄κ²Œ import λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Also applies to: 29-29, 33-33


55-55: UseCase μ£Όμž…μ΄ μ˜¬λ°”λ₯΄κ²Œ κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€!

RegisterStandardListProgramUseCaseκ°€ ViewModel μƒμ„±μžμ— 적절히 μ£Όμž…λ˜μ—ˆμŠ΅λ‹ˆλ‹€.


110-111: UI μƒνƒœ 관리가 적절히 κ΅¬ν˜„λ˜μ—ˆμŠ΅λ‹ˆλ‹€!

RegisterStandardProgramListUiState의 초기 μƒνƒœκ°€ Loading으둜 μ˜¬λ°”λ₯΄κ²Œ μ„€μ •λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

core/network/src/main/java/com/school_of_company/network/mapper/standard/request/StandardRequestMapper.kt (2)

6-11: κΈ°λ³Έ κ΅¬ν˜„μ΄ 잘 λ˜μ–΄μžˆμŠ΅λ‹ˆλ‹€.

맀핑 둜직이 λͺ…ν™•ν•˜κ³  κ°„λ‹¨ν•˜κ²Œ κ΅¬ν˜„λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.


6-11: Null μ•ˆμ „μ„± 검사 μΆ”κ°€λ₯Ό κ³ λ €ν•΄λ³΄μ„Έμš”.

ν•„λ“œκ°’μ΄ null일 수 μžˆλŠ” 경우λ₯Ό λŒ€λΉ„ν•˜μ—¬ μ•ˆμ „μ„± 검사λ₯Ό μΆ”κ°€ν•˜λŠ” 것이 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€.

λ‹€μŒ 슀크립트둜 λͺ¨λΈ 클래슀의 ν•„λ“œ nullable μ—¬λΆ€λ₯Ό ν™•μΈν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€:

core/network/src/main/java/com/school_of_company/network/mapper/standard/response/StandardProgramListResponseMapper.kt (1)

1-5: νŒ¨ν‚€μ§€ ꡬ쑰와 μž„ν¬νŠΈκ°€ 잘 κ΅¬μ„±λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€!

λ„€νŠΈμ›Œν¬ κ³„μΈ΅μ˜ λ§€νΌλ‘œμ„œ μ μ ˆν•œ μœ„μΉ˜μ— 있으며, ν•„μš”ν•œ ν΄λž˜μŠ€λ“€λ§Œ μž„ν¬νŠΈν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

Comment on lines +8 to +10
@Json(name = "title") val title: String,
@Json(name = "startedAt") val startedAt: String,
@Json(name = "endedAt") val endedAt: String,
Copy link

Choose a reason for hiding this comment

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

πŸ’‘ Codebase verification

μ‹œκ°„ ν•„λ“œμ— λŒ€ν•œ 검증이 ν•„μš”ν•˜λ©° λ¬Έμ„œν™”κ°€ λ―Έν‘ν•©λ‹ˆλ‹€.

μ½”λ“œλ² μ΄μŠ€ 뢄석 κ²°κ³Ό λ‹€μŒκ³Ό 같은 λ¬Έμ œμ λ“€μ΄ λ°œκ²¬λ˜μ—ˆμŠ΅λ‹ˆλ‹€:

  1. startedAtκ³Ό endedAt ν•„λ“œλŠ” "yyyy-MM-dd" ν˜•μ‹μœΌλ‘œ 처리되고 μžˆμœΌλ‚˜, 이에 λŒ€ν•œ λͺ…μ‹œμ μΈ λ¬Έμ„œν™”κ°€ DTO에 μ—†μŠ΅λ‹ˆλ‹€.
  2. formatServerDate() μœ ν‹Έλ¦¬ν‹°λŠ” μžˆμ§€λ§Œ, λ‚ μ§œμ˜ μœ νš¨μ„±μ„ κ²€μ¦ν•˜λŠ” 둜직이 μ—†μŠ΅λ‹ˆλ‹€.
  3. startedAt이 endedAt보닀 이전 μ‹œκ°„μΈμ§€ ν™•μΈν•˜λŠ” 검증 둜직이 μ—†μŠ΅λ‹ˆλ‹€.

κ°œμ„  ꢌμž₯사항:

  • DTO ν΄λž˜μŠ€μ— λ‚ μ§œ ν˜•μ‹μ— λŒ€ν•œ λͺ…ν™•ν•œ λ¬Έμ„œν™” μΆ”κ°€ (예: @Json μ–΄λ…Έν…Œμ΄μ…˜ μœ„μ— KDoc μ£Όμ„μœΌλ‘œ "yyyy-MM-dd" ν˜•μ‹μž„μ„ λͺ…μ‹œ)
  • λ‚ μ§œ μœ νš¨μ„± 검증 둜직 κ΅¬ν˜„
  • μ‹œμž‘μΌμ΄ μ’…λ£ŒμΌλ³΄λ‹€ 이전인지 ν™•μΈν•˜λŠ” 검증 둜직 μΆ”κ°€
πŸ”— Analysis chain

μ‹œκ°„ ν•„λ“œμ— λŒ€ν•œ μœ νš¨μ„± 검사와 λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

startedAtκ³Ό endedAt ν•„λ“œμ™€ κ΄€λ ¨ν•˜μ—¬ λ‹€μŒ 사항듀을 κ³ λ €ν•΄μ£Όμ„Έμš”:

  1. μ‹œκ°„ ν˜•μ‹μ— λŒ€ν•œ λͺ…ν™•ν•œ λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€ (예: ISO 8601 ν˜•μ‹ μ‚¬μš© μ—¬λΆ€).
  2. startedAt이 endedAt보닀 이전 μ‹œκ°„μΈμ§€ κ²€μ¦ν•˜λŠ” 둜직이 ν•„μš”ν•  것 κ°™μŠ΅λ‹ˆλ‹€.

λ‹€μŒ 슀크립트둜 μ‹œκ°„ κ΄€λ ¨ 검증 둜직의 쑴재 μ—¬λΆ€λ₯Ό 확인할 수 μžˆμŠ΅λ‹ˆλ‹€:


Let's search more broadly to understand the context and validation patterns in the codebase.


Let's search for date/time validation and formatting related code to better understand how dates are handled in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for time validation logic in the codebase

# Search for time validation patterns
rg -i "validate.*time|time.*validate|check.*time|time.*check" 

# Search for date/time utility functions
ast-grep --pattern 'fun $_($$TIME|$$Date|$$DateTime)$_($$$) { $$$ }'

Length of output: 134


Script:

#!/bin/bash
# Search for any date/time related validation or utility code
rg -i "date|time" -A 3 --type kotlin

# Search specifically in the network module
fd . "core/network" -e kt -x cat {}

# Look for validation related code
rg -i "validate|check" -A 3 --type kotlin

Length of output: 100877


Script:

#!/bin/bash
# Let's check for date/time validation and formatting utilities
rg -i "format.*date|date.*format|parse.*date|date.*parse" -A 3

# Look for any date/time related utilities or helper functions
fd . "core/ui/src/main/java" -e kt -x cat {}

# Check for any validation related code in the codebase
ast-grep --pattern 'fun $_validate$_($$$) { $$$ }'

Length of output: 5945

Comment on lines +6 to +8
class DeleteStandardProgramListUseCase @Inject constructor(
private val repository: StandardRepository
) {
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

클래슀 이름이 κΈ°λŠ₯κ³Ό μΌμΉ˜ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€

ν˜„μž¬ 클래슀 이름은 DeleteStandardProgramListUseCaseμ΄μ§€λ§Œ μ‹€μ œλ‘œλŠ” 단일 ν”„λ‘œκ·Έλž¨μ„ μ‚­μ œν•˜λŠ” κΈ°λŠ₯을 μˆ˜ν–‰ν•©λ‹ˆλ‹€. 더 λͺ…ν™•ν•œ 의미 전달을 μœ„ν•΄ DeleteStandardProgramUseCase둜 λ³€κ²½ν•˜λŠ” 것이 μ’‹κ² μŠ΅λ‹ˆλ‹€.

-class DeleteStandardProgramListUseCase @Inject constructor(
+class DeleteStandardProgramUseCase @Inject constructor(
    private val repository: StandardRepository
)
πŸ“ 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
class DeleteStandardProgramListUseCase @Inject constructor(
private val repository: StandardRepository
) {
class DeleteStandardProgramUseCase @Inject constructor(
private val repository: StandardRepository
) {

Comment on lines +11 to +12
operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> =
repository.standardProgramList(expoId = expoId)
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

μž…λ ₯κ°’ 검증이 ν•„μš”ν•©λ‹ˆλ‹€

expoId에 λŒ€ν•œ μœ νš¨μ„± 검사가 μ—†μŠ΅λ‹ˆλ‹€. 빈 λ¬Έμžμ—΄μ΄λ‚˜ 잘λͺ»λœ ν˜•μ‹μ˜ IDκ°€ μž…λ ₯될 경우 μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

 operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> =
+    require(expoId.isNotBlank()) { "expoIdλŠ” λΉ„μ–΄μžˆμ„ 수 μ—†μŠ΅λ‹ˆλ‹€" }
     repository.standardProgramList(expoId = expoId)
πŸ“ 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
operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> =
repository.standardProgramList(expoId = expoId)
operator fun invoke(expoId: String) : Flow<List<StandardProgramListResponseEntity>> =
require(expoId.isNotBlank()) { "expoIdλŠ” λΉ„μ–΄μžˆμ„ 수 μ—†μŠ΅λ‹ˆλ‹€" }
repository.standardProgramList(expoId = expoId)

Comment on lines +11 to +12
operator fun invoke(standardProId: Long) : Flow<List<StandardAttendListResponseEntity>> =
repository.standardProgramAttendList(standardProId = standardProId)
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

μž…λ ₯κ°’ 검증과 μ˜ˆμ™Έ μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€

standardProIdκ°€ μœ νš¨ν•œμ§€ ν™•μΈν•˜λŠ” 둜직이 μ—†μœΌλ©°, μ‘΄μž¬ν•˜μ§€ μ•ŠλŠ” ν”„λ‘œκ·Έλž¨μ— λŒ€ν•œ μ˜ˆμ™Έ μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

 operator fun invoke(standardProId: Long) : Flow<List<StandardAttendListResponseEntity>> =
+    require(standardProId > 0) { "standardProIdλŠ” 0보닀 컀야 ν•©λ‹ˆλ‹€" }
     repository.standardProgramAttendList(standardProId = standardProId)
+        .catch { throwable ->
+            when (throwable) {
+                is NoSuchElementException -> throw StandardProgramNotFoundException(standardProId)
+                else -> throw throwable
+            }
+        }

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

Comment on lines +13 to +14
@Json(name = "entryTime") val entryTime: String,
@Json(name = "leaveTime") val leaveTime: String
Copy link

Choose a reason for hiding this comment

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

πŸ’‘ Codebase verification

μ‹œκ°„ 데이터 μ²˜λ¦¬μ— λŒ€ν•œ ν‘œμ€€ν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

μ½”λ“œλ² μ΄μŠ€ 뢄석 κ²°κ³Ό, FormatServerDate.ktμ—μ„œ λ‚ μ§œ ν¬λ§·νŒ…μ„ μœ„ν•œ μœ ν‹Έλ¦¬ν‹°λŠ” μžˆμœΌλ‚˜ μ‹œκ°„ 처리λ₯Ό μœ„ν•œ ν‘œμ€€ν™”λœ 방식이 μ—†λŠ” κ²ƒμœΌλ‘œ ν™•μΈλ©λ‹ˆλ‹€. λ‹€μŒκ³Ό 같은 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€:

  1. core/ui/util νŒ¨ν‚€μ§€μ— μ‹œκ°„ ν¬λ§·νŒ…μ„ μœ„ν•œ μœ ν‹Έλ¦¬ν‹° 클래슀 μΆ”κ°€
  2. entryTimeκ³Ό leaveTime을 LocalDateTime λ˜λŠ” ZonedDateTime으둜 νŒŒμ‹±ν•˜λŠ” 둜직 κ΅¬ν˜„
  3. μ‹œκ°„λŒ€ 처리λ₯Ό μœ„ν•œ ν‘œμ€€ 포맷 μ •μ˜

ν˜„μž¬ λ¬Έμžμ—΄λ‘œ μ²˜λ¦¬λ˜λŠ” μ‹œκ°„ λ°μ΄ν„°λŠ” 일관성 μžˆλŠ” ν¬λ§·νŒ…κ³Ό 검증이 μ–΄λ €μš°λ―€λ‘œ, μœ„ μ‚¬ν•­λ“€μ˜ κ΅¬ν˜„μ„ ꢌμž₯λ“œλ¦½λ‹ˆλ‹€.

πŸ”— Analysis chain

μ‹œκ°„ ν•„λ“œμ˜ ν˜•μ‹ κ²€ν† κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

entryTimeκ³Ό leaveTime ν•„λ“œκ°€ String νƒ€μž…μœΌλ‘œ μ •μ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. μ‹œκ°„ λ°μ΄ν„°μ˜ 일관성과 μœ νš¨μ„±μ„ 보μž₯ν•˜κΈ° μœ„ν•΄ λ‹€μŒ 사항듀을 κ³ λ €ν•΄λ³΄μ‹œκΈ° λ°”λžλ‹ˆλ‹€:

  1. ISO 8601 ν˜•μ‹ μ‚¬μš©
  2. LocalDateTime λ˜λŠ” ZonedDateTime으둜 νŒŒμ‹±
  3. μ‹œκ°„λŒ€(timezone) 처리 방식

μ‹œκ°„ ν˜•μ‹ 검증을 μœ„ν•œ 슀크립트:


Let me generate additional scripts to check for any time-related utilities or formatters in the codebase:

This will help us understand if there are any existing time handling utilities or standardized approaches in the codebase before making the final recommendation.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: μ‹œκ°„ κ΄€λ ¨ ν•„λ“œμ˜ μ‚¬μš© νŒ¨ν„΄ 확인

# μ‹œκ°„ ν•„λ“œ μ‚¬μš© νŒ¨ν„΄ 검색
rg "entryTime|leaveTime" -A 3 -B 3

Length of output: 5265


Script:

#!/bin/bash
# Description: Check for time-related utilities and formatters

# Search for date/time related imports and utilities
rg "import.*time|import.*date|TimeFormat|DateFormat|ZonedDateTime|LocalDateTime" -g "*.kt"

# Search for any custom time formatting or validation logic
rg "fun.*Time|class.*Time|object.*Time" -g "*.kt"

Length of output: 14508

Comment on lines +13 to +18
) = runCatching {
repository.registerStandardProgram(
expoId = expoId,
body = body
)
}
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

μ—λŸ¬ 처리 κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

ν˜„μž¬ runCatchingλ§ŒμœΌλ‘œλŠ” ꡬ체적인 μ—λŸ¬ μ²˜λ¦¬κ°€ λΆ€μ‘±ν•  수 μžˆμŠ΅λ‹ˆλ‹€. λ‹€μŒκ³Ό 같은 κ°œμ„ μ‚¬ν•­μ„ κ³ λ €ν•΄λ³΄μ„Έμš”:

  1. ꡬ체적인 μ˜ˆμ™Έ νƒ€μž… μ •μ˜
  2. λΉ„μ¦ˆλ‹ˆμŠ€ 둜직 μ‹€νŒ¨μ— λŒ€ν•œ 처리
  3. λ„€νŠΈμ›Œν¬ 였λ₯˜ ꡬ뢄

μ˜ˆμ‹œ μ½”λ“œ:

- ) = runCatching {
+ ) = runCatching {
+    require(expoId.isNotBlank()) { "expoIdλŠ” λΉ„μ–΄μžˆμ„ 수 μ—†μŠ΅λ‹ˆλ‹€" }
+    require(body.isValid()) { "μœ νš¨ν•˜μ§€ μ•Šμ€ μš”μ²­μž…λ‹ˆλ‹€" }
+
     repository.registerStandardProgram(
         expoId = expoId,
         body = body
     )
+ }.onFailure { throwable ->
+    when (throwable) {
+        is IllegalArgumentException -> throw BusinessException(throwable)
+        is IOException -> throw NetworkException(throwable)
+        else -> throw throwable
+    }
 }

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

Comment on lines +7 to +19
class RegisterStandardListProgramUseCase @Inject constructor(
private val repository: StandardRepository
) {
operator fun invoke(
expoId: String,
body: List<StandardRequestModel>
) = runCatching {
repository.registerStandardListProgram(
expoId = expoId,
body = body
)
}
}
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

μ½”λ“œ 쀑볡 및 μ„±λŠ₯ κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€.

  1. μ½”λ“œ 쀑볡:

    • RegisterStandardProgramUseCase와 μœ μ‚¬ν•œ ꡬ쑰가 μ€‘λ³΅λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€.
    • 곡톡 λ‘œμ§μ„ 좔상 ν΄λž˜μŠ€λ‚˜ μΈν„°νŽ˜μ΄μŠ€λ‘œ λΆ„λ¦¬ν•˜λŠ” 것을 κ³ λ €ν•΄λ³΄μ„Έμš”.
  2. μ„±λŠ₯ 고렀사항:

    • λŒ€λŸ‰μ˜ 데이터 처리 μ‹œ 배치 크기 μ œν•œμ΄ μ—†μŠ΅λ‹ˆλ‹€.
    • 병렬 처리 방식이 κ³ λ €λ˜μ§€ μ•Šμ•˜μŠ΅λ‹ˆλ‹€.

μ˜ˆμ‹œ μ½”λ“œ:

 operator fun invoke(
     expoId: String,
     body: List<StandardRequestModel>
 ) = runCatching {
+    require(body.size <= MAX_BATCH_SIZE) { "μ΅œλŒ€ 처리 κ°€λŠ₯ν•œ 크기λ₯Ό μ΄ˆκ³Όν–ˆμŠ΅λ‹ˆλ‹€" }
+
+    body.chunked(OPTIMAL_CHUNK_SIZE)
+        .asFlow()
+        .flatMapMerge { chunk ->
     repository.registerStandardListProgram(
         expoId = expoId,
-        body = body
+        body = chunk
     )
+ }
 }

+companion object {
+    private const val MAX_BATCH_SIZE = 1000
+    private const val OPTIMAL_CHUNK_SIZE = 100
+}

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

Comment on lines +14 to +18
@POST("/standard/{expo_id}")
suspend fun registerStandardProgram(
@Path("expo_id") expoId: String,
@Body body: StandardRequest
)
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

API μ—”λ“œν¬μΈνŠΈ 경둜의 일관성 κ²€ν† κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

μ—”λ“œν¬μΈνŠΈ κ²½λ‘œμ—μ„œ λ‹€μŒκ³Ό 같은 비일관성이 λ°œκ²¬λ©λ‹ˆλ‹€:

  • /standard/{expo_id} vs /standard/list/{expo_id} vs /standard/{standardPro_id}
  • expo_id와 standardPro_id의 넀이밍 μ»¨λ²€μ…˜μ΄ λ‹€λ¦…λ‹ˆλ‹€ (snake_case vs camelCase)

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜λŠ” 것을 μ œμ•ˆλ“œλ¦½λ‹ˆλ‹€:

-    @POST("/standard/{expo_id}")
+    @POST("/standard/program/{expoId}")
     suspend fun registerStandardProgram(
-        @Path("expo_id") expoId: String,
+        @Path("expoId") expoId: String,
         @Body body: StandardRequest
     )

-    @POST("/standard/list/{expo_id}")
+    @POST("/standard/program/list/{expoId}")
     suspend fun registerStandardListProgram(
-        @Path("expo_id") expoId: String,
+        @Path("expoId") expoId: String,
         @Body body: List<StandardRequest>
     )

-    @POST("/standard/{standardPro_id}")
+    @POST("/standard/program/{standardProId}")
     suspend fun modifyStandardProgram(
-        @Path("standardPro_id") standardProId: Long,
+        @Path("standardProId") standardProId: Long,
         @Body body: StandardRequest
     )

Also applies to: 20-24, 26-30

Comment on lines +29 to +33
override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> =
performApiRequest { service.modifyStandardProgram(
standardProId = standardProId,
body = body
) }
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Long νƒ€μž… λ§€κ°œλ³€μˆ˜ μœ νš¨μ„± 검사 μΆ”κ°€ ν•„μš”

standardProIdκ°€ 0보닀 μž‘μ€ κ²½μš°μ— λŒ€ν•œ μ²˜λ¦¬κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같은 μœ νš¨μ„± 검사 μΆ”κ°€λ₯Ό μ œμ•ˆν•©λ‹ˆλ‹€:

 override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> =
+    require(standardProId > 0) { "standardProId must be positive" }
     performApiRequest { service.modifyStandardProgram(
         standardProId = standardProId,
         body = body
     ) }
πŸ“ 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
override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> =
performApiRequest { service.modifyStandardProgram(
standardProId = standardProId,
body = body
) }
override fun modifyStandardProgram(standardProId: Long, body: StandardRequest): Flow<Unit> =
require(standardProId > 0) { "standardProId must be positive" }
performApiRequest { service.modifyStandardProgram(
standardProId = standardProId,
body = body
) }

Comment on lines +7 to +12
data class StandardProgramListResponse(
@Json(name = "id") val id: Long,
@Json(name = "title") val title: String,
@Json(name = "startedAt") val startedAt: String,
@Json(name = "endedAt") val endedAt: String,
)
Copy link

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

ν•„λ“œμ˜ Null μ•ˆμ •μ„± κ°œμ„ μ΄ ν•„μš”ν•©λ‹ˆλ‹€

ν˜„μž¬ λͺ¨λ“  ν•„λ“œκ°€ non-nullable둜 μ„ μ–Έλ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. APIμ—μ„œ null 값을 λ°˜ν™˜ν•  경우 λŸ°νƒ€μž„ μ˜ˆμ™Έκ°€ λ°œμƒν•  수 μžˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒκ³Ό 같이 μˆ˜μ •ν•˜λŠ” 것을 ꢌμž₯λ“œλ¦½λ‹ˆλ‹€:

@JsonClass(generateAdapter = true)
data class StandardProgramListResponse(
-   @Json(name = "id") val id: Long,
-   @Json(name = "title") val title: String,
-   @Json(name = "startedAt") val startedAt: String,
-   @Json(name = "endedAt") val endedAt: String,
+   @Json(name = "id") val id: Long?,
+   @Json(name = "title") val title: String?,
+   @Json(name = "startedAt") val startedAt: String?,
+   @Json(name = "endedAt") val endedAt: String?,
)

λ§Œμ•½ ν˜„μž¬ ν•„λ“œλ“€μ΄ λ°˜λ“œμ‹œ non-nullμž„μ΄ 보μž₯λœλ‹€λ©΄, 이λ₯Ό λͺ…μ‹œν•˜λŠ” λ¬Έμ„œν™”κ°€ ν•„μš”ν•©λ‹ˆλ‹€.

πŸ“ 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
data class StandardProgramListResponse(
@Json(name = "id") val id: Long,
@Json(name = "title") val title: String,
@Json(name = "startedAt") val startedAt: String,
@Json(name = "endedAt") val endedAt: String,
)
@JsonClass(generateAdapter = true)
data class StandardProgramListResponse(
@Json(name = "id") val id: Long?,
@Json(name = "title") val title: String?,
@Json(name = "startedAt") val startedAt: String?,
@Json(name = "endedAt") val endedAt: String?,
)

Copy link
Member

@Xixn2 Xixn2 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0️⃣ Priority: Critical μš°μ„ μˆœμœ„ - κΈ΄κΈ‰!!!!!
Projects
None yet
2 participants