Add dashboard bike snapshot aggregate endpoint (#132)#133
Merged
Conversation
Slice ③-1 of the detail-panel join-tab work. Adds a single backend
endpoint that returns bike + active rider-bike contract + rider (with
education summary) + active rider insurances + active bike equipments in
one read-only transaction. The dashboard detail panel will call this
once on marker-click instead of fan-out fetching every domain endpoint
from the browser.
GET /api/v1/dashboard/bikes/{bikeId}/snapshot
Pieces:
- DashboardBikeSnapshotResponse DTO with five nested record summaries
(bike / activeContract / rider / riderInsuranceSummary[] /
bikeEquipmentSummary[]).
- DashboardBikeSnapshotQueryRepository with four targeted SQL queries:
bike read, active contract + template join, rider + lateral latest
education record, active rider insurances + insurance items, active
bike equipments + equipment types. Each query uses partial indexes
already present from V1–V9.
- DashboardBikeSnapshotService runs the queries inside a single
@transactional(readOnly = true) so the operator sees a coherent view
even if a rider link mutates while the panel is opening.
- DashboardBikeSnapshotController exposes the GET endpoint; ArchUnit
dashboard-read-only rule passes (no PUT/POST/PATCH/DELETE).
Telemetry currentState is intentionally NOT bundled here. The detail
panel keeps fetching that from the existing
`GET /api/v1/telemetry/bikes/{id}/current-state` so polling and the
snapshot stay independently cacheable.
Tests:
- New DashboardBikeSnapshotApiTests covers full-active happy path,
no-active-contract path (rider/insurances null/empty), no-insurance
path, removed equipment + disabled rider insurance filtering,
unknown-bike → 404, missing-auth → 401, and education-expired
computation against the latest record.
Trace:
- Target issue: #132
- Change-control issue: EVNSolution/clever-change-control#120
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 8, 2026
This was referenced May 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Trace
Scope
Backend-only. 다음 슬라이스 (③-2) 가 프론트 디테일 패널을 이 endpoint 에 연결.
Included:
Excluded:
응답 구조
```
{
bikeId, generatedAt,
bike: { id, idx, plateNumber, vin, modelName, operationStatus, memo, createdAt, updatedAt },
activeContract: null | { id, idx, contractTemplateId, templateName,
templateCategory, templateReturnType,
templateDurationUnit, templateDurationValue,
templateIncludesInsurance,
startAt, endAt, terminatedAt, terminatedReason, memo },
rider: null | { id, idx, name, phoneNumber, teamName, areaName,
appLinkStatus, memo,
educationCompleted, latestEducationType,
latestEducationCompletedAt, latestEducationExpiresAt,
educationExpired },
insurances: [ { id, insuranceItemId, itemName, category, coverageType,
startsAt, endsAt, riderBikeContractId, memo } ],
equipments: [ { id, equipmentTypeId, typeName, equipmentLabel, modelName,
serialNumber, installedAt, removedAt,
managementDueDate, memo } ]
}
```
Validation
Test plan
Concurrent work gate
Note
이번 PR 머지 후 `Slice ③-2 (프론트 디테일 패널 join 탭)` 로 이어집니다. 그 슬라이스가 머지되면 운영자가 마커 클릭 한 번으로 차량 + 라이더 + 계약 + 보험 + 장비 + 교육 정보를 모두 화면에서 확인 가능.