diff --git a/lib/controllers/providers/api/service_requests_provider.dart b/lib/controllers/providers/api/service_requests_provider.dart index a9ad27cd..ade9ef31 100644 --- a/lib/controllers/providers/api/service_requests_provider.dart +++ b/lib/controllers/providers/api/service_requests_provider.dart @@ -254,7 +254,11 @@ class ServiceRequestsProvider extends ChangeNotifier { ], "callComments": request.callComments, "noofFollowup": 0, - // "status": null, + "status": request.statusId == null + ? null + : { + "id": request.statusId, + }, "callLastSituation": null, "firstAction": request.firstAction?.toMap(), "loanAvailablity": request.loanAvailability?.toMap(), diff --git a/lib/models/service_request/service_request.dart b/lib/models/service_request/service_request.dart index 36885189..68a55eb8 100644 --- a/lib/models/service_request/service_request.dart +++ b/lib/models/service_request/service_request.dart @@ -19,6 +19,7 @@ class ServiceRequest { String date; String audio; int statusValue; + int statusId; String statusLabel; String reviewComment; String comments; @@ -54,6 +55,7 @@ class ServiceRequest { this.callComments, this.statusLabel, this.statusValue, + this.statusId, this.departmentName, this.deviceId, this.audio, @@ -82,8 +84,7 @@ class ServiceRequest { factory ServiceRequest.fromJson(Map parsedJson) { List images = []; - if(parsedJson["attachmentsCallRequest"]!=null) - if (parsedJson["attachmentsCallRequest"] is List) { + if (parsedJson["attachmentsCallRequest"] != null) if (parsedJson["attachmentsCallRequest"] is List) { List list = parsedJson["attachmentsCallRequest"]; images = list.map((e) => URLs.getFileUrl(e["attachmentsCallRequest"])).toList(); } @@ -104,6 +105,7 @@ class ServiceRequest { comments: parsedJson["comments"], statusLabel: parsedJson["status"] == null ? null : parsedJson["status"]["name"], statusValue: parsedJson["status"] == null ? null : parsedJson["status"]["value"], + statusId: parsedJson["status"] == null ? null : parsedJson["status"]["id"], departmentName: parsedJson["asset"]["department"] != null ? parsedJson["asset"]["department"]["name"] : "", engineerName: parsedJson["assignedEmployee"] == null ? null : parsedJson["assignedEmployee"]["name"], engineerId: parsedJson["assignedEmployee"] == null ? null : parsedJson["assignedEmployee"]["id"],