feat(frame): duplicate a frame via POST /:id/duplicate (#46) #47

Merged
eliott merged 1 commit from develop into main 2026-05-15 15:35:04 +02:00
Owner

Promotes #46 from develop to main.

Adds the POST /frame/:id/duplicate endpoint - atomic transactional copy of a frame plus its optional frame_location row, into the same shoot. Source frame is locked with FOR UPDATE; shoot row is locked the same way for MAX(number) + 1. Rejects on a done shoot (400), other user's frame (404), unknown id (404).

Also includes a refactor(import) cleanup pulling commit() and commitData() into focused helpers, and a small refactor pass on frame.service.ts extracting getNextFrameNumber, loadOwnedFrameOrThrow, lockShootAndAssertOpen, copyFrameLocation, shootChangeTarget, and prepareShootMove. Driven by the fallow CRAP gate; behavior is unchanged.

Tests: 100/100 integration. Lint clean.

Generated with Claude Code (https://claude.com/claude-code)

Promotes #46 from develop to main. Adds the `POST /frame/:id/duplicate` endpoint - atomic transactional copy of a frame plus its optional `frame_location` row, into the same shoot. Source frame is locked with `FOR UPDATE`; shoot row is locked the same way for `MAX(number) + 1`. Rejects on a done shoot (400), other user's frame (404), unknown id (404). Also includes a `refactor(import)` cleanup pulling `commit()` and `commitData()` into focused helpers, and a small refactor pass on `frame.service.ts` extracting `getNextFrameNumber`, `loadOwnedFrameOrThrow`, `lockShootAndAssertOpen`, `copyFrameLocation`, `shootChangeTarget`, and `prepareShootMove`. Driven by the fallow CRAP gate; behavior is unchanged. Tests: 100/100 integration. Lint clean. Generated with Claude Code (https://claude.com/claude-code)
feat(frame): duplicate a frame via POST /:id/duplicate (#46)
All checks were successful
tests / test (pull_request) Successful in 2m51s
14a7f82238
Reviewed-on: #46
Co-authored-by: Eliott BIDAULT-HERVOUET <homelab@eliottbidault.fr>
Co-committed-by: Eliott BIDAULT-HERVOUET <homelab@eliottbidault.fr>
eliott merged commit dd879917f3 into main 2026-05-15 15:35:04 +02:00
Sign in to join this conversation.
No reviewers
No labels
run-ci
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RollNote/rollnote-api!47
No description provided.