API+App+Admin: telemetria bytnosci w ogolnym widoku sirowni - GET /gyms/:id/presence-stats (heatmapa dzien×godzina, sredni pobyt, wizyty/dzien, szczyt, teraz w srodku, top urzadzenia; stale 30 dni), wspoldzielony komponent PresenceHeatmap, telemetria wyciagnieta z podstrony statystyk; pasek godzin w forma zegarowa z minutami, usuniete karta Dane i filtr okresu; swagger + testy integracyjne, unit i e2e

This commit is contained in:
tisachi
2026-10-27 05:32:55 +01:00
parent 104748b3e8
commit 1629068bf0
30 changed files with 965 additions and 507 deletions

View File

@@ -588,6 +588,27 @@ export const openapi: Record<string, unknown> = {
},
},
},
'/gyms/{gymId}/presence-stats': {
get: {
tags: ['Gyms'],
summary:
'Presence telemetry of a gym (general view): day×hour heatmap, avg stay, visits/day, peak, live, top equipment. REAL visible to all logged-in users; VIRTUAL to managers only (empty — presence is REAL only). Default range: last 30 days',
security: [{ bearerAuth: [] }],
parameters: [
{ name: 'gymId', in: 'path', required: true, schema: { type: 'string' } },
{ name: 'from', in: 'query', schema: { type: 'string', format: 'date-time' } },
{ name: 'to', in: 'query', schema: { type: 'string', format: 'date-time' } },
],
responses: {
200: {
description:
'OK, returns { gym, stats: { visits, avgStayMinutes, heatmap: [{ day, hour, count }], topGyms, peak, topEquipment, live, visitsPerDay } }',
},
403: { description: 'VIRTUAL gym and the caller is not a manager' },
404: { description: 'Gym not found' },
},
},
},
'/gyms/{gymId}/stats/overview': {
get: {
tags: ['Gyms'],