Project Store
app.infrastructure.project.project_storeSerializes project documents to JSON and validates them when reading.
See Also
ProjectDocument— document model persisted by this storeProjectService— coordinates project persistence
Layer: Infrastructure. Context: Implements concrete processing and i/o behind application-facing contracts at this architectural boundary.
ProjectStore
Read and write versioned project documents as JSON.
Layer: Infrastructure. Context: Encodes domain project data at the filesystem boundary and validates the persisted structure before constructing domain objects.
load(file_path: str) -> ProjectDocument
Read JSON from disk and validate it as a supported project.
| PARAMETER | DESCRIPTION |
|---|---|
file_path
|
Source project JSON file.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
ProjectDocument
|
The decoded domain project document. |
| RAISES | DESCRIPTION |
|---|---|
OSError
|
If the file cannot be opened or read. |
UnicodeDecodeError
|
If the file is not valid UTF-8. |
JSONDecodeError
|
If the file does not contain valid JSON. |
ProjectFormatException
|
If the payload has an unsupported version or an invalid required structure. |
TypeError
|
If a numeric field has an incompatible type. |
ValueError
|
If a numeric field cannot be converted to an integer. |
save(file_path: str, project: ProjectDocument) -> None
Serialize a project document to the specified path.
| PARAMETER | DESCRIPTION |
|---|---|
file_path
|
Destination JSON file; its parent directory is created when necessary.
TYPE:
|
project
|
Domain document to serialize.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
OSError
|
If the destination directory cannot be created or the file cannot be written. |
TypeError
|
If the destination path or a project value has an unsupported type. |
ValueError
|
If serialization encounters a circular reference. |