feat(houseofrc): fetch club events, classes and entries with transponders via the timing API (1.81.0)

This commit is contained in:
larssand committed 2026-11-08 15:53:57 +01:00
1 parent 9c1f5713e6
commit b0f2b92c04
15 files changed
+247 -149

No files matched your search

+5 -5
View File
@@ -1007,12 +1007,12 @@ Status 2026-11-08 (1.78.0-1.80.0):
- [x] Key stored server-side (`data/houseofrc.json`, mode 600), Settings → System → House of RC with **Test connection** (`/v1/me` works).
- [x] Drivers → **Fetch from House of RC**: names and makes by transponder (`/timing/users`); drivers are linked by `houseOfRcId`.
- [x] Race wizard → **Fetch from House of RC**: events via `/v1/events` (filtered by country here), entries via `/results?event_id=` (before the race it lists the entered drivers with 0 points). The race stores `houseOfRc.eventId`.
- Note: on 2026-11-08 `/results` answered 404 for every event (also ones that listed entries the day before) and `/openapi.yaml` gave "Server Error"; ask Conny.
- [x] 1.81.0: House of RC added a timing API (2026-11-08). The club's organization key (from `/v1/me`, e.g. Jämtlands MK = 233) lists its events (`/v1/events?parent_id=`), and `GET /v1/timing/events/{id}/entries` gives the classes, entries (status, driver number, transponders, club, car) and drivers. The old `/results` is gone. Contact details are dropped on the server.
Still open with Conny:
- [x] Test the key with `GET /v1/me`.
- [ ] An event's classes (eventclass ID + name), e.g. `/v1/events/{id}/classes`, so one fetch can create a race per class instead of choosing our class by hand.
- [ ] The transponder per entry (or the eventclass ID per row in `/results`), so new drivers don't need it typed in.
Next:
- [ ] **Results back:** `POST /v1/timing/events/{id}/entries` with `{ entries: [{ id, ranking, qualification, points, tq, laps_time, data }] }`, all or nothing, up to 2000 entries. `data.result` is shown on House of RC (`main`, `main_position`, `bumped_from`, `race`, `best_lap`, `average_lap`, `points`, `heats[]`). The race already keeps each driver's entry id (`event.houseOfRc.entryIds`).
- [ ] **Semi-live (Conny's idea):** post after every heat, with that heat's results in `data`; House of RC would add a view showing only the latest heat.
- [ ] One click for all classes: create one race per House of RC class.
- [ ] The URL and JSON body for posting results, with an example of a qualifying-plus-finals result (TQ, A/B/C finals). Can a result be posted again, overwriting the previous one, after a correction?
- [ ] A test event to post against.