Aug 25 - Implement new function allow Director (internal & customer) to assign and inspection to another inspector

This commit is contained in:
2026-08-25 12:30:06 -04:00
parent 3f30e2c7bd
commit ca7c09f982
3 changed files with 36 additions and 0 deletions
+9
View File
@@ -302,6 +302,12 @@ struct APIInspectionSummary: Decodable, Identifiable, Hashable, Sendable {
let followUpRequired: Bool
let followUpNote: String?
let parentInspectionId: Int?
/// phase53 who was asked to perform the follow-up. nil means it belongs
/// to the inspection's own inspector, which is what it always meant.
/// The list endpoint already returns only follow-ups this user OWNS, so
/// these are for display, not filtering.
let followUpAssignedTo: Int?
let followUpAssignedToName: String?
/// Form field values as [fieldId: stringValue] for the grid renderer.
var formValues: [String: String] {
@@ -368,6 +374,8 @@ struct APIInspectionSummary: Decodable, Identifiable, Hashable, Sendable {
followUpRequired = (try? c.decode(Bool.self, forKey: .followUpRequired)) ?? false
followUpNote = try? c.decode(String.self, forKey: .followUpNote)
parentInspectionId = try? c.decode(Int.self, forKey: .parentInspectionId)
followUpAssignedTo = try? c.decode(Int.self, forKey: .followUpAssignedTo)
followUpAssignedToName = try? c.decode(String.self, forKey: .followUpAssignedToName)
}
private enum CodingKeys: String, CodingKey {
case id, templateId, templateName, facilityId, facilityName
@@ -376,6 +384,7 @@ struct APIInspectionSummary: Decodable, Identifiable, Hashable, Sendable {
case formData, formSchema
case formMedia
case followUpRequired, followUpNote, parentInspectionId
case followUpAssignedTo, followUpAssignedToName
}
// Explicit Hashable formDataRaw/formSchemaRaw contain JSONValue which