You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
3.7 KiB
Dart
135 lines
3.7 KiB
Dart
import 'package:test_sa/models/lookup.dart';
|
|
import 'package:test_sa/models/new_models/building.dart';
|
|
import 'package:test_sa/models/new_models/department.dart';
|
|
import 'package:test_sa/models/new_models/floor.dart';
|
|
import 'package:test_sa/models/new_models/site.dart';
|
|
import 'package:test_sa/modules/loan_module/models/medical_department_model.dart';
|
|
|
|
class LoanFormModel {
|
|
String? docName;
|
|
String? docNumber;
|
|
String? docEmail;
|
|
String? itemDescription;
|
|
String? requestDescription;
|
|
String? model;
|
|
String? manufacturer;
|
|
Lookup? loanProvided;
|
|
String? vendorName;
|
|
String? vendorRepresentativeName;
|
|
String? vendorNumber;
|
|
String? vendorEmail;
|
|
Site? site;
|
|
MedicalDepartmentModel? department;
|
|
List<LoanAttachments>? loanAttachment;
|
|
|
|
LoanFormModel({
|
|
this.docName,
|
|
this.docNumber,
|
|
this.docEmail,
|
|
this.itemDescription,
|
|
this.requestDescription,
|
|
this.model,
|
|
this.manufacturer,
|
|
this.loanProvided,
|
|
this.vendorName,
|
|
this.vendorRepresentativeName,
|
|
this.vendorNumber,
|
|
this.vendorEmail,
|
|
this.loanAttachment,
|
|
this.site,
|
|
this.department,
|
|
});
|
|
|
|
//{
|
|
// "id": 0,
|
|
// "employeeId": "fa29a9de-1337-4729-b823-68c6ecffdd33",
|
|
// "requestorUserID": "fa29a9de-1337-4729-b823-68c6ecffdd33",
|
|
// "employeeName": "engineer-dev",
|
|
// "employeeEmail": "Engineer_Dev@yahoo.com",
|
|
// "positionName": "High",
|
|
// "requesterExtensionNumber": "7726",
|
|
// "requesterContactNumber": "72132197",
|
|
// "siteId": 1,
|
|
// "departmentId": 5,
|
|
// "loanTypeId": 6448,
|
|
// "doctorName": "Doctor A",
|
|
// "doctorContact": "0561432451",
|
|
// "doctorEmail": "doctor@test.com",
|
|
// "itemDescription": "Test item",
|
|
// "requestDescription": "Test request",
|
|
// "loanPeriodId": 6453,
|
|
// "assetId": null,
|
|
// "assetNumber": "",
|
|
// "assetName": "",
|
|
// "assetSerialNumber": "",
|
|
// "model": "Model A",
|
|
// "manufacturer": "Siemens",
|
|
// "vendorName": "Vendor A",
|
|
// "vendorRepName": "Vendor Rep A",
|
|
// "vendorContact": "0561432455",
|
|
// "vendorEmail": "vendor@test.com",
|
|
// "loanStatusId": 1,
|
|
// "loanAttachments": [],
|
|
// "submittedAt": "2025-11-13T12:11:12.673Z",
|
|
// "updatedAt": null,
|
|
// "cMWOItemId": null
|
|
// }
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return {
|
|
"doctorName": docName,
|
|
"doctorContact": docNumber,
|
|
"doctorEmail": docEmail,
|
|
"itemDescription": itemDescription,
|
|
"requestDescription": requestDescription,
|
|
"model": model,
|
|
"manufacturer": manufacturer,
|
|
"loanPeriodId": loanProvided?.id,
|
|
"vendorName": vendorName,
|
|
"vendorRepresentativeName": vendorRepresentativeName,
|
|
"vendorNumber": vendorNumber,
|
|
"vendorEmail": vendorEmail,
|
|
'siteId' : site?.id,
|
|
'departmentId' : department?.id,
|
|
"loanAttachments": loanAttachment != null ? loanAttachment!.map((v) => v.toJson()).toList() : [],
|
|
};
|
|
}
|
|
}
|
|
class LoanAttachments {
|
|
LoanAttachments({
|
|
this.id,
|
|
this.name,
|
|
this.originalName,
|
|
});
|
|
|
|
LoanAttachments.fromJson(dynamic json) {
|
|
id = json['id'];
|
|
name = json['name'];
|
|
originalName = json['originalName'];
|
|
}
|
|
|
|
num? id;
|
|
String? name;
|
|
String? originalName;
|
|
|
|
LoanAttachments copyWith({
|
|
num? id, // Parameter is now nullable
|
|
String? name, // Parameter is now nullable
|
|
String? originalName, // Parameter is now nullable
|
|
}) =>
|
|
LoanAttachments(
|
|
id: id ?? this.id,
|
|
name: name ?? this.name,
|
|
originalName: originalName ?? this.originalName,
|
|
);
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, dynamic>{};
|
|
map['id'] = id;
|
|
map['name'] = name;
|
|
map['originalName'] = originalName;
|
|
return map;
|
|
}
|
|
}
|