docs: update documentation of STA
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
**Feature**: 001-modbus-relay-control
|
||||
**Phase**: 2 (Domain Layer - Type-Driven Development)
|
||||
**Status**: Complete
|
||||
**Last Updated**: 2026-01-04
|
||||
**Status**: Complete (US1 MVP also complete)
|
||||
**Last Updated**: 2026-05-15
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -419,13 +419,15 @@ backend/src/domain/
|
||||
├── modbus.rs # ModbusAddress type
|
||||
└── relay/
|
||||
├── mod.rs # Relay module exports
|
||||
├── controler.rs # RelayController trait (trait definition)
|
||||
├── controller.rs # RelayController trait (trait definition)
|
||||
├── entity.rs # Relay aggregate
|
||||
└── types/
|
||||
├── mod.rs # Type exports
|
||||
├── relayid.rs # RelayId newtype
|
||||
├── relaystate.rs # RelayState enum
|
||||
└── relaylabel.rs # RelayLabel newtype
|
||||
├── types/
|
||||
│ ├── mod.rs # Type exports
|
||||
│ ├── relayid.rs # RelayId newtype
|
||||
│ ├── relaystate.rs # RelayState enum
|
||||
│ └── relaylabel.rs # RelayLabel newtype
|
||||
└── repository/
|
||||
└── label.rs # RelayLabelRepository trait
|
||||
```
|
||||
|
||||
## Dependency Graph
|
||||
@@ -558,16 +560,16 @@ Coverage: 100% for domain layer
|
||||
|
||||
## Next Steps
|
||||
|
||||
**Phase 3: Infrastructure Layer** (Tasks T028-T040)
|
||||
**Phase 4 (US1 MVP) — Complete** — Users can view all 8 relay states and toggle individual relays on/off via the web UI.
|
||||
|
||||
Now that domain types are complete, the infrastructure layer can:
|
||||
The infrastructure, application, and presentation layers were built on top of these domain types:
|
||||
|
||||
1. Implement `RelayController` trait with real Modbus client
|
||||
2. Create `MockRelayController` for testing
|
||||
3. Implement `RelayLabelRepository` with SQLite
|
||||
4. Use domain types throughout infrastructure code
|
||||
1. **Infrastructure** (Phase 3): `ModbusRelayController` (real Modbus TCP client) + `MockRelayController` (testing), `SqliteRelayLabelRepository` for persistence, with factory functions for dependency injection
|
||||
2. **Application** (Phase 3): `ToggleRelayUseCase`, `GetAllRelaysUseCase`, `HealthMonitor` service
|
||||
3. **Presentation** (Phase 4): `RelayApi` handlers with `RelayDto`, REST endpoints (`GET /api/relays`, `POST /api/relays/{id}/toggle`)
|
||||
4. **Frontend** (Phase 4): Vue 3 + TypeScript with `RelayCard`, `RelayGrid`, `useRelayPolling` composable (2s polling)
|
||||
|
||||
**Key advantage**: Infrastructure layer can depend on stable, well-tested domain types with strong guarantees.
|
||||
**Upcoming phases**: US2 (bulk controls), US3 (health monitoring UI), US4 (relay labeling)
|
||||
|
||||
## References
|
||||
|
||||
|
||||
Reference in New Issue
Block a user