Skip to content

DB migration #36

@rudals02

Description

@rudals02

{
"sessionId": "S-1763185275147",
"completed": true,
"affectedSets": 3
}


### 작동 방식

1. **미완료 → 완료**
   - 세션의 한 세트라도 미완료(`completed=false`)면
   - 모든 세트를 완료(`completed=true`)로 변경
   
2. **완료 → 미완료**
   - 세션의 모든 세트가 완료(`completed=true`)면
   - 모든 세트를 미완료(`completed=false`)로 변경

3. **달성률 자동 재계산**
   - 토글 후 해당 날짜의 달성률 자동 업데이트

## 🎯 전체 API 목록

GET /api/workouts/{userId} - 운동 기록 조회
POST /api/workouts - 운동 기록 추가
DELETE /api/workouts/{sessionId} - 운동 기록 삭제
PATCH /api/workouts/{sessionId}/toggle - 완료 상태 토글 ⭐ NEW!


## 🚀 테스트 시나리오

1. **운동 3개 추가**
   - 벤치프레스 (3세트) 
   - 푸시업 (3세트)
   - 스쿼트 (3세트)
   - 달성률: 0% (모두 미완료)

2. **벤치프레스 완료 토글**

PATCH /api/workouts/S-xxx/toggle

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions