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.
cloudsolutions-atoms/lib/models/service_request/search_work_order.dart

2960 lines
76 KiB
Dart

import 'package:test_sa/models/lookup.dart';
import 'package:test_sa/models/service_request/sub_work_order_details.dart';
import 'package:test_sa/models/timer_model.dart';
2 years ago
import '../fault_description.dart';
class SearchWorkOrder {
SearchWorkOrder({
this.id,
this.parentWOId,
this.workOrderNo,
this.workOrderYear,
this.workOrderSequennce,
this.callRequest,
this.assetType,
this.assignedEmployee,
this.visitDate,
this.assistantEmployees,
this.supplier,
this.vendorTicketNumber,
this.contactPersonWorkOrders,
this.calllastSituation,
this.currentSituation,
this.repairLocation,
this.reason,
// this.startofWorkTime,
// this.endofWorkTime,
this.workingHours,
this.travelingHours,
this.travelingExpenses,
this.faultDescription,
this.sparePartsWorkOrders,
this.reviewComment,
this.comment,
this.attachmentsWorkOrder,
this.equipmentStatus,
this.suppEngineerWorkOrders,
this.engSignature,
this.nurseSignature,
this.woParentDto,
this.timer,
this.mrNumber,
});
SearchWorkOrder.fromJson(dynamic json) {
id = json['id'];
parentWOId = json['parentWOId'];
workOrderNo = json['workOrderNo'];
workOrderYear = json['workOrderYear'];
workOrderSequennce = json['workOrderSequennce'];
callRequest = json['callRequest'] != null ? CallRequest.fromJson(json['callRequest']) : null;
assetType = json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null;
assignedEmployee = json['assignedEmployee'] != null ? AssignedEmployee.fromJson(json['assignedEmployee']) : null;
visitDate = json['visitDate'];
mrNumber = json['mrNumber'];
if (json['assistantEmployees'] != null) {
assistantEmployees = [];
json['assistantEmployees'].forEach((v) {
assistantEmployees.add(AssistantEmployees.fromJson(v));
});
}
supplier = json['supplier'] != null ? SupplierModel.fromJson(json['supplier']) : null;
vendorTicketNumber = json['vendorTicketNumber'];
if (json['contactPersonWorkOrders'] != null) {
contactPersonWorkOrders = [];
json['contactPersonWorkOrders'].forEach((v) {
contactPersonWorkOrders.add(ContactPersonWorkOrders.fromJson(v));
});
}
calllastSituation = json['calllastSituation'] != null ? Lookup.fromJson(json['calllastSituation']) : null;
currentSituation = json['currentSituation'] != null ? Lookup.fromJson(json['currentSituation']) : null;
repairLocation = json['repairLocation'] != null ? Lookup.fromJson(json['repairLocation']) : null;
2 years ago
reason = json['reason'] != null ? Lookup.fromJson(json['reason']) : null;
// startofWorkTime = json['startofWorkTime'];
// endofWorkTime = json['endofWorkTime'];
if (json['startofWorkTime'] != null || json['endofWorkTime'] != null) {
timer = TimerModel();
}
if (json['startofWorkTime'] != null) timer.startAt = DateTime.tryParse(json['startofWorkTime']);
if (json['endofWorkTime'] != null) timer.endAt = DateTime.tryParse(json['endofWorkTime']);
workingHours = json['workingHours'];
travelingHours = json['travelingHours'];
travelingExpenses = json['travelingExpenses'];
faultDescription = json['faultDescription'] != null ? FaultDescription.fromJson(json['faultDescription']) : null;
if (json['sparePartsWorkOrders'] != null) {
sparePartsWorkOrders = [];
json['sparePartsWorkOrders'].forEach((v) {
sparePartsWorkOrders.add(SparePartsWorkOrders.fromJson(v));
});
}
reviewComment = json['reviewComment'];
comment = json['comment'];
if (json['attachmentsWorkOrder'] != null) {
attachmentsWorkOrder = [];
json['attachmentsWorkOrder'].forEach((v) {
attachmentsWorkOrder.add(AttachmentsWorkOrder.fromJson(v));
});
}
equipmentStatus = json['equipmentStatus'] != null ? Lookup.fromJson(json['equipmentStatus']) : null;
if (json['suppEngineerWorkOrders'] != null) {
suppEngineerWorkOrders = [];
json['suppEngineerWorkOrders'].forEach((v) {
suppEngineerWorkOrders.add(SuppEngineerWorkOrders.fromJson(v));
});
}
engSignature = json['engSignature'];
nurseSignature = json['nurseSignature'];
woParentDto = json['woParentDto'] != null ? WoParentDto.fromJson(json['woParentDto']) : null;
}
2 years ago
void copyFrom(SearchWorkOrder wo) {
parentWOId = wo.parentWOId ?? parentWOId;
workOrderNo = wo.workOrderNo ?? workOrderNo;
workOrderYear = wo.workOrderYear ?? workOrderYear;
workOrderSequennce = wo.workOrderSequennce ?? workOrderSequennce;
callRequest = wo.callRequest ?? callRequest;
if (wo.assetType != null) assetType = Lookup.fromJson((wo.assetType)?.toJson() ?? {});
if (wo.assignedEmployee != null) assignedEmployee = AssignedEmployee.fromJson((wo.assignedEmployee)?.toJson() ?? {});
2 years ago
visitDate = wo.visitDate ?? visitDate;
assistantEmployees = (wo.assistantEmployees ?? assistantEmployees)
?.map((e) => AssistantEmployees.fromJson({
"id": e?.id,
"user": {"name": e?.user?.name, "id": (e?.user?.id) ?? "0"}
}))
?.toList() ??
[];
if (wo.supplier != null) supplier = SupplierModel.fromJson((wo.supplier)?.toJson() ?? {});
2 years ago
vendorTicketNumber = wo.vendorTicketNumber ?? vendorTicketNumber;
contactPersonWorkOrders = (wo.contactPersonWorkOrders ?? contactPersonWorkOrders)?.map((e) => ContactPersonWorkOrders.fromJson(e?.toJson() ?? {}))?.toList() ?? [];
calllastSituation = Lookup.fromJson((wo.calllastSituation ?? calllastSituation)?.toJson() ?? {});
if (wo.currentSituation != null) currentSituation = Lookup.fromJson((wo.currentSituation)?.toJson() ?? {});
repairLocation = Lookup.fromJson((wo.repairLocation ?? repairLocation)?.toJson() ?? {});
reason = Lookup.fromJson((wo.reason ?? reason)?.toJson() ?? {});
// startofWorkTime = wo.startofWorkTime ?? startofWorkTime;
// endofWorkTime = wo.endofWorkTime ?? endofWorkTime;
timer = wo.timer ?? timer;
2 years ago
workingHours = wo.workingHours ?? workingHours;
travelingHours = wo.travelingHours ?? travelingHours;
travelingExpenses = wo.travelingExpenses ?? travelingExpenses;
faultDescription = FaultDescription.fromJson((wo.faultDescription ?? faultDescription)?.toJson() ?? {});
sparePartsWorkOrders = (wo.sparePartsWorkOrders ?? sparePartsWorkOrders)?.map((e) => SparePartsWorkOrders.fromJson(e?.toJson() ?? {}))?.toList() ?? [];
2 years ago
reviewComment = wo.reviewComment ?? reviewComment;
comment = wo.comment ?? comment;
attachmentsWorkOrder = (wo.attachmentsWorkOrder ?? attachmentsWorkOrder)?.map((e) => AttachmentsWorkOrder.fromJson(e?.toJson() ?? {}))?.toList() ?? [];
equipmentStatus = Lookup.fromJson((wo.equipmentStatus ?? equipmentStatus)?.toJson() ?? {});
suppEngineerWorkOrders = (wo.suppEngineerWorkOrders ?? suppEngineerWorkOrders)?.map((e) => SuppEngineerWorkOrders.fromJson(e?.toJson() ?? {}))?.toList() ?? [];
2 years ago
engSignature = wo.engSignature ?? engSignature;
nurseSignature = wo.nurseSignature ?? nurseSignature;
woParentDto = wo.woParentDto ?? woParentDto;
mrNumber = wo.mrNumber ?? mrNumber;
2 years ago
}
num id;
num parentWOId;
String workOrderNo;
num workOrderYear;
num workOrderSequennce;
CallRequest callRequest;
Lookup assetType;
AssignedEmployee assignedEmployee;
String visitDate;
List<AssistantEmployees> assistantEmployees;
SupplierModel supplier;
String vendorTicketNumber;
List<ContactPersonWorkOrders> contactPersonWorkOrders;
Lookup calllastSituation;
Lookup currentSituation;
Lookup repairLocation;
2 years ago
Lookup reason;
// String startofWorkTime;
// String endofWorkTime;
num workingHours;
num travelingHours;
num travelingExpenses;
FaultDescription faultDescription;
List<SparePartsWorkOrders> sparePartsWorkOrders;
String reviewComment;
String comment;
List<AttachmentsWorkOrder> attachmentsWorkOrder;
Lookup equipmentStatus;
List<SuppEngineerWorkOrders> suppEngineerWorkOrders;
String engSignature;
String nurseSignature;
WoParentDto woParentDto;
TimerModel timer;
String mrNumber;
SearchWorkOrder copyWith({
num id,
num parentWOId,
String workOrderNo,
num workOrderYear,
num workOrderSequennce,
CallRequest callRequest,
Lookup assetType,
AssignedEmployee assignedEmployee,
String visitDate,
List<AssistantEmployees> assistantEmployees,
SupplierModel supplier,
String vendorTicketNumber,
List<ContactPersonWorkOrders> contactPersonWorkOrders,
Lookup calllastSituation,
Lookup currentSituation,
Lookup repairLocation,
2 years ago
Lookup reason,
// String startofWorkTime,
// String endofWorkTime,
num workingHours,
num travelingHours,
num travelingExpenses,
FaultDescription faultDescription,
List<SparePartsWorkOrders> sparePartsWorkOrders,
String reviewComment,
String comment,
List<AttachmentsWorkOrder> attachmentsWorkOrder,
Lookup equipmentStatus,
List<SuppEngineerWorkOrders> suppEngineerWorkOrders,
String engSignature,
String nurseSignature,
WoParentDto woParentDto,
TimerModel timer,
String mrNumber,
}) =>
SearchWorkOrder(
id: id ?? this.id,
parentWOId: parentWOId ?? this.parentWOId,
workOrderNo: workOrderNo ?? this.workOrderNo,
workOrderYear: workOrderYear ?? this.workOrderYear,
workOrderSequennce: workOrderSequennce ?? this.workOrderSequennce,
callRequest: callRequest ?? this.callRequest,
assetType: assetType ?? this.assetType,
assignedEmployee: assignedEmployee ?? this.assignedEmployee,
visitDate: visitDate ?? this.visitDate,
assistantEmployees: assistantEmployees ?? this.assistantEmployees,
supplier: supplier ?? this.supplier,
vendorTicketNumber: vendorTicketNumber ?? this.vendorTicketNumber,
contactPersonWorkOrders: contactPersonWorkOrders ?? this.contactPersonWorkOrders,
calllastSituation: calllastSituation ?? this.calllastSituation,
currentSituation: currentSituation ?? this.currentSituation,
repairLocation: repairLocation ?? this.repairLocation,
reason: reason ?? this.reason,
// startofWorkTime: startofWorkTime ?? this.startofWorkTime,
// endofWorkTime: endofWorkTime ?? this.endofWorkTime,
workingHours: workingHours ?? this.workingHours,
travelingHours: travelingHours ?? this.travelingHours,
travelingExpenses: travelingExpenses ?? this.travelingExpenses,
faultDescription: faultDescription ?? this.faultDescription,
sparePartsWorkOrders: sparePartsWorkOrders ?? this.sparePartsWorkOrders,
reviewComment: reviewComment ?? this.reviewComment,
comment: comment ?? this.comment,
attachmentsWorkOrder: attachmentsWorkOrder ?? this.attachmentsWorkOrder,
equipmentStatus: equipmentStatus ?? this.equipmentStatus,
suppEngineerWorkOrders: suppEngineerWorkOrders ?? this.suppEngineerWorkOrders,
engSignature: engSignature ?? this.engSignature,
nurseSignature: nurseSignature ?? this.nurseSignature,
woParentDto: woParentDto ?? this.woParentDto,
timer: timer ?? this.timer,
mrNumber: mrNumber ?? this.mrNumber,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['parentWOId'] = parentWOId;
map['workOrderNo'] = workOrderNo;
map['workOrderYear'] = workOrderYear;
map['workOrderSequennce'] = workOrderSequennce;
if (callRequest != null) {
map['callRequest'] = callRequest.toJson();
}
if (assetType != null) {
map['assetType'] = assetType.toJson();
}
if (assignedEmployee != null) {
map['assignedEmployee'] = assignedEmployee.toJson();
}
map['visitDate'] = visitDate;
if (assistantEmployees != null) {
2 years ago
map['assistantEmployees'] = assistantEmployees.map((v) => v?.toJson()).toList();
}
if (supplier != null) {
map['supplier'] = supplier.toJson();
}
map['vendorTicketNumber'] = vendorTicketNumber;
if (contactPersonWorkOrders != null) {
map['contactPersonWorkOrders'] = contactPersonWorkOrders.map((v) => v.toJson()).toList();
}
if (calllastSituation != null) {
map['calllastSituation'] = calllastSituation.toJson();
}
map['currentSituation'] = currentSituation?.toJson();
if (repairLocation?.id != null) {
map['repairLocation'] = repairLocation.toJson();
}
if (reason != null && reason.id != null) {
map['reason'] = reason.toJson();
}
// map['startofWorkTime'] = startofWorkTime;
// map['endofWorkTime'] = endofWorkTime;
map['startofWorkTime'] = timer?.startAt?.toIso8601String();
map['endofWorkTime'] = timer?.endAt?.toIso8601String();
map['workingHours'] = workingHours;
map['travelingHours'] = travelingHours;
map['travelingExpenses'] = travelingExpenses;
if (faultDescription?.id != null) {
map['faultDescription'] = faultDescription.toJson();
}
if (sparePartsWorkOrders != null) {
map['sparePartsWorkOrders'] = sparePartsWorkOrders.map((v) => v.toJson()).toList();
}
map['reviewComment'] = reviewComment;
map['comment'] = comment;
if (attachmentsWorkOrder != null) {
2 years ago
map['attachmentsWorkOrder'] = attachmentsWorkOrder.map((v) => v.toJson()).toList();
}
if (equipmentStatus != null && equipmentStatus.id != null) {
map['equipmentStatus'] = equipmentStatus.toJson();
}
if (suppEngineerWorkOrders != null) {
map['suppEngineerWorkOrders'] = suppEngineerWorkOrders.map((v) => v.toJson()).toList();
}
map['engSignature'] = engSignature;
map['nurseSignature'] = nurseSignature;
if (woParentDto != null) {
map['woParentDto'] = woParentDto.toJson();
}
if (mrNumber != null) {
map['mrNumber'] = mrNumber;
}
return map;
}
void copyDetails(SubWorkOrderDetails subWoDetails) {
equipmentStatus = subWoDetails.equipmentStatus;
reason = subWoDetails.reason;
faultDescription = subWoDetails.faultDescription;
sparePartsWorkOrders = subWoDetails.sparePartsWorkOrders;
suppEngineerWorkOrders = subWoDetails.suppEngineerWorkOrders;
supplier = subWoDetails.supplier;
}
}
class WoParentDto {
WoParentDto({
this.callLastSituation,
this.supplier,
this.assetType,
this.vendorTicketNumber,
this.callId,
this.id,
this.stepsWorkOrderDto,
this.suppEngineerWorkOrders,
this.equipmentStatus,
this.currentSituation,
});
WoParentDto.fromJson(dynamic json) {
callLastSituation = json['callLastSituation'] != null ? Lookup.fromJson(json['callLastSituation']) : null;
supplier = json['supplier'] != null ? SupplierModel.fromJson(json['supplier']) : null;
assetType = json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null;
vendorTicketNumber = json['vendorTicketNumber'];
callId = json['callId'];
id = json['id'];
stepsWorkOrderDto = json['stepsWorkOrderDto'] != null ? StepsWorkOrderDto.fromJson(json['stepsWorkOrderDto']) : null;
if (json['suppEngineerWorkOrders'] != null) {
suppEngineerWorkOrders = [];
json['suppEngineerWorkOrders'].forEach((v) {
suppEngineerWorkOrders.add(SuppEngineerWorkOrders.fromJson(v));
});
}
equipmentStatus = json['equipmentStatus'] != null ? Lookup.fromJson(json['equipmentStatus']) : null;
currentSituation = json['currentSituation'] != null ? Lookup.fromJson(json['currentSituation']) : null;
}
2 years ago
Lookup callLastSituation;
SupplierModel supplier;
Lookup assetType;
String vendorTicketNumber;
num callId;
num id;
StepsWorkOrderDto stepsWorkOrderDto;
List<SuppEngineerWorkOrders> suppEngineerWorkOrders;
Lookup equipmentStatus;
Lookup currentSituation;
2 years ago
WoParentDto copyWith({
Lookup callLastSituation,
SupplierModel supplier,
Lookup assetType,
String vendorTicketNumber,
num callId,
num id,
StepsWorkOrderDto stepsWorkOrderDto,
List<SuppEngineerWorkOrders> suppEngineerWorkOrders,
Lookup equipmentStatus,
Lookup currentSituation,
}) =>
WoParentDto(
callLastSituation: callLastSituation ?? this.callLastSituation,
supplier: supplier ?? this.supplier,
assetType: assetType ?? this.assetType,
vendorTicketNumber: vendorTicketNumber ?? this.vendorTicketNumber,
callId: callId ?? this.callId,
id: id ?? this.id,
stepsWorkOrderDto: stepsWorkOrderDto ?? this.stepsWorkOrderDto,
suppEngineerWorkOrders: suppEngineerWorkOrders ?? this.suppEngineerWorkOrders,
equipmentStatus: equipmentStatus ?? this.equipmentStatus,
currentSituation: currentSituation ?? this.currentSituation,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (callLastSituation != null) {
map['callLastSituation'] = callLastSituation.toJson();
}
if (supplier != null) {
map['supplier'] = supplier.toJson();
}
if (assetType != null) {
map['assetType'] = assetType.toJson();
}
map['vendorTicketNumber'] = vendorTicketNumber;
2 years ago
map['callId'] = callId ?? 0;
map['id'] = id ?? 0;
if (stepsWorkOrderDto != null) {
map['stepsWorkOrderDto'] = stepsWorkOrderDto.toJson();
}
if (suppEngineerWorkOrders != null) {
map['suppEngineerWorkOrders'] = suppEngineerWorkOrders.map((v) => v.toJson()).toList();
}
if (equipmentStatus != null) {
map['equipmentStatus'] = equipmentStatus.toJson();
}
if (currentSituation != null) {
map['currentSituation'] = currentSituation.toJson();
}
return map;
}
}
class SuppEngineerWorkOrders {
SuppEngineerWorkOrders({
this.id,
this.supplierContactId,
this.personName,
this.personRoleName,
this.contact,
this.externalEngCode,
this.email,
});
SuppEngineerWorkOrders.fromJson(dynamic json) {
id = json['id'];
supplierContactId = json['supplierContactId'];
personName = json['personName'];
personRoleName = json['personRoleName'];
contact = json['contact'];
externalEngCode = json['externalEngCode'];
email = json['email'];
}
2 years ago
num id;
num supplierContactId;
String personName;
String personRoleName;
String contact;
String externalEngCode;
String email;
2 years ago
SuppEngineerWorkOrders copyWith({
num id,
num supplierContactId,
String personName,
String personRoleName,
String contact,
String externalEngCode,
String email,
}) =>
SuppEngineerWorkOrders(
id: id ?? this.id,
supplierContactId: supplierContactId ?? this.supplierContactId,
personName: personName ?? this.personName,
personRoleName: personRoleName ?? this.personRoleName,
contact: contact ?? this.contact,
externalEngCode: externalEngCode ?? this.externalEngCode,
email: email ?? this.email,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['supplierContactId'] = supplierContactId;
map['personName'] = personName;
map['personRoleName'] = personRoleName;
map['contact'] = contact;
map['externalEngCode'] = externalEngCode;
map['email'] = email;
return map;
}
}
class StepsWorkOrderDto {
StepsWorkOrderDto({
this.sequence,
this.id,
this.name,
this.statusValue,
this.typeTransaction,
this.processed,
this.parentWOId,
this.callId,
});
StepsWorkOrderDto.fromJson(dynamic json) {
sequence = json['sequence'];
id = json['id'];
name = json['name'];
statusValue = json['statusValue'];
typeTransaction = json['typeTransaction'];
processed = json['processed'];
parentWOId = json['parentWOId'];
callId = json['callId'];
}
2 years ago
num sequence;
num id;
String name;
num statusValue;
String typeTransaction;
bool processed;
num parentWOId;
num callId;
2 years ago
StepsWorkOrderDto copyWith({
num sequence,
num id,
String name,
num statusValue,
String typeTransaction,
bool processed,
num parentWOId,
num callId,
}) =>
StepsWorkOrderDto(
sequence: sequence ?? this.sequence,
id: id ?? this.id,
name: name ?? this.name,
statusValue: statusValue ?? this.statusValue,
typeTransaction: typeTransaction ?? this.typeTransaction,
processed: processed ?? this.processed,
parentWOId: parentWOId ?? this.parentWOId,
callId: callId ?? this.callId,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['sequence'] = sequence;
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['statusValue'] = statusValue;
map['typeTransaction'] = typeTransaction;
map['processed'] = processed;
map['parentWOId'] = parentWOId;
map['callId'] = callId;
return map;
}
}
class SupplierModel {
SupplierModel({
this.id,
this.suppliername,
this.name,
this.website,
this.email,
this.code,
this.suppNo,
this.suppStatusId,
this.cityId,
this.person,
this.comment,
this.zipcode,
this.contact,
this.telephones,
this.faxes,
this.addresses,
this.attachments,
this.suppPersons,
this.suppTCodes,
});
SupplierModel.fromJson(dynamic json) {
2 years ago
id = json['id'] ?? 0;
suppliername = json['suppliername'];
name = json['name'];
website = json['website'];
email = json['email'];
code = json['code'];
suppNo = json['suppNo'];
suppStatusId = json['suppStatusId'];
cityId = json['cityId'];
person = json['person'];
comment = json['comment'];
zipcode = json['zipcode'];
contact = json['contact'];
if (json['telephones'] != null) {
telephones = [];
json['telephones'].forEach((v) {
telephones.add(Telephones.fromJson(v));
});
}
if (json['faxes'] != null) {
faxes = [];
json['faxes'].forEach((v) {
faxes.add(Faxes.fromJson(v));
});
}
if (json['addresses'] != null) {
addresses = [];
json['addresses'].forEach((v) {
addresses.add(Addresses.fromJson(v));
});
}
if (json['attachments'] != null) {
attachments = [];
json['attachments'].forEach((v) {
attachments.add(Attachments.fromJson(v));
});
}
if (json['suppPersons'] != null) {
suppPersons = [];
json['suppPersons'].forEach((v) {
suppPersons.add(SuppPersons.fromJson(v));
});
}
if (json['suppTCodes'] != null) {
suppTCodes = [];
json['suppTCodes'].forEach((v) {
suppTCodes.add(SuppTCodes.fromJson(v));
});
}
}
2 years ago
num id;
String suppliername;
String name;
String website;
String email;
String code;
num suppNo;
num suppStatusId;
num cityId;
String person;
String comment;
num zipcode;
String contact;
List<Telephones> telephones;
List<Faxes> faxes;
List<Addresses> addresses;
List<Attachments> attachments;
List<SuppPersons> suppPersons;
List<SuppTCodes> suppTCodes;
2 years ago
SupplierModel copyWith({
num id,
String suppliername,
String name,
String website,
String email,
String code,
num suppNo,
num suppStatusId,
num cityId,
String person,
String comment,
num zipcode,
String contact,
List<Telephones> telephones,
List<Faxes> faxes,
List<Addresses> addresses,
List<Attachments> attachments,
List<SuppPersons> suppPersons,
List<SuppTCodes> suppTCodes,
}) =>
SupplierModel(
2 years ago
id: id ?? this.id ?? 0,
suppliername: suppliername ?? this.suppliername,
name: name ?? this.name,
website: website ?? this.website,
email: email ?? this.email,
code: code ?? this.code,
suppNo: suppNo ?? this.suppNo,
suppStatusId: suppStatusId ?? this.suppStatusId,
cityId: cityId ?? this.cityId,
person: person ?? this.person,
comment: comment ?? this.comment,
zipcode: zipcode ?? this.zipcode,
contact: contact ?? this.contact,
telephones: telephones ?? this.telephones,
faxes: faxes ?? this.faxes,
addresses: addresses ?? this.addresses,
attachments: attachments ?? this.attachments,
suppPersons: suppPersons ?? this.suppPersons,
suppTCodes: suppTCodes ?? this.suppTCodes,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['suppliername'] = suppliername;
map['name'] = name;
map['website'] = website;
map['email'] = email;
map['code'] = code;
map['suppNo'] = suppNo;
map['suppStatusId'] = suppStatusId;
map['cityId'] = cityId;
map['person'] = person;
map['comment'] = comment;
map['zipcode'] = zipcode;
map['contact'] = contact;
if (telephones != null) {
map['telephones'] = telephones.map((v) => v.toJson()).toList();
}
if (faxes != null) {
map['faxes'] = faxes.map((v) => v.toJson()).toList();
}
if (addresses != null) {
map['addresses'] = addresses.map((v) => v.toJson()).toList();
}
if (attachments != null) {
map['attachments'] = attachments.map((v) => v.toJson()).toList();
}
if (suppPersons != null) {
map['suppPersons'] = suppPersons.map((v) => v.toJson()).toList();
}
if (suppTCodes != null) {
map['suppTCodes'] = suppTCodes.map((v) => v.toJson()).toList();
}
return map;
}
}
class SuppTCodes {
SuppTCodes({
this.id,
this.supplierId,
this.codeTypeId,
this.codeValue,
});
SuppTCodes.fromJson(dynamic json) {
id = json['id'];
supplierId = json['supplierId'];
codeTypeId = json['codeTypeId'];
codeValue = json['codeValue'];
}
2 years ago
num id;
num supplierId;
num codeTypeId;
String codeValue;
2 years ago
SuppTCodes copyWith({
num id,
num supplierId,
num codeTypeId,
String codeValue,
}) =>
SuppTCodes(
2 years ago
id: id ?? this.id ?? 0,
supplierId: supplierId ?? this.supplierId,
codeTypeId: codeTypeId ?? this.codeTypeId,
codeValue: codeValue ?? this.codeValue,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['supplierId'] = supplierId;
map['codeTypeId'] = codeTypeId;
map['codeValue'] = codeValue;
return map;
}
}
class SuppPersons {
SuppPersons({
this.id,
this.supplierId,
this.personName,
this.personRoleId,
this.contact,
this.externalEngCode,
this.email,
});
SuppPersons.fromJson(dynamic json) {
id = json['id'];
supplierId = json['supplierId'];
personName = json['personName'];
personRoleId = json['personRoleId'];
contact = json['contact'];
externalEngCode = json['externalEngCode'];
email = json['email'];
}
2 years ago
num id;
num supplierId;
String personName;
num personRoleId;
String contact;
String externalEngCode;
String email;
2 years ago
SuppPersons copyWith({
num id,
num supplierId,
String personName,
num personRoleId,
String contact,
String externalEngCode,
String email,
}) =>
SuppPersons(
id: id ?? this.id,
supplierId: supplierId ?? this.supplierId,
personName: personName ?? this.personName,
personRoleId: personRoleId ?? this.personRoleId,
contact: contact ?? this.contact,
externalEngCode: externalEngCode ?? this.externalEngCode,
email: email ?? this.email,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['supplierId'] = supplierId;
map['personName'] = personName;
map['personRoleId'] = personRoleId;
map['contact'] = contact;
map['externalEngCode'] = externalEngCode;
map['email'] = email;
return map;
}
}
class Attachments {
Attachments({
this.id,
this.supplierId,
this.attachmentName,
this.attachmentURL,
});
Attachments.fromJson(dynamic json) {
id = json['id'];
supplierId = json['supplierId'];
attachmentName = json['attachmentName'];
attachmentURL = json['attachmentURL'];
}
2 years ago
num id;
num supplierId;
String attachmentName;
String attachmentURL;
2 years ago
Attachments copyWith({
num id,
num supplierId,
String attachmentName,
String attachmentURL,
}) =>
Attachments(
id: id ?? this.id,
supplierId: supplierId ?? this.supplierId,
attachmentName: attachmentName ?? this.attachmentName,
attachmentURL: attachmentURL ?? this.attachmentURL,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['supplierId'] = supplierId;
map['attachmentName'] = attachmentName;
map['attachmentURL'] = attachmentURL;
return map;
}
}
class Addresses {
Addresses({
this.id,
this.supplierId,
this.address,
});
Addresses.fromJson(dynamic json) {
id = json['id'];
supplierId = json['supplierId'];
address = json['address'];
}
2 years ago
num id;
num supplierId;
String address;
2 years ago
Addresses copyWith({
num id,
num supplierId,
String address,
}) =>
Addresses(
id: id ?? this.id,
supplierId: supplierId ?? this.supplierId,
address: address ?? this.address,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['supplierId'] = supplierId;
map['address'] = address;
return map;
}
}
class Faxes {
Faxes({
this.id,
this.supplierId,
this.fax,
});
Faxes.fromJson(dynamic json) {
id = json['id'];
supplierId = json['supplierId'];
fax = json['fax'];
}
2 years ago
num id;
num supplierId;
String fax;
2 years ago
Faxes copyWith({
num id,
num supplierId,
String fax,
}) =>
Faxes(
id: id ?? this.id,
supplierId: supplierId ?? this.supplierId,
fax: fax ?? this.fax,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['supplierId'] = supplierId;
map['fax'] = fax;
return map;
}
}
class Telephones {
Telephones({
this.id,
this.supplierId,
this.telephone,
});
Telephones.fromJson(dynamic json) {
id = json['id'];
supplierId = json['supplierId'];
telephone = json['telephone'];
}
2 years ago
num id;
num supplierId;
String telephone;
2 years ago
Telephones copyWith({
num id,
num supplierId,
String telephone,
}) =>
Telephones(
id: id ?? this.id,
supplierId: supplierId ?? this.supplierId,
telephone: telephone ?? this.telephone,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['supplierId'] = supplierId;
map['telephone'] = telephone;
return map;
}
}
class AttachmentsWorkOrder {
AttachmentsWorkOrder({
this.id,
this.name,
});
AttachmentsWorkOrder.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
}
2 years ago
num id;
String name;
2 years ago
AttachmentsWorkOrder copyWith({
num id,
String name,
}) =>
AttachmentsWorkOrder(
id: id ?? this.id,
name: name ?? this.name,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
return map;
}
}
class SparePartsWorkOrders {
SparePartsWorkOrders({
this.id,
this.sparePart,
this.qty,
this.returnQty,
this.installQty,
});
SparePartsWorkOrders.fromJson(dynamic json) {
id = json['id'];
sparePart = json['sparePart'] != null ? SparePart.fromJson(json['sparePart']) : null;
qty = json['qty'];
returnQty = json['returnQty'];
installQty = json['installQty'];
}
2 years ago
num id;
SparePart sparePart;
num qty;
num returnQty;
num installQty;
2 years ago
SparePartsWorkOrders copyWith({
num id,
SparePart sparePart,
num qty,
num returnQty,
num installQty,
}) =>
SparePartsWorkOrders(
id: id ?? this.id,
sparePart: sparePart ?? this.sparePart,
qty: qty ?? this.qty,
returnQty: returnQty ?? this.returnQty,
installQty: installQty ?? this.installQty,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
if (sparePart != null) {
map['sparePart'] = sparePart.toJson();
}
map['qty'] = qty;
map['returnQty'] = returnQty;
map['installQty'] = installQty;
return map;
}
}
class SparePart {
SparePart({
this.id,
this.partNo,
this.partName,
});
SparePart.fromJson(dynamic json) {
id = json['id'];
partNo = json['partNo'];
partName = json['partName'];
}
2 years ago
num id;
String partNo;
String partName;
2 years ago
SparePart copyWith({
num id,
String partNo,
String partName,
}) =>
SparePart(
id: id ?? this.id,
partNo: partNo ?? this.partNo,
partName: partName ?? this.partName,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['partNo'] = partNo;
map['partName'] = partName;
return map;
}
}
class ContactPersonWorkOrders {
ContactPersonWorkOrders({
this.id,
this.employeeCode,
this.name,
this.telephone,
this.job,
this.email,
this.land,
this.contactUserId,
});
ContactPersonWorkOrders.fromJson(dynamic json) {
id = json['id'];
employeeCode = json['employeeCode'];
name = json['name'];
telephone = json['telephone'];
job = json['job'];
email = json['email'];
land = json['land'];
contactUserId = json['contactUserId'];
}
2 years ago
num id;
String employeeCode;
String name;
String telephone;
String job;
String email;
String land;
String contactUserId;
2 years ago
ContactPersonWorkOrders copyWith({
num id,
String employeeCode,
String name,
String telephone,
String job,
String email,
String land,
String contactUserId,
}) =>
ContactPersonWorkOrders(
id: id ?? this.id,
employeeCode: employeeCode ?? this.employeeCode,
name: name ?? this.name,
telephone: telephone ?? this.telephone,
job: job ?? this.job,
email: email ?? this.email,
land: land ?? this.land,
contactUserId: contactUserId ?? this.contactUserId,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['employeeCode'] = employeeCode;
map['name'] = name;
map['telephone'] = telephone;
map['job'] = job;
map['email'] = email;
map['land'] = land;
map['contactUserId'] = contactUserId;
return map;
}
}
class AssistantEmployees {
AssistantEmployees({
this.id,
this.user,
});
AssistantEmployees.fromJson(dynamic json) {
id = json['id'];
2 years ago
user = json['user'] != null ? UserModel.fromJson(json['user']) : UserModel(name: json['userName'], id: json['userId']);
}
2 years ago
num id;
UserModel user;
2 years ago
AssistantEmployees copyWith({
num id,
UserModel user,
}) =>
AssistantEmployees(
id: id ?? this.id,
user: user ?? this.user,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
if (user != null) {
map['user'] = user.toJson();
}
return map;
}
}
class UserModel {
UserModel({
this.id,
this.name,
});
UserModel.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
}
2 years ago
String id;
String name;
2 years ago
UserModel copyWith({
String id,
String name,
}) =>
UserModel(
id: id ?? this.id,
name: name ?? this.name,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
return map;
}
}
class AssignedEmployee {
AssignedEmployee({
this.id,
this.name,
});
AssignedEmployee.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
}
2 years ago
String id;
String name;
2 years ago
AssignedEmployee copyWith({
String id,
String name,
}) =>
AssignedEmployee(
id: id ?? this.id,
name: name ?? this.name,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
return map;
}
}
class CallRequest {
CallRequest({
this.id,
this.callNo,
this.callComments,
this.asset,
this.assignedEmployee,
this.callSiteContactPerson,
this.status,
this.callLastSituation,
this.defectType,
this.firstAction,
this.assetType,
});
CallRequest.fromJson(dynamic json) {
id = json['id'];
callNo = json['callNo'];
callComments = json['callComments'];
asset = json['asset'] != null ? Asset.fromJson(json['asset']) : null;
assignedEmployee = json['assignedEmployee'] != null ? AssignedEmployee.fromJson(json['assignedEmployee']) : null;
if (json['callSiteContactPerson'] != null) {
callSiteContactPerson = [];
json['callSiteContactPerson'].forEach((v) {
callSiteContactPerson.add(CallSiteContactPerson.fromJson(v));
});
}
status = json['status'] != null ? Status.fromJson(json['status']) : null;
callLastSituation = json['callLastSituation'] != null ? Lookup.fromJson(json['callLastSituation']) : null;
defectType = json['defectType'] != null ? DefectType.fromJson(json['defectType']) : null;
firstAction = json['firstAction'] != null ? FirstAction.fromJson(json['firstAction']) : null;
assetType = json['assetType'];
}
2 years ago
num id;
String callNo;
String callComments;
Asset asset;
AssignedEmployee assignedEmployee;
List<CallSiteContactPerson> callSiteContactPerson;
Status status;
Lookup callLastSituation;
DefectType defectType;
FirstAction firstAction;
num assetType;
2 years ago
CallRequest copyWith({
num id,
String callNo,
String callComments,
Asset asset,
AssignedEmployee assignedEmployee,
List<CallSiteContactPerson> callSiteContactPerson,
Status status,
Lookup callLastSituation,
DefectType defectType,
FirstAction firstAction,
num assetType,
}) =>
CallRequest(
id: id ?? this.id,
callNo: callNo ?? this.callNo,
callComments: callComments ?? this.callComments,
asset: asset ?? this.asset,
assignedEmployee: assignedEmployee ?? this.assignedEmployee,
callSiteContactPerson: callSiteContactPerson ?? this.callSiteContactPerson,
status: status ?? this.status,
callLastSituation: callLastSituation ?? this.callLastSituation,
defectType: defectType ?? this.defectType,
firstAction: firstAction ?? this.firstAction,
assetType: assetType ?? this.assetType,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['callNo'] = callNo;
map['callComments'] = callComments;
if (asset != null) {
map['asset'] = asset.toJson();
}
if (assignedEmployee != null) {
map['assignedEmployee'] = assignedEmployee.toJson();
}
if (callSiteContactPerson != null) {
map['callSiteContactPerson'] = callSiteContactPerson.map((v) => v.toJson()).toList();
}
if (status != null) {
map['status'] = status.toJson();
}
if (callLastSituation != null) {
map['callLastSituation'] = callLastSituation.toJson();
}
if (defectType != null) {
map['defectType'] = defectType.toJson();
}
if (firstAction != null) {
map['firstAction'] = firstAction.toJson();
}
map['assetType'] = assetType;
return map;
}
}
class FirstAction {
FirstAction({
this.id,
this.name,
this.value,
});
FirstAction.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
FirstAction copyWith({
num id,
String name,
num value,
}) =>
FirstAction(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class DefectType {
DefectType({
this.id,
this.name,
this.value,
});
DefectType.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
DefectType copyWith({
num id,
String name,
num value,
}) =>
DefectType(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class Status {
Status({
this.id,
this.name,
this.value,
});
Status.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
Status copyWith({
num id,
String name,
num value,
}) =>
Status(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class CallSiteContactPerson {
CallSiteContactPerson({
this.id,
this.employeeCode,
this.name,
this.telephone,
this.job,
this.email,
this.land,
this.contactUserId,
});
CallSiteContactPerson.fromJson(dynamic json) {
id = json['id'];
employeeCode = json['employeeCode'];
name = json['name'];
telephone = json['telephone'];
job = json['job'];
email = json['email'];
land = json['land'];
contactUserId = json['contactUserId'];
}
2 years ago
num id;
String employeeCode;
String name;
String telephone;
String job;
String email;
String land;
String contactUserId;
2 years ago
CallSiteContactPerson copyWith({
num id,
String employeeCode,
String name,
String telephone,
String job,
String email,
String land,
String contactUserId,
}) =>
CallSiteContactPerson(
id: id ?? this.id,
employeeCode: employeeCode ?? this.employeeCode,
name: name ?? this.name,
telephone: telephone ?? this.telephone,
job: job ?? this.job,
email: email ?? this.email,
land: land ?? this.land,
contactUserId: contactUserId ?? this.contactUserId,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['employeeCode'] = employeeCode;
map['name'] = name;
map['telephone'] = telephone;
map['job'] = job;
map['email'] = email;
map['land'] = land;
map['contactUserId'] = contactUserId;
return map;
}
}
class Asset {
Asset({
this.id,
this.assetSerialNo,
this.systemID,
this.assetNumber,
this.modelDefinition,
this.supplier,
this.ipAddress,
this.macAddress,
this.portNumber,
this.assetReplace,
this.oldAsset,
this.isParent,
this.parentAsset,
this.assetType,
this.site,
this.building,
this.floor,
this.department,
this.room,
this.testsDay,
this.purchasingPrice,
this.nbv,
this.currency,
this.poNo,
this.invoiceNumber,
this.invoiceDate,
this.replacementDate,
this.originDepartment,
this.originSite,
this.budgetYear,
this.lastPOPrice,
this.commissioningStatus,
this.productionDate,
this.edd,
this.technicalInspectionDate,
this.deliveryInspectionDate,
this.endUserAcceptanceDate,
this.receivingCommittee,
this.siteWarrantyMonths,
this.extendedWarrantyMonths,
this.remainderWarrantyMonths,
this.eomWarrantyMonthsNo,
this.warrantyValue,
this.warrantyEndDate,
this.warrantyContractConditions,
this.technicalGuidanceBooks,
this.comment,
this.tagCode,
});
Asset.fromJson(dynamic json) {
id = json['id'];
assetSerialNo = json['assetSerialNo'];
systemID = json['systemID'];
assetNumber = json['assetNumber'];
modelDefinition = json['modelDefinition'] != null ? ModelDefinition.fromJson(json['modelDefinition']) : null;
2 years ago
supplier = json['supplier'] != null ? Supplier.fromJson(json['supplier']) : null;
ipAddress = json['ipAddress'];
macAddress = json['macAddress'];
portNumber = json['portNumber'];
assetReplace = json['assetReplace'] != null ? AssetReplace.fromJson(json['assetReplace']) : null;
oldAsset = json['oldAsset'] != null ? OldAsset.fromJson(json['oldAsset']) : null;
isParent = json['isParent'] != null ? IsParent.fromJson(json['isParent']) : null;
parentAsset = json['parentAsset'] != null ? ParentAsset.fromJson(json['parentAsset']) : null;
assetType = json['assetType'] != null ? Lookup.fromJson(json['assetType']) : null;
site = json['site'] != null ? Site.fromJson(json['site']) : null;
building = json['building'] != null ? Building.fromJson(json['building']) : null;
floor = json['floor'] != null ? Floor.fromJson(json['floor']) : null;
department = json['department'] != null ? Department.fromJson(json['department']) : null;
room = json['room'];
testsDay = json['testsDay'];
purchasingPrice = json['purchasingPrice'];
nbv = json['nbv'];
currency = json['currency'] != null ? Currency.fromJson(json['currency']) : null;
poNo = json['poNo'];
invoiceNumber = json['invoiceNumber'];
invoiceDate = json['invoiceDate'];
replacementDate = json['replacementDate'];
originDepartment = json['originDepartment'] != null ? OriginDepartment.fromJson(json['originDepartment']) : null;
originSite = json['originSite'] != null ? OriginSite.fromJson(json['originSite']) : null;
budgetYear = json['budgetYear'];
lastPOPrice = json['lastPOPrice'];
commissioningStatus = json['commissioningStatus'] != null ? CommissioningStatus.fromJson(json['commissioningStatus']) : null;
productionDate = json['productionDate'];
edd = json['edd'];
technicalInspectionDate = json['technicalInspectionDate'];
deliveryInspectionDate = json['deliveryInspectionDate'];
endUserAcceptanceDate = json['endUserAcceptanceDate'];
receivingCommittee = json['receivingCommittee'];
siteWarrantyMonths = json['siteWarrantyMonths'] != null ? SiteWarrantyMonths.fromJson(json['siteWarrantyMonths']) : null;
extendedWarrantyMonths = json['extendedWarrantyMonths'] != null ? ExtendedWarrantyMonths.fromJson(json['extendedWarrantyMonths']) : null;
remainderWarrantyMonths = json['remainderWarrantyMonths'] != null ? RemainderWarrantyMonths.fromJson(json['remainderWarrantyMonths']) : null;
eomWarrantyMonthsNo = json['eomWarrantyMonthsNo'];
warrantyValue = json['warrantyValue'];
warrantyEndDate = json['warrantyEndDate'];
warrantyContractConditions = json['warrantyContractConditions'];
if (json['technicalGuidanceBooks'] != null) {
technicalGuidanceBooks = [];
json['technicalGuidanceBooks'].forEach((v) {
technicalGuidanceBooks.add(TechnicalGuidanceBooks.fromJson(v));
});
}
comment = json['comment'];
tagCode = json['tagCode'];
}
2 years ago
num id;
String assetSerialNo;
String systemID;
String assetNumber;
ModelDefinition modelDefinition;
2 years ago
Supplier supplier;
String ipAddress;
String macAddress;
String portNumber;
AssetReplace assetReplace;
OldAsset oldAsset;
IsParent isParent;
ParentAsset parentAsset;
Lookup assetType;
Site site;
Building building;
Floor floor;
Department department;
String room;
num testsDay;
num purchasingPrice;
String nbv;
Currency currency;
String poNo;
String invoiceNumber;
String invoiceDate;
String replacementDate;
OriginDepartment originDepartment;
OriginSite originSite;
num budgetYear;
num lastPOPrice;
CommissioningStatus commissioningStatus;
String productionDate;
String edd;
String technicalInspectionDate;
String deliveryInspectionDate;
String endUserAcceptanceDate;
String receivingCommittee;
SiteWarrantyMonths siteWarrantyMonths;
ExtendedWarrantyMonths extendedWarrantyMonths;
RemainderWarrantyMonths remainderWarrantyMonths;
num eomWarrantyMonthsNo;
num warrantyValue;
String warrantyEndDate;
String warrantyContractConditions;
List<TechnicalGuidanceBooks> technicalGuidanceBooks;
String comment;
String tagCode;
2 years ago
Asset copyWith({
num id,
String assetSerialNo,
String systemID,
String assetNumber,
ModelDefinition modelDefinition,
SupplierModel supplier,
String ipAddress,
String macAddress,
String portNumber,
AssetReplace assetReplace,
OldAsset oldAsset,
IsParent isParent,
ParentAsset parentAsset,
Lookup assetType,
Site site,
Building building,
Floor floor,
Department department,
String room,
num testsDay,
num purchasingPrice,
String nbv,
Currency currency,
String poNo,
String invoiceNumber,
String invoiceDate,
String replacementDate,
OriginDepartment originDepartment,
OriginSite originSite,
num budgetYear,
num lastPOPrice,
CommissioningStatus commissioningStatus,
String productionDate,
String edd,
String technicalInspectionDate,
String deliveryInspectionDate,
String endUserAcceptanceDate,
String receivingCommittee,
SiteWarrantyMonths siteWarrantyMonths,
ExtendedWarrantyMonths extendedWarrantyMonths,
RemainderWarrantyMonths remainderWarrantyMonths,
num eomWarrantyMonthsNo,
num warrantyValue,
String warrantyEndDate,
String warrantyContractConditions,
List<TechnicalGuidanceBooks> technicalGuidanceBooks,
String comment,
String tagCode,
}) =>
Asset(
id: id ?? this.id,
assetSerialNo: assetSerialNo ?? this.assetSerialNo,
systemID: systemID ?? this.systemID,
assetNumber: assetNumber ?? this.assetNumber,
modelDefinition: modelDefinition ?? this.modelDefinition,
supplier: supplier ?? this.supplier,
ipAddress: ipAddress ?? this.ipAddress,
macAddress: macAddress ?? this.macAddress,
portNumber: portNumber ?? this.portNumber,
assetReplace: assetReplace ?? this.assetReplace,
oldAsset: oldAsset ?? this.oldAsset,
isParent: isParent ?? this.isParent,
parentAsset: parentAsset ?? this.parentAsset,
assetType: assetType ?? this.assetType,
site: site ?? this.site,
building: building ?? this.building,
floor: floor ?? this.floor,
department: department ?? this.department,
room: room ?? this.room,
testsDay: testsDay ?? this.testsDay,
purchasingPrice: purchasingPrice ?? this.purchasingPrice,
nbv: nbv ?? this.nbv,
currency: currency ?? this.currency,
poNo: poNo ?? this.poNo,
invoiceNumber: invoiceNumber ?? this.invoiceNumber,
invoiceDate: invoiceDate ?? this.invoiceDate,
replacementDate: replacementDate ?? this.replacementDate,
originDepartment: originDepartment ?? this.originDepartment,
originSite: originSite ?? this.originSite,
budgetYear: budgetYear ?? this.budgetYear,
lastPOPrice: lastPOPrice ?? this.lastPOPrice,
commissioningStatus: commissioningStatus ?? this.commissioningStatus,
productionDate: productionDate ?? this.productionDate,
edd: edd ?? this.edd,
technicalInspectionDate: technicalInspectionDate ?? this.technicalInspectionDate,
deliveryInspectionDate: deliveryInspectionDate ?? this.deliveryInspectionDate,
endUserAcceptanceDate: endUserAcceptanceDate ?? this.endUserAcceptanceDate,
receivingCommittee: receivingCommittee ?? this.receivingCommittee,
siteWarrantyMonths: siteWarrantyMonths ?? this.siteWarrantyMonths,
extendedWarrantyMonths: extendedWarrantyMonths ?? this.extendedWarrantyMonths,
remainderWarrantyMonths: remainderWarrantyMonths ?? this.remainderWarrantyMonths,
eomWarrantyMonthsNo: eomWarrantyMonthsNo ?? this.eomWarrantyMonthsNo,
warrantyValue: warrantyValue ?? this.warrantyValue,
warrantyEndDate: warrantyEndDate ?? this.warrantyEndDate,
warrantyContractConditions: warrantyContractConditions ?? this.warrantyContractConditions,
technicalGuidanceBooks: technicalGuidanceBooks ?? this.technicalGuidanceBooks,
comment: comment ?? this.comment,
tagCode: tagCode ?? this.tagCode,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['assetSerialNo'] = assetSerialNo;
map['systemID'] = systemID;
map['assetNumber'] = assetNumber;
if (modelDefinition != null) {
map['modelDefinition'] = modelDefinition.toJson();
}
map['supplier'] = supplier?.toJson();
map['ipAddress'] = ipAddress;
map['macAddress'] = macAddress;
map['portNumber'] = portNumber;
if (assetReplace != null) {
map['assetReplace'] = assetReplace.toJson();
}
if (oldAsset != null) {
map['oldAsset'] = oldAsset.toJson();
}
if (isParent != null) {
map['isParent'] = isParent.toJson();
}
if (parentAsset != null) {
map['parentAsset'] = parentAsset.toJson();
}
map['assetType'] = assetType?.toJson();
if (site != null) {
map['site'] = site.toJson();
}
if (building != null) {
map['building'] = building.toJson();
}
if (floor != null) {
map['floor'] = floor.toJson();
}
if (department != null) {
map['department'] = department.toJson();
}
map['room'] = room;
map['testsDay'] = testsDay;
map['purchasingPrice'] = purchasingPrice;
map['nbv'] = nbv;
if (currency != null) {
map['currency'] = currency.toJson();
}
map['poNo'] = poNo;
map['invoiceNumber'] = invoiceNumber;
map['invoiceDate'] = invoiceDate;
map['replacementDate'] = replacementDate;
if (originDepartment != null) {
map['originDepartment'] = originDepartment.toJson();
}
if (originSite != null) {
map['originSite'] = originSite.toJson();
}
map['budgetYear'] = budgetYear;
map['lastPOPrice'] = lastPOPrice;
if (commissioningStatus != null) {
map['commissioningStatus'] = commissioningStatus.toJson();
}
map['productionDate'] = productionDate;
map['edd'] = edd;
map['technicalInspectionDate'] = technicalInspectionDate;
map['deliveryInspectionDate'] = deliveryInspectionDate;
map['endUserAcceptanceDate'] = endUserAcceptanceDate;
map['receivingCommittee'] = receivingCommittee;
if (siteWarrantyMonths != null) {
map['siteWarrantyMonths'] = siteWarrantyMonths.toJson();
}
if (extendedWarrantyMonths != null) {
map['extendedWarrantyMonths'] = extendedWarrantyMonths.toJson();
}
if (remainderWarrantyMonths != null) {
map['remainderWarrantyMonths'] = remainderWarrantyMonths.toJson();
}
map['eomWarrantyMonthsNo'] = eomWarrantyMonthsNo;
map['warrantyValue'] = warrantyValue;
map['warrantyEndDate'] = warrantyEndDate;
map['warrantyContractConditions'] = warrantyContractConditions;
if (technicalGuidanceBooks != null) {
map['technicalGuidanceBooks'] = technicalGuidanceBooks.map((v) => v.toJson()).toList();
}
map['comment'] = comment;
map['tagCode'] = tagCode;
return map;
}
}
class TechnicalGuidanceBooks {
TechnicalGuidanceBooks({
this.id,
this.guidanceBook,
});
TechnicalGuidanceBooks.fromJson(dynamic json) {
id = json['id'];
guidanceBook = json['guidanceBook'] != null ? GuidanceBook.fromJson(json['guidanceBook']) : null;
}
2 years ago
num id;
GuidanceBook guidanceBook;
2 years ago
TechnicalGuidanceBooks copyWith({
num id,
GuidanceBook guidanceBook,
}) =>
TechnicalGuidanceBooks(
id: id ?? this.id,
guidanceBook: guidanceBook ?? this.guidanceBook,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
if (guidanceBook != null) {
map['guidanceBook'] = guidanceBook.toJson();
}
return map;
}
}
class GuidanceBook {
GuidanceBook({
this.id,
this.name,
this.value,
});
GuidanceBook.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
GuidanceBook copyWith({
num id,
String name,
num value,
}) =>
GuidanceBook(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class RemainderWarrantyMonths {
RemainderWarrantyMonths({
this.id,
this.name,
this.value,
});
RemainderWarrantyMonths.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
RemainderWarrantyMonths copyWith({
num id,
String name,
num value,
}) =>
RemainderWarrantyMonths(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class ExtendedWarrantyMonths {
ExtendedWarrantyMonths({
this.id,
this.name,
this.value,
});
ExtendedWarrantyMonths.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
ExtendedWarrantyMonths copyWith({
num id,
String name,
num value,
}) =>
ExtendedWarrantyMonths(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class SiteWarrantyMonths {
SiteWarrantyMonths({
this.id,
this.name,
this.value,
});
SiteWarrantyMonths.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
SiteWarrantyMonths copyWith({
num id,
String name,
num value,
}) =>
SiteWarrantyMonths(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class CommissioningStatus {
CommissioningStatus({
this.id,
this.name,
this.value,
});
CommissioningStatus.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
CommissioningStatus copyWith({
num id,
String name,
num value,
}) =>
CommissioningStatus(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class OriginSite {
OriginSite({
this.id,
this.customerCode,
this.custName,
this.buildings,
});
OriginSite.fromJson(dynamic json) {
id = json['id'];
customerCode = json['customerCode'];
custName = json['custName'];
if (json['buildings'] != null) {
buildings = [];
json['buildings'].forEach((v) {
buildings.add(Buildings.fromJson(v));
});
}
}
2 years ago
num id;
num customerCode;
String custName;
List<Buildings> buildings;
2 years ago
OriginSite copyWith({
num id,
num customerCode,
String custName,
List<Buildings> buildings,
}) =>
OriginSite(
id: id ?? this.id,
customerCode: customerCode ?? this.customerCode,
custName: custName ?? this.custName,
buildings: buildings ?? this.buildings,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['customerCode'] = customerCode;
map['custName'] = custName;
if (buildings != null) {
map['buildings'] = buildings.map((v) => v.toJson()).toList();
}
return map;
}
}
class Buildings {
Buildings({
this.id,
this.name,
this.value,
this.floors,
});
Buildings.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
if (json['floors'] != null) {
floors = [];
json['floors'].forEach((v) {
floors.add(Floors.fromJson(v));
});
}
}
2 years ago
num id;
String name;
num value;
List<Floors> floors;
2 years ago
Buildings copyWith({
num id,
String name,
num value,
List<Floors> floors,
}) =>
Buildings(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
floors: floors ?? this.floors,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
if (floors != null) {
map['floors'] = floors.map((v) => v.toJson()).toList();
}
return map;
}
}
class Floors {
Floors({
this.id,
this.name,
this.value,
this.departments,
});
Floors.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
if (json['departments'] != null) {
departments = [];
json['departments'].forEach((v) {
departments.add(Departments.fromJson(v));
});
}
}
2 years ago
num id;
String name;
num value;
List<Departments> departments;
2 years ago
Floors copyWith({
num id,
String name,
num value,
List<Departments> departments,
}) =>
Floors(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
departments: departments ?? this.departments,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
if (departments != null) {
map['departments'] = departments.map((v) => v.toJson()).toList();
}
return map;
}
}
class Departments {
Departments({
this.id,
this.name,
});
Departments.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
}
2 years ago
num id;
String name;
2 years ago
Departments copyWith({
num id,
String name,
}) =>
Departments(
id: id ?? this.id,
name: name ?? this.name,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
return map;
}
}
class OriginDepartment {
OriginDepartment({
this.id,
this.departmentName,
this.departmentCode,
this.ntCode,
});
OriginDepartment.fromJson(dynamic json) {
id = json['id'];
departmentName = json['departmentName'];
departmentCode = json['departmentCode'];
ntCode = json['ntCode'];
}
2 years ago
num id;
String departmentName;
String departmentCode;
String ntCode;
2 years ago
OriginDepartment copyWith({
num id,
String departmentName,
String departmentCode,
String ntCode,
}) =>
OriginDepartment(
2 years ago
id: id ?? this.id ?? 0,
departmentName: departmentName ?? this.departmentName,
departmentCode: departmentCode ?? this.departmentCode,
ntCode: ntCode ?? this.ntCode,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['departmentName'] = departmentName;
map['departmentCode'] = departmentCode;
map['ntCode'] = ntCode;
return map;
}
}
class Currency {
Currency({
this.id,
this.name,
this.value,
});
Currency.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
Currency copyWith({
num id,
String name,
num value,
}) =>
Currency(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class Department {
Department({
this.id,
this.departmentName,
this.departmentCode,
this.ntCode,
});
Department.fromJson(dynamic json) {
id = json['id'];
departmentName = json['departmentName'];
departmentCode = json['departmentCode'];
ntCode = json['ntCode'];
}
2 years ago
num id;
String departmentName;
String departmentCode;
String ntCode;
2 years ago
Department copyWith({
num id,
String departmentName,
String departmentCode,
String ntCode,
}) =>
Department(
id: id ?? this.id,
departmentName: departmentName ?? this.departmentName,
departmentCode: departmentCode ?? this.departmentCode,
ntCode: ntCode ?? this.ntCode,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['departmentName'] = departmentName;
map['departmentCode'] = departmentCode;
map['ntCode'] = ntCode;
return map;
}
}
class Floor {
Floor({
this.id,
this.name,
this.value,
});
Floor.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
Floor copyWith({
num id,
String name,
num value,
}) =>
Floor(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class Building {
Building({
this.id,
this.name,
this.value,
});
Building.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
Building copyWith({
num id,
String name,
num value,
}) =>
Building(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class Site {
Site({
this.id,
this.customerCode,
this.custName,
this.buildings,
});
Site.fromJson(dynamic json) {
id = json['id'];
customerCode = json['customerCode'];
custName = json['custName'];
if (json['buildings'] != null) {
buildings = [];
json['buildings'].forEach((v) {
buildings.add(Buildings.fromJson(v));
});
}
}
2 years ago
num id;
num customerCode;
String custName;
List<Buildings> buildings;
2 years ago
Site copyWith({
num id,
num customerCode,
String custName,
List<Buildings> buildings,
}) =>
Site(
id: id ?? this.id,
customerCode: customerCode ?? this.customerCode,
custName: custName ?? this.custName,
buildings: buildings ?? this.buildings,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['customerCode'] = customerCode;
map['custName'] = custName;
if (buildings != null) {
map['buildings'] = buildings.map((v) => v.toJson()).toList();
}
return map;
}
}
class ParentAsset {
ParentAsset({
this.id,
this.assetSerialNo,
this.assetNumber,
this.tagCode,
this.systemId,
});
ParentAsset.fromJson(dynamic json) {
id = json['id'];
assetSerialNo = json['assetSerialNo'];
assetNumber = json['assetNumber'];
tagCode = json['tagCode'];
systemId = json['systemId'];
}
2 years ago
num id;
String assetSerialNo;
String assetNumber;
String tagCode;
String systemId;
2 years ago
ParentAsset copyWith({
num id,
String assetSerialNo,
String assetNumber,
String tagCode,
String systemId,
}) =>
ParentAsset(
id: id ?? this.id,
assetSerialNo: assetSerialNo ?? this.assetSerialNo,
assetNumber: assetNumber ?? this.assetNumber,
tagCode: tagCode ?? this.tagCode,
systemId: systemId ?? this.systemId,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['assetSerialNo'] = assetSerialNo;
map['assetNumber'] = assetNumber;
map['tagCode'] = tagCode;
map['systemId'] = systemId;
return map;
}
}
class IsParent {
IsParent({
this.id,
this.name,
this.value,
});
IsParent.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
IsParent copyWith({
num id,
String name,
num value,
}) =>
IsParent(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class OldAsset {
OldAsset({
this.id,
this.assetSerialNo,
this.assetNumber,
this.tagCode,
this.systemId,
});
OldAsset.fromJson(dynamic json) {
id = json['id'];
assetSerialNo = json['assetSerialNo'];
assetNumber = json['assetNumber'];
tagCode = json['tagCode'];
systemId = json['systemId'];
}
2 years ago
num id;
String assetSerialNo;
String assetNumber;
String tagCode;
String systemId;
2 years ago
OldAsset copyWith({
num id,
String assetSerialNo,
String assetNumber,
String tagCode,
String systemId,
}) =>
OldAsset(
2 years ago
id: id ?? this.id ?? 0,
assetSerialNo: assetSerialNo ?? this.assetSerialNo,
assetNumber: assetNumber ?? this.assetNumber,
tagCode: tagCode ?? this.tagCode,
systemId: systemId ?? this.systemId,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['assetSerialNo'] = assetSerialNo;
map['assetNumber'] = assetNumber;
map['tagCode'] = tagCode;
map['systemId'] = systemId;
return map;
}
}
class AssetReplace {
AssetReplace({
this.id,
this.name,
this.value,
});
AssetReplace.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
value = json['value'];
}
2 years ago
num id;
String name;
num value;
2 years ago
AssetReplace copyWith({
num id,
String name,
num value,
}) =>
AssetReplace(
id: id ?? this.id,
name: name ?? this.name,
value: value ?? this.value,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['name'] = name;
map['value'] = value;
return map;
}
}
class Supplier {
Supplier({
this.id,
this.suppliername,
this.suppPersons,
});
Supplier.fromJson(dynamic json) {
id = json['id'];
suppliername = json['suppliername'];
if (json['suppPersons'] != null) {
suppPersons = [];
json['suppPersons'].forEach((v) {
suppPersons.add(SuppPersons.fromJson(v));
});
}
}
2 years ago
num id;
String suppliername;
List<SuppPersons> suppPersons;
2 years ago
SupplierModel copyWith({
num id,
String suppliername,
List<SuppPersons> suppPersons,
}) =>
SupplierModel(
id: id ?? this.id,
suppliername: suppliername ?? this.suppliername,
suppPersons: suppPersons ?? this.suppPersons,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['suppliername'] = suppliername;
if (suppPersons != null) {
map['suppPersons'] = suppPersons.map((v) => v.toJson()).toList();
}
return map;
}
}
class ModelDefinition {
ModelDefinition({
this.id,
this.assetName,
this.modelDefCode,
this.modelName,
this.manufacturerId,
this.manufacturerName,
this.supplierName,
this.replacementDate,
this.essentialEquipement,
this.businessCritical,
this.lifeSpan,
this.modelDefRelatedDefects,
this.suppliers,
});
ModelDefinition.fromJson(dynamic json) {
id = json['id'];
assetName = json['assetName'];
modelDefCode = json['modelDefCode'];
modelName = json['modelName'];
manufacturerId = json['manufacturerId'];
manufacturerName = json['manufacturerName'];
supplierName = json['supplierName'];
replacementDate = json['replacementDate'];
essentialEquipement = json['essentialEquipement'];
businessCritical = json['businessCritical'];
lifeSpan = json['lifeSpan'];
if (json['modelDefRelatedDefects'] != null) {
modelDefRelatedDefects = [];
json['modelDefRelatedDefects'].forEach((v) {
modelDefRelatedDefects.add(ModelDefRelatedDefects.fromJson(v));
});
}
if (json['suppliers'] != null) {
suppliers = [];
json['suppliers'].forEach((v) {
suppliers.add(Suppliers.fromJson(v));
});
}
}
2 years ago
num id;
String assetName;
String modelDefCode;
String modelName;
num manufacturerId;
String manufacturerName;
String supplierName;
String replacementDate;
String essentialEquipement;
String businessCritical;
num lifeSpan;
List<ModelDefRelatedDefects> modelDefRelatedDefects;
List<Suppliers> suppliers;
2 years ago
ModelDefinition copyWith({
num id,
String assetName,
String modelDefCode,
String modelName,
num manufacturerId,
String manufacturerName,
String supplierName,
String replacementDate,
String essentialEquipement,
String businessCritical,
num lifeSpan,
List<ModelDefRelatedDefects> modelDefRelatedDefects,
List<Suppliers> suppliers,
}) =>
ModelDefinition(
id: id ?? this.id,
assetName: assetName ?? this.assetName,
modelDefCode: modelDefCode ?? this.modelDefCode,
modelName: modelName ?? this.modelName,
manufacturerId: manufacturerId ?? this.manufacturerId,
manufacturerName: manufacturerName ?? this.manufacturerName,
supplierName: supplierName ?? this.supplierName,
replacementDate: replacementDate ?? this.replacementDate,
essentialEquipement: essentialEquipement ?? this.essentialEquipement,
businessCritical: businessCritical ?? this.businessCritical,
lifeSpan: lifeSpan ?? this.lifeSpan,
modelDefRelatedDefects: modelDefRelatedDefects ?? this.modelDefRelatedDefects,
suppliers: suppliers ?? this.suppliers,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['assetName'] = assetName;
map['modelDefCode'] = modelDefCode;
map['modelName'] = modelName;
map['manufacturerId'] = manufacturerId;
map['manufacturerName'] = manufacturerName;
map['supplierName'] = supplierName;
map['replacementDate'] = replacementDate;
map['essentialEquipement'] = essentialEquipement;
map['businessCritical'] = businessCritical;
map['lifeSpan'] = lifeSpan;
if (modelDefRelatedDefects != null) {
map['modelDefRelatedDefects'] = modelDefRelatedDefects.map((v) => v.toJson()).toList();
}
if (suppliers != null) {
map['suppliers'] = suppliers.map((v) => v.toJson()).toList();
}
return map;
}
}
class Suppliers {
Suppliers({
this.id,
this.suppliername,
});
Suppliers.fromJson(dynamic json) {
id = json['id'];
suppliername = json['suppliername'];
}
2 years ago
num id;
String suppliername;
2 years ago
Suppliers copyWith({
num id,
String suppliername,
}) =>
Suppliers(
id: id ?? this.id,
suppliername: suppliername ?? this.suppliername,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
2 years ago
map['id'] = id ?? 0;
map['suppliername'] = suppliername;
return map;
}
}
class ModelDefRelatedDefects {
ModelDefRelatedDefects({
this.id,
this.defectName,
this.workPerformed,
this.estimatedTime,
});
ModelDefRelatedDefects.fromJson(dynamic json) {
id = json['id'];
defectName = json['defectName'];
workPerformed = json['workPerformed'];
estimatedTime = json['estimatedTime'];
}
2 years ago
num id;
String defectName;
String workPerformed;
String estimatedTime;
2 years ago
ModelDefRelatedDefects copyWith({
num id,
String defectName,
String workPerformed,
String estimatedTime,
}) =>
ModelDefRelatedDefects(
2 years ago
id: id ?? this.id ?? 0,
defectName: defectName ?? this.defectName,
workPerformed: workPerformed ?? this.workPerformed,
estimatedTime: estimatedTime ?? this.estimatedTime,
);
2 years ago
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['defectName'] = defectName;
map['workPerformed'] = workPerformed;
map['estimatedTime'] = estimatedTime;
return map;
}
}