Skip to content

[feat/MAT-591] study handwriting snapshot API hook 추가#289

Open
b0nsu wants to merge 1 commit into
developfrom
feat/mat-350-study-handwriting-api
Open

[feat/MAT-591] study handwriting snapshot API hook 추가#289
b0nsu wants to merge 1 commit into
developfrom
feat/mat-350-study-handwriting-api

Conversation

@b0nsu
Copy link
Copy Markdown
Collaborator

@b0nsu b0nsu commented Apr 24, 2026

Summary

MAT-591 신규 spec 인 study handwriting snapshot endpoint 의 hook 두 개 추가. publishId/problemId/type 조합으로 시점별 (AFTER_FIRST_SUBMIT / AFTER_RETRY_SUBMIT / AFTER_POINTING) 필기 데이터 upsert + 단건 조회. 후속 MAT-591 통합 PR (매니저 generic 화 + ProblemScreen / PointingScreen 통합) 의 base.

Linear

  • MAT-591 — 문제풀이 영역 필기 저장 기능 추가

Changes

  • apps/native/src/apis/controller/student/study/handwriting/useGetStudyHandwritingSnapshot.ts 신규 — GET /api/student/study/problem/{publishId}/{problemId}/handwriting/snapshot/{type}. StudyHandwritingSnapshotType 도 함께 export. staleTime: Infinity, enabled 패턴.
  • apps/native/src/apis/controller/student/study/handwriting/usePostStudyHandwritingSnapshot.ts 신규 — POST /api/student/study/problem/{publishId}/{problemId}/handwriting/snapshot, body { type, dataJson }. onSuccess setQueryData 미장착 — 캐시는 MAT-591 통합 PR 의 wiring 단일 경로에서 처리.
  • apps/native/src/apis/controller/student/study/index.ts — 옛 useGetStudyHandwriting / useUpdateStudyHandwriting export 제거 (consumer 0). snapshot hook + StudyHandwritingSnapshotType re-export.
  • apps/native/src/types/api/schema.d.tspnpm openapi regen. snapshot endpoint 2 개 + StudyHandwritingSnapshotSaveRequest / StudyHandwritingSnapshotResp 추가. 누적된 다른 도메인 schema 변경도 함께 동기화.

Testing

  • pnpm --filter native exec tsc --noEmit — exit 0
  • pnpm --filter native exec eslint <변경 파일> — 0 error (@/apis/client import warning 은 주변 hook 과 동일한 사전 존재 패턴)
  • hook 단독 추가이므로 기존 화면 영향 없음 (consumer 0)

Risk / Impact

Follow-up

  • MAT-591 통합 PR
    • useHandwritingManager generic 화 — { scope: 'scrap' | 'study', ... }
    • save queue entry key 일반화 (scrapId 단일 → composite key)
    • poster scope 분기 (scrap PUT vs study POST)
    • ProblemScreen / PointingScreen 통합 (3 시점 매트릭스: phase 별 write/read type)

@linear
Copy link
Copy Markdown

linear Bot commented Apr 24, 2026

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pointer-admin Ready Ready Preview, Comment May 13, 2026 2:55pm

Copy link
Copy Markdown
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

Adds a new student study handwriting API layer to the native app so problem-solving/pointing screens can fetch and persist handwriting tied to (publishId, problemId) using the existing OpenAPI + TanStack Query client setup.

Changes:

  • Added useGetStudyHandwriting query hook for fetching handwriting with staleTime: Infinity and enabled support.
  • Added useUpdateStudyHandwriting mutation hook to save/update handwriting and immediately update the query cache.
  • Regenerated OpenAPI types (schema.d.ts) and exported the new hooks from the study controller index.

Reviewed changes

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

File Description
apps/native/src/types/api/schema.d.ts Adds Study handwriting endpoint types (and other regenerated schema changes).
apps/native/src/apis/controller/student/study/index.ts Exposes new handwriting hooks from the study controller entrypoint.
apps/native/src/apis/controller/student/study/handwriting/useGetStudyHandwriting.ts New query hook for (publishId, problemId) handwriting retrieval.
apps/native/src/apis/controller/student/study/handwriting/putUpdateStudyHandwriting.ts New mutation hook for saving handwriting + updating cached query data.

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

@b0nsu b0nsu marked this pull request as draft May 11, 2026 07:46
MAT-591 spec 도입. publishId/problemId/type 조합 upsert + 단건 조회.
MAT-591 통합 PR (매니저 generic + ProblemScreen/PointingScreen 통합) 의 base.

- useGetStudyHandwritingSnapshot: GET .../snapshot/{type}, staleTime Infinity
- usePostStudyHandwritingSnapshot: POST .../snapshot, body { type, dataJson }
- onSuccess setQueryData 미장착 - 캐시는 MAT-591 통합 PR 의 wiring 에서 처리
- 옛 useGetStudyHandwriting / useUpdateStudyHandwriting 제거 (consumer 0,
  MAT-591 spec 에선 사용 안 함)
- schema.d.ts: pnpm openapi regen (snapshot endpoint 2 개 + StudyHandwritingSnapshotSaveRequest /
  StudyHandwritingSnapshotResp + 누적 도메인 schema 동기화)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@b0nsu b0nsu force-pushed the feat/mat-350-study-handwriting-api branch from 1355eb3 to 81eb1d7 Compare May 13, 2026 14:54
@b0nsu b0nsu changed the title feat: study handwriting API 추가 [feat/MAT-591] study handwriting snapshot API hook 추가 May 13, 2026
@b0nsu b0nsu requested a review from sterdsterd May 13, 2026 16:26
@b0nsu b0nsu marked this pull request as ready for review May 13, 2026 16:26
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