Jul 27 - Update for scheduled task instruction
This commit is contained in:
@@ -38,6 +38,24 @@ final class LocalScheduledInspection {
|
||||
var isOverdue: Bool
|
||||
var notes: String?
|
||||
|
||||
/// Manager-authored instructions for this occurrence, normalised.
|
||||
///
|
||||
/// The wire field, the server model attribute and the DB column are all
|
||||
/// still `notes` — only the user-facing wording changed to "Instructions"
|
||||
/// (web form label + both iPad surfaces). Renaming the stored property would
|
||||
/// break `init(from:)`/`update(from:)` against `APIScheduledInspection.notes`
|
||||
/// for no benefit, so the rename lives here.
|
||||
///
|
||||
/// Returns nil for nil, empty, or whitespace-only text so callers can guard
|
||||
/// with a single `if let` instead of repeating the emptiness check.
|
||||
/// Computed, not stored — no SwiftData schema change.
|
||||
var instructions: String? {
|
||||
guard let t = notes?.trimmingCharacters(in: .whitespacesAndNewlines),
|
||||
!t.isEmpty
|
||||
else { return nil }
|
||||
return t
|
||||
}
|
||||
|
||||
/// Last time this row was refreshed from the server pull.
|
||||
var updatedAt: Date
|
||||
|
||||
|
||||
Reference in New Issue
Block a user