julee.repositories.memory.assembly_specification¶
Memory implementation of AssemblySpecificationRepository.
This module provides an in-memory implementation of the AssemblySpecificationRepository protocol that follows the Clean Architecture patterns defined in the Fun-Police Framework. It handles assembly specification storage with JSON schemas and knowledge service query configurations in memory dictionaries, ensuring idempotency and proper error handling.
The implementation uses Python dictionaries to store specification 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 AssemblySpecificationRepository using Python |
Module Contents¶
- class julee.repositories.memory.assembly_specification.MemoryAssemblySpecificationRepository[source]¶
Bases:
julee.domain.repositories.assembly_specification.AssemblySpecificationRepository,julee.repositories.memory.base.MemoryRepositoryMixin[julee.domain.models.assembly_specification.AssemblySpecification]Memory implementation of AssemblySpecificationRepository using Python dictionaries.
This implementation stores assembly specifications in memory:
Specifications: Dictionary keyed by assembly_specification_id containing AssemblySpecification objects
This provides a lightweight, dependency-free option for testing while maintaining the same interface as other implementations.
- async generate_id()[source]¶
Generate a unique assembly specification identifier.
- Returns:
Unique assembly specification ID string
- Return type:
str
- async get(assembly_specification_id)[source]¶
Retrieve an assembly specification by ID.
- Parameters:
assembly_specification_id (str) – Unique specification identifier
- Returns:
AssemblySpecification if found, None otherwise
- Return type:
julee.domain.models.assembly_specification.AssemblySpecification | None
- async get_many(assembly_specification_ids)[source]¶
Retrieve multiple assembly specifications by ID.
- Parameters:
assembly_specification_ids (list[str]) – List of unique specification
identifiers
- Returns:
Dict mapping specification_id to AssemblySpecification (or None if not found)
- Return type:
dict[str, julee.domain.models.assembly_specification.AssemblySpecification | None]
- async list_all()[source]¶
List all assembly specifications.
- Returns:
List of all AssemblySpecification entities in the repository
- Return type:
list[julee.domain.models.assembly_specification.AssemblySpecification]
- async save(assembly_specification)[source]¶
Save an assembly specification.
- Parameters:
assembly_specification (julee.domain.models.assembly_specification.AssemblySpecification) – Complete AssemblySpecification to save
- storage_dict: dict[str, julee.domain.models.assembly_specification.AssemblySpecification][source]¶