feat(InventoryStore): return a restricted view of the inventory

This commit is contained in:
Johannes Kirschbauer
2025-05-27 17:08:24 +02:00
parent 467aa546c4
commit e57c8f6f9a
4 changed files with 148 additions and 17 deletions

View File

@@ -13,12 +13,11 @@ Interacting with 'clan_lib.inventory' is NOT recommended and will be removed
from clan_lib.api import API
from clan_lib.flake import Flake
from clan_lib.nix_models.clan import Inventory
from clan_lib.persist.inventory_store import InventoryStore
from clan_lib.persist.inventory_store import InventorySnapshot, InventoryStore
@API.register
def get_inventory(flake: Flake) -> Inventory:
def get_inventory(flake: Flake) -> InventorySnapshot:
inventory_store = InventoryStore(flake)
inventory = inventory_store.read()
return inventory