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

study handwriting snapshot endpoint hook 추가. publishId/problemId/type 조합으로 시점별 (`AFTER_FIRST_SUBMIT` / `AFTER_RETRY_SUBMIT` / `AFTER_POINTING`) 필기 snapshot upsert + 단건 조회.

Linear

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

Changes

  • `useGetStudyHandwritingSnapshot` — GET `/api/student/study/problem/{publishId}/{problemId}/handwriting/snapshot/{type}`. `staleTime: Infinity`, `enabled` 패턴. `StudyHandwritingSnapshotType` 도 함께 export
  • `usePostStudyHandwritingSnapshot` — POST `/api/student/study/problem/{publishId}/{problemId}/handwriting/snapshot`, body `{ type, dataJson }`
  • `apis/controller/student/study/index.ts` — 옛 `useGetStudyHandwriting` / `useUpdateStudyHandwriting` export 제거 (consumer 0). snapshot hook + `StudyHandwritingSnapshotType` re-export
  • `types/api/schema.d.ts` — `pnpm openapi` regen. snapshot endpoint 2개 + `StudyHandwritingSnapshotSaveRequest` / `StudyHandwritingSnapshotResp` 추가. 누적된 다른 도메인 schema 변경도 함께 동기화
  • `useHandwritingManager.ts` — schema regen 후 `data` 가 `string | undefined` 가 되어 `dataString` 으로 변수 추출 + narrow (TS error fix)

Testing

  • `pnpm --filter native exec tsc --noEmit` — exit 0
  • `pnpm --filter native exec eslint <변경 파일>` — 0 error

Risk / Impact

  • 영향 범위: study API layer (snapshot endpoint 신규 추가) + scrap manager 의 dataString narrow
  • 호환성: 옛 study handwriting GET/PUT hook 제거 — consumer 0 이라 영향 없음. 서버측 endpoint 는 살아있음 (다른 client 가 사용 가능)

@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
@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
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 01bc89c to 838bbeb Compare May 26, 2026 10:48
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