This repository has been archived on 2024-10-18. You can view files and clone it, but cannot push or open issues or pull requests.
ftc_patient_app/lib/models/rota/LiveRoster.dart

65 lines
1.7 KiB
Dart

import 'ShiftLocation.dart';
class LiveRoster {
LiveRoster({
this.id,
this.rotaTemplateId,
this.rosterStartDate,
this.rosterEndDate,
this.templateWeeks,
this.shiftLocation,
this.active,
this.lastModifiedBy,
this.createdAt,
this.updatedAt,
this.v,});
LiveRoster.fromJson(dynamic json) {
id = json['_id'];
rotaTemplateId = json['rotaTemplateId'];
rosterStartDate = json['rosterStartDate'];
rosterEndDate = json['rosterEndDate'];
templateWeeks = json['templateWeeks'];
if (json['shiftLocation'] != null && json['shiftLocation'] is List) {
shiftLocation = [];
json['shiftLocation'].forEach((v) {
shiftLocation?.add(ShiftLocation.fromJson(v));
});
}
active = json['active'];
lastModifiedBy = json['lastModifiedBy'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
v = json['__v'];
}
String? id;
String? rotaTemplateId;
int? rosterStartDate;
int? rosterEndDate;
int? templateWeeks;
List<ShiftLocation>? shiftLocation;
bool? active;
String? lastModifiedBy;
String? createdAt;
String? updatedAt;
int? v;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
map['rotaTemplateId'] = rotaTemplateId;
map['rosterStartDate'] = rosterStartDate;
map['rosterEndDate'] = rosterEndDate;
map['templateWeeks'] = templateWeeks;
if (shiftLocation != null) {
map['shiftLocation'] = shiftLocation?.map((v) => v.toJson()).toList();
}
map['active'] = active;
map['lastModifiedBy'] = lastModifiedBy;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
map['__v'] = v;
return map;
}
}