05/05 Update the API to follow-up and resinspection
This commit is contained in:
@@ -39,6 +39,18 @@ final class LocalInspection {
|
||||
var syncErrorMessage: String?
|
||||
var syncRetryCount: Int
|
||||
|
||||
// ── Follow-up / re-inspection (populated from server after sync) ───────
|
||||
/// Set by director/admin on the web app; signals this inspection needs a follow-up.
|
||||
@Attribute var followUpRequired: Bool = false
|
||||
/// Optional note explaining what the follow-up should address.
|
||||
var followUpNote: String?
|
||||
/// Server ID of the parent inspection this record is a re-inspection of.
|
||||
var parentServerId: Int?
|
||||
/// Local UUID of the parent LocalInspection — set at creation, always available
|
||||
/// regardless of whether the parent has synced. Used to clear the parent's
|
||||
/// followUpRequired badge without relying on parentServerId being non-nil.
|
||||
var parentLocalId: String?
|
||||
|
||||
// ── Relationships ──────────────────────────────────────────────────────
|
||||
@Relationship(deleteRule: .cascade) var pendingPhotos: [PendingPhoto]
|
||||
@Relationship(deleteRule: .cascade) var localIssues: [LocalIssue]
|
||||
@@ -66,6 +78,10 @@ final class LocalInspection {
|
||||
self.syncStatus = "pending"
|
||||
self.syncErrorMessage = nil
|
||||
self.syncRetryCount = 0
|
||||
self.followUpRequired = false
|
||||
self.followUpNote = nil
|
||||
self.parentServerId = nil
|
||||
self.parentLocalId = nil
|
||||
self.pendingPhotos = []
|
||||
self.localIssues = []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user