15 lines
523 B
Python
15 lines
523 B
Python
"""Toy Inventory Portal Adapter."""
|
|
from __future__ import annotations
|
|
from crisisops.adapters_registry import Adapter
|
|
|
|
|
|
class InventoryPortalAdapter(Adapter):
|
|
def __init__(self):
|
|
super().__init__("inventory_portal")
|
|
|
|
def adapt(self, data):
|
|
# Example adaptation: normalize inventory counts
|
|
if "inventory" in data and isinstance(data["inventory"], dict):
|
|
data["inventory"] = {k: int(v) for k, v in data["inventory"].items()}
|
|
return {"adapter": self.name, "adapted": data}
|