Skip to content

[Feat/add total time field] - 총 달린거리 로직 수정#98

Merged
ekgns33 merged 4 commits intomainfrom
feat/add-total-time-field
Jun 11, 2025
Merged

[Feat/add total time field] - 총 달린거리 로직 수정#98
ekgns33 merged 4 commits intomainfrom
feat/add-total-time-field

Conversation

@ekgns33
Copy link
Contributor

@ekgns33 ekgns33 commented Jun 11, 2025

작업내역

  • 기존 로직에서 시작시간과 끝나는 시간으로 시간을 계산했습니다. 이는 일시정지를 고려하지 않아 데이터 이상이 발생합니다.

ex) 40분 일시정지 후 종료할 시 달린시간에 40분이 추가됨.

  • 따라서 클라이언트에서 총 달린 시간을 계산하여 전달받도록 수정

Summary by CodeRabbit

  • New Features

    • Added support for tracking total running time (in seconds) for running records. This new information is now included when saving and displaying running records.
  • Bug Fixes

    • Improved test data and acceptance tests to accommodate the new total running time field.
  • Documentation

    • Updated API documentation to describe the new total running time field.
  • Chores

    • Updated database schema and test datasets to include the new total running time column for running records.

@coderabbitai
Copy link

coderabbitai bot commented Jun 11, 2025

Walkthrough

A new field, totalTimeInSeconds, has been introduced throughout the running record domain, DTOs, REST requests, and persistence layers. This field is now part of the Java domain model, API request/response objects, SQL schemas, and associated test data, ensuring explicit storage and handling of total running time in seconds.

Changes

Files / Areas Change Summary
RecordSaveRequest.java, RecordCreateCommand.java, RunningRecord.java Added totalTimeInSeconds field and updated constructors/factory methods to handle the new field.
RecordCommandService.java Updated mapping logic to set the new totalTimeInSeconds property.
schema.sql, src/test/resources/sql/schema.sql Added total_time_in_seconds column to running_record table; minor formatting adjustments.
src/test/resources/sql/*.sql (test data files) Updated insert statements for running_record to include total_time_in_seconds with sample data.
RecordFixtures.java, RecordAcceptanceTest.java, RewardAcceptanceTest.java Updated test object construction to include the new field.
RewardServiceTest.java, RewardTest.java Updated test record creation and handling for the new field; minor formatting changes.
data.sql Added new item insertions for test setup; unrelated to main feature.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller
    participant Service
    participant Domain
    participant DB

    Client->>Controller: POST /records (RecordSaveRequest with totalTimeInSeconds)
    Controller->>Service: saveRecord(RecordCreateCommand with totalTimeInSeconds)
    Service->>Domain: new RunningRecord(..., totalTimeInSeconds, ...)
    Domain->>DB: INSERT running_record (includes total_time_in_seconds)
    DB-->>Domain: Record persisted
    Domain-->>Service: RunningRecord instance
    Service-->>Controller: Record ID / Response
    Controller-->>Client: Success Response
Loading

Poem

A second counts, a rabbit hops,
Now time in seconds never stops!
From schema deep to API,
Our records track each moment fly.
With tests and code all in accord,
The running clock is now restored!
🕒🐇


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 8a96db1 and 7cef146.

📒 Files selected for processing (16)
  • src/main/java/org/runimo/runimo/records/controller/request/RecordSaveRequest.java (1 hunks)
  • src/main/java/org/runimo/runimo/records/domain/RunningRecord.java (6 hunks)
  • src/main/java/org/runimo/runimo/records/service/RecordCommandService.java (1 hunks)
  • src/main/java/org/runimo/runimo/records/service/usecases/dtos/RecordCreateCommand.java (2 hunks)
  • src/main/resources/sql/schema.sql (6 hunks)
  • src/test/java/org/runimo/runimo/records/RecordFixtures.java (1 hunks)
  • src/test/java/org/runimo/runimo/records/api/RecordAcceptanceTest.java (1 hunks)
  • src/test/java/org/runimo/runimo/rewards/RewardTest.java (3 hunks)
  • src/test/java/org/runimo/runimo/rewards/api/RewardAcceptanceTest.java (3 hunks)
  • src/test/java/org/runimo/runimo/rewards/service/RewardServiceTest.java (4 hunks)
  • src/test/resources/sql/data.sql (1 hunks)
  • src/test/resources/sql/main_view_data.sql (2 hunks)
  • src/test/resources/sql/schema.sql (6 hunks)
  • src/test/resources/sql/user_mypage_test_data.sql (2 hunks)
  • src/test/resources/sql/weekly_record_data.sql (1 hunks)
  • src/test/resources/sql/weekly_record_partial_data.sql (1 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 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? Join our Discord community 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 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
Contributor

@jeeheaG jeeheaG left a comment

Choose a reason for hiding this comment

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

그런 버그가 있었군요 좋습니다👍

@ekgns33 ekgns33 merged commit 38f9d37 into main Jun 11, 2025
5 checks passed
@ekgns33 ekgns33 deleted the feat/add-total-time-field branch June 11, 2025 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants