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/modules/internal_audit_module/models/engineer_data_model.dart

53 lines
1.5 KiB
Dart

import 'package:test_sa/models/generic_attachment_model.dart';
11 months ago
class EngineerData {
int? id;
String? debrief;
String? startTime;
String? endTime;
double? totalHours;
bool? isComplete;
int? statusId;
int? requestId;
List<GenericAttachmentModel>? attachments;
11 months ago
EngineerData({
this.id,
this.debrief,
this.startTime,
this.endTime,
this.totalHours,
this.isComplete,
this.statusId,
this.requestId,
this.attachments,
});
EngineerData.fromJson(Map<String, dynamic> json) {
id = json['id'];
debrief = json['debrief'];
startTime = json['startTime'];
endTime = json['endTime'];
totalHours = (json['totalHours'] as num?)?.toDouble();
isComplete = json['isComplete'];
statusId = json['statusId'];
requestId = json['requestId'];
attachments = json['attachments'] != null ? (json['attachments'] as List).map((e) => GenericAttachmentModel.fromInternalAuditJson(e)).toList() : [];
11 months ago
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = {};
data['id'] = id;
data['debrief'] = debrief;
data['startTime'] = startTime;
data['endTime'] = endTime;
data['totalHours'] = totalHours;
data['isComplete'] = isComplete;
data['statusId'] = statusId;
data['requestId'] = requestId;
if (attachments != null) {
data['attachments'] = attachments!.whereType<GenericAttachmentModel>().map((e) => e.toInternalAuditJson()).toList();
11 months ago
}
return data;
}
}