Enhancements

merge-requests/24/head
zaid_daoud 1 year ago
parent 8968f9ae2f
commit 048774bd8c

@ -11,8 +11,7 @@ class URLs{
set host(String value) => _host = value;
static String getFileUrl(String file) => file == null || file.isEmpty
? null : "$_host/attachment/$file";
static String getFileUrl(String file) => file == null || file.isEmpty ? null : "$_host/attachment/$file";
// API Routes
static get login => "$_baseUrl/MobileAuth/Login"; // post
@ -39,7 +38,7 @@ class URLs{
static get getRecentNotifications => "$_baseUrl/return/user/recent/notification"; // get
static get createRequest => "$_baseUrl/CallRequest/AddCallRequest"; // get
static get createReport => "$_baseUrl/handle/create/report/issue"; // get
static get updateRequestDate => "$_baseUrl/handle/update/request"; // get
static get updateRequestDate => "$_baseUrl/CallRequest/UpdateCallRequest"; // get
// service report
static get createServiceReport => "$_baseUrl/WorkOrder/AddWorkOrder"; // get
@ -83,5 +82,4 @@ class URLs{
static get getPentryStatus => "$_baseUrl/Lookups/GetLookup?lookupEnum=401"; // get
// contacts
static get getPentryContacts => "$_baseUrl/handle/return/all/contacts"; // get
}

@ -193,17 +193,15 @@ class ServiceRequestsProvider extends ChangeNotifier {
@required ServiceRequest request,
}) async {
Response response;
Map<String, String> body = {};
body["uid"] = user.id;
body["token"] = user.token;
body["nid"] = request.id;
if (newDate != null) body["date"] = newDate;
if (employee != null) body["ass_emp"] = employee.id.toString();
var body = {
"callCreatedBy": {"id": user.id, "name": user.userName},
"assets": request.deviceId == null ? [] : [request.deviceId],
"requestedDate": newDate,
"requestedTime": newDate,
};
try {
response = await post(
Uri.parse(
//host+
URLs.updateRequestDate),
response = await ApiManager.instance.put(
URLs.updateRequestDate,
body: body,
);
stateCode = response.statusCode;

@ -12,7 +12,6 @@ class Device{
ModelDefinition modelDefinition;
Hospital hospital;
Device({
this.id,
this.serialNumber,
@ -21,14 +20,9 @@ class Device{
// this.brand,
// this.model,
this.modelDefinition,
});
factory Device.fromJson(Map<String, dynamic> parsedJson) {
return Device(
id: parsedJson["id"],
serialNumber: parsedJson["assetSerialNo"],
@ -60,6 +54,7 @@ class Device{
'modelDefinition': modelDefinition.toJson(),
'site': hospital.toMap(),
'AssetType': assetType.toMap(),
"supplier": {"id": 0, "suppliername": "string"},
};
}
}

@ -113,41 +113,6 @@ class ServiceReport {
}
_map["nurseSignature"] = signatureNurse;
_map["engSignature"] = signatureEngineer;
// ///TODO : zaid
// _map["supplier"] = {
// "id": 0,
// "suppliername": "string",
// "name": "string",
// "website": "string",
// "email": "string",
// "code": "string",
// "suppNo": 0,
// "suppStatusId": 0,
// "cityId": 0,
// "person": "string",
// "comment": "string",
// "zipcode": 0,
// "contact": "string",
// "telephones": [
// {"id": 0, "supplierId": 0, "telephone": "string"}
// ],
// "faxes": [
// {"id": 0, "supplierId": 0, "fax": "string"}
// ],
// "addresses": [
// {"id": 0, "supplierId": 0, "address": "string"}
// ],
// "attachments": [
// {"id": 0, "supplierId": 0, "attachmentName": "string", "attachmentURL": "string"}
// ],
// "suppPersons": [
// {"id": 0, "supplierId": 0, "personName": "string", "personRoleId": 0, "contact": "string", "externalEngCode": "string", "email": "string"}
// ],
// "suppTCodes": [
// {"id": 0, "supplierId": 0, "codeTypeId": 0, "codeValue": "string"}
// ]
// };
return _map;
}

Loading…
Cancel
Save