Files
CalendarApi/internal/repository/models.go
Michilis 2cb9d72a7f Add public/private calendars, full iCal support, and iCal URL import
- Public/private: toggle is_public via PUT /calendars/{id}; generate/clear
  public_token and return ical_url when public
- Public feed: GET /cal/{token}/feed.ics (no auth) for subscription in
  Google/Apple/Outlook calendars
- Full iCal export: use golang-ical; VALARM, ATTENDEE, all-day (VALUE=DATE),
  RRULE, DTSTAMP, CREATED, LAST-MODIFIED
- Full iCal import: parse TZID, VALUE=DATE, VALARM, ATTENDEE, RRULE
- Import from URL: POST /calendars/import-url with calendar_id + url
- Migration: unique index on public_token, calendar_subscriptions table
- Config: BASE_URL for ical_url; Calendar model + API: ical_url field
- Docs: OpenAPI, llms.txt, README, SKILL.md, about/overview

Made-with: Cursor
2026-02-28 04:48:53 +00:00

148 lines
5.1 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.30.0
package repository
import (
"github.com/jackc/pgx/v5/pgtype"
)
type ApiKey struct {
ID pgtype.UUID `json:"id"`
UserID pgtype.UUID `json:"user_id"`
Name string `json:"name"`
KeyHash string `json:"key_hash"`
Scopes []byte `json:"scopes"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
}
type AuditLog struct {
ID pgtype.UUID `json:"id"`
EntityType string `json:"entity_type"`
EntityID pgtype.UUID `json:"entity_id"`
Action string `json:"action"`
UserID pgtype.UUID `json:"user_id"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type BookingLink struct {
ID pgtype.UUID `json:"id"`
CalendarID pgtype.UUID `json:"calendar_id"`
Token string `json:"token"`
DurationMinutes int32 `json:"duration_minutes"`
BufferMinutes int32 `json:"buffer_minutes"`
Timezone string `json:"timezone"`
WorkingHours []byte `json:"working_hours"`
Active bool `json:"active"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Calendar struct {
ID pgtype.UUID `json:"id"`
OwnerID pgtype.UUID `json:"owner_id"`
Name string `json:"name"`
Color string `json:"color"`
IsPublic bool `json:"is_public"`
PublicToken pgtype.Text `json:"public_token"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}
type CalendarMember struct {
CalendarID pgtype.UUID `json:"calendar_id"`
UserID pgtype.UUID `json:"user_id"`
Role string `json:"role"`
}
type CalendarSubscription struct {
ID pgtype.UUID `json:"id"`
CalendarID pgtype.UUID `json:"calendar_id"`
SourceUrl string `json:"source_url"`
LastSyncedAt pgtype.Timestamptz `json:"last_synced_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type Contact struct {
ID pgtype.UUID `json:"id"`
OwnerID pgtype.UUID `json:"owner_id"`
FirstName pgtype.Text `json:"first_name"`
LastName pgtype.Text `json:"last_name"`
Email pgtype.Text `json:"email"`
Phone pgtype.Text `json:"phone"`
Company pgtype.Text `json:"company"`
Notes pgtype.Text `json:"notes"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}
type Event struct {
ID pgtype.UUID `json:"id"`
CalendarID pgtype.UUID `json:"calendar_id"`
Title string `json:"title"`
Description pgtype.Text `json:"description"`
Location pgtype.Text `json:"location"`
StartTime pgtype.Timestamptz `json:"start_time"`
EndTime pgtype.Timestamptz `json:"end_time"`
Timezone string `json:"timezone"`
AllDay bool `json:"all_day"`
RecurrenceRule pgtype.Text `json:"recurrence_rule"`
Tags []string `json:"tags"`
CreatedBy pgtype.UUID `json:"created_by"`
UpdatedBy pgtype.UUID `json:"updated_by"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}
type EventAttachment struct {
ID pgtype.UUID `json:"id"`
EventID pgtype.UUID `json:"event_id"`
FileUrl string `json:"file_url"`
}
type EventAttendee struct {
ID pgtype.UUID `json:"id"`
EventID pgtype.UUID `json:"event_id"`
UserID pgtype.UUID `json:"user_id"`
Email pgtype.Text `json:"email"`
Status string `json:"status"`
}
type EventException struct {
ID pgtype.UUID `json:"id"`
EventID pgtype.UUID `json:"event_id"`
ExceptionDate pgtype.Date `json:"exception_date"`
Action string `json:"action"`
}
type EventReminder struct {
ID pgtype.UUID `json:"id"`
EventID pgtype.UUID `json:"event_id"`
MinutesBefore int32 `json:"minutes_before"`
}
type RefreshToken struct {
ID pgtype.UUID `json:"id"`
UserID pgtype.UUID `json:"user_id"`
TokenHash string `json:"token_hash"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
RevokedAt pgtype.Timestamptz `json:"revoked_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type User struct {
ID pgtype.UUID `json:"id"`
Email string `json:"email"`
PasswordHash string `json:"password_hash"`
Timezone string `json:"timezone"`
IsActive bool `json:"is_active"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
DeletedAt pgtype.Timestamptz `json:"deleted_at"`
}