2026-07-02 16:01:29 +00:00
|
|
|
# @landvex/api
|
|
|
|
|
|
|
|
|
|
Mission Import API for LandveX Intelligence Lab.
|
|
|
|
|
|
|
|
|
|
## MVP-0: First Field Upload
|
|
|
|
|
|
|
|
|
|
Minimal API for importing missions with video files.
|
|
|
|
|
|
|
|
|
|
### Endpoints
|
|
|
|
|
|
|
|
|
|
| Method | Endpoint | Description |
|
|
|
|
|
|--------|----------|-------------|
|
|
|
|
|
| POST | `/api/v1/missions/import` | Import mission with video |
|
|
|
|
|
| GET | `/api/v1/missions/:id` | Get mission by ID |
|
|
|
|
|
| GET | `/api/v1/missions` | List active missions |
|
|
|
|
|
| GET | `/health` | Health check |
|
|
|
|
|
|
|
|
|
|
### Import Mission
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-07-02 17:34:19 +00:00
|
|
|
curl -X POST http://localhost:3002/api/v1/missions/import \
|
2026-07-02 16:01:29 +00:00
|
|
|
-F "inspector=erik_svensson" \
|
|
|
|
|
-F "location[lat]=59.3293" \
|
|
|
|
|
-F "location[lng]=18.0686" \
|
|
|
|
|
-F "device[model]=iPhone14,2" \
|
|
|
|
|
-F "device[os]=iOS 17.0" \
|
|
|
|
|
-F "device[appVersion]=1.0.0" \
|
|
|
|
|
-F "video=@/path/to/video.mp4"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Response
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"missionId": "mission_20260702_000001",
|
|
|
|
|
"sessionId": "session_20260702_000001",
|
|
|
|
|
"artifactId": "artifact_000001",
|
|
|
|
|
"status": "created",
|
|
|
|
|
"file": {
|
|
|
|
|
"originalName": "video.mp4",
|
|
|
|
|
"size": 12345678,
|
|
|
|
|
"path": "uploads/abc123.mp4"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Express Router → Application Handlers → Domain → In-Memory Repositories
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**No AI. No processing. Just store and track.**
|
|
|
|
|
|
|
|
|
|
## Dependencies
|
|
|
|
|
|
|
|
|
|
- `@landvex/application` — use cases
|
|
|
|
|
- `@landvex/infrastructure` — in-memory repositories (swap for PostgreSQL in PR-003B)
|
|
|
|
|
- `@landvex/domain` — domain objects
|
|
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
npm test
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
5 tests verifying MVP-0 acceptance criteria.
|