"""Persistence for Order entities."""

from order_app.domain.order import Order


class OrderRepository:
    _store: dict[str, Order] = {}

    def save(self, order: Order) -> Order:
        self._store[order.id] = order
        return order

    def find_by_id(self, order_id: str) -> Order | None:
        return self._store.get(order_id)
