PendingFutureCarb.swift 610 B

123456789101112131415161718
  1. // LoopFollow
  2. // PendingFutureCarb.swift
  3. import Foundation
  4. /// Tracks a future-dated carb entry that has been observed but whose scheduled time
  5. /// has not yet arrived. Used by `FutureCarbsCondition` to fire a reminder when it's time to eat.
  6. struct PendingFutureCarb: Codable, Equatable {
  7. /// Scheduled eating time (`timeIntervalSince1970`)
  8. let carbDate: TimeInterval
  9. /// Grams of carbs (used together with `carbDate` to identify unique entries)
  10. let grams: Double
  11. /// When the entry was first observed (`timeIntervalSince1970`, for staleness cleanup)
  12. let observedAt: TimeInterval
  13. }