ScheduleLog

final class ScheduleLog : Model

ScheduleLog records changes made to the events in the schedule, both by manual schedule updates (done by uploading a .ics file) and automatic schedule updates (where the server periodically queries Sched.com and applies changes automatically).

Properties

  • id

    The edit’s ID.

    Declaration

    Swift

    @ID
    var id: Int?
  • TRUE if this update was started automatically by the server. The server is currently set up to use Queues to query Sched.com once per hour and automatically apply any schedule updates to our db. FALSE if this was a manual update.

    Declaration

    Swift

    @Field
    var automaticUpdate: Bool
  • The total number of changes between the existing db and the new schedule information. May be > than the number of events modified as it may count a time and location change to a single event as 2 changes.

    Declaration

    Swift

    @Field
    var changeCount: Int
  • The JSON built from the EventUpdateDifferenceData, describing what changed. Will be nil if there was an error or if this was an automatic schedule update check and nothing changed.

    Declaration

    Swift

    @OptionalField
    var differenceData: Data?
  • If this was an automated schedule update and it failed, the failure reason.

    Declaration

    Swift

    @OptionalField
    var errorResult: String?
  • Timestamp of the model’s creation, set automatically.

    Declaration

    Swift

    @Timestamp
    var createdAt: Date?

Initialization

  • Declaration

    Swift

    init()
  • Initializes a new ScheduleLog for a successful update event.

    Declaration

    Swift

    init(diff: EventUpdateDifferenceData?, isAutomatic: Bool) throws

    Parameters

    diff

    The changes between the old and new schedule. Pass in NIL if there we no changes.

    isAutomatic

    TRUE if this update was done by the automatic Queues system.

  • Initializes a new ScheduleLog that reports an error indicating the schedule update did not complete.

    Declaration

    Swift

    init(error: Error) throws

    Parameters

    diff

    The changes between the old and new schedule..