Documentation
¶
Index ¶
- func Register(app core.App)
- type CreateEventCommand
- type Event
- type EventMutationResult
- func CreateEvent(ctx context.Context, app core.App, actorID string, command CreateEventCommand) (EventMutationResult, error)
- func DeleteEvent(ctx context.Context, app core.App, actorID, eventID string) (EventMutationResult, error)
- func UpdateEvent(ctx context.Context, app core.App, actorID string, command UpdateEventCommand) (EventMutationResult, error)
- type EventOccurrence
- type ScheduleDay
- type ScheduleResult
- type ScheduleTask
- type SearchEventsResult
- type UpdateEventCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateEventCommand ¶
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
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 ¶
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.