julee.repositories.memory.assembly¶
Memory implementation of AssemblyRepository.
This module provides an in-memory implementation of the AssemblyRepository protocol that follows the Clean Architecture patterns defined in the Fun-Police Framework. It handles assembly storage in memory dictionaries, ensuring idempotency and proper error handling.
The implementation uses Python dictionaries to store assembly data, making it ideal for testing scenarios where external dependencies should be avoided. All operations are still async to maintain interface compatibility.
Attributes¶
Classes¶
Memory implementation of AssemblyRepository using Python dictionaries. |
Module Contents¶
- class julee.repositories.memory.assembly.MemoryAssemblyRepository[source]¶
Bases:
julee.domain.repositories.assembly.AssemblyRepository,julee.repositories.memory.base.MemoryRepositoryMixin[julee.domain.models.assembly.Assembly]Memory implementation of AssemblyRepository using Python dictionaries.
This implementation stores assembly data in memory using a dictionary keyed by assembly_id. This provides a lightweight, dependency-free option for testing.
- async generate_id()[source]¶
Generate a unique assembly identifier.
- Returns:
Unique assembly ID string
- Return type:
str
- async get(assembly_id)[source]¶
Retrieve an assembly by ID.
- Parameters:
assembly_id (str) – Unique assembly identifier
- Returns:
Assembly if found, None otherwise
- Return type:
- async get_many(assembly_ids)[source]¶
Retrieve multiple assemblies by ID.
- Parameters:
assembly_ids (list[str]) – List of unique assembly identifiers
- Returns:
Dict mapping assembly_id to Assembly (or None if not found)
- Return type:
dict[str, julee.domain.models.assembly.Assembly | None]
- async save(assembly)[source]¶
Save assembly metadata (status, updated_at, etc.).
- Parameters:
assembly (julee.domain.models.assembly.Assembly) – Assembly entity
- storage_dict: dict[str, julee.domain.models.assembly.Assembly][source]¶