calendar

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(app core.App)

Register attaches Calendar record validation to the application.

Types

type CreateEventCommand

type CreateEventCommand struct {
	Title                 string
	Description           string
	StartAt               string
	EndAt                 string
	AllDay                bool
	Location              string
	Color                 string
	RecurrenceFrequency   string
	RecurrenceInterval    int
	ReminderMinutesBefore *int
}

type Event

type Event struct {
	ID                    string `json:"id"`
	Title                 string `json:"title"`
	Description           string `json:"description,omitempty"`
	StartAt               string `json:"startAt"`
	EndAt                 string `json:"endAt"`
	AllDay                bool   `json:"allDay"`
	Timezone              string `json:"timezone"`
	Location              string `json:"location,omitempty"`
	Color                 string `json:"color"`
	RecurrenceFrequency   string `json:"recurrenceFrequency"`
	RecurrenceInterval    int    `json:"recurrenceInterval"`
	ReminderMinutesBefore int    `json:"reminderMinutesBefore"`
}

func GetDeletableEvent added in v0.0.7

func GetDeletableEvent(ctx context.Context, app core.App, actorID, eventID string) (Event, error)

GetDeletableEvent resolves an owned event for a human-readable approval prompt. Repeating events are stored as one record, so deleting the record removes the complete series.

type EventMutationResult

type EventMutationResult struct {
	OK     bool   `json:"ok"`
	Action string `json:"action"`
	Event  Event  `json:"event"`
}

func CreateEvent

func CreateEvent(ctx context.Context, app core.App, actorID string, command CreateEventCommand) (EventMutationResult, error)

func DeleteEvent added in v0.0.7

func DeleteEvent(ctx context.Context, app core.App, actorID, eventID string) (EventMutationResult, error)

DeleteEvent re-reads and re-authorizes the event immediately before the mutation so an approval cannot outlive an ownership or target change.

func UpdateEvent

func UpdateEvent(ctx context.Context, app core.App, actorID string, command UpdateEventCommand) (EventMutationResult, error)

type EventOccurrence

type EventOccurrence struct {
	Event
	OccurrenceDate string `json:"occurrenceDate"`
	InstanceStart  string `json:"instanceStart"`
	InstanceEnd    string `json:"instanceEnd"`
}

func OccurrenceOnDate

func OccurrenceOnDate(record *core.Record, requested time.Time, location *time.Location) (EventOccurrence, bool)

OccurrenceOnDate returns the event occurrence on requested in the provided system location. Notification scheduling uses this to keep all reminders on the configured system timezone instead of the process or browser timezone.

type ScheduleDay

type ScheduleDay struct {
	Date   string            `json:"date"`
	Tasks  []ScheduleTask    `json:"tasks"`
	Events []EventOccurrence `json:"events"`
}

type ScheduleResult

type ScheduleResult struct {
	Days []ScheduleDay `json:"days"`
}

func GetSchedule

func GetSchedule(ctx context.Context, app core.App, actorID string, dates []string) (ScheduleResult, error)

type ScheduleTask

type ScheduleTask struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	Priority    string `json:"priority"`
	DueDate     string `json:"dueDate"`
	ProjectID   string `json:"projectId"`
	ProjectName string `json:"projectName"`
	StateID     string `json:"stateId"`
	StateName   string `json:"stateName"`
	Completed   bool   `json:"completed"`
}

type SearchEventsResult added in v0.0.9

type SearchEventsResult struct {
	Events   []Event `json:"events"`
	Total    int     `json:"total"`
	Complete bool    `json:"complete"`
}

func SearchEvents added in v0.0.9

func SearchEvents(ctx context.Context, app core.App, actorID, query, from, to string) (SearchEventsResult, error)

SearchEvents lists owned events and optionally filters them by text. GetSchedule answers for exact dates instead, so locating an event by name through it means guessing dates and scanning. A repeating event makes that worse, because it only surfaces on the dates its recurrence lands on.

Results are the events themselves rather than occurrences. The caller wants the record and its ID in order to edit or delete it, and a repeating event has one record however many times it occurs.

type UpdateEventCommand

type UpdateEventCommand struct {
	EventID               string
	Title                 *string
	Description           *string
	StartAt               *string
	EndAt                 *string
	AllDay                *bool
	Location              *string
	Color                 *string
	RecurrenceFrequency   *string
	RecurrenceInterval    *int
	ReminderMinutesBefore *int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL