feat: add miner detail view
This commit is contained in:
1 parent
b8b741ccee
commit
19fc29c72c
22 files changed
+1882
-10
No files matched your search
@@ -14,6 +14,7 @@ from app.locations.models import (
|
||||
MineMapData,
|
||||
MineMapMeta,
|
||||
MineMapResponse,
|
||||
MinerLocationDetail,
|
||||
)
|
||||
from app.locations.repository import LocationMapRepository
|
||||
|
||||
@@ -87,6 +88,12 @@ class LocationMapService:
|
||||
),
|
||||
)
|
||||
|
||||
def get_miner_location(self, miner_id: UUID) -> MinerLocationDetail | None:
|
||||
row = self.repository.get_miner_location(miner_id)
|
||||
if row is None:
|
||||
return None
|
||||
return MinerLocationDetail.model_validate(row)
|
||||
|
||||
def summarize_locations(self, *, include_miner_counts: bool) -> LocationSummary:
|
||||
return LocationSummary.model_validate(
|
||||
self.repository.summarize_locations(
|
||||
|
||||
Reference in new issue
Block a user