|
|
|
|
@ -12,42 +12,77 @@ import 'package:test_sa/models/new_models/site.dart';
|
|
|
|
|
import 'package:test_sa/models/timer_model.dart';
|
|
|
|
|
|
|
|
|
|
class GasRefillModel {
|
|
|
|
|
GasRefillModel(
|
|
|
|
|
{this.id,
|
|
|
|
|
this.gazRefillNo,
|
|
|
|
|
this.expectedDate,
|
|
|
|
|
this.expectedTime,
|
|
|
|
|
this.startDate,
|
|
|
|
|
this.startTime,
|
|
|
|
|
this.endDate,
|
|
|
|
|
this.endTime,
|
|
|
|
|
this.engSignature,
|
|
|
|
|
this.nurseSignature,
|
|
|
|
|
this.workingHours,
|
|
|
|
|
this.extensionNo,
|
|
|
|
|
this.employeeId,
|
|
|
|
|
this.name,
|
|
|
|
|
this.createdDate,
|
|
|
|
|
this.site,
|
|
|
|
|
this.building,
|
|
|
|
|
this.floor,
|
|
|
|
|
this.department,
|
|
|
|
|
this.assignedEmployee,
|
|
|
|
|
this.status,
|
|
|
|
|
this.comment,
|
|
|
|
|
this.gazRefillDetails,
|
|
|
|
|
this.localEngineerSignature,
|
|
|
|
|
this.localNurseSignature,
|
|
|
|
|
this.timer,
|
|
|
|
|
this.timerModelList,
|
|
|
|
|
this.gasRefillTimer,
|
|
|
|
|
this.gasRefillAttachments,
|
|
|
|
|
GasRefillModel({
|
|
|
|
|
this.id,
|
|
|
|
|
this.gasRefillNo,
|
|
|
|
|
this.expectedDate,
|
|
|
|
|
this.expectedTime,
|
|
|
|
|
this.startDate,
|
|
|
|
|
this.startTime,
|
|
|
|
|
this.endDate,
|
|
|
|
|
this.endTime,
|
|
|
|
|
this.engSignature,
|
|
|
|
|
this.nurseSignature,
|
|
|
|
|
this.workingHours,
|
|
|
|
|
this.extensionNo,
|
|
|
|
|
this.employeeId,
|
|
|
|
|
this.name,
|
|
|
|
|
this.createdDate,
|
|
|
|
|
this.site,
|
|
|
|
|
this.building,
|
|
|
|
|
this.floor,
|
|
|
|
|
this.department,
|
|
|
|
|
this.assignedEmployee,
|
|
|
|
|
this.status,
|
|
|
|
|
this.comment,
|
|
|
|
|
this.techComment,
|
|
|
|
|
this.gasRefillDetails,
|
|
|
|
|
this.localEngineerSignature,
|
|
|
|
|
this.localNurseSignature,
|
|
|
|
|
this.timer,
|
|
|
|
|
this.timerModelList,
|
|
|
|
|
this.gasRefillTimers,
|
|
|
|
|
this.gasRefillAttachments,
|
|
|
|
|
this.statusValue,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
num? id; // Now nullable
|
|
|
|
|
String? gasRefillNo; // Now nullable
|
|
|
|
|
String? expectedDate; // Now nullable
|
|
|
|
|
String? expectedTime; // Now nullable
|
|
|
|
|
String? startDate; // Now nullable
|
|
|
|
|
String? startTime; // Now nullable
|
|
|
|
|
String? endDate; // Now nullable
|
|
|
|
|
String? endTime; // Now nullable
|
|
|
|
|
String? engSignature; // Now nullable
|
|
|
|
|
String? nurseSignature; // Now nullable
|
|
|
|
|
double? workingHours;
|
|
|
|
|
dynamic extensionNo;
|
|
|
|
|
String? employeeId;
|
|
|
|
|
String? name;
|
|
|
|
|
String? createdDate;
|
|
|
|
|
Site? site; // Now nullable
|
|
|
|
|
Building? building; // Now nullable
|
|
|
|
|
Floor? floor; // Now nullable
|
|
|
|
|
Department? department; // Now nullable
|
|
|
|
|
AssignedEmployee? assignedEmployee; // Now nullable
|
|
|
|
|
Lookup? status; // Now nullable
|
|
|
|
|
String? comment; // Now nullable
|
|
|
|
|
String? techComment; // Now nullable
|
|
|
|
|
List<GasRefillDetails>? gasRefillDetails; // Now nullable
|
|
|
|
|
Uint8List? localNurseSignature; // Now nullable
|
|
|
|
|
Uint8List? localEngineerSignature; // Now nullable
|
|
|
|
|
TimerModel? timer;
|
|
|
|
|
|
|
|
|
|
//TODO need to check when api provided..
|
|
|
|
|
List<TimerModel>? timerModelList = [];
|
|
|
|
|
List<GasRefillTimer>? gasRefillTimers = [];
|
|
|
|
|
List<GasRefillAttachments>? gasRefillAttachments;
|
|
|
|
|
int? statusValue;
|
|
|
|
|
|
|
|
|
|
GasRefillModel.fromJson(dynamic json) {
|
|
|
|
|
id = json['id'];
|
|
|
|
|
gazRefillNo = json['gazRefillNo'];
|
|
|
|
|
gasRefillNo = json['gasRefillNo'];
|
|
|
|
|
expectedDate = json['expectedDate'];
|
|
|
|
|
expectedTime = json['expectedTime'];
|
|
|
|
|
startDate = json['startDate'];
|
|
|
|
|
@ -55,18 +90,19 @@ class GasRefillModel {
|
|
|
|
|
endDate = json['endDate'];
|
|
|
|
|
endTime = json['endTime'];
|
|
|
|
|
comment = json['comment'];
|
|
|
|
|
techComment = json['techComment'];
|
|
|
|
|
workingHours = json['workingHours'];
|
|
|
|
|
extensionNo = json['extensionNo'];
|
|
|
|
|
employeeId = json['employeeId'];
|
|
|
|
|
name = json['name'];
|
|
|
|
|
createdDate = json['createdDate'];
|
|
|
|
|
//TODO need to use this when added from backend...
|
|
|
|
|
if (json['gasRefillTimer'] != null) {
|
|
|
|
|
gasRefillTimer = <GasRefillTimer>[];
|
|
|
|
|
json['gasRefillTimer'].forEach((v) {
|
|
|
|
|
gasRefillTimer?.add(GasRefillTimer.fromJson(v));
|
|
|
|
|
if (json['gasRefillTimers'] != null) {
|
|
|
|
|
gasRefillTimers = <GasRefillTimer>[];
|
|
|
|
|
json['gasRefillTimers'].forEach((v) {
|
|
|
|
|
gasRefillTimers?.add(GasRefillTimer.fromJson(v));
|
|
|
|
|
});
|
|
|
|
|
workingHours = json['gasRefillTimer'].fold(0.0, (sum, item) => (sum ?? 0) + DateTime.parse(item['endDateTime']).difference(DateTime.parse(item['startDateTime'])).inSeconds) ?? 0;
|
|
|
|
|
workingHours = json['gasRefillTimers'].fold(0.0, (sum, item) => (sum ?? 0) + DateTime.parse(item['endDate']).difference(DateTime.parse(item['startDate'])).inSeconds) ?? 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (json['gasRefillAttachments'] != null) {
|
|
|
|
|
gasRefillAttachments = <GasRefillAttachments>[];
|
|
|
|
|
@ -75,23 +111,23 @@ class GasRefillModel {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
final DateTime? sd = DateTime.tryParse(startDate ?? "");
|
|
|
|
|
final DateTime? st = DateTime.tryParse(startTime ?? "");
|
|
|
|
|
final DateTime? ed = DateTime.tryParse(endDate ?? "");
|
|
|
|
|
final DateTime? et = DateTime.tryParse(endTime ?? "");
|
|
|
|
|
timer = TimerModel(
|
|
|
|
|
startAt: st == null ? sd : sd?.add(Duration(hours: st.hour, minutes: st.minute, seconds: st.second)), // Handle potential null 'sd'
|
|
|
|
|
endAt: et == null ? ed : ed?.add(Duration(hours: et.hour, minutes: et.minute, seconds: et.second)), // Handle potential null 'ed'
|
|
|
|
|
);
|
|
|
|
|
if (timer!.endAt != null && timer!.startAt != null) {
|
|
|
|
|
// Use '!' since timer could be null after initialization
|
|
|
|
|
timer!.durationInSecond = (timer!.endAt!.difference(timer!.startAt!)).inSeconds;
|
|
|
|
|
workingHours = (((timer!.durationInSecond ?? 0) / 60) / 60);
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
print(e);
|
|
|
|
|
}
|
|
|
|
|
// try {
|
|
|
|
|
// final DateTime? sd = DateTime.tryParse(startDate ?? "");
|
|
|
|
|
// final DateTime? st = DateTime.tryParse(startTime ?? "");
|
|
|
|
|
// final DateTime? ed = DateTime.tryParse(endDate ?? "");
|
|
|
|
|
// final DateTime? et = DateTime.tryParse(endTime ?? "");
|
|
|
|
|
// timer = TimerModel(
|
|
|
|
|
// startAt: st == null ? sd : sd?.add(Duration(hours: st.hour, minutes: st.minute, seconds: st.second)), // Handle potential null 'sd'
|
|
|
|
|
// endAt: et == null ? ed : ed?.add(Duration(hours: et.hour, minutes: et.minute, seconds: et.second)), // Handle potential null 'ed'
|
|
|
|
|
// );
|
|
|
|
|
// if (timer!.endAt != null && timer!.startAt != null) {
|
|
|
|
|
// // Use '!' since timer could be null after initialization
|
|
|
|
|
// timer!.durationInSecond = (timer!.endAt!.difference(timer!.startAt!)).inSeconds;
|
|
|
|
|
// workingHours = (((timer!.durationInSecond ?? 0) / 60) / 60);
|
|
|
|
|
// }
|
|
|
|
|
// } catch (e) {
|
|
|
|
|
// print(e);
|
|
|
|
|
// }
|
|
|
|
|
engSignature = json['engSignature'];
|
|
|
|
|
nurseSignature = json['nurseSignature'];
|
|
|
|
|
site = json['site'] != null ? Site.fromJson(json['site']) : null;
|
|
|
|
|
@ -100,96 +136,93 @@ class GasRefillModel {
|
|
|
|
|
department = json['department'] != null ? Department.fromJson(json['department']) : null;
|
|
|
|
|
assignedEmployee = json['assignedEmployee'] != null ? AssignedEmployee.fromJson(json['assignedEmployee']) : null;
|
|
|
|
|
status = json['status'] != null ? Lookup.fromJson(json['status']) : null;
|
|
|
|
|
if (json['gazRefillDetails'] != null) {
|
|
|
|
|
gazRefillDetails = [];
|
|
|
|
|
json['gazRefillDetails'].forEach((v) {
|
|
|
|
|
gazRefillDetails!.add(GasRefillDetails.fromJson(v)); // Use '!' since gazRefillDetails is initialized here
|
|
|
|
|
if (json['gasRefillDetails'] != null) {
|
|
|
|
|
gasRefillDetails = [];
|
|
|
|
|
json['gasRefillDetails'].forEach((v) {
|
|
|
|
|
gasRefillDetails!.add(GasRefillDetails.fromJson(v)); // Use '!' since gasRefillDetails is initialized here
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
num? id; // Now nullable
|
|
|
|
|
String? gazRefillNo; // Now nullable
|
|
|
|
|
String? expectedDate; // Now nullable
|
|
|
|
|
String? expectedTime; // Now nullable
|
|
|
|
|
String? startDate; // Now nullable
|
|
|
|
|
String? startTime; // Now nullable
|
|
|
|
|
String? endDate; // Now nullable
|
|
|
|
|
String? endTime; // Now nullable
|
|
|
|
|
String? engSignature; // Now nullable
|
|
|
|
|
String? nurseSignature; // Now nullable
|
|
|
|
|
double? workingHours;
|
|
|
|
|
dynamic extensionNo;
|
|
|
|
|
String? employeeId;
|
|
|
|
|
String? name;
|
|
|
|
|
String? createdDate;
|
|
|
|
|
Site? site; // Now nullable
|
|
|
|
|
Building? building; // Now nullable
|
|
|
|
|
Floor? floor; // Now nullable
|
|
|
|
|
Department? department; // Now nullable
|
|
|
|
|
AssignedEmployee? assignedEmployee; // Now nullable
|
|
|
|
|
Lookup? status; // Now nullable
|
|
|
|
|
String? comment; // Now nullable
|
|
|
|
|
List<GasRefillDetails>? gazRefillDetails; // Now nullable
|
|
|
|
|
Uint8List? localNurseSignature; // Now nullable
|
|
|
|
|
Uint8List? localEngineerSignature; // Now nullable
|
|
|
|
|
TimerModel? timer;
|
|
|
|
|
//TODO need to check when api provided..
|
|
|
|
|
List<TimerModel>? timerModelList = [];
|
|
|
|
|
List<GasRefillTimer>? gasRefillTimer = [];
|
|
|
|
|
List<GasRefillAttachments>? gasRefillAttachments;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
|
final map = <String, dynamic>{};
|
|
|
|
|
map['id'] = id ?? 0;
|
|
|
|
|
map['gazRefillNo'] = "GR-${DateTime.now().toString().split(" ").first}";
|
|
|
|
|
map['expectedDate'] = expectedDate;
|
|
|
|
|
map['expectedTime'] = expectedTime;
|
|
|
|
|
map['startDate'] = startDate;
|
|
|
|
|
map['startTime'] = startTime;
|
|
|
|
|
map['endDate'] = endDate;
|
|
|
|
|
map['endTime'] = endTime;
|
|
|
|
|
map['engSignature'] = engSignature;
|
|
|
|
|
map['nurseSignature'] = nurseSignature;
|
|
|
|
|
map['workingHours'] = workingHours;
|
|
|
|
|
map['extensionNo'] = extensionNo;
|
|
|
|
|
map['employeeId'] = employeeId;
|
|
|
|
|
map['name'] = name;
|
|
|
|
|
map['createdDate'] = createdDate;
|
|
|
|
|
map['comment'] = comment;
|
|
|
|
|
//TODO need to check parameters here ...
|
|
|
|
|
if (gasRefillTimer != null) {
|
|
|
|
|
map['gasRefillTimer'] = gasRefillTimer?.map((v) => v.toJson()).toList();
|
|
|
|
|
}
|
|
|
|
|
if (gasRefillAttachments != null) {
|
|
|
|
|
map['gasRefillAttachments'] = gasRefillAttachments?.map((v) => v.toJson()).toList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
map['gasTypeId'] = gasRefillDetails?[0].gasType?.id;
|
|
|
|
|
map['cylinderTypeId'] = gasRefillDetails?[0].cylinderType?.id;
|
|
|
|
|
map['cylinderSizeId'] = gasRefillDetails?[0].cylinderSize?.id;
|
|
|
|
|
map['requestedQty'] = gasRefillDetails?[0].requestedQty;
|
|
|
|
|
if (site != null) {
|
|
|
|
|
map['site'] = site?.toJson(addBuildings: false); // Use '?.' for null safety
|
|
|
|
|
map['siteId'] = site?.id; // Use '?.' for null safety
|
|
|
|
|
}
|
|
|
|
|
if (building != null) {
|
|
|
|
|
map['building'] = building?.toJson(addFloor: false); // Use '?.' for null safety
|
|
|
|
|
map['buildingId'] = building?.id; // Use '?.' for null safety
|
|
|
|
|
}
|
|
|
|
|
if (floor != null) {
|
|
|
|
|
map['floor'] = floor?.toJson(addDepartments: false); // Use '?.' for null safety
|
|
|
|
|
map['floorId'] = floor?.id; // Use '?.' for null safety
|
|
|
|
|
}
|
|
|
|
|
if (department != null) {
|
|
|
|
|
map['department'] = department?.toJson(); // Use '?.' for null safety
|
|
|
|
|
map['departmentId'] = department?.id; // Use '?.' for null safety
|
|
|
|
|
}
|
|
|
|
|
if (assignedEmployee != null) {
|
|
|
|
|
map['assignedEmployee'] = assignedEmployee?.toJson(); // Use '?.' for null safety
|
|
|
|
|
map['comment'] = comment;
|
|
|
|
|
|
|
|
|
|
if (gasRefillAttachments != null) {
|
|
|
|
|
map['gasRefillAttachments'] = gasRefillAttachments?.map((v) => v.toJson()).toList();
|
|
|
|
|
}
|
|
|
|
|
if (status != null) {
|
|
|
|
|
map['status'] = status?.toJson(); // Use '?.' for null safety
|
|
|
|
|
|
|
|
|
|
//older code.....
|
|
|
|
|
// map['gasRefillNo'] = "GR-${DateTime.now().toString().split(" ").first}";
|
|
|
|
|
// map['expectedTime'] = expectedTime;
|
|
|
|
|
//
|
|
|
|
|
// map['startDate'] = startDate;
|
|
|
|
|
// map['startTime'] = startTime;
|
|
|
|
|
// map['endDate'] = endDate;
|
|
|
|
|
// map['endTime'] = endTime;
|
|
|
|
|
// map['engSignature'] = engSignature;
|
|
|
|
|
// map['nurseSignature'] = nurseSignature;
|
|
|
|
|
// map['workingHours'] = workingHours;
|
|
|
|
|
// map['extensionNo'] = extensionNo;
|
|
|
|
|
// map['employeeId'] = employeeId;
|
|
|
|
|
// map['name'] = name;
|
|
|
|
|
// map['createdDate'] = createdDate;
|
|
|
|
|
// map['comment'] = comment;
|
|
|
|
|
// if (site != null) {
|
|
|
|
|
// map['site'] = site?.toJson(addBuildings: false); // Use '?.' for null safety
|
|
|
|
|
// }
|
|
|
|
|
// if (building != null) {
|
|
|
|
|
// map['building'] = building?.toJson(addFloor: false); // Use '?.' for null safety
|
|
|
|
|
// }
|
|
|
|
|
// if (floor != null) {
|
|
|
|
|
// map['floor'] = floor?.toJson(addDepartments: false); // Use '?.' for null safety
|
|
|
|
|
// }
|
|
|
|
|
// if (department != null) {
|
|
|
|
|
// map['department'] = department?.toJson(); // Use '?.' for null safety
|
|
|
|
|
// }
|
|
|
|
|
// if (assignedEmployee != null) {
|
|
|
|
|
// map['assignedEmployee'] = assignedEmployee?.toJson(); // Use '?.' for null safety
|
|
|
|
|
// }
|
|
|
|
|
// if (status != null) {
|
|
|
|
|
// map['status'] = status?.toJson(); // Use '?.' for null safety
|
|
|
|
|
// }
|
|
|
|
|
// if (gasRefillDetails != null) {
|
|
|
|
|
// map['gasRefillDetails'] = gasRefillDetails!.map((v) => v.toJson()).toList(); // Use '!' since gasRefillDetails could be null
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toUpdateEngineerPayload({required int status}) {
|
|
|
|
|
final map = <String, dynamic>{};
|
|
|
|
|
map['id'] = id ?? 0;
|
|
|
|
|
map['deliveredQty'] = gasRefillDetails?[0].deliverdQty;
|
|
|
|
|
map['statusValue'] = status;
|
|
|
|
|
map['techComment'] = techComment;
|
|
|
|
|
if (gasRefillTimers != null) {
|
|
|
|
|
map['gasRefillTimers'] = gasRefillTimers?.map((v) => v.toJson()).toList();
|
|
|
|
|
}
|
|
|
|
|
if (gazRefillDetails != null) {
|
|
|
|
|
map['gazRefillDetails'] = gazRefillDetails!.map((v) => v.toJson()).toList(); // Use '!' since gazRefillDetails could be null
|
|
|
|
|
if (gasRefillAttachments != null) {
|
|
|
|
|
map['gasRefillAttachments'] = gasRefillAttachments?.map((v) => v.toJson()).toList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -214,9 +247,9 @@ class GasRefillModel {
|
|
|
|
|
id = model.id;
|
|
|
|
|
//userId = model.userId;
|
|
|
|
|
site = model.site;
|
|
|
|
|
gazRefillNo = model.gazRefillNo;
|
|
|
|
|
gasRefillNo = model.gasRefillNo;
|
|
|
|
|
status = Lookup.fromStatus(model.status);
|
|
|
|
|
gazRefillDetails = model.gazRefillDetails;
|
|
|
|
|
gasRefillDetails = model.gasRefillDetails;
|
|
|
|
|
building = model.building;
|
|
|
|
|
floor = model.floor;
|
|
|
|
|
department = model.department;
|
|
|
|
|
@ -233,12 +266,13 @@ class GasRefillModel {
|
|
|
|
|
extensionNo = model.extensionNo;
|
|
|
|
|
employeeId = model.employeeId;
|
|
|
|
|
name = model.name;
|
|
|
|
|
techComment = model.techComment;
|
|
|
|
|
createdDate = model.createdDate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GasRefillModel copyWith({
|
|
|
|
|
num? id, // Parameters are now nullable
|
|
|
|
|
String? gazRefillNo,
|
|
|
|
|
String? gasRefillNo,
|
|
|
|
|
String? expectedDate,
|
|
|
|
|
String? expectedTime,
|
|
|
|
|
String? startDate,
|
|
|
|
|
@ -259,14 +293,13 @@ class GasRefillModel {
|
|
|
|
|
AssignedEmployee? assignedEmployee,
|
|
|
|
|
Lookup? status,
|
|
|
|
|
String? comment,
|
|
|
|
|
List<GasRefillDetails>? gazRefillDetails,
|
|
|
|
|
List<GasRefillDetails>? gasRefillDetails,
|
|
|
|
|
List<GasRefillTimer>? gasRefillTimer,
|
|
|
|
|
TimerModel? timer,
|
|
|
|
|
|
|
|
|
|
}) =>
|
|
|
|
|
GasRefillModel(
|
|
|
|
|
id: id ?? this.id,
|
|
|
|
|
gazRefillNo: gazRefillNo ?? this.gazRefillNo,
|
|
|
|
|
gasRefillNo: gasRefillNo ?? this.gasRefillNo,
|
|
|
|
|
expectedDate: expectedDate ?? this.expectedDate,
|
|
|
|
|
expectedTime: expectedTime ?? this.expectedTime,
|
|
|
|
|
startDate: startDate ?? this.startDate,
|
|
|
|
|
@ -283,9 +316,9 @@ class GasRefillModel {
|
|
|
|
|
assignedEmployee: assignedEmployee ?? this.assignedEmployee,
|
|
|
|
|
status: status ?? this.status,
|
|
|
|
|
comment: comment ?? this.comment,
|
|
|
|
|
gazRefillDetails: gazRefillDetails ?? this.gazRefillDetails,
|
|
|
|
|
gasRefillDetails: gasRefillDetails ?? this.gasRefillDetails,
|
|
|
|
|
timer: timer ?? this.timer,
|
|
|
|
|
gasRefillTimer : gasRefillTimer ?? this.gasRefillTimer,
|
|
|
|
|
gasRefillTimers: gasRefillTimer ?? this.gasRefillTimers,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -369,51 +402,51 @@ class GasRefillDetails {
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class GasRefillTimer {
|
|
|
|
|
int? id;
|
|
|
|
|
String? startTime;
|
|
|
|
|
String? endTime;
|
|
|
|
|
String? startDate;
|
|
|
|
|
String? endDate;
|
|
|
|
|
dynamic workingHours;
|
|
|
|
|
|
|
|
|
|
GasRefillTimer({this.id, this.startTime, this.endTime, this.workingHours});
|
|
|
|
|
GasRefillTimer({this.id, this.startDate, this.endDate, this.workingHours});
|
|
|
|
|
|
|
|
|
|
GasRefillTimer.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
id = json['id'];
|
|
|
|
|
startTime = json['startDateTime'];
|
|
|
|
|
endTime = json['endDateTime'];
|
|
|
|
|
workingHours = json['workingHour'];
|
|
|
|
|
startDate = json['startDate'];
|
|
|
|
|
endDate = json['endDate'];
|
|
|
|
|
workingHours = json['workingHours'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
|
data['id'] = id;
|
|
|
|
|
data['startDateTime'] = startTime;
|
|
|
|
|
data['endDateTime'] = endTime;
|
|
|
|
|
data['workingHour'] = workingHours;
|
|
|
|
|
data['startDate'] = startDate;
|
|
|
|
|
data['endDate'] = endDate;
|
|
|
|
|
data['workingHours'] = workingHours;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class GasRefillAttachments {
|
|
|
|
|
int? id;
|
|
|
|
|
num? gasRefillId;
|
|
|
|
|
String? attachmentName;
|
|
|
|
|
|
|
|
|
|
GasRefillAttachments({this.id, this.attachmentName});
|
|
|
|
|
GasRefillAttachments({this.id, this.attachmentName, this.gasRefillId});
|
|
|
|
|
|
|
|
|
|
GasRefillAttachments.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
id = json['id'];
|
|
|
|
|
gasRefillId = json['gasRefillId'];
|
|
|
|
|
attachmentName = json['attachmentName'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
|
final Map<String, dynamic> data = <String, dynamic>{};
|
|
|
|
|
data['id'] = id;
|
|
|
|
|
data['gasRefillId'] = gasRefillId;
|
|
|
|
|
data['attachmentName'] = attachmentName;
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|