# Module: Nexus Update Service

**Placering:** `source/nexus-update-service/`  
**Fase:** 6  
**Type:** Cloud service + Agent integration

---

## Funktioner

- Platform-opdateringer (Shell, Agent)
- App package hosting (MSI, MSIX, EXE)
- Deployment jobs med targeting (gruppe/enhed)
- Staged rollout (canary → broad)
- Silent install via Agent
- Rollback ved failure
- Version compatibility matrix
- Delta-opdateringer (fremtid)

---

## Ansvar

| Ansvar | Ejer |
|--------|------|
| Package storage og versioning | Update Service |
| Deployment orchestration | Update Service |
| Package download og install | Agent (eksekvering) |
| Platform self-update | Update Service + Agent |

---

## Datamodel

```
Package
├── id: UUID (PK)
├── name: string
├── version: string
├── type: msi|msix|exe|nexus-platform
├── file_url: string
├── file_hash: SHA256
├── file_size: bigint
├── install_command: string
├── uninstall_command: string
├── metadata: JSON

Deployment
├── id: UUID (PK)
├── package_id: UUID (FK)
├── target_type: device|group|all
├── target_id: UUID
├── status: pending|in_progress|completed|failed|rolled_back
├── rollout_percentage: integer
├── scheduled_at: timestamp
├── created_by: UUID (FK)

DeploymentStatus
├── deployment_id: UUID (FK)
├── device_id: UUID (FK)
├── status: pending|downloading|installing|success|failed
├── progress: integer (0-100)
├── error_message: text
├── completed_at: timestamp

PlatformVersion
├── component: shell|agent
├── version: string
├── min_compatible: string
├── package_id: UUID (FK)
├── released_at: timestamp
```

---

## Afhængigheder

| Afhænger af | Hvorfor |
|-------------|---------|
| Nexus Agent | Download og install |
| Device Management | Targeting |
| Object Storage | Package files |

| Afhænges af af | Hvorfor |
|----------------|---------|
| App Center | App installation |
| Alle klienter | Platform updates |

---

*Se: [roadmap/PHASE_06_SOFTWARE_DEPLOYMENT.md](../roadmap/PHASE_06_SOFTWARE_DEPLOYMENT.md)*
