feat: implement award definition editor with safety validation

Add comprehensive admin-only UI for managing award definitions stored as JSON files.

Backend changes:
- Add awards-admin.service.js with file operations and validation
- Add clearAwardCache() function to invalidate in-memory cache after changes
- Add API routes: GET/POST/PUT/DELETE /api/admin/awards, POST /api/admin/awards/:id/test
- Support testing unsaved awards by passing award definition directly

Frontend changes:
- Add awards list view at /admin/awards
- Add create form at /admin/awards/create with safety checks for:
  - Impossible filter combinations (e.g., mode=CW AND mode=SSB)
  - Redundant filters and mode groups
  - Logical contradictions (e.g., satellite_only with HF-only bands)
  - Duplicate callsigns, empty mode groups, etc.
- Add edit form at /admin/awards/[id] with same validation
- Add FilterBuilder component for nested filter structures
- Add TestAwardModal with deep validation and test calculation
- Add Awards tab to admin dashboard

Safety validation includes:
- Schema validation (required fields, types, formats)
- Business rule validation (valid rule types, operators, bands, modes)
- Cross-field validation (filter contradictions, allowed_bands conflicts)
- Edge case detection (complex filters, impossible targets)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-23 08:16:28 +01:00
parent b9b6afedb8
commit bd89ea0855
11 changed files with 4951 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
{
"id": "qo100grids",
"name": "QO100 Grids",
"description": "Work as much Grids as possible on QO100 Satellite",
"caption": "Work as much Grids as possible on QO100 Satellite",
"category": "satellite",
"rules": {
"type": "entity",
"satellite_only": true,
"filters": {
"operator": "AND",
"filters": [
{
"field": "satName",
"operator": "eq",
"value": "QO-100"
}
]
},
"entityType": "grid",
"target": 100,
"displayField": "grid"
},
"modeGroups": {}
}