54 lines
1.5 KiB
Markdown
54 lines
1.5 KiB
Markdown
|
|
# @landvex/infrastructure
|
||
|
|
|
||
|
|
Persistence adapters and infrastructure for LandveX domain.
|
||
|
|
|
||
|
|
## Architecture
|
||
|
|
|
||
|
|
```
|
||
|
|
Domain (interfaces) ← Infrastructure (adapters)
|
||
|
|
```
|
||
|
|
|
||
|
|
- **Domain defines** repository interfaces (WHAT)
|
||
|
|
- **Infrastructure implements** them (HOW)
|
||
|
|
- **Domain never depends** on infrastructure
|
||
|
|
|
||
|
|
## Repository Interfaces
|
||
|
|
|
||
|
|
| Interface | Purpose |
|
||
|
|
|-----------|---------|
|
||
|
|
| `FieldSessionRepository` | Store/retrieve field sessions |
|
||
|
|
| `MissionRepository` | Store/retrieve missions |
|
||
|
|
| `DecisionCaseRepository` | Store/retrieve decision cases |
|
||
|
|
| `ArtifactRegistry` | Register/find artifacts |
|
||
|
|
| `EventStore` | Append-only event log |
|
||
|
|
| `UnitOfWork` | Coordinate multiple repositories |
|
||
|
|
|
||
|
|
## In-Memory Adapters
|
||
|
|
|
||
|
|
For testing and development:
|
||
|
|
|
||
|
|
| Adapter | Data Structure |
|
||
|
|
|---------|---------------|
|
||
|
|
| `InMemoryFieldSessionRepository` | Map<string, FieldSession> |
|
||
|
|
| `InMemoryMissionRepository` | Map<string, Mission> |
|
||
|
|
| `InMemoryDecisionCaseRepository` | Map<string, DecisionCase> |
|
||
|
|
| `InMemoryArtifactRegistry` | Map<string, Artifact> |
|
||
|
|
| `InMemoryEventStore` | Array<DomainEvent> |
|
||
|
|
| `InMemoryUnitOfWork` | Coordinates all above |
|
||
|
|
|
||
|
|
## Future Adapters
|
||
|
|
|
||
|
|
| Adapter | Technology | Status |
|
||
|
|
|---------|-----------|--------|
|
||
|
|
| PostgreSQL repositories | PostgreSQL | Planned |
|
||
|
|
| S3 Artifact Registry | AWS S3 / Cloudflare R2 | Planned |
|
||
|
|
| Event Store | PostgreSQL / EventStoreDB | Planned |
|
||
|
|
|
||
|
|
## ADRs
|
||
|
|
|
||
|
|
- ADR-006: In-Memory Adapters for Testing
|
||
|
|
|
||
|
|
## Dependencies
|
||
|
|
|
||
|
|
- `@landvex/domain` — repository interfaces depend on domain types
|