feat: add asset ID history API

This commit is contained in:
lussierj committed 2026-07-28 19:48:57 +00:00
1 parent a87ab2709f
commit d738b8e27e
6 files changed
+254 -9

No files matched your search

+12
View File
@@ -12,6 +12,7 @@ from app.inventory.exceptions import (
MinerNotFound,
)
from app.inventory.models import (
InventoryAssetIDHistoryEntry,
InventoryCreateRequest,
InventoryMetadataUpdateRequest,
InventoryMinerDetail,
@@ -112,6 +113,17 @@ class InventoryService:
raise MinerNotFound(miner_id)
return self._detail_model(row)
def get_asset_id_history(
self,
miner_id: UUID,
) -> list[InventoryAssetIDHistoryEntry]:
if not self.repository.get_miner_by_id(miner_id):
raise MinerNotFound(miner_id)
return [
InventoryAssetIDHistoryEntry.model_validate(row)
for row in self.repository.list_asset_id_history(miner_id)
]
def list_miners(
self,
*,