73 lines
2.0 KiB
Dart
73 lines
2.0 KiB
Dart
import 'PureRiskRating.dart';
|
|
import 'InPlace.dart';
|
|
import 'ResidualRiskRating.dart';
|
|
|
|
class RiskAssessmentData {
|
|
RiskAssessmentData({
|
|
this.pureRiskRating,
|
|
this.inPlace,
|
|
this.residualRiskRating,
|
|
this.id,
|
|
this.hazard,
|
|
this.personsExposedToHazard,
|
|
this.riskIdentified,
|
|
this.coldMeasureRequired,
|
|
this.userId,
|
|
this.createdAt,
|
|
this.updatedAt,
|
|
});
|
|
|
|
RiskAssessmentData.fromJson(dynamic json) {
|
|
pureRiskRating = json['pureRiskRating'] != null
|
|
? PureRiskRating.fromJson(json['pureRiskRating'])
|
|
: null;
|
|
inPlace =
|
|
json['inPlace'] != null ? InPlace.fromJson(json['inPlace']) : null;
|
|
residualRiskRating = json['residualRiskRating'] != null
|
|
? ResidualRiskRating.fromJson(json['residualRiskRating'])
|
|
: null;
|
|
id = json['_id'];
|
|
hazard = json['hazard'];
|
|
personsExposedToHazard = json['personsExposedToHazard'];
|
|
riskIdentified = json['riskIdentified'];
|
|
coldMeasureRequired = json['coldMeasureRequired'];
|
|
userId = json['userId'];
|
|
createdAt = json['createdAt'];
|
|
updatedAt = json['updatedAt'];
|
|
}
|
|
|
|
PureRiskRating? pureRiskRating;
|
|
InPlace? inPlace;
|
|
ResidualRiskRating? residualRiskRating;
|
|
String? id;
|
|
String? hazard;
|
|
String? personsExposedToHazard;
|
|
String? riskIdentified;
|
|
String? coldMeasureRequired;
|
|
String? userId;
|
|
String? createdAt;
|
|
String? updatedAt;
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final map = <String, dynamic>{};
|
|
if (pureRiskRating != null) {
|
|
map['pureRiskRating'] = pureRiskRating?.toJson();
|
|
}
|
|
if (inPlace != null) {
|
|
map['inPlace'] = inPlace?.toJson();
|
|
}
|
|
if (residualRiskRating != null) {
|
|
map['residualRiskRating'] = residualRiskRating?.toJson();
|
|
}
|
|
map['_id'] = id;
|
|
map['hazard'] = hazard;
|
|
map['personsExposedToHazard'] = personsExposedToHazard;
|
|
map['riskIdentified'] = riskIdentified;
|
|
map['coldMeasureRequired'] = coldMeasureRequired;
|
|
map['userId'] = userId;
|
|
map['createdAt'] = createdAt;
|
|
map['updatedAt'] = updatedAt;
|
|
return map;
|
|
}
|
|
}
|