Jul 13 - Update codes to catch up with the web app updates: scheduled inspection and issue's handler

This commit is contained in:
Nguyen Ngo
2026-07-13 14:03:41 -04:00
parent c05f0029fb
commit 20f9a99646
22 changed files with 5800 additions and 18 deletions
+23
View File
@@ -153,6 +153,20 @@ final class LocalIssue {
/// Nil when unassigned. Updated on every pullAssignedIssues().
var assignedToName: String?
// Handler ("Handled By", phase35)
// Who resolves the issue: internal (our staff) | facility (facility's own
// staff) | vendor (external contractor). Synced from the server; the
// inspector may also set it from Issue Detail. nil-default optionals
// SwiftData lightweight migration safe.
var handlerType: String? // "internal" | "facility" | "vendor"
var handlerLabel: String? // human-readable label from server
var facilityHandlerName: String?
var facilityHandlerContact: String?
var facilityHandlerNotes: String?
var vendorName: String?
var vendorContact: String?
var vendorNotes: String?
// Explicit inverse declared so SwiftData has an unambiguous relationship
// graph at schema-build time. Without it the relationship is implicit,
// which can cause migration warnings or incorrect cascade behaviour on some
@@ -192,6 +206,15 @@ final class LocalIssue {
self.reportedByName = nil
self.areaNameCache = nil
self.assignedToName = nil
// Handler fields nil by default
self.handlerType = nil
self.handlerLabel = nil
self.facilityHandlerName = nil
self.facilityHandlerContact = nil
self.facilityHandlerNotes = nil
self.vendorName = nil
self.vendorContact = nil
self.vendorNotes = nil
}
var severityColor: String {