Add OpenAPI docs, frontend, migrations, and API updates

- OpenAPI: add missing endpoints (add-from-url, subscriptions, public availability)
- OpenAPI: CalendarSubscription schema, Subscriptions tag
- Frontend app
- Migrations: count_for_availability, subscriptions_sync, user_preferences, calendar_settings
- Config, rate limit, auth, calendar, booking, ICS, availability, user service updates

Made-with: Cursor
This commit is contained in:
Michilis
2026-03-02 14:07:55 +00:00
parent 2cb9d72a7f
commit 75105b8b46
8120 changed files with 1486881 additions and 314 deletions

View File

@@ -1,8 +1,31 @@
-- name: CreateCalendarSubscription :one
INSERT INTO calendar_subscriptions (id, calendar_id, source_url)
VALUES ($1, $2, $3)
INSERT INTO calendar_subscriptions (id, calendar_id, source_url, sync_interval_minutes)
VALUES ($1, $2, $3, $4)
RETURNING *;
-- name: GetSubscriptionByCalendar :one
-- name: ListSubscriptionsByCalendar :many
SELECT * FROM calendar_subscriptions
WHERE calendar_id = $1;
WHERE calendar_id = $1
ORDER BY created_at ASC;
-- name: GetSubscriptionByID :one
SELECT * FROM calendar_subscriptions
WHERE id = $1;
-- name: DeleteSubscription :exec
DELETE FROM calendar_subscriptions
WHERE id = $1;
-- name: UpdateSubscriptionLastSynced :exec
UPDATE calendar_subscriptions
SET last_synced_at = now()
WHERE id = $1;
-- name: ListSubscriptionsDueForSync :many
SELECT s.id, s.calendar_id, s.source_url, c.owner_id
FROM calendar_subscriptions s
JOIN calendars c ON c.id = s.calendar_id AND c.deleted_at IS NULL
WHERE s.sync_interval_minutes IS NOT NULL
AND s.sync_interval_minutes > 0
AND (s.last_synced_at IS NULL
OR s.last_synced_at + make_interval(mins => s.sync_interval_minutes::numeric) <= now());