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:
@@ -1,28 +1,36 @@
|
||||
-- name: CreateCalendar :one
|
||||
INSERT INTO calendars (id, owner_id, name, color, is_public)
|
||||
VALUES ($1, $2, $3, $4, $5)
|
||||
RETURNING id, owner_id, name, color, is_public, public_token, created_at, updated_at;
|
||||
RETURNING id, owner_id, name, color, is_public, public_token, count_for_availability, default_reminder_minutes, sort_order, created_at, updated_at;
|
||||
|
||||
-- name: GetCalendarByID :one
|
||||
SELECT id, owner_id, name, color, is_public, public_token, created_at, updated_at
|
||||
SELECT id, owner_id, name, color, is_public, public_token, count_for_availability, default_reminder_minutes, sort_order, created_at, updated_at
|
||||
FROM calendars
|
||||
WHERE id = $1 AND deleted_at IS NULL;
|
||||
|
||||
-- name: ListCalendarsByUser :many
|
||||
SELECT c.id, c.owner_id, c.name, c.color, c.is_public, c.created_at, c.updated_at, cm.role
|
||||
SELECT c.id, c.owner_id, c.name, c.color, c.is_public, c.count_for_availability, c.default_reminder_minutes, c.sort_order, c.created_at, c.updated_at, cm.role
|
||||
FROM calendars c
|
||||
JOIN calendar_members cm ON cm.calendar_id = c.id
|
||||
WHERE cm.user_id = $1 AND c.deleted_at IS NULL
|
||||
ORDER BY c.created_at ASC;
|
||||
ORDER BY c.sort_order ASC, c.created_at ASC;
|
||||
|
||||
-- name: ListCalendarsByOwnerForAvailability :many
|
||||
SELECT id, owner_id, name, color, is_public, public_token, count_for_availability, default_reminder_minutes, sort_order, created_at, updated_at
|
||||
FROM calendars
|
||||
WHERE owner_id = $1 AND deleted_at IS NULL AND count_for_availability = true;
|
||||
|
||||
-- name: UpdateCalendar :one
|
||||
UPDATE calendars
|
||||
SET name = COALESCE(sqlc.narg('name')::TEXT, name),
|
||||
color = COALESCE(sqlc.narg('color')::TEXT, color),
|
||||
is_public = COALESCE(sqlc.narg('is_public')::BOOLEAN, is_public),
|
||||
count_for_availability = COALESCE(sqlc.narg('count_for_availability')::BOOLEAN, count_for_availability),
|
||||
default_reminder_minutes = COALESCE(sqlc.narg('default_reminder_minutes')::INTEGER, default_reminder_minutes),
|
||||
sort_order = COALESCE(sqlc.narg('sort_order')::INTEGER, sort_order),
|
||||
updated_at = now()
|
||||
WHERE id = @id AND deleted_at IS NULL
|
||||
RETURNING id, owner_id, name, color, is_public, public_token, created_at, updated_at;
|
||||
RETURNING id, owner_id, name, color, is_public, public_token, count_for_availability, default_reminder_minutes, sort_order, created_at, updated_at;
|
||||
|
||||
-- name: SoftDeleteCalendar :exec
|
||||
UPDATE calendars SET deleted_at = now(), updated_at = now()
|
||||
@@ -32,10 +40,10 @@ WHERE id = $1 AND deleted_at IS NULL;
|
||||
UPDATE calendars SET deleted_at = now(), updated_at = now()
|
||||
WHERE owner_id = $1 AND deleted_at IS NULL;
|
||||
|
||||
-- name: GetCalendarByPublicToken :one
|
||||
SELECT id, owner_id, name, color, is_public, public_token, created_at, updated_at
|
||||
-- name: GetCalendarByToken :one
|
||||
SELECT id, owner_id, name, color, is_public, public_token, count_for_availability, default_reminder_minutes, sort_order, created_at, updated_at
|
||||
FROM calendars
|
||||
WHERE public_token = $1 AND is_public = true AND deleted_at IS NULL;
|
||||
WHERE public_token = $1 AND deleted_at IS NULL;
|
||||
|
||||
-- name: SetCalendarPublicToken :exec
|
||||
UPDATE calendars
|
||||
|
||||
Reference in New Issue
Block a user