julee.repositories.memory.policy ================================ .. py:module:: julee.repositories.memory.policy .. autoapi-nested-parse:: Memory implementation of PolicyRepository. This module provides an in-memory implementation of the PolicyRepository protocol that follows the Clean Architecture patterns defined in the Fun-Police Framework. It handles policy storage in memory dictionaries, ensuring idempotency and proper error handling. The implementation uses Python dictionaries to store policy data, making it ideal for testing scenarios where external dependencies should be avoided. All operations are still async to maintain interface compatibility. Attributes ---------- .. autoapisummary:: julee.repositories.memory.policy.logger Classes ------- .. autoapisummary:: julee.repositories.memory.policy.MemoryPolicyRepository Module Contents --------------- .. py:class:: MemoryPolicyRepository Bases: :py:obj:`julee.domain.repositories.policy.PolicyRepository`, :py:obj:`julee.repositories.memory.base.MemoryRepositoryMixin`\ [\ :py:obj:`julee.domain.models.policy.Policy`\ ] Memory implementation of PolicyRepository using Python dictionaries. This implementation stores policy data in memory using a dictionary keyed by policy_id. This provides a lightweight, dependency-free option for testing. .. py:method:: generate_id() :async: Generate a unique policy identifier. :returns: Unique policy ID string .. py:method:: get(policy_id) :async: Retrieve a policy by ID. :param policy_id: Unique policy identifier :returns: Policy if found, None otherwise .. py:method:: get_many(policy_ids) :async: Retrieve multiple policies by ID. :param policy_ids: List of unique policy identifiers :returns: Dict mapping policy_id to Policy (or None if not found) .. py:method:: save(policy) :async: Save a policy. :param policy: Complete Policy to save .. py:attribute:: entity_name :value: 'Policy' .. py:attribute:: logger .. py:attribute:: storage_dict :type: Dict[str, julee.domain.models.policy.Policy] .. py:data:: logger