package collections import "slices" var Synced = []string{"entries", "closed_days", "closed_weeks", "settings_history", "balance_adjustments"} // ReadOnly collections are pulled by clients but only ever written by the server. var ReadOnly = []string{"closed_days", "closed_weeks"} // DataFields lists, per synced collection, the record fields that hold the data // of a row, in contrast to the sync fields every collection shares (owner, rev, // client_updated_at and deleted). Only the fields of the writable collections // reach the records through the push endpoint; the read-only collections are // written by the server alone. var DataFields = map[string][]string{ "entries": {"start_time", "end_time", "auto_stopped", "note", "day_key"}, "closed_days": {"day_key", "worked_ms", "kind", "closed_at"}, "closed_weeks": {"week_key", "expected_ms", "worked_ms", "delta_ms", "closed_at"}, "settings_history": {"effective_from", "hours_per_week", "workdays_mask", "timezone"}, "balance_adjustments": {"delta_ms", "note", "effective_at"}, } func IsSynced(name string) bool { return slices.Contains(Synced, name) } func IsReadOnly(name string) bool { return slices.Contains(ReadOnly, name) }