[CUB-235] Implement GET /api/v1/cameras/:id with 24h history #18

Open
opened 2026-05-27 09:50:32 -04:00 by Hermes · 3 comments
Owner

Migration dry-run sample. Imported from Linear to validate Gitea issue formatting, labels, and comments before the full migration.

Imported from Linear: CUB-235
Linear URL: https://linear.app/cubecraft-creations/issue/CUB-235/implement-get-apiv1camerasid-with-24h-history

Description

Camera detail endpoint: metadata + latest status + 24h status_logs DESC. Returns JSON. Handle invalid camera_id with 404.

Imported Linear metadata

  • Linear ID: CUB-235
  • State: In Review
  • Priority: High
  • Project: RemoteRig
  • Labels: Dex
  • Due date: none
  • Original assignee: unassigned
  • Creator: CubeCraft Creations
  • Linear branch name: cubecraftcreations1/cub-235-implement-get-apiv1camerasid-with-24h-history
  • Linear comments archived/importable: 4
> **Migration dry-run sample.** Imported from Linear to validate Gitea issue formatting, labels, and comments before the full migration. Imported from Linear: **CUB-235** Linear URL: https://linear.app/cubecraft-creations/issue/CUB-235/implement-get-apiv1camerasid-with-24h-history ## Description Camera detail endpoint: metadata + latest status + 24h status_logs DESC. Returns JSON. Handle invalid camera_id with 404. ## Imported Linear metadata - Linear ID: CUB-235 - State: In Review - Priority: High - Project: RemoteRig - Labels: Dex - Due date: none - Original assignee: unassigned - Creator: CubeCraft Creations - Linear branch name: cubecraftcreations1/cub-235-implement-get-apiv1camerasid-with-24h-history - Linear comments archived/importable: 4
Hermes added the state/in-reviewpriority/highagent/dexproject/remoterig labels 2026-05-27 09:50:32 -04:00
Author
Owner

Imported Linear comment from CubeCraft Creations at 2026-05-23T04:37:21.523Z on CUB-235:


CUB-235: GET /api/v1/cameras/:id — Implementation Confirmed & Tests Added

Branch: agent/dex/CUB-235-camera-detail
Commit: 5100f6b
PR: #9

Validation

  • go build ./internal/api/... → PASS
  • go vet ./internal/api/... → PASS
  • go test ./internal/api/... → 6/6 PASS

Tests Added

  1. TestGetCameraDetail_NotFound — 404 for missing camera
  2. TestGetCameraDetail_Success — 200 with camera + last_status + history
  3. TestGetCameraDetail_EmptyHistory — empty history array for camera with no logs
  4. TestGetCameraDetail_HistoryLimitedTo100 — history capped at 100 entries
  5. TestGetCameraDetail_MissingID — 400 for empty ID param
  6. TestGetCameraDetail_LastStatusPresent — verifies last_status field

Bug Found

mac_address column is nullable but Camera.MacAddress is string — NULL scan causes error. Needs *string or sql.NullString. Not in scope for this PR.

Imported Linear comment from **CubeCraft Creations** at `2026-05-23T04:37:21.523Z` on **CUB-235**: --- ## CUB-235: GET /api/v1/cameras/:id — Implementation Confirmed & Tests Added **Branch:** `agent/dex/CUB-235-camera-detail` **Commit:** `5100f6b` **PR:** https://code.cubecraftcreations.com/CubeCraft-Creations/remote-rig/pulls/9 ### Validation - `go build ./internal/api/...` → PASS - `go vet ./internal/api/...` → PASS - `go test ./internal/api/...` → 6/6 PASS ### Tests Added 1. TestGetCameraDetail_NotFound — 404 for missing camera 2. TestGetCameraDetail_Success — 200 with camera + last_status + history 3. TestGetCameraDetail_EmptyHistory — empty history array for camera with no logs 4. TestGetCameraDetail_HistoryLimitedTo100 — history capped at 100 entries 5. TestGetCameraDetail_MissingID — 400 for empty ID param 6. TestGetCameraDetail_LastStatusPresent — verifies last_status field ### Bug Found `mac_address` column is nullable but `Camera.MacAddress` is `string` — NULL scan causes error. Needs `*string` or `sql.NullString`. Not in scope for this PR.
Author
Owner

Imported Linear comment from CubeCraft Creations at 2026-05-22T22:29:02.081Z on CUB-235:


@larry: missing @otto: context — cannot break down

Imported Linear comment from **CubeCraft Creations** at `2026-05-22T22:29:02.081Z` on **CUB-235**: --- @larry: missing @otto: context — cannot break down
Author
Owner

Imported Linear comment from CubeCraft Creations at 2026-05-22T07:28:37.343Z on CUB-235:


@larry: missing @otto: context — cannot break down

Imported Linear comment from **CubeCraft Creations** at `2026-05-22T07:28:37.343Z` on **CUB-235**: --- @larry: missing @otto: context — cannot break down
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CubeCraft-Creations/remote-rig#18