Aug 25 - Implement new function allow Director (internal & customer) to assign and inspection to another inspector
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user