fist commit ftc staff app clone

This commit is contained in:
2024-08-01 13:46:46 +05:30
commit bf9064a9c9
515 changed files with 42796 additions and 0 deletions

View File

@@ -0,0 +1,103 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
class AppointmentsListResponse {
AppointmentsListResponse({
this.success,
this.status,
this.message,
this.data,});
AppointmentsListResponse.fromJson(dynamic json) {
status = json['status'];
message = json['message'];
if (json['data'] != null) {
data = [];
json['data'].forEach((v) {
data?.add(AppointmentsListResponseData.fromJson(v));
});
}
}
bool? success;
String? status;
String? message;
List<AppointmentsListResponseData>? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['status'] = status;
map['message'] = message;
if (data != null) {
map['data'] = data?.map((v) => v.toJson()).toList();
}
return map;
}
}
class AppointmentsListResponseData {
AppointmentsListResponseData({
this.id,
this.user,
this.appointmentDate,
this.appointmentStartTime,
this.appointmentEndTime,
this.appointmentMin,
this.staff,
this.addedby,
this.appointmentDetails,
this.status,
this.createdAt,
this.updatedAt,
this.appointmentTitle,});
AppointmentsListResponseData.fromJson(dynamic json) {
id = json['_id'];
user = json['user'];
appointmentDate = json['appointmentDate'];
appointmentStartTime = json['appointmentStartTime'];
appointmentEndTime = json['appointmentEndTime'];
appointmentMin = json['appointmentMin'];
staff = json['staff'] != null ? UserData.fromJson(json['staff']) : null;
addedby = json['addedby'];
appointmentDetails = json['appointmentDetails'];
status = json['status'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
appointmentTitle = json['appointmentTitle'];
}
String? id;
String? user;
int? appointmentDate;
String? appointmentStartTime;
String? appointmentEndTime;
int? appointmentMin;
UserData? staff;
String? addedby;
String? appointmentDetails;
String? status;
String? createdAt;
String? updatedAt;
String? appointmentTitle;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
map['user'] = user;
map['appointmentDate'] = appointmentDate;
map['appointmentStartTime'] = appointmentStartTime;
map['appointmentEndTime'] = appointmentEndTime;
map['appointmentMin'] = appointmentMin;
if (staff != null) {
map['staff'] = staff?.toJson();
}
map['addedby'] = addedby;
map['appointmentDetails'] = appointmentDetails;
map['status'] = status;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
map['appointmentTitle'] = appointmentTitle;
return map;
}
}

View File

@@ -0,0 +1,80 @@
import '../profileData/user_data.dart';
class ChatModel {
static const stateNone = 0;
static const stateError = -1;
static const stateLoading = 1;
static const stateSuccess = 2;
static const String fileTypeLocalPath = "localPath";
ChatModel({
this.id,
this.from,
this.to,
this.message,
this.messageType,
this.filePath,
this.date,
this.archived,
this.createdAt,
this.updatedAt,
this.localId,
this.fileType,
this.state = stateNone,
});
ChatModel.fromJson(dynamic json) {
from = json['from'] != null ? UserData.fromJson(json['from']) : null;
to = json['to'] != null ? UserData.fromJson(json['to']) : null;
id = json['_id'];
message = json['message'];
messageType = json['messageType'];
filePath = json['filePath'];
date = json['date'];
localId = json['localId'];
archived = json['archived'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
date = DateTime.tryParse(createdAt ?? "")?.millisecondsSinceEpoch ?? 0;
}
String? id;
UserData? from;
UserData? to;
String? message;
String? messageType;
String? filePath;
int? date;
bool? archived;
String? createdAt;
String? updatedAt;
//Local usage variables
int state = stateNone;
String? fileType;
String? localId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (from != null) {
map['from'] = from?.toJson();
}
if (to != null) {
map['to'] = to?.toJson();
}
map['_id'] = id;
map['message'] = message;
map['messageType'] = messageType;
map['filePath'] = filePath;
map['date'] = date;
map['archived'] = archived;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
map['localId'] = localId;
map['state'] = state;
map['isSent'] = state;
return map;
}
}

View File

@@ -0,0 +1,61 @@
class AddDeleteUpdateGroupMessageModel {
AddDeleteUpdateGroupMessageModel({
required this.groupId,
required this.userId,
required this.message,
required this.isDeleted,
required this.isHide,
required this.isPin,
required this.id,
required this.seenBy,
required this.createdAt,
required this.updatedAt,
required this.v,
});
String groupId = "";
String userId = "";
String message = "";
bool isDeleted = false;
bool isHide = false;
bool isPin = false;
String id = "";
List<dynamic> seenBy = [];
String createdAt = "";
String updatedAt = "";
int v = -1;
AddDeleteUpdateGroupMessageModel.fromJson(Map<String, dynamic> json){
groupId = json['groupId']??"";
userId = json['userId']??"";
message = json['message']??"";
isDeleted = json['isDeleted']?? false;
isHide = json['isHide']?? false;
isPin = json['isPin']?? false;
id = json['_id']??"";
seenBy = List.castFrom<dynamic, dynamic>(json['seenBy']??[]);
createdAt = json['createdAt']??"";
updatedAt = json['updatedAt']??"";
v = json['__v']??-1;
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['groupId'] = groupId;
data['userId'] = userId;
data['message'] = message;
data['isDeleted'] = isDeleted;
data['isHide'] = isHide;
data['isPin'] = isPin;
data['_id'] = id;
data['seenBy'] = seenBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = v;
return data;
}
@override
String toString() {
return 'AddDeleteUpdateGroupMessageModel{groupId: $groupId, userId: $userId, message: $message, isDeleted: $isDeleted, isHide: $isHide, isPin: $isPin, id: $id, seenBy: $seenBy, createdAt: $createdAt, updatedAt: $updatedAt, v: $v}';
}
}

View File

@@ -0,0 +1,353 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import '../profileData/FcmTokens.dart';
import '../profileData/LocationData.dart';
class AllGroupMessages {
AllGroupMessages({
required this.id,
required this.groupId,
required this.userId,
required this.message,
required this.messageType,
required this.filePath,
required this.isDeleted,
required this.isHide,
required this.isPin,
required this.seenBy,
required this.createdAt,
required this.updatedAt,
required this.v,
});
String id = "";
GroupId groupId = GroupId.empty();
UserData? userId;
String message = "";
String messageType = "";
String filePath = "";
bool isDeleted = false;
bool isHide = false;
bool isPin = false;
List<dynamic> seenBy = [];
String createdAt = "";
String updatedAt = "";
int v = -1;
AllGroupMessages.empty();
AllGroupMessages.fromJson(Map<String, dynamic> json) {
id = json['_id'] ?? "";
groupId = GroupId.fromJson(json['groupId'] ?? GroupId.empty());
userId = UserData.fromJson(json['userId'] ?? {});
message = json['message'] ?? "";
messageType = json['messageType'] ?? "";
filePath = json['filePath'] ?? "";
isDeleted = json['isDeleted'] ?? false;
isHide = json['isHide'] ?? false;
isPin = json['isPin'] ?? false;
seenBy = List.castFrom<dynamic, dynamic>(json['seenBy'] ?? []);
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['_id'] = id;
data['groupId'] = groupId.toJson();
data['userId'] = userId?.toJson();
data['message'] = message;
data['messageType'] = messageType;
data['filePath'] = filePath;
data['isDeleted'] = isDeleted;
data['isHide'] = isHide;
data['isPin'] = isPin;
data['seenBy'] = seenBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
return data;
}
@override
String toString() {
return 'AllGroupMessages{id: $id, groupId: $groupId, userId: $userId, message: $message, isDeleted: $isDeleted, isHide: $isHide, isPin: $isPin, seenBy: $seenBy, createdAt: $createdAt, updatedAt: $updatedAt, v: $v}';
}
}
class GroupId {
GroupId({
required this.lastMessages,
required this.groupWorkingScheduleTime,
required this.id,
required this.groupName,
required this.groupImage,
required this.groupMembers,
required this.isGroup,
required this.date,
required this.isActive,
required this.createdAt,
required this.updatedAt,
required this.v,
});
LastMessages lastMessages = LastMessages.empty();
GroupWorkingScheduleTime groupWorkingScheduleTime =
GroupWorkingScheduleTime.empty();
String id = "";
String groupName = "";
String groupImage = "";
List<String> groupMembers = [];
bool isGroup = false;
String date = "";
bool isActive = false;
String createdAt = "";
String updatedAt = "";
int v = -1;
GroupId.empty();
GroupId.id({required this.id});
GroupId.fromJson(Map<String, dynamic> json) {
lastMessages =
LastMessages.fromJson(json['lastMessages'] ?? LastMessages.empty());
groupWorkingScheduleTime = GroupWorkingScheduleTime.fromJson(
json['groupWorkingScheduleTime'] ?? GroupWorkingScheduleTime.empty());
id = json['_id'] ?? "";
groupName = json['groupName'] ?? "";
groupImage = json['groupImage'] ?? "";
groupMembers = List.castFrom<dynamic, String>(json['groupMembers'] ?? []);
isGroup = json['isGroup'] ?? false;
date = json['date'] ?? "";
isActive = json['isActive'] ?? false;
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
v = json['__v'] ?? -1;
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['lastMessages'] = lastMessages.toJson();
data['groupWorkingScheduleTime'] = groupWorkingScheduleTime.toJson();
data['_id'] = id;
data['groupName'] = groupName;
data['groupImage'] = groupImage;
data['groupMembers'] = groupMembers;
data['isGroup'] = isGroup;
data['date'] = date;
data['isActive'] = isActive;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = v;
return data;
}
@override
String toString() {
return 'GroupId{lastMessages: $lastMessages, groupWorkingScheduleTime: $groupWorkingScheduleTime, id: $id, groupName: $groupName, groupImage: $groupImage, groupMembers: $groupMembers, isGroup: $isGroup, date: $date, isActive: $isActive, createdAt: $createdAt, updatedAt: $updatedAt, v: $v}';
}
}
class LastMessages {
LastMessages({
required this.message,
required this.messageSentBy,
required this.messageTime,
});
String message = "";
String messageSentBy = "";
int messageTime = -1;
LastMessages.empty();
LastMessages.fromJson(Map<String, dynamic> json) {
message = json['message'] ?? "";
messageSentBy = json['messageSentBy'] ?? "";
messageTime = json['messageTime'] ?? -1;
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['message'] = message;
data['messageSentBy'] = messageSentBy;
data['messageTime'] = messageTime;
return data;
}
@override
String toString() {
return 'LastMessages{message: $message, messageSentBy: $messageSentBy, messageTime: $messageTime}';
}
}
class GroupWorkingScheduleTime {
GroupWorkingScheduleTime({
required this.startTime,
required this.endTime,
required this.totalWorkHours,
});
int startTime = -1;
int endTime = -1;
String totalWorkHours = "";
GroupWorkingScheduleTime.empty();
GroupWorkingScheduleTime.fromJson(Map<String, dynamic> json) {
startTime = json['startTime'] ?? -1;
endTime = json['endTime'] ?? -1;
totalWorkHours = json['totalWorkHours'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['startTime'] = startTime;
data['endTime'] = endTime;
data['totalWorkHours'] = totalWorkHours;
return data;
}
@override
String toString() {
return 'GroupWorkingScheduleTime{startTime: $startTime, endTime: $endTime, totalWorkHours: $totalWorkHours}';
}
}
class UserId {
UserId({
required this.fcmTokens,
required this.location,
required this.id,
required this.userModelName,
required this.name,
required this.version,
required this.email,
required this.phoneNumber,
required this.active,
required this.role,
required this.profilePictureUrl,
required this.deviceId,
required this.verificationCode,
required this.isVerified,
required this.approved,
required this.blocked,
required this.createdAt,
required this.updatedAt,
required this.v,
required this.password,
required this.userSettings,
required this.modelId,
});
FcmTokens fcmTokens = FcmTokens.empty();
LocationData location = LocationData.empty();
String id = "";
String userModelName = "";
String name = "";
String version = "";
String email = "";
String phoneNumber = "";
bool active = false;
String role = "";
String profilePictureUrl = "";
String deviceId = "";
String verificationCode = "";
bool isVerified = false;
bool approved = false;
bool blocked = false;
String createdAt = "";
String updatedAt = "";
int v = -1;
String password = "";
String userSettings = "";
String modelId = "";
UserId.empty();
UserId.id({required this.id});
UserId.fromJson(Map<String, dynamic> json) {
fcmTokens = FcmTokens.fromJson(json['fcm_tokens'] ?? FcmTokens.empty());
location = LocationData.fromJson(json['location'] ?? LocationData.empty());
id = json['_id'] ?? "";
userModelName = json['userModelName'] ?? "";
name = json['name'] ?? "";
version = json['version'] ?? "";
email = json['email'] ?? "";
phoneNumber = json['phoneNumber'] ?? "";
active = json['active'] ?? false;
role = json['role'] ?? "";
profilePictureUrl = json['profile_picture_url'] ?? "";
deviceId = json['deviceId'] ?? "";
verificationCode = json['verification_code'] ?? "";
isVerified = json['is_verified'] ?? false;
approved = json['approved'] ?? false;
blocked = json['blocked'] ?? false;
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
v = json['__v'] ?? -1;
password = json['password'] ?? "";
userSettings = json['userSettings'] ?? "";
modelId = json['modelId'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['fcm_tokens'] = fcmTokens.toJson();
data['location'] = location.toJson();
data['_id'] = id;
data['userModelName'] = userModelName;
data['name'] = name;
data['version'] = version;
data['email'] = email;
data['phoneNumber'] = phoneNumber;
data['active'] = active;
data['role'] = role;
data['profile_picture_url'] = profilePictureUrl;
data['deviceId'] = deviceId;
data['verification_code'] = verificationCode;
data['is_verified'] = isVerified;
data['approved'] = approved;
data['blocked'] = blocked;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = v;
data['password'] = password;
data['userSettings'] = userSettings;
data['modelId'] = modelId;
return data;
}
@override
String toString() {
return 'UserId{fcmTokens: $fcmTokens, location: $location, id: $id, userModelName: $userModelName, name: $name, version: $version, email: $email, phoneNumber: $phoneNumber, active: $active, role: $role, profilePictureUrl: $profilePictureUrl, deviceId: $deviceId, verificationCode: $verificationCode, isVerified: $isVerified, approved: $approved, blocked: $blocked, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, password: $password, userSettings: $userSettings, modelId: $modelId}';
}
}
// class Location {
// Location({
// required this.type,
// required this.coordinates,
// });
// String type = "";
// List<double> coordinates = [];
//
// Location.empty();
// Location.fromJson(Map<String, dynamic> json){
// type = json['type']??"";
// coordinates = List.castFrom<dynamic, double>(json['coordinates']??[]);
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['type'] = type;
// data['coordinates'] = coordinates;
// return data;
// }
//
// @override
// String toString() {
// return 'Location{type: $type, coordinates: $coordinates}';
// }
// }

View File

@@ -0,0 +1,45 @@
class AllSingleChatMessages {
AllSingleChatMessages({
required this.seen,
required this.recieverId,
required this.name,
required this.message,
required this.date,
required this.image,
required this.senderId,
});
bool seen = false;
String recieverId ="";
String name ="";
String message ="";
String date ="";
String image ="";
String senderId ="";
AllSingleChatMessages.fromJson(Map<String, dynamic> json){
seen = json['seen'] ?? false;
recieverId = json['recieverId'] ?? "";
name = json['name'] ?? "";
message = json['message'] ?? "";
date = json['date'] ?? "";
image = json['image'] ?? "";
senderId = json['senderId'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['seen'] = seen;
data['recieverId'] = recieverId;
data['name'] = name;
data['message'] = message;
data['date'] = date;
data['image'] = image;
data['senderId'] = senderId;
return data;
}
@override
String toString() {
return 'AllSingleChatMessages{seen: $seen, recieverId: $recieverId, name: $name, message: $message, date: $date, image: $image, senderId: $senderId}';
}
}

View File

@@ -0,0 +1,57 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
class AllSingleUsersChats {
AllSingleUsersChats({
required this.from,
required this.to,
required this.message,
required this.seen,
required this.isDeleted,
required this.isHide,
required this.createdAt,
required this.updatedAt,
required this.seenAt,
required this.id,
});
UserData? from;
UserData? to;
String message = "";
bool seen = false;
bool isDeleted = false;
bool isHide = false;
String createdAt = "";
String updatedAt = "";
String seenAt = "";
String id = "";
AllSingleUsersChats.empty();
AllSingleUsersChats.fromJson(Map<String, dynamic> json) {
from = UserData.fromJson(json['from'] ?? {});
to = UserData.fromJson(json['to'] ?? {});
message = json['message'] ?? "";
seen = json['seen'] ?? false;
isDeleted = json['isDeleted'] ?? false;
isHide = json['isHide'] ?? false;
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
seenAt = json['seenAt'] ?? "";
id = json['_id'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['from'] = from?.toJson();
data['to'] = to?.toJson();
data['message'] = message;
data['seen'] = seen;
data['isDeleted'] = isDeleted;
data['isHide'] = isHide;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['seenAt'] = seenAt;
data['_id'] = id;
return data;
}
}

View File

@@ -0,0 +1,214 @@
class CombinedMessageModel {
CombinedMessageModel({
required this.personalMessage,
required this.sortedArrayGroup,
});
List<PersonalMessage> personalMessage = [];
List<SortedArrayGroup> sortedArrayGroup = [];
CombinedMessageModel.empty();
CombinedMessageModel.fromJson(Map<String, dynamic> json){
personalMessage = List.from(json['personalMessage']).map((e)=>PersonalMessage.fromJson(e)).toList();
sortedArrayGroup = List.from(json['sortedArrayGroup']).map((e)=>SortedArrayGroup.fromJson(e)).toList();
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['personalMessage'] = personalMessage.map((e)=>e.toJson()).toList();
data['sortedArrayGroup'] = sortedArrayGroup.map((e)=>e.toJson()).toList();
return data;
}
@override
String toString() {
return 'CombinedMessageModel{personalMessage: $personalMessage, sortedArrayGroup: $sortedArrayGroup}';
}
}
class PersonalMessage {
PersonalMessage({
required this.isGroup,
required this.seen,
required this.recieverId,
required this.name,
required this.message,
required this.messageType,
required this.date,
required this.image,
required this.senderId,
});
bool isGroup = false;
bool seen = false;
String recieverId = "";
String name = "";
String message = "";
String messageType = "";
String date = ""; //eg. "2024-06-21T09:38:16.352Z"
String image = "";
String senderId = "";
PersonalMessage.empty();
PersonalMessage.fromJson(Map<String, dynamic> json){
isGroup = json['isGroup']??false;
seen = json['seen']??false;
recieverId = json['recieverId']??"";
name = json['name']??"";
message = json['message']??"";
messageType = json['messageType']??"";
date = json['date']??"";
image = json['image']??"";
senderId = json['senderId']??"";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['isGroup'] = isGroup;
data['seen'] = seen;
data['recieverId'] = recieverId;
data['name'] = name;
data['message'] = message;
data['messageType'] = messageType;
data['date'] = date;
data['image'] = image;
data['senderId'] = senderId;
return data;
}
@override
String toString() {
return 'PersonalMessage{isGroup: $isGroup, seen: $seen, recieverId: $recieverId, name: $name, message: $message, date: $date, image: $image, senderId: $senderId}';
}
}
class SortedArrayGroup {
SortedArrayGroup({
required this.lastMessages,
required this.groupWorkingScheduleTime,
required this.id,
required this.groupName,
required this.groupImage,
required this.groupMembers,
required this.isGroup,
required this.date,
required this.isActive,
required this.createdAt,
required this.updatedAt,
required this.v,
});
LastMessages lastMessages = LastMessages.empty();
GroupWorkingScheduleTime groupWorkingScheduleTime = GroupWorkingScheduleTime.empty();
String id = "";
String groupName = "";
String groupImage = "";
List<String> groupMembers = [];
bool isGroup = false;
String date = "";
bool isActive = false;
String createdAt = "";
String updatedAt = "";
int v = -1;
SortedArrayGroup.empty();
SortedArrayGroup.fromJson(Map<String, dynamic> json){
lastMessages = LastMessages.fromJson(json['lastMessages'] ?? LastMessages.empty());
groupWorkingScheduleTime = GroupWorkingScheduleTime.fromJson(json['groupWorkingScheduleTime'] ?? GroupWorkingScheduleTime.empty());
id = json['_id'] ?? "";
groupName = json['groupName'] ?? "";
groupImage = json['groupImage'] ?? "";
groupMembers = List.castFrom<dynamic, String>(json['groupMembers'] ?? []);
isGroup = json['isGroup'] ?? false;
date = json['date'] ?? "";
isActive = json['isActive'] ?? false;
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
v = json['__v'] ?? -1;
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['lastMessages'] = lastMessages.toJson();
data['groupWorkingScheduleTime'] = groupWorkingScheduleTime.toJson();
data['_id'] = id;
data['groupName'] = groupName;
data['groupImage'] = groupImage;
data['groupMembers'] = groupMembers;
data['isGroup'] = isGroup;
data['date'] = date;
data['isActive'] = isActive;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = v;
return data;
}
@override
String toString() {
return 'SortedArrayGroup{lastMessages: $lastMessages, groupWorkingScheduleTime: $groupWorkingScheduleTime, id: $id, groupName: $groupName, groupImage: $groupImage, groupMembers: $groupMembers, isGroup: $isGroup, date: $date, isActive: $isActive, createdAt: $createdAt, updatedAt: $updatedAt, v: $v}';
}
}
class LastMessages {
LastMessages({
required this.message,
required this.messageType,
required this.messageSentBy,
required this.messageTime,
});
String message = "";
String messageType = "";
String messageSentBy = "";
int messageTime = -1;
LastMessages.empty();
LastMessages.fromJson(Map<String, dynamic> json){
message = json['message'] ?? "";
messageType = json['messageType'] ?? "";
messageSentBy = json['messageSentBy'] ?? "";
messageTime = json['messageTime'] ?? -1;
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['message'] = message;
data['messageType'] = messageType;
data['messageSentBy'] = messageSentBy;
data['messageTime'] = messageTime;
return data;
}
@override
String toString() {
return 'LastMessages{message: $message, messageSentBy: $messageSentBy, messageTime: $messageTime}';
}
}
class GroupWorkingScheduleTime {
GroupWorkingScheduleTime({
required this.startTime,
required this.endTime,
required this.totalWorkHours,
});
int startTime = -1;
int endTime = -1;
String totalWorkHours = "";
GroupWorkingScheduleTime.empty();
GroupWorkingScheduleTime.fromJson(Map<String, dynamic> json){
startTime = json['startTime']?? -1;
endTime = json['endTime']?? -1;
totalWorkHours = json['totalWorkHours']?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['startTime'] = startTime;
data['endTime'] = endTime;
data['totalWorkHours'] = totalWorkHours;
return data;
}
@override
String toString() {
return 'GroupWorkingScheduleTime{startTime: $startTime, endTime: $endTime, totalWorkHours: $totalWorkHours}';
}
}

View File

@@ -0,0 +1,53 @@
class SingleChatModelClass {
SingleChatModelClass({
required this.from,
required this.to,
required this.message,
required this.seen,
required this.isDeleted,
required this.isHide,
required this.isPin,
required this.id2,
required this.id,
});
String from = "";
String to = "";
String message = "";
bool seen = false;
bool isDeleted = false;
bool isHide = false;
bool isPin = false;
String id2 = "";
String id = "";
SingleChatModelClass.fromJson(Map<String, dynamic> json){
from = json['from'] ?? "";
to = json['to'] ?? "";
message = json['message'] ?? "";
seen = json['seen'] ?? false;
isDeleted = json['isDeleted'] ?? false;
isHide = json['isHide'] ?? false;
isPin = json['isPin'] ?? false;
id2 = json['_id'] ?? "";
id = json['id'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['from'] = from;
data['to'] = to;
data['message'] = message;
data['seen'] = seen;
data['isDeleted'] = isDeleted;
data['isHide'] = isHide;
data['isPin'] = isPin;
data['_id'] = id2;
data['id'] = id;
return data;
}
@override
String toString() {
return 'SingleChatModelClass{from: $from, to: $to, message: $message, seen: $seen, isDeleted: $isDeleted, isHide: $isHide, isPin: $isPin, id2: $id2, id: $id}';
}
}

View File

@@ -0,0 +1,69 @@
class UpdateDeleteSingleMessageModel {
UpdateDeleteSingleMessageModel({
required this.idOne,
required this.from,
required this.to,
required this.message,
required this.seen,
required this.isDeleted,
required this.isHide,
required this.isPin,
required this.createdAt,
required this.updatedAt,
required this.v,
required this.seenAt,
required this.id,
});
String idOne = "";
String from = "";
String to = "";
String message = "";
bool seen = false;
bool isDeleted = false;
bool isHide = false;
bool isPin = false;
String createdAt = "";
String updatedAt = "";
int v = -1;
String seenAt = "";
String id = "";
UpdateDeleteSingleMessageModel.fromJson(Map<String, dynamic> json){
idOne = json['_id']?? "";
from = json['from']?? "";
to = json['to']?? "";
message = json['message']?? "";
seen = json['seen']?? false;
isDeleted = json['isDeleted']?? false;
isHide = json['isHide']?? false;
isPin = json['isPin']?? false;
createdAt = json['createdAt']?? "";
updatedAt = json['updatedAt']?? "";
v = json['__v']?? -1;
seenAt = json['seenAt']?? "";
id = json['id']?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['_id'] = idOne;
data['from'] = from;
data['to'] = to;
data['message'] = message;
data['seen'] = seen;
data['isDeleted'] = isDeleted;
data['isHide'] = isHide;
data['isPin'] = isPin;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = v;
data['seenAt'] = seenAt;
data['id'] = id;
return data;
}
@override
String toString() {
return 'UpdateDeleteSingleMessageModel{idOne: $idOne, from: $from, to: $to, message: $message, seen: $seen, isDeleted: $isDeleted, isHide: $isHide, isPin: $isPin, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, seenAt: $seenAt, id: $id}';
}
}

View File

@@ -0,0 +1,58 @@
import 'package:ftc_mobile_app/models/clients/body_points_category.dart';
class HealthIssueDetailsModel {
String sId = "";
BodyPointsCategory? bodyPointsCategory;
bool status = false;
String healthNote = "";
String complaint = "";
String userId = "";
String createdAt = "";
String updatedAt = "";
int iV = -1;
String id = "";
HealthIssueDetailsModel(
{required this.sId,
required this.bodyPointsCategory,
required this.status,
required this.healthNote,
required this.complaint,
required this.userId,
required this.createdAt,
required this.updatedAt,
required this.iV,
required this.id});
HealthIssueDetailsModel.empty();
HealthIssueDetailsModel.fromJson(Map<String, dynamic> json) {
sId = json['_id'] ?? "";
bodyPointsCategory = json['category'] != null && json['category'] is Map
? BodyPointsCategory.fromJson(json['category'] ?? <String, dynamic>{} )
: null;
status = json['status']??''=="1";
healthNote = json['healthNote'] ?? "";
complaint = json['complaint'] ?? "";
userId = json['userId'] ?? "";
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
iV = json['__v'] ?? "";
id = json['id'] ?? "";
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['_id'] = sId;
data['category'] = bodyPointsCategory?.toJson();
data['status'] = status;
data['healthNote'] = healthNote;
data['complaint'] = complaint;
data['userId'] = userId;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = iV;
data['id'] = id;
return data;
}
}

View File

@@ -0,0 +1,381 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:quill_html_editor/quill_html_editor.dart';
class PBSListDataJson {
PBSListDataJson({
required this.pbsList,
required this.count,
});
List<PbsList> pbsList = [];
int count = -1;
PBSListDataJson.empty();
PBSListDataJson.fromJson(Map<String, dynamic> json) {
for (var item in json['pbsList']) {
pbsList.add(PbsList.fromJson(item));
}
// pbsList = List.from(json['pbsList']).map((e)=>PbsList.fromJson(e)).toList();
count = json['count'];
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['pbsList'] = pbsList.map((e) => e.toJson()).toList();
data['count'] = count;
return data;
}
@override
String toString() {
return 'PBSListDataJson{pbsList: $pbsList, count: $count}';
}
}
class PbsList {
PbsList({
required this.id,
required this.userIdModelInPbs,
required this.staffId,
required this.aboutPlan,
required this.managementOfBehaviorPlan,
required this.secondaryPrevention,
required this.reactiveStrategies,
required this.postIncidentSupport,
required this.updatedAt,
required this.createdAt,
});
String id = "";
UserData? userIdModelInPbs;
UserData? staffId;
String aboutPlan = "";
String managementOfBehaviorPlan = "";
String secondaryPrevention = "";
String reactiveStrategies = "";
String postIncidentSupport = "";
String updatedAt = "";
String createdAt = "";
QuillEditorController aboutPlanQuillController = QuillEditorController();
QuillEditorController managementOfBehaviouralPresentationQuillController = QuillEditorController();
QuillEditorController secondaryPreventionQuillController = QuillEditorController();
QuillEditorController reactiveStrategiesQuillController = QuillEditorController();
QuillEditorController postIncidentSupportRecoveryQuillController = QuillEditorController();
PbsList.empty();
PbsList.addData({
required this.id,
required this.aboutPlan,
required this.managementOfBehaviorPlan,
required this.secondaryPrevention,
required this.reactiveStrategies,
required this.postIncidentSupport,
});
PbsList.fromJson(Map<String, dynamic> json) {
id = json['_id'] ?? "";
userIdModelInPbs = UserData.fromJson(json['userId'] ?? {});
staffId = UserData.fromJson(json['staffId'] ?? {});
aboutPlan = json['aboutPlan'] ?? "";
managementOfBehaviorPlan = json['managementOfBehaviorPlan'] ?? "";
secondaryPrevention = json['secondaryPrevention'] ?? "";
reactiveStrategies = json['reactiveStartegies'] ?? "";
postIncidentSupport = json['postIncidentSupport'] ?? "";
updatedAt = json['updatedAt'] ?? "";
createdAt = json['createdAt'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['_id'] = id;
data['userId'] = userIdModelInPbs?.toJson();
data['staffId'] = staffId?.toJson();
data['aboutPlan'] = aboutPlan;
data['managementOfBehaviorPlan'] = managementOfBehaviorPlan;
data['secondaryPrevention'] = secondaryPrevention;
data['reactiveStartegies'] = reactiveStrategies;
data['postIncidentSupport'] = postIncidentSupport;
data['updatedAt'] = updatedAt;
data['createdAt'] = createdAt;
return data;
}
}
// class UserIdModelInPbs {
// UserIdModelInPbs({
// required this.fcmTokens,
// required this.location,
// required this.id,
// required this.userModelName,
// required this.name,
// required this.version,
// required this.email,
// required this.phoneNumber,
// required this.active,
// required this.role,
// required this.profilePictureUrl,
// required this.deviceId,
// required this.verificationCode,
// required this.isVerified,
// required this.approved,
// required this.blocked,
// required this.createdAt,
// required this.updatedAt,
// required this.v,
// required this.password,
// required this.userSettings,
// required this.modelId,
// });
//
// FcmTokens fcmTokens = FcmTokens.empty();
// Location location = Location.empty();
// String id = "";
// String userModelName = "";
// String name = "";
// String version = "";
// String email = "";
// String phoneNumber = "";
// bool active = false;
// String role = "";
// String profilePictureUrl = "";
// String deviceId = "";
// String verificationCode = "";
// bool isVerified = false;
// bool approved = false;
// bool blocked = false;
// String createdAt = "";
// String updatedAt = "";
// int v = -1;
// String password = "";
// String userSettings = "";
// String modelId = "";
//
// UserIdModelInPbs.empty();
//
// UserIdModelInPbs.fromJson(Map<String, dynamic> json) {
// fcmTokens = FcmTokens.fromJson(json['fcm_tokens'] ?? "");
// location = Location.fromJson(json['location'] ?? "");
// id = json['_id'] ?? "";
// userModelName = json['userModelName'] ?? "";
// name = json['name'] ?? "";
// version = json['version'] ?? "";
// email = json['email'] ?? "";
// phoneNumber = json['phoneNumber'] ?? "";
// active = json['active'] ?? "";
// role = json['role'] ?? "";
// profilePictureUrl = json['profile_picture_url'] ?? "";
// deviceId = json['deviceId'] ?? "";
// verificationCode = json['verification_code'] ?? "";
// isVerified = json['is_verified'] ?? "";
// approved = json['approved'] ?? "";
// blocked = json['blocked'] ?? "";
// createdAt = json['createdAt'] ?? "";
// updatedAt = json['updatedAt'] ?? "";
// v = json['__v'] ?? "";
// password = json['password'] ?? "";
// userSettings = json['userSettings'] ?? "";
// modelId = json['modelId'] ?? "";
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['fcm_tokens'] = fcmTokens.toJson();
// data['location'] = location.toJson();
// data['_id'] = id;
// data['userModelName'] = userModelName;
// data['name'] = name;
// data['version'] = version;
// data['email'] = email;
// data['phoneNumber'] = phoneNumber;
// data['active'] = active;
// data['role'] = role;
// data['profile_picture_url'] = profilePictureUrl;
// data['deviceId'] = deviceId;
// data['verification_code'] = verificationCode;
// data['is_verified'] = isVerified;
// data['approved'] = approved;
// data['blocked'] = blocked;
// data['createdAt'] = createdAt;
// data['updatedAt'] = updatedAt;
// data['__v'] = v;
// data['password'] = password;
// data['userSettings'] = userSettings;
// data['modelId'] = modelId;
// return data;
// }
//
// @override
// String toString() {
// return 'UserId{fcmTokens: $fcmTokens, location: $location, id: $id, userModelName: $userModelName, name: $name, version: $version, email: $email, phoneNumber: $phoneNumber, active: $active, role: $role, profilePictureUrl: $profilePictureUrl, deviceId: $deviceId, verificationCode: $verificationCode, isVerified: $isVerified, approved: $approved, blocked: $blocked, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, password: $password, userSettings: $userSettings, modelId: $modelId}';
// }
// }
//
// class FcmTokens {
// FcmTokens({
// required this.token,
// required this.deviceType,
// });
//
// String token = "";
// String deviceType = "";
//
// FcmTokens.empty();
//
// FcmTokens.fromJson(Map<String, dynamic> json) {
// token = json['token'] ?? "";
// deviceType = json['deviceType'] ?? "";
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['token'] = token;
// data['deviceType'] = deviceType;
// return data;
// }
//
// @override
// String toString() {
// return 'FcmTokens{token: $token, deviceType: $deviceType}';
// }
// }
//
// class Location {
// Location({
// required this.type,
// required this.coordinates,
// });
//
// String type = "";
// List<double> coordinates = [0, 0];
//
// Location.empty();
//
// Location.fromJson(Map<String, dynamic> json) {
// type = json['type'];
// coordinates = List.castFrom<dynamic, double>(json['coordinates']);
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['type'] = type;
// data['coordinates'] = coordinates;
// return data;
// }
//
// @override
// String toString() {
// return 'Location{type: $type, coordinates: $coordinates}';
// }
// }
//
// class StaffId {
// StaffId({
// required this.fcmTokens,
// required this.location,
// required this.id,
// required this.userModelName,
// required this.name,
// required this.version,
// required this.email,
// required this.phoneNumber,
// required this.active,
// required this.role,
// required this.profilePictureUrl,
// required this.deviceId,
// required this.verificationCode,
// required this.isVerified,
// required this.approved,
// required this.blocked,
// required this.createdAt,
// required this.updatedAt,
// required this.v,
// required this.password,
// required this.userSettings,
// required this.modelId,
// });
//
// FcmTokens fcmTokens = FcmTokens.empty();
// Location location = Location.empty();
// String id = "";
// String userModelName = "";
// String name = "";
// String version = "";
// String email = "";
// String phoneNumber = "";
// bool active = false;
// String role = "";
// String profilePictureUrl = "";
// String deviceId = "";
// String verificationCode = "";
// bool isVerified = false;
// bool approved = false;
// bool blocked = false;
// String createdAt = "";
// String updatedAt = "";
// int v = -1;
// String password = "";
// String userSettings = "";
// String modelId = "";
//
// StaffId.empty();
//
// StaffId.fromJson(Map<String, dynamic> json) {
// fcmTokens = FcmTokens.fromJson(json['fcm_tokens'] ?? "");
// location = Location.fromJson(json['location'] ?? "");
// id = json['_id'] ?? "";
// userModelName = json['userModelName'] ?? "";
// name = json['name'] ?? "";
// version = json['version'] ?? "";
// email = json['email'] ?? "";
// phoneNumber = json['phoneNumber'] ?? "";
// active = json['active'] ?? "";
// role = json['role'] ?? "";
// profilePictureUrl = json['profile_picture_url'] ?? "";
// deviceId = json['deviceId'] ?? "";
// verificationCode = json['verification_code'] ?? "";
// isVerified = json['is_verified'] ?? "";
// approved = json['approved'] ?? "";
// blocked = json['blocked'] ?? "";
// createdAt = json['createdAt'] ?? "";
// updatedAt = json['updatedAt'] ?? "";
// v = json['__v'] ?? "";
// password = json['password'] ?? "";
// userSettings = json['userSettings'] ?? "";
// modelId = json['modelId'] ?? "";
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['fcm_tokens'] = fcmTokens.toJson();
// data['location'] = location.toJson();
// data['_id'] = id;
// data['userModelName'] = userModelName;
// data['name'] = name;
// data['version'] = version;
// data['email'] = email;
// data['phoneNumber'] = phoneNumber;
// data['active'] = active;
// data['role'] = role;
// data['profile_picture_url'] = profilePictureUrl;
// data['deviceId'] = deviceId;
// data['verification_code'] = verificationCode;
// data['is_verified'] = isVerified;
// data['approved'] = approved;
// data['blocked'] = blocked;
// data['createdAt'] = createdAt;
// data['updatedAt'] = updatedAt;
// data['__v'] = v;
// data['password'] = password;
// data['userSettings'] = userSettings;
// data['modelId'] = modelId;
// return data;
// }
//
// @override
// String toString() {
// return 'StaffId{fcmTokens: $fcmTokens, location: $location, id: $id, userModelName: $userModelName, name: $name, version: $version, email: $email, phoneNumber: $phoneNumber, active: $active, role: $role, profilePictureUrl: $profilePictureUrl, deviceId: $deviceId, verificationCode: $verificationCode, isVerified: $isVerified, approved: $approved, blocked: $blocked, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, password: $password, userSettings: $userSettings, modelId: $modelId}';
// }
// }

View File

@@ -0,0 +1,74 @@
import 'package:quill_html_editor/quill_html_editor.dart';
class AddPBSPlanModel{
// String incidentTitle = "";
// String incidentId = "";
// String userId = "";
// int incidentDate = 0;
// bool active = false;
// String createdAt = "";
// String updatedAt = "";
// int v = 0;
String userId = "";
String staffId = "";
String planId = "";
String aboutPlanNote = "";
QuillEditorController aboutPlanQuillController = QuillEditorController();
String managementOfBehaviouralPresentationNote = "";
QuillEditorController managementOfBehaviouralPresentationQuillController = QuillEditorController();
String secondaryPreventionNote = "";
QuillEditorController secondaryPreventionQuillController = QuillEditorController();
String reactiveStrategiesNote = "";
QuillEditorController reactiveStrategiesQuillController = QuillEditorController();
String postIncidentSupportRecoveryNote = "";
QuillEditorController postIncidentSupportRecoveryQuillController = QuillEditorController();
Future<bool> get areAllFieldsEdited async {
String aboutPlanText = await aboutPlanQuillController.getText();
String managementOfBehaviouralPresentationText =
await managementOfBehaviouralPresentationQuillController.getText();
String secondaryPreventionText =
await secondaryPreventionQuillController.getText();
String reactiveStrategiesText =
await reactiveStrategiesQuillController.getText();
String postIncidentSupportRecoveryText =
await postIncidentSupportRecoveryQuillController.getText();
return aboutPlanText.isNotEmpty &&
managementOfBehaviouralPresentationText.isNotEmpty &&
secondaryPreventionText.isNotEmpty &&
reactiveStrategiesText.isNotEmpty &&
postIncidentSupportRecoveryText.isNotEmpty;
}
AddPBSPlanModel.empty();
AddPBSPlanModel.fromJson(Map<String, dynamic> json){
userId = json['userId'];
staffId = json['staffId'];
aboutPlanNote = json['aboutPlan'];
managementOfBehaviouralPresentationNote = json['managementOfBehaviorPlan'];
secondaryPreventionNote = json['secondaryPrevention'];
reactiveStrategiesNote = json['reactiveStartegies'];
postIncidentSupportRecoveryNote = json['postIncidentSupport'];
planId = json['_id'];
}
@override
String toString() {
return 'AddPBSPlanModel{userId: $userId, staffId: $staffId, planId: $planId, aboutPlanNote: $aboutPlanNote, aboutPlanQuillController: $aboutPlanQuillController, managementOfBehaviouralPresentationNote: $managementOfBehaviouralPresentationNote, managementOfBehaviouralPresentationQuillController: $managementOfBehaviouralPresentationQuillController, secondaryPreventionNote: $secondaryPreventionNote, secondaryPreventionQuillController: $secondaryPreventionQuillController, reactiveStrategiesNote: $reactiveStrategiesNote, reactiveStrategiesQuillController: $reactiveStrategiesQuillController, postIncidentSupportRecoveryNote: $postIncidentSupportRecoveryNote, postIncidentSupportRecoveryQuillController: $postIncidentSupportRecoveryQuillController}';
}
// Map<String, dynamic> toJson() {
// final _data = <String, dynamic>{};
// _data['userId'] = userId;
// _data['staffId'] = staffId;
// _data['aboutPlan'] = aboutPlan;
// _data['managementOfBehaviorPlan'] = managementOfBehaviorPlan;
// _data['secondaryPrevention'] = secondaryPrevention;
// _data['reactiveStartegies'] = reactiveStartegies;
// _data['postIncidentSupport'] = postIncidentSupport;
// _data['_id'] = _id;
// return _data;
// }
}

View File

@@ -0,0 +1,33 @@
import 'CareNoteData.dart';
class AllCareNotesListResponse {
AllCareNotesListResponse({
this.status,
this.message,
this.data,
});
AllCareNotesListResponse.success() {
status = "Success";
}
AllCareNotesListResponse.fromJson(dynamic json) {
status = json['status'];
message = json['message'];
data = json['data'] != null ? CareNoteData.fromJson(json['data']) : null;
}
String? status;
String? message;
CareNoteData? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['status'] = status;
map['message'] = message;
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}

View File

@@ -0,0 +1,42 @@
import 'CarePlans.dart';
class CareNoteData {
CareNoteData({
this.carePlans,
this.count,
this.carePlanCount,
this.offset,
this.limit,
});
CareNoteData.fromJson(dynamic json) {
if (json['carePlans'] != null) {
carePlans = [];
json['carePlans'].forEach((v) {
carePlans?.add(CarePlan.fromJson(v));
});
}
count = json['count'];
carePlanCount = json['carePlanCount'];
offset = json['offset'];
limit = json['limit'];
}
List<CarePlan>? carePlans;
int? count;
int? carePlanCount;
int? offset;
int? limit;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (carePlans != null) {
map['carePlans'] = carePlans?.map((v) => v.toJson()).toList();
}
map['count'] = count;
map['carePlanCount'] = carePlanCount;
map['offset'] = offset;
map['limit'] = limit;
return map;
}
}

View File

@@ -0,0 +1,200 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import '../body_points_category.dart';
class CarePlan {
CarePlan({
this.id,
this.eventDateTime,
this.userId,
this.addedby,
this.noteDetails,
this.active,
this.noteType,
this.title,
this.flag,
this.isHTML,
this.createdAt,
this.updatedAt,
this.healthIssueId,
this.keycontacts,
this.riskAssesments,
});
CarePlan.fromJson(dynamic json) {
id = json['_id'];
eventDateTime = json['eventDateTime'];
userId = json['userId'] is Map ? UserData.fromJson(json['userId']) : null;
addedby = json['addedby'] is Map ? UserData.fromJson(json['addedby']) : null;
noteDetails = json['noteDetails'];
active = json['active'];
noteType = json['noteType'];
title = json['title'];
flag = json['flag'];
isHTML = json['isHTML'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
healthIssueId = json['healthIssueId'] != null
? HealthIssueId.fromJson(json['healthIssueId'])
: null;
keycontacts = json['keycontacts'] != null
? List<dynamic>.from(json['keycontacts'])
: null;
riskAssesments = json['riskAssesments'] != null
? List<dynamic>.from(json['riskAssesments'])
: null;
}
String? id;
int? eventDateTime;
UserData? userId;
UserData? addedby;
String? noteDetails;
bool? active;
String? noteType;
String? title;
bool? flag;
bool? isHTML;
String? createdAt;
String? updatedAt;
HealthIssueId? healthIssueId;
List<dynamic>? keycontacts;
List<dynamic>? riskAssesments;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
map['eventDateTime'] = eventDateTime;
if (userId != null) {
map['userId'] = userId?.toJson();
}
if (addedby != null) {
map['addedby'] = addedby?.toJson();
}
map['noteDetails'] = noteDetails;
map['active'] = active;
map['noteType'] = noteType;
map['title'] = title;
map['flag'] = flag;
map['isHTML'] = isHTML;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
if (healthIssueId != null) {
map['healthIssueId'] = healthIssueId?.toJson();
}
if (keycontacts != null) {
map['keycontacts'] = keycontacts;
}
if (riskAssesments != null) {
map['riskAssesments'] = riskAssesments;
}
return map;
}
}
class HealthIssueId {
HealthIssueId.fromJson(dynamic json) {
id = json['_id'];
category =
json['category'] != null ? SubCat.fromJson(json['category']) : null;
status = json['status'];
healthNote = json['healthNote'];
complaint = json['complaint'];
userId = json['userId'];
isCarePlanData = json['isCarePlanData'];
isPhysicalIntervention = json['isPhysicalIntervention'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
}
String? id;
SubCat? category;
bool? status;
String? healthNote;
String? complaint;
String? userId;
bool? isCarePlanData;
bool? isPhysicalIntervention;
String? createdAt;
String? updatedAt;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
if (category != null) {
map['category'] = category?.toJson();
}
map['status'] = status;
map['healthNote'] = healthNote;
map['complaint'] = complaint;
map['userId'] = userId;
map['isCarePlanData'] = isCarePlanData;
map['isPhysicalIntervention'] = isPhysicalIntervention;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
return map;
}
}
// class Category {
// Category.fromJson(dynamic json) {
// id = json['_id'];
// name = json['name'];
// enumValue = json['enum'];
// parentCategory = json['parentCategory'] != null ? ParentCategory.fromJson(json['parentCategory']) : null;
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// }
//
// String? id;
// String? name;
// String? enumValue;
// ParentCategory? parentCategory;
// String? createdAt;
// String? updatedAt;
// int? v;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['_id'] = id;
// map['name'] = name;
// map['enum'] = enumValue;
// if (parentCategory != null) {
// map['parentCategory'] = parentCategory?.toJson();
// }
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// return map;
// }
// }
//
// class ParentCategory {
// ParentCategory.fromJson(dynamic json) {
// id = json['_id'];
// name = json['name'];
// enumValue = json['enum'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// }
//
// String? id;
// String? name;
// String? enumValue;
// String? createdAt;
// String? updatedAt;
// int? v;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['_id'] = id;
// map['name'] = name;
// map['enum'] = enumValue;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// return map;
// }
// }

View File

@@ -0,0 +1,734 @@
import '../../profileData/user_data.dart';
class AllClientsResponse {
AllClientsResponse({
this.success,
this.status,
this.message,
this.data,});
AllClientsResponse.fromJson(dynamic json) {
status = json['status'];
message = json['message'];
data = json['data'] != null ? AllClientsResponseData.fromJson(json['data']) : null;
}
//Local var
bool? success;
String? status;
String? message;
AllClientsResponseData? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['status'] = status;
map['message'] = message;
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}
class AllClientsResponseData {
AllClientsResponseData({
this.users,
this.count,
this.offset,
this.limit,});
AllClientsResponseData.fromJson(dynamic json) {
if (json['users'] != null) {
users = [];
json['users'].forEach((v) {
users?.add(UserData.fromJson(v));
});
}
count = json['count'];
offset = json['offset'];
limit = json['limit'];
}
List<UserData>? users;
int? count;
int? offset;
int? limit;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (users != null) {
map['users'] = users?.map((v) => v.toJson()).toList();
}
map['count'] = count;
map['offset'] = offset;
map['limit'] = limit;
return map;
}
}
// class Users {
// Users({
// this.id,
// this.userModelName,
// this.active,
// this.role,
// this.profilePictureUrl,
// this.profileVideoUrl,
// this.deviceId,
// this.verificationCode,
// this.isVerified,
// this.approved,
// this.blocked,
// this.name,
// this.phoneNumber,
// this.email,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.modelId,});
//
// Users.fromJson(dynamic json) {
// id = json['_id'];
// userModelName = json['userModelName'];
// active = json['active'];
// role = json['role'];
// profilePictureUrl = json['profile_picture_url'];
// profileVideoUrl = json['profile_video_url'];
// deviceId = json['deviceId'];
// verificationCode = json['verification_code'];
// isVerified = json['is_verified'];
// approved = json['approved'];
// blocked = json['blocked'];
// name = json['name'];
// phoneNumber = json['phoneNumber'];
// email = json['email'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// modelId = json['modelId'] != null ? ModelId.fromJson(json['modelId']) : null;
// }
// String? id;
// String? userModelName;
// bool? active;
// String? role;
// String? profilePictureUrl;
// String? profileVideoUrl;
// String? deviceId;
// String? verificationCode;
// bool? isVerified;
// bool? approved;
// bool? blocked;
// String? name;
// String? phoneNumber;
// String? email;
// String? createdAt;
// String? updatedAt;
// int? v;
// ModelId? modelId;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['_id'] = id;
// map['userModelName'] = userModelName;
// map['active'] = active;
// map['role'] = role;
// map['profile_picture_url'] = profilePictureUrl;
// map['profile_video_url'] = profileVideoUrl;
// map['deviceId'] = deviceId;
// map['verification_code'] = verificationCode;
// map['is_verified'] = isVerified;
// map['approved'] = approved;
// map['blocked'] = blocked;
// map['name'] = name;
// map['phoneNumber'] = phoneNumber;
// map['email'] = email;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// if (modelId != null) {
// map['modelId'] = modelId?.toJson();
// }
// return map;
// }
//
// }
//
// class ModelId {
// ModelId({
// this.id,
// this.suProvider,
// this.currSU,
// this.shifts,
// this.serviceUserMedications,
// this.homeVisitSignOut,
// this.srUsShiftsRequired,
// this.suEnquiries,
// this.active,
// this.diagnosises,
// this.suLastName,
// this.name,
// this.addedby,
// this.user,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.lastModifiedBy,
// this.providerName,
// this.referenceId,
// this.seMedicalAlert,
// this.suAddress1,
// this.suAddress2,
// this.suAge,
// this.suCity,
// this.suDOB,
// this.suEmailHome,
// this.suEmailWork,
// this.suEmergencyContact,
// this.suFamilyHead,
// this.suFirstMiddleName,
// this.suFirstVisitDate,
// this.suHomePhone,
// this.suLastVisitDate,
// this.suMobileHomeNo,
// this.suMobileWorkNo,
// this.suNote,
// this.suPrefHomeNo,
// this.suPrefWorkNo,
// this.suPreferredName,
// this.suReferredBY,
// this.suSex,
// this.suSsn,
// this.suState,
// this.suWorkPhone,
// this.suZip,});
//
// ModelId.fromJson(dynamic json) {
// id = json['_id'];
// if (json['suProvider'] != null) {
// suProvider = [];
// json['suProvider'].forEach((v) {
// suProvider?.add(SuProvider.fromJson(v));
// });
// }
// currSU = json['currSU'];
// if (json['shifts'] != null) {
// shifts = [];
// json['shifts'].forEach((v) {
// shifts?.add(Dynamic.fromJson(v));
// });
// }
// if (json['serviceUserMedications'] != null) {
// serviceUserMedications = [];
// json['serviceUserMedications'].forEach((v) {
// serviceUserMedications?.add(Dynamic.fromJson(v));
// });
// }
// if (json['homeVisitSignOut'] != null) {
// homeVisitSignOut = [];
// json['homeVisitSignOut'].forEach((v) {
// homeVisitSignOut?.add(Dynamic.fromJson(v));
// });
// }
// if (json['srUsShiftsRequired'] != null) {
// srUsShiftsRequired = [];
// json['srUsShiftsRequired'].forEach((v) {
// srUsShiftsRequired?.add(Dynamic.fromJson(v));
// });
// }
// if (json['suEnquiries'] != null) {
// suEnquiries = [];
// json['suEnquiries'].forEach((v) {
// suEnquiries?.add(SuEnquiries.fromJson(v));
// });
// }
// active = json['active'];
// if (json['diagnosises'] != null) {
// diagnosises = [];
// json['diagnosises'].forEach((v) {
// diagnosises?.add(Dynamic.fromJson(v));
// });
// }
// suLastName = json['suLastName'];
// name = json['name'];
// addedby = json['addedby'];
// user = json['user'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// lastModifiedBy = json['lastModifiedBy'];
// providerName = json['providerName'];
// referenceId = json['referenceId'];
// seMedicalAlert = json['seMedicalAlert'];
// suAddress1 = json['suAddress1'];
// suAddress2 = json['suAddress2'];
// suAge = json['suAge'];
// suCity = json['suCity'];
// suDOB = json['suDOB'];
// suEmailHome = json['suEmailHome'];
// suEmailWork = json['suEmailWork'];
// suEmergencyContact = json['suEmergencyContact'];
// suFamilyHead = json['suFamilyHead'];
// suFirstMiddleName = json['suFirstMiddleName'];
// suFirstVisitDate = json['suFirstVisitDate'];
// suHomePhone = json['suHomePhone'];
// suLastVisitDate = json['suLastVisitDate'];
// suMobileHomeNo = json['suMobileHomeNo'];
// suMobileWorkNo = json['suMobileWorkNo'];
// suNote = json['suNote'];
// suPrefHomeNo = json['suPrefHomeNo'];
// suPrefWorkNo = json['suPrefWorkNo'];
// suPreferredName = json['suPreferredName'];
// suReferredBY = json['suReferredBY'];
// suSex = json['suSex'];
// suSsn = json['suSsn'];
// suState = json['suState'];
// suWorkPhone = json['suWorkPhone'];
// suZip = json['suZip'];
// }
// String? id;
// List<SuProvider>? suProvider;
// bool? currSU;
// List<dynamic>? shifts;
// List<dynamic>? serviceUserMedications;
// List<dynamic>? homeVisitSignOut;
// List<dynamic>? srUsShiftsRequired;
// List<SuEnquiries>? suEnquiries;
// bool? active;
// List<dynamic>? diagnosises;
// String? suLastName;
// String? name;
// String? addedby;
// String? user;
// String? createdAt;
// String? updatedAt;
// int? v;
// String? lastModifiedBy;
// String? providerName;
// String? referenceId;
// String? seMedicalAlert;
// String? suAddress1;
// String? suAddress2;
// String? suAge;
// String? suCity;
// String? suDOB;
// String? suEmailHome;
// String? suEmailWork;
// String? suEmergencyContact;
// String? suFamilyHead;
// String? suFirstMiddleName;
// String? suFirstVisitDate;
// String? suHomePhone;
// String? suLastVisitDate;
// String? suMobileHomeNo;
// String? suMobileWorkNo;
// String? suNote;
// String? suPrefHomeNo;
// String? suPrefWorkNo;
// String? suPreferredName;
// String? suReferredBY;
// String? suSex;
// String? suSsn;
// String? suState;
// String? suWorkPhone;
// String? suZip;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['_id'] = id;
// if (suProvider != null) {
// map['suProvider'] = suProvider?.map((v) => v.toJson()).toList();
// }
// map['currSU'] = currSU;
// if (shifts != null) {
// map['shifts'] = shifts?.map((v) => v.toJson()).toList();
// }
// if (serviceUserMedications != null) {
// map['serviceUserMedications'] = serviceUserMedications?.map((v) => v.toJson()).toList();
// }
// if (homeVisitSignOut != null) {
// map['homeVisitSignOut'] = homeVisitSignOut?.map((v) => v.toJson()).toList();
// }
// if (srUsShiftsRequired != null) {
// map['srUsShiftsRequired'] = srUsShiftsRequired?.map((v) => v.toJson()).toList();
// }
// if (suEnquiries != null) {
// map['suEnquiries'] = suEnquiries?.map((v) => v.toJson()).toList();
// }
// map['active'] = active;
// if (diagnosises != null) {
// map['diagnosises'] = diagnosises?.map((v) => v.toJson()).toList();
// }
// map['suLastName'] = suLastName;
// map['name'] = name;
// map['addedby'] = addedby;
// map['user'] = user;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// map['lastModifiedBy'] = lastModifiedBy;
// map['providerName'] = providerName;
// map['referenceId'] = referenceId;
// map['seMedicalAlert'] = seMedicalAlert;
// map['suAddress1'] = suAddress1;
// map['suAddress2'] = suAddress2;
// map['suAge'] = suAge;
// map['suCity'] = suCity;
// map['suDOB'] = suDOB;
// map['suEmailHome'] = suEmailHome;
// map['suEmailWork'] = suEmailWork;
// map['suEmergencyContact'] = suEmergencyContact;
// map['suFamilyHead'] = suFamilyHead;
// map['suFirstMiddleName'] = suFirstMiddleName;
// map['suFirstVisitDate'] = suFirstVisitDate;
// map['suHomePhone'] = suHomePhone;
// map['suLastVisitDate'] = suLastVisitDate;
// map['suMobileHomeNo'] = suMobileHomeNo;
// map['suMobileWorkNo'] = suMobileWorkNo;
// map['suNote'] = suNote;
// map['suPrefHomeNo'] = suPrefHomeNo;
// map['suPrefWorkNo'] = suPrefWorkNo;
// map['suPreferredName'] = suPreferredName;
// map['suReferredBY'] = suReferredBY;
// map['suSex'] = suSex;
// map['suSsn'] = suSsn;
// map['suState'] = suState;
// map['suWorkPhone'] = suWorkPhone;
// map['suZip'] = suZip;
// return map;
// }
//
// }
//
// class SuEnquiries {
// SuEnquiries({
// this.id,
// this.initialContactDate,
// this.suEnqContactNo,
// this.suEnqEmail,
// this.reasonForNeed,
// this.suEnqStatus,
// this.requestType,
// this.suEnqComments,
// this.serviceUser,
// this.addedby,
// this.active,
// this.referenceId,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.lastModifiedBy,});
//
// SuEnquiries.fromJson(dynamic json) {
// id = json['_id'];
// initialContactDate = json['initialContactDate'];
// suEnqContactNo = json['suEnqContactNo'];
// suEnqEmail = json['suEnqEmail'];
// reasonForNeed = json['reasonForNeed'];
// suEnqStatus = json['suEnqStatus'];
// requestType = json['requestType'];
// suEnqComments = json['suEnqComments'];
// serviceUser = json['serviceUser'];
// addedby = json['addedby'];
// active = json['active'];
// referenceId = json['referenceId'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// lastModifiedBy = json['lastModifiedBy'];
// }
// String? id;
// String? initialContactDate;
// String? suEnqContactNo;
// String? suEnqEmail;
// String? reasonForNeed;
// String? suEnqStatus;
// String? requestType;
// String? suEnqComments;
// String? serviceUser;
// String? addedby;
// bool? active;
// String? referenceId;
// String? createdAt;
// String? updatedAt;
// int? v;
// String? lastModifiedBy;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['_id'] = id;
// map['initialContactDate'] = initialContactDate;
// map['suEnqContactNo'] = suEnqContactNo;
// map['suEnqEmail'] = suEnqEmail;
// map['reasonForNeed'] = reasonForNeed;
// map['suEnqStatus'] = suEnqStatus;
// map['requestType'] = requestType;
// map['suEnqComments'] = suEnqComments;
// map['serviceUser'] = serviceUser;
// map['addedby'] = addedby;
// map['active'] = active;
// map['referenceId'] = referenceId;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// map['lastModifiedBy'] = lastModifiedBy;
// return map;
// }
//
// }
//
// class SuProvider {
// SuProvider({
// this.contractedHours,
// this.id,
// this.staffMemberName,
// this.staffDesignation,
// this.staffOnLeave,
// this.supervisorId,
// this.holidays,
// this.complianceDocuments,
// this.driverFields,
// this.niNumber,
// this.kin,
// this.user,
// this.clients,
// this.staffWorkLoads,
// this.staffHolidayRequests,
// this.staffTrainings,
// this.supervision,
// this.underSupervisions,
// this.staffWorkingDays,
// this.stafDob,
// this.active,
// this.covidCheck,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.staffDisciplinaries,
// this.staffReferences,});
//
// SuProvider.fromJson(dynamic json) {
// contractedHours = json['contractedHours'] != null ? ContractedHours.fromJson(json['contractedHours']) : null;
// id = json['_id'];
// staffMemberName = json['staffMemberName'];
// staffDesignation = json['staffDesignation'];
// staffOnLeave = json['staffOnLeave'];
// supervisorId = json['supervisorId'];
// if (json['holidays'] != null) {
// holidays = [];
// json['holidays'].forEach((v) {
// holidays?.add(Dynamic.fromJson(v));
// });
// }
// if (json['complianceDocuments'] != null) {
// complianceDocuments = [];
// json['complianceDocuments'].forEach((v) {
// complianceDocuments?.add(Dynamic.fromJson(v));
// });
// }
// driverFields = json['driverFields'] != null ? DriverFields.fromJson(json['driverFields']) : null;
// niNumber = json['niNumber'];
// kin = json['kin'];
// user = json['user'];
// if (json['clients'] != null) {
// clients = [];
// json['clients'].forEach((v) {
// clients?.add(Dynamic.fromJson(v));
// });
// }
// staffWorkLoads = json['staffWorkLoads'] != null ? json['staffWorkLoads'].cast<String>() : [];
// if (json['staffHolidayRequests'] != null) {
// staffHolidayRequests = [];
// json['staffHolidayRequests'].forEach((v) {
// staffHolidayRequests?.add(Dynamic.fromJson(v));
// });
// }
// if (json['staffTrainings'] != null) {
// staffTrainings = [];
// json['staffTrainings'].forEach((v) {
// staffTrainings?.add(Dynamic.fromJson(v));
// });
// }
// supervision = json['supervision'] != null ? Supervision.fromJson(json['supervision']) : null;
// if (json['underSupervisions'] != null) {
// underSupervisions = [];
// json['underSupervisions'].forEach((v) {
// underSupervisions?.add(Dynamic.fromJson(v));
// });
// }
// if (json['staffWorkingDays'] != null) {
// staffWorkingDays = [];
// json['staffWorkingDays'].forEach((v) {
// staffWorkingDays?.add(Dynamic.fromJson(v));
// });
// }
// stafDob = json['stafDob'];
// active = json['active'];
// covidCheck = json['covidCheck'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// staffDisciplinaries = json['staffDisciplinaries'];
// staffReferences = json['staffReferences'];
// }
// ContractedHours? contractedHours;
// String? id;
// String? staffMemberName;
// String? staffDesignation;
// bool? staffOnLeave;
// String? supervisorId;
// List<dynamic>? holidays;
// List<dynamic>? complianceDocuments;
// DriverFields? driverFields;
// String? niNumber;
// String? kin;
// String? user;
// List<dynamic>? clients;
// List<String>? staffWorkLoads;
// List<dynamic>? staffHolidayRequests;
// List<dynamic>? staffTrainings;
// Supervision? supervision;
// List<dynamic>? underSupervisions;
// List<dynamic>? staffWorkingDays;
// String? stafDob;
// bool? active;
// bool? covidCheck;
// String? createdAt;
// String? updatedAt;
// int? v;
// String? staffDisciplinaries;
// String? staffReferences;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (contractedHours != null) {
// map['contractedHours'] = contractedHours?.toJson();
// }
// map['_id'] = id;
// map['staffMemberName'] = staffMemberName;
// map['staffDesignation'] = staffDesignation;
// map['staffOnLeave'] = staffOnLeave;
// map['supervisorId'] = supervisorId;
// if (holidays != null) {
// map['holidays'] = holidays?.map((v) => v.toJson()).toList();
// }
// if (complianceDocuments != null) {
// map['complianceDocuments'] = complianceDocuments?.map((v) => v.toJson()).toList();
// }
// if (driverFields != null) {
// map['driverFields'] = driverFields?.toJson();
// }
// map['niNumber'] = niNumber;
// map['kin'] = kin;
// map['user'] = user;
// if (clients != null) {
// map['clients'] = clients?.map((v) => v.toJson()).toList();
// }
// map['staffWorkLoads'] = staffWorkLoads;
// if (staffHolidayRequests != null) {
// map['staffHolidayRequests'] = staffHolidayRequests?.map((v) => v.toJson()).toList();
// }
// if (staffTrainings != null) {
// map['staffTrainings'] = staffTrainings?.map((v) => v.toJson()).toList();
// }
// if (supervision != null) {
// map['supervision'] = supervision?.toJson();
// }
// if (underSupervisions != null) {
// map['underSupervisions'] = underSupervisions?.map((v) => v.toJson()).toList();
// }
// if (staffWorkingDays != null) {
// map['staffWorkingDays'] = staffWorkingDays?.map((v) => v.toJson()).toList();
// }
// map['stafDob'] = stafDob;
// map['active'] = active;
// map['covidCheck'] = covidCheck;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// map['staffDisciplinaries'] = staffDisciplinaries;
// map['staffReferences'] = staffReferences;
// return map;
// }
//
// }
//
// class Supervision {
// Supervision({
// this.supervisionName,
// this.sprDueDate,
// this.sprStatus,
// this.sprResult,
// this.templateTitleId,});
//
// Supervision.fromJson(dynamic json) {
// supervisionName = json['supervisionName'];
// sprDueDate = json['sprDueDate'];
// sprStatus = json['sprStatus'];
// sprResult = json['sprResult'];
// templateTitleId = json['templateTitleId'];
// }
// String? supervisionName;
// String? sprDueDate;
// String? sprStatus;
// String? sprResult;
// String? templateTitleId;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['supervisionName'] = supervisionName;
// map['sprDueDate'] = sprDueDate;
// map['sprStatus'] = sprStatus;
// map['sprResult'] = sprResult;
// map['templateTitleId'] = templateTitleId;
// return map;
// }
//
// }
//
// class DriverFields {
// DriverFields({
// this.isDriver,
// this.vehicleType,});
//
// DriverFields.fromJson(dynamic json) {
// isDriver = json['isDriver'];
// vehicleType = json['vehicleType'];
// }
// bool? isDriver;
// String? vehicleType;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['isDriver'] = isDriver;
// map['vehicleType'] = vehicleType;
// return map;
// }
//
// }
//
// class ContractedHours {
// ContractedHours({
// this.contractedHours,
// this.totalShiftHoursWeek,
// this.noOfShifts,});
//
// ContractedHours.fromJson(dynamic json) {
// contractedHours = json['contractedHours'];
// totalShiftHoursWeek = json['totalShiftHoursWeek'];
// noOfShifts = json['noOfShifts'];
// }
// int? contractedHours;
// int? totalShiftHoursWeek;
// int? noOfShifts;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['contractedHours'] = contractedHours;
// map['totalShiftHoursWeek'] = totalShiftHoursWeek;
// map['noOfShifts'] = noOfShifts;
// return map;
// }
//
// }

View File

@@ -0,0 +1,116 @@
class BodyPointsCategory {
String idOne = "";
String name = "";
String enumed = "";
String createdAt = "";
String updatedAt = "";
int v = 0;
List<SubCat> subCategory = [];
String id = "";
BodyPointsCategory({
required this.idOne,
required this.name,
required this.enumed,
required this.createdAt,
required this.updatedAt,
required this.v,
required this.subCategory,
required this.id,
});
@override
String toString() {
return 'BodyPointsCategory{idOne: $idOne, name: $name, enumed: $enumed, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, subCategory: $subCategory, id: $id}';
}
// // Override == operator and hashCode getter
// @override
// bool operator ==(other) =>
// identical(this, other) ||
// other is BodyPointsCategory && runtimeType == other.runtimeType && id == other.id;
//
// @override
// int get hashCode => id.hashCode;
BodyPointsCategory.empty();
BodyPointsCategory.fromJson(Map<String, dynamic> json) {
idOne = json['_id'] ?? "";
name = json['name'] ?? "";
enumed = json['enum'] ?? "";
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
v = json['__v'] ?? 0;
subCategory = json['subcat'] != null
? List.from(json['subcat']).map((e) => SubCat.fromJson(e)).toList()
: [SubCat.empty()];
id = json['id'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['_id'] = idOne;
data['name'] = name;
data['enum'] = enumed;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = v;
data['subcat'] = subCategory.map((e) => e.toJson()).toList();
data['id'] = id;
return data;
}
}
class SubCat {
String idOne = "";
String name = "";
String enumed = "";
dynamic parentCategory;
String createdAt = "";
String updatedAt = "";
int v = 0;
String id = "";
@override
String toString() {
return 'SubCat{idOne: $idOne, name: $name, enumed: $enumed, parentCategory: $parentCategory, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, id: $id}';
}
SubCat({
required this.idOne,
required this.name,
required this.enumed,
required this.parentCategory,
required this.createdAt,
required this.updatedAt,
required this.v,
required this.id,
});
SubCat.empty();
SubCat.fromJson(Map<String, dynamic> json) {
idOne = json['_id'] ?? "";
name = json['name'] ?? "";
enumed = json['enum'] ?? "";
parentCategory = json['parentCategory'] is Map
? BodyPointsCategory.fromJson(json['parentCategory'])
: json['parentCategory'];
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
id = json['id'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['_id'] = idOne;
data['name'] = name;
data['enum'] = enumed;
data['parentCategory'] = parentCategory;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['id'] = id;
return data;
}
}

View File

@@ -0,0 +1,50 @@
import 'package:get/get_rx/src/rx_types/rx_types.dart';
class BodyPointsManager {
double? triangleTopPosition;
double? triangleBottomPosition;
double? triangleRightPosition;
double? triangleLeftPosition;
double? dialogTopPosition;
double? dialogBottomPosition;
double? dialogRightPosition;
double? dialogLeftPosition;
String pointName = "";
String healthNote = "";
String complaint = "";
String lastUpdate = "";
String pointParentId = "";
String pointId = "";
String pointIssueId = "";
RxBool isPointInactive = true.obs;
RxBool pointVisibility = false.obs;
RxString pointStatusSelectedDropdownValue = "Active".obs;
String serviceUserId = "";
BodyPointsManager.empty();
BodyPointsManager.addPoint({
required this.pointParentId,
required this.isPointInactive,
required this.pointId,
required this.pointName,
required this.pointVisibility,
required this.pointStatusSelectedDropdownValue,
this.triangleTopPosition,
this.triangleBottomPosition,
this.triangleRightPosition,
this.triangleLeftPosition,
this.dialogTopPosition,
this.dialogBottomPosition,
this.dialogRightPosition,
this.dialogLeftPosition,
required this.healthNote,
required this.complaint,
required this.lastUpdate,
});
@override
String toString() {
return 'BodyPointsManager{Point Id $pointId,triangleTopPosition: $triangleTopPosition, triangleBottomPosition: $triangleBottomPosition, triangleRightPosition: $triangleRightPosition, triangleLeftPosition: $triangleLeftPosition, dialogTopPosition: $dialogTopPosition, dialogBottomPosition: $dialogBottomPosition, dialogRightPosition: $dialogRightPosition, dialogLeftPosition: $dialogLeftPosition, pointName: $pointName, healthNote: $healthNote, complaint: $complaint, lastUpdate: $lastUpdate, isPointInactive: $isPointInactive, pointVisibility: $pointVisibility, pointStatusSelectedDropdownValue: $pointStatusSelectedDropdownValue}';
}
}

View File

@@ -0,0 +1,25 @@
class ABCFormHtmlRequest {
final String antecedentEvents;
final String behaviour;
final String consequenceEvents;
ABCFormHtmlRequest({
required this.antecedentEvents,
required this.behaviour,
required this.consequenceEvents,
});
String toHtml() {
return """
<div className="col-md-12">
<p><strong>Antecedent Events: </strong><span id="antecedentEventsData">$antecedentEvents</span></p>
</div>
<div className="col-md-12">
<p><strong>Behaviour: </strong><span id="behaviourData">$behaviour</span></p>
</div>
<div className="col-md-12">
<p><strong>Consequence Events: </strong><span id="consequenceEventsData">$consequenceEvents</span></p>
</div>
""";
}
}

View File

@@ -0,0 +1,12 @@
import 'package:get/get_rx/get_rx.dart';
class HtmlTableOption {
String id;
String requirements;
final RxBool isChecked = false.obs;
HtmlTableOption({
required this.id,
required this.requirements,
});
}

View File

@@ -0,0 +1,313 @@
import 'package:html/parser.dart' as htmlparser;
import 'package:html/dom.dart' as dom;
import 'HtmlTableOption.dart';
class ConsentCapacityHtmlRequest {
final String comments;
final String isMCARequired;
final String mentalCapacityAssessmentDetail;
final String specificDecisionDetail;
final String personUndertakingName;
final String personUndertakingRole;
final String organisation;
final String address;
final String tel;
final String email;
final String dateAndTimeOfAssessment;
final String lackCapacityToMakeParticularDecisionDetail;
final String recordYourEvidenceDescribe;
final String viableOptionsConsidered;
final String explainWhyTickedBox;
final List<HtmlTableOption> canDecisionBeDelayedOptions;
final String selectedImpairmentOption;
final String impairmentDescribe;
final String selectedCanPersonDecisionInfoOption;
final String describeCanPersonDecisionInfo;
final String selectedCanTheyRetainOption;
final String describeCanTheyRetain;
final String selectedCanTheyUseOption;
final String describeCanTheyUse;
final String selectedCanTheyCommunicateOption;
final String describeCanTheyCommunicate;
final List<HtmlTableOption> causativeNexusOptions;
final String evidence;
final String selectedDoYouHaveConcernOption;
final String whatIsYourEvidence;
final String seekingManagementDescribe;
final String recordInterviewDescribe;
final String section9DontHaveDecisionNameData;
final String section9DontHaveDecisionDateData;
final String section9HaveDecisionNameData;
final String section9HaveDecisionDateData;
final String isIMCARequired;
final String giveWhyIMCARequiredReason;
final String whyIMCARequiredDateTime;
final String section9AssessorsName;
final String assessorsDesignation;
final String assessorsBaseAddress;
final String assessorsContactDetailsData;
ConsentCapacityHtmlRequest({
required this.comments,
required this.isMCARequired,
required this.mentalCapacityAssessmentDetail,
required this.specificDecisionDetail,
required this.personUndertakingName,
required this.personUndertakingRole,
required this.organisation,
required this.address,
required this.tel,
required this.email,
required this.dateAndTimeOfAssessment,
required this.lackCapacityToMakeParticularDecisionDetail,
required this.recordYourEvidenceDescribe,
required this.viableOptionsConsidered,
required this.explainWhyTickedBox,
required this.canDecisionBeDelayedOptions,
required this.selectedImpairmentOption,
required this.impairmentDescribe,
required this.selectedCanPersonDecisionInfoOption,
required this.describeCanPersonDecisionInfo,
required this.selectedCanTheyRetainOption,
required this.describeCanTheyRetain,
required this.selectedCanTheyUseOption,
required this.describeCanTheyUse,
required this.selectedCanTheyCommunicateOption,
required this.describeCanTheyCommunicate,
required this.causativeNexusOptions,
required this.evidence,
required this.selectedDoYouHaveConcernOption,
required this.whatIsYourEvidence,
required this.seekingManagementDescribe,
required this.recordInterviewDescribe,
required this.section9DontHaveDecisionNameData,
required this.section9DontHaveDecisionDateData,
required this.section9HaveDecisionNameData,
required this.section9HaveDecisionDateData,
required this.isIMCARequired,
required this.giveWhyIMCARequiredReason,
required this.whyIMCARequiredDateTime,
required this.section9AssessorsName,
required this.assessorsDesignation,
required this.assessorsBaseAddress,
required this.assessorsContactDetailsData,
});
String toHtml(String htmlString) {
// Process the HTML string as needed
dom.Document document = htmlparser.parse(htmlString);
_addTextToElementId(
id: 'isMCARequiredData', value: isMCARequired, document: document);
_addTextToElementId(
id: 'commentsData', value: comments, document: document);
final myElement = document.getElementById("ifMcaRequiredContentDiv");
if (isMCARequired == "No") {
myElement?.attributes['style'] = 'display: none;';
} else {
myElement?.attributes['style'] = 'display: block;';
_addTextToElementId(
id: 'mentalCapacityAssessmentDetail',
value: mentalCapacityAssessmentDetail,
document: document);
_addTextToElementId(
id: 'specificDecisionDetail',
value: specificDecisionDetail,
document: document);
_addTextToElementId(
id: 'personUndertakingName',
value: personUndertakingName,
document: document);
_addTextToElementId(
id: 'personUndertakingRole',
value: personUndertakingRole,
document: document);
_addTextToElementId(
id: 'organisation', value: organisation, document: document);
_addTextToElementId(id: 'address', value: address, document: document);
_addTextToElementId(id: 'tel', value: tel, document: document);
_addTextToElementId(id: 'email', value: email, document: document);
_addTextToElementId(
id: 'dateAndTimeOfAssessment',
value: dateAndTimeOfAssessment,
document: document);
_addTextToElementId(
id: 'lackCapacityToMakeParticularDecisionDetail',
value: lackCapacityToMakeParticularDecisionDetail,
document: document);
_addTextToElementId(
id: 'recordYourEvidenceDescribe',
value: recordYourEvidenceDescribe,
document: document);
_addTextToElementId(
id: 'viableOptionsConsidered',
value: viableOptionsConsidered,
document: document);
//canDecisionBeDelayedTable
final String generatedHtml1 =
generateHtmlRows(canDecisionBeDelayedOptions);
print("table1: $generatedHtml1");
final tableBody1 = document.getElementById('canDecisionBeDelayedTable');
// document.querySelector('.canDecisionBeDelayedTable tbody');
print("is tableBody1 null: ${tableBody1 == null}");
tableBody1?.innerHtml = generatedHtml1;
_addTextToElementId(
id: 'explainWhyTickedBox',
value: explainWhyTickedBox,
document: document);
_addTextToElementId(
id: 'selectedImpairmentOption',
value: selectedImpairmentOption,
document: document);
_addTextToElementId(
id: 'impairmentDescribe',
value: impairmentDescribe,
document: document);
_addTextToElementId(
id: 'selectedCanPersonDecisionInfoOption',
value: selectedCanPersonDecisionInfoOption,
document: document);
_addTextToElementId(
id: 'describeCanPersonDecisionInfo',
value: describeCanPersonDecisionInfo,
document: document);
_addTextToElementId(
id: 'selectedCanTheyRetainOption',
value: selectedCanTheyRetainOption,
document: document);
_addTextToElementId(
id: 'describeCanTheyRetain',
value: describeCanTheyRetain,
document: document);
_addTextToElementId(
id: 'selectedCanTheyUseOption',
value: selectedCanTheyUseOption,
document: document);
_addTextToElementId(
id: 'describeCanTheyUse',
value: describeCanTheyUse,
document: document);
_addTextToElementId(
id: 'selectedCanTheyCommunicateOption',
value: selectedCanTheyCommunicateOption,
document: document);
_addTextToElementId(
id: 'describeCanTheyCommunicate',
value: describeCanTheyCommunicate,
document: document);
final String generatedHtml2 = generateHtmlRows(causativeNexusOptions);
print("table2: $generatedHtml2");
final tableBody2 = document.getElementById('causativeNexusOptions');
// final tableBody2 = document.querySelector('.causativeNexusOptions tbody');
print("is table2 null: ${tableBody2 == null}");
tableBody2?.innerHtml = generatedHtml2;
_addTextToElementId(id: 'evidence', value: evidence, document: document);
_addTextToElementId(
id: 'selectedDoYouHaveConcernOption',
value: selectedDoYouHaveConcernOption,
document: document);
_addTextToElementId(
id: 'whatIsYourEvidence',
value: whatIsYourEvidence,
document: document);
_addTextToElementId(
id: 'seekingManagementDescribe',
value: seekingManagementDescribe,
document: document);
_addTextToElementId(
id: 'recordInterviewDescribe',
value: recordInterviewDescribe,
document: document);
_addTextToElementId(
id: 'section9DontHaveDecisionNameData',
value: section9DontHaveDecisionNameData,
document: document);
_addTextToElementId(
id: 'section9DontHaveDecisionDateData',
value: section9DontHaveDecisionDateData,
document: document);
_addTextToElementId(
id: 'section9HaveDecisionNameData',
value: section9HaveDecisionNameData,
document: document);
_addTextToElementId(
id: 'section9HaveDecisionDateData',
value: section9HaveDecisionDateData,
document: document);
_addTextToElementId(
id: 'isIMCARequired', value: isIMCARequired, document: document);
_addTextToElementId(
id: 'giveWhyIMCARequiredReason',
value: giveWhyIMCARequiredReason,
document: document);
_addTextToElementId(
id: 'whyIMCARequiredDateTime',
value: whyIMCARequiredDateTime,
document: document);
_addTextToElementId(
id: 'section9AssessorsName',
value: section9AssessorsName,
document: document);
_addTextToElementId(
id: 'assessorsDesignation',
value: assessorsDesignation,
document: document);
_addTextToElementId(
id: 'assessorsBaseAddress',
value: assessorsBaseAddress,
document: document);
_addTextToElementId(
id: 'assessorsContactDetailsData',
value: assessorsContactDetailsData,
document: document);
}
return document.outerHtml;
}
_addTextToElementId({
required String id,
required String value,
required dom.Document document,
}) {
final myElement = document.getElementById(id);
if (myElement != null) {
myElement.text = value;
}
}
String generateHtmlRows(List<HtmlTableOption> options) {
final StringBuffer htmlBuffer = StringBuffer();
for (final option in options) {
final String rowHtml = '''<tr>
<td>${option.requirements}</td>
<td>
<img src="${option.isChecked.value ? 'http://16.171.242.62/actionButtonTick.464cd329d1d7b49fd28f9f4d8c486b63.svg' : 'http://16.171.242.62/actionButtonDel.7fcdf165cc653aa57ec7b2167ef2f3cc.svg'}"
alt="${option.isChecked.value ? 'Tick' : 'Close'}"
width="24"
height="24">
</td>
</tr>
''';
htmlBuffer.write(rowHtml);
}
return htmlBuffer.toString();
}
}

View File

@@ -0,0 +1,23 @@
class HealthAppointmentsFormHtmlRequest {
final String appointmentWith;
final String reason;
final String comments;
HealthAppointmentsFormHtmlRequest({
required this.appointmentWith,
required this.reason,
required this.comments,
});
String toHtml() {
return """<div className="col-md-6">
<p><strong>Appointment with: </strong><span id="appointmentWithData">$appointmentWith </span></p>
</div>
<div className="col-md-6">
<p><strong>Reason for appointment: </strong><span id="reasonForAppointmentData">$reason</span></p>
</div>
<div className="col-md-12">
<p><strong>Comments: </strong><span id="commentsData">$comments</span></p>
</div>""";
}
}

View File

@@ -0,0 +1,35 @@
class NutritionHydrationFormHtmlRequest {
final String nutritionHydrationType;
final String foodFluidType;
final String foodFluidAmount;
final String comments;
NutritionHydrationFormHtmlRequest({
required this.nutritionHydrationType,
required this.foodFluidType,
required this.foodFluidAmount,
required this.comments,
});
String toHtml() {
return """<div className="col-md-12">
<p className="text-left"><strong>Type: </strong><span id="nutritionHydrationTypeData">$nutritionHydrationType</span>
</p>
</div>
<div className="col-md-6">
<p className="text-left"><strong>${nutritionHydrationType == "Food" ? "Meal Type: (Breakfast, Lunch, Dinner, Snack etc)" : nutritionHydrationType == "Fluid" ? "Drink Type" : ""}: </strong><span
id="foodFluidTypeData">$foodFluidType</span></p>
</div>
<div className="col-md-6">
<p className="text-left"><strong>${nutritionHydrationType == "Food" ? "Amount Eaten" : nutritionHydrationType == "Fluid" ? "Amount (ML)" : ""}: </strong><span
id="foodFluidAmountData">$foodFluidAmount</span></p>
</div>
<div className="col-md-12">
<p><strong>Comments: </strong><span id="commentsData">${comments.isNotEmpty ? comments : "No assistance required"}</span>
</p>
</div>
<div className="col-md-12">
${(nutritionHydrationType == "Food") ? """<img className="observationImg" src="http://16.171.242.62/Plat.png" alt="Plat" width="100%"/>""" : nutritionHydrationType == "Fluid" ? """<img className="observationImg" src="http://16.171.242.62/Glass.png" alt="Glass" width="100%"/>""" : ""}</div>
""";
}
}

View File

@@ -0,0 +1,48 @@
class ObservationsFormHtmlReq {
final String heartRate;
final String bloodPressure;
final String respiratoryRate;
final String oxygen;
final String temperature;
final String bloodSugar;
ObservationsFormHtmlReq({
required this.heartRate,
required this.bloodPressure,
required this.respiratoryRate,
required this.oxygen,
required this.temperature,
required this.bloodSugar,
});
String toHtml() {
return """<div className="col-md-6">
<p><strong>Heart Rate (BPM): </strong><span
id="heartRateData">$heartRate</span></p>
</div>
<div className="col-md-6">
<p><strong>Blood Pressure (/MMHG): </strong><span id="bloodPressureData">$bloodPressure</span>
</p>
</div>
<div className="col-md-6">
<p><strong>Respiratory Rate: </strong><span id="respiratoryRateData">$respiratoryRate </span>
</p>
</div>
<div className="col-md-6">
<p><strong>Oxygen (%): </strong><span id="oxygenData">$oxygen</span>
</p>
</div>
<div className="col-md-6">
<p><strong>Temperature (˚C): </strong><span id="temperatureData">$temperature </span>
</p>
</div>
<div className="col-md-6">
<p><strong>Blood Sugar (MMOL/L): </strong><span id="bloodSugarData">$bloodSugar</span>
</p>
</div>
<div className="col-md-12">
<img className="observationImg" src="http://16.171.242.62/Observation.png" alt="Observation"
width="100%"/>
</div>""";
}
}

View File

@@ -0,0 +1,150 @@
import 'HtmlTableOption.dart';
class PhysicalInterventionFormHtmlRequest {
final String durationOfIncidents;
final String staffDebriefFormNumber;
final String nameOfWitnesses;
final String placeOfIncident;
final String priorToIntervention;
final String pbsFollowed;
final String reasonForPhysicalIntervention;
final String staffInvolvedInPI;
final String conditionOfSU;
final String howSuCalmed;
final List<HtmlTableOption> useOfForceNecessary;
final String pleaseExplain;
final String isParentContacted;
final String nameOfParentContacted;
final String parentContactedTime;
final String howParentContacted;
final String parentCarersComments;
final String howFormWasShared;
PhysicalInterventionFormHtmlRequest({
required this.durationOfIncidents,
required this.staffDebriefFormNumber,
required this.nameOfWitnesses,
required this.placeOfIncident,
required this.priorToIntervention,
required this.pbsFollowed,
required this.reasonForPhysicalIntervention,
required this.staffInvolvedInPI,
required this.conditionOfSU,
required this.howSuCalmed,
required this.useOfForceNecessary,
required this.pleaseExplain,
required this.isParentContacted,
required this.nameOfParentContacted,
required this.parentContactedTime,
required this.howParentContacted,
required this.parentCarersComments,
required this.howFormWasShared,
});
String toHtml() {
String ifParentContactedHtml = (isParentContacted == "Yes")
? """<div className="col-md-6">
<p><strong>Name of Parent Contacted</strong>
<span id="nameOfParentContactedData">$nameOfParentContacted</span></p>
</div>
<div className="col-md-6">
<p><strong>Contact time</strong>
<span id="parentContactedTimeData">$parentContactedTime</span></p>
</div>
<div className="col-md-12">
<p><strong>How parent was contacted</strong>
<span id="howParentContactedData">$howParentContacted</span></p>
</div>"""
: "";
return """<div className="col-md-6">
<p><strong>Duration of incident (Mins)</strong>
<span id="durationOfIncidentsData">$durationOfIncidents</span></p>
</div>
<div className="col-md-6">
<p><strong>Staff Debrief Form Number</strong>
<span id="staffDebriefFormNumberData">$staffDebriefFormNumber</span></p>
</div>
<div className="col-md-6">
<p><strong>Name of witnesses/adults present</strong>
<span id="nameOfWitnessesData">$nameOfWitnesses</span></p>
</div>
<div className="col-md-6">
<p><strong>Place incident occurred</strong>
<span id="placeOfIncidentData">$placeOfIncident</span></p>
</div>
<div className="col-md-6">
<p><strong>What was used prior to intervention to defuse/deescalate the situation?</strong>
<span id="priorToInterventionData">$priorToIntervention</span></p>
</div>
<div className="col-md-6">
<p><strong>Was the PBS followed and was it sufficient enough to manage this incident?</strong>
<span id="pbsFollowedData">$pbsFollowed</span></p>
</div>
<div className="col-md-6">
<p><strong>Reason for physical intervention</strong>
<span id="reasonForPhysicalInterventionData">$reasonForPhysicalIntervention</span></p>
</div>
<div className="col-md-6">
<p><strong>Staff involved in the physical intervention</strong>
<span id="staffInvolvedInPIData">$staffInvolvedInPI</span></p>
</div>
<div className="col-md-6">
<p><strong>Condition of service user following the incident, including breathing monitoring</strong>
<span id="conditionOfSUData">$conditionOfSU</span></p>
</div>
<div className="col-md-6">
<p><strong>How was the service user calmed?</strong>
<span id="howSuCalmedData">$howSuCalmed</span></p>
</div>
<div className="col-md-12">
<p><strong>Why was the use of force necessary?</strong></p>
<div className="keyChecksWrapper">
<div className="keyPoints">
<div className="table-responsive">
<Table striped bordered hover className='dynamicRows'>
<tbody>
<!-- Use of force necessary details -->
${useOfForceNecessary.map((row) {
return """<tr key=${row.id}>
<td>${row.requirements}</td>
<td>
${row.isChecked() ? """
<img
src="http://16.171.242.62/actionButtonTick.464cd329d1d7b49fd28f9f4d8c486b63.svg"
alt="Tick"
width="24"
height="24"
/>""" : """<img
src="http://16.171.242.62/actionButtonDel.7fcdf165cc653aa57ec7b2167ef2f3cc.svg"
alt="Close"
width="24"
height="24"
/> """}
</td>
</tr>""";
}).join()}
</tbody>
</Table>
</div>
</div>
</div>
<p><strong>If ticked "Other" please explain</strong>
<span id="pleaseExplainData">$pleaseExplain</span></p>
</div>
<div className="col-md-12 mb-3">
<p><strong>Parent Contacted</strong>
<span id="isParentContactedData">$isParentContacted</span></p>
</div>
<!-- Parent contact details -->
$ifParentContactedHtml
<div className="col-md-12 mt-5">
<p><strong>Parent/carers comments</strong>
<span id="parentCarersCommentsData">$parentCarersComments</span></p>
</div>
<div className="col-md-12 mb-3">
<p><strong>How was this form shared with parents/carers?</strong>
<span id="howFormWasSharedData">$howFormWasShared</span></p>
</div>""";
}
}

View File

@@ -0,0 +1,59 @@
class SafeguardingFormHtmlRequest {
final String concernsAboutServiceUser;
final String voiceOfTheServiceUser;
final String areThereAnyImmediateRisks;
final String whatActionDoYouFeel;
final String comments;
final String yourName;
final String anyWitnesses;
final String dateTimeReporting;
final String yourNameDslDdsl;
final String actionTaken;
SafeguardingFormHtmlRequest({
required this.concernsAboutServiceUser,
required this.voiceOfTheServiceUser,
required this.areThereAnyImmediateRisks,
required this.whatActionDoYouFeel,
required this.comments,
required this.yourName,
required this.anyWitnesses,
required this.dateTimeReporting,
required this.yourNameDslDdsl,
required this.actionTaken,
});
String toHtml() {
return """<div className="col-md-12">
<p><strong>Concerns about the service user: </strong><span id="concernsAboutServiceUserData">$concernsAboutServiceUser</span></p>
</div>
<div className="col-md-12">
<p><strong>Voice of the service user: </strong><span id="voiceOfTheServiceUserData">$voiceOfTheServiceUser </span></p>
</div>
<div className="col-md-12">
<p><strong>Are there any immediate risks: </strong><span id="areThereAnyImmediateRisksData">$areThereAnyImmediateRisks</span></p>
</div>
<div className="col-md-12">
<p><strong>What action do you feel should be taken?: </strong><span id="whatActionDoYouFeelData">$whatActionDoYouFeel</span></p>
</div>
<div className="col-md-12">
<p><strong>Comments: </strong><span id="commentsData">$comments</span></p>
</div>
<div className="col-md-4">
<p><strong>Your Name: </strong><span id="yourNameData">$yourName</span></p>
</div>
<div className="col-md-4">
<p><strong>Any witnesses: </strong><span id="anyWitnessesData">$anyWitnesses</span></p>
</div>
<div className="col-md-4">
<p><strong>Date and time of reporting</strong>
<span id="dateTimeReportingData">$dateTimeReporting</span></p>
</div>
<div className="col-md-6">
<p>To be completed by DSL/DDSL<br /><strong>Your Name: </strong><span id="yourNameDslDdslData">$yourNameDslDdsl</span></p>
</div>
<div className="col-md-6">
<p><br /><strong>Action taken: </strong><span id="actionTakenData">$actionTaken</span></p>
</div>""";
}
}

View File

@@ -0,0 +1,20 @@
class ShoweringAndBathFormHtmlRequest {
final String showeringBathType;
final String comments;
ShoweringAndBathFormHtmlRequest({
required this.showeringBathType,
required this.comments,
});
String toHtml() {
return """
<div className="col-md-12">
<p><strong>Type: </strong><span id="showeringBathTypeData">$showeringBathType</span></p>
</div>
<div className="col-md-12">
<p><strong>Comments: </strong><span id="commentsData">${comments.isNotEmpty ? comments : "No assistance required"}</span></p>
</div>
""";
}
}

View File

@@ -0,0 +1,25 @@
class ToiletingFormHtmlRequest {
final bool assistanceRequired;
final String assistanceType;
final String comments;
ToiletingFormHtmlRequest({
required this.assistanceRequired,
required this.assistanceType,
required this.comments,
});
String toHtml() {
return """
<div className="col-md-12">
<p className="text-left"><strong>Was assistance required with toileting? </strong><span id="assistanceRequiredData" className="${assistanceRequired ? "text-success" : "text-danger"}">${assistanceRequired ? "Yes" : "No"}</span></p>
</div>
<div className="col-md-12">
<p><strong>Assistance type: </strong><span id="assistanceTypeData">${assistanceType.isNotEmpty ? assistanceType : "Handled alone"}</span></p>
</div>
<div className="col-md-12">
<p><strong>Comments: </strong><span id="commentsData">${comments.isNotEmpty ? comments : "No assistance required"}</span></p>
</div>
""";
}
}

View File

@@ -0,0 +1,62 @@
class CareNoteCategory {
CareNoteCategory({
this.iconPath,
this.category,
this.subcategories,
});
CareNoteCategory.fromJson(dynamic json) {
iconPath = json['iconPath'];
category = json['category'];
if (json['subcategories'] != null) {
subcategories = [];
json['subcategories'].forEach((v) {
subcategories?.add(Subcategories.fromJson(v));
});
}
}
String? iconPath;
String? category;
List<Subcategories>? subcategories;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['iconPath'] = iconPath;
map['category'] = category;
if (subcategories != null) {
map['subcategories'] = subcategories?.map((v) => v.toJson()).toList();
}
return map;
}
}
class Subcategories {
Subcategories({
this.iconPath,
this.name,
this.formType,
this.apiValue,
});
Subcategories.fromJson(dynamic json) {
iconPath = json['iconPath'];
name = json['name'];
formType = json['formType'];
apiValue = json['apiValue'];
}
String? iconPath;
String? name;
String? formType;
String? apiValue;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['iconPath'] = iconPath;
map['name'] = name;
map['formType'] = formType;
map['apiValue'] = apiValue;
return map;
}
}

View File

@@ -0,0 +1,25 @@
class ClientDataModel{
String firstName = "";
String lastName = "";
String mobileNo = "";
String email = "";
String gender = "";
DateTime dob = DateTime.now();
String age = "";
ClientDataModel.empty();
ClientDataModel.addData(
{required this.firstName,
required this.lastName,
required this.mobileNo,
required this.email,
required this.gender,
required this.dob,
required this.age});
@override
String toString() {
return 'ClientDataModel{firstName: $firstName, lastName: $lastName, mobileNo: $mobileNo, email: $email, gender: $gender, dob: $dob, age: $age}';
}
}

View File

@@ -0,0 +1,34 @@
class ConsentDetailsModel{
String id = "";
String staffId = "";
bool active = false;
String description = "";
int v = 0;
DateTime createdAt =DateTime.now();
DateTime updatedAt =DateTime.now();
ConsentDetailsModel.empty();
ConsentDetailsModel.addData(
{required this.id,
required this.staffId,
required this.active,
required this.description,
required this.v,
required this.createdAt,
required this.updatedAt});
ConsentDetailsModel.fromJson(Map<String, dynamic> json){
id = json['_id']??"";
staffId = json['staffId']??"";
active = json['active']??false;
description = json['description']??"";
v = json['__v']??-1;
createdAt = DateTime.tryParse(json['createdAt'])??DateTime.now();
updatedAt = DateTime.tryParse(json['updatedAt'])??DateTime.now();
}
@override
String toString() {
return 'ConsentDetailsModel{id: $id, staffId: $staffId, active: $active, description: $description, v: $v, createdAt: $createdAt, updatedAt: $updatedAt}';
}
}

View File

@@ -0,0 +1,338 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
class DocumentsListModel {
DocumentsListModel({
required this.documentList,
required this.count,
required this.offset,
required this.limit,
});
List<DocumentModel> documentList = [];
int count = -1;
int offset = -1;
int limit = -1;
DocumentsListModel.empty();
DocumentsListModel.fromJson(Map<String, dynamic> json) {
documentList = List.from(json['documentList'] ?? [])
.map((e) => DocumentModel.fromJson(e))
.toList();
count = json['count'] ?? -1;
offset = json['offset'] ?? -1;
limit = json['limit'] ?? -1;
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['documentList'] = documentList.map((e) => e.toJson()).toList();
data['count'] = count;
data['offset'] = offset;
data['limit'] = limit;
return data;
}
}
class DocumentModel {
DocumentModel({
required this.id,
required this.docPath,
required this.details,
required this.title,
required this.userId,
required this.addedBy,
required this.createdAt,
required this.updatedAt,
});
String id = "";
String docPath = "";
String details = "";
String title = "";
UserData? userId;
UserData? addedBy;
String createdAt = "";
String updatedAt = "";
DocumentModel.empty();
DocumentModel.fromJson(Map<String, dynamic> json) {
id = json['_id'] ?? "";
docPath = json['docPath'] ?? "";
details = json['details'] ?? "";
title = json['title'] ?? "";
userId = json['userId'] is Map ? UserData.fromJson(json['userId']) : null;
addedBy =
json['addedBy'] is Map ? UserData.fromJson(json['addedBy']) : null;
createdAt = json['createdAt'] ?? "";
updatedAt = json['updatedAt'] ?? "";
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['_id'] = id;
data['docPath'] = docPath;
data['details'] = details;
data['title'] = title;
data['userId'] = userId;
data['addedBy'] = addedBy;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
return data;
}
}
// class UserId {
// UserId({
// required this.fcmTokens,
// required this.location,
// required this.id,
// required this.userModelName,
// required this.name,
// required this.version,
// required this.email,
// required this.phoneNumber,
// required this.active,
// required this.role,
// required this.profilePictureUrl,
// required this.deviceId,
// required this.verificationCode,
// required this.isVerified,
// required this.approved,
// required this.blocked,
// required this.createdAt,
// required this.updatedAt,
// required this.V,
// required this.password,
// required this.userSettings,
// required this.modelId,
// });
//
// Location location = Location.empty();
// String id = "";
// String userModelName = "";
// String name = "";
// String version = "";
// String email = "";
// String phoneNumber = "";
// bool active = false;
// String role = "";
// String profilePictureUrl = "";
// String deviceId = "";
// String verificationCode = "";
// bool isVerified = false;
// bool approved = false;
// bool blocked = false;
// String createdAt = "";
// String updatedAt = "";
// int V = -1;
// String password = "";
// String userSettings = "";
// String modelId = "";
//
// UserId.empty();
//
// UserId.fromJson(Map<String, dynamic> json) {
// location = Location.fromJson(json['location'] ?? {});
// id = json['_id'] ?? "";
// userModelName = json['userModelName'] ?? "";
// name = json['name'] ?? "";
// version = json['version'] ?? "";
// email = json['email'] ?? "";
// phoneNumber = json['phoneNumber'] ?? "";
// active = json['active'] ?? false;
// role = json['role'] ?? "";
// profilePictureUrl = json['profile_picture_url'] ?? "";
// deviceId = json['deviceId'] ?? "";
// verificationCode = json['verification_code'] ?? "";
// isVerified = json['is_verified'] ?? false;
// approved = json['approved'] ?? false;
// blocked = json['blocked'] ?? false;
// createdAt = json['createdAt'] ?? "";
// updatedAt = json['updatedAt'] ?? "";
// V = json['__v'] ?? -1;
// password = json['password'] ?? "";
// userSettings = json['userSettings'] ?? "";
// modelId = json['modelId'] ?? "";
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['fcm_tokens'] = fcmTokens.toJson();
// data['location'] = location.toJson();
// data['_id'] = id;
// data['userModelName'] = userModelName;
// data['name'] = name;
// data['version'] = version;
// data['email'] = email;
// data['phoneNumber'] = phoneNumber;
// data['active'] = active;
// data['role'] = role;
// data['profile_picture_url'] = profilePictureUrl;
// data['deviceId'] = deviceId;
// data['verification_code'] = verificationCode;
// data['is_verified'] = isVerified;
// data['approved'] = approved;
// data['blocked'] = blocked;
// data['createdAt'] = createdAt;
// data['updatedAt'] = updatedAt;
// data['__v'] = V;
// data['password'] = password;
// data['userSettings'] = userSettings;
// data['modelId'] = modelId;
// return data;
// }
// }
//
// class FcmTokens {
// FcmTokens({
// required this.token,
// required this.deviceType,
// });
//
// String token = "";
// String deviceType = "";
//
// FcmTokens.empty();
//
// FcmTokens.fromJson(Map<String, dynamic> json) {
// token = json['token'] ?? "";
// deviceType = json['deviceType'] ?? "";
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['token'] = token;
// data['deviceType'] = deviceType;
// return data;
// }
// }
//
// class Location {
// Location({
// required this.type,
// required this.coordinates,
// });
//
// String type = "";
// List<double> coordinates = [];
//
// Location.empty();
//
// Location.fromJson(Map<String, dynamic> json) {
// type = json['type'] ?? "";
// coordinates = List.castFrom<dynamic, double>(json['coordinates'] ?? []);
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['type'] = type;
// data['coordinates'] = coordinates;
// return data;
// }
// }
//
// class AddedBy {
// AddedBy({
// required this.fcmTokens,
// required this.location,
// required this.id,
// required this.userModelName,
// required this.name,
// required this.version,
// required this.email,
// required this.phoneNumber,
// required this.active,
// required this.role,
// required this.profilePictureUrl,
// required this.deviceId,
// required this.verificationCode,
// required this.isVerified,
// required this.approved,
// required this.blocked,
// required this.createdAt,
// required this.updatedAt,
// required this.V,
// required this.password,
// required this.userSettings,
// required this.modelId,
// });
//
// FcmTokens fcmTokens = FcmTokens.empty();
// Location location = Location.empty();
// String id = "";
// String userModelName = "";
// String name = "";
// String version = "";
// String email = "";
// String phoneNumber = "";
// bool active = 0 == 1;
// String role = "";
// String profilePictureUrl = "";
// String deviceId = "";
// String verificationCode = "";
// bool isVerified = 1 == 0;
// bool approved = 1 == 0;
// bool blocked = 1 == 0;
// String createdAt = "";
// String updatedAt = "";
// int V = 1;
// String password = "";
// String userSettings = "";
// String modelId = "";
//
// AddedBy.empty();
//
// AddedBy.fromJson(Map<String, dynamic> json) {
// fcmTokens = FcmTokens.fromJson(json['fcm_tokens'] ?? FcmTokens.empty());
// location = Location.fromJson(json['location'] ?? Location.empty());
// id = json['_id'] ?? "";
// userModelName = json['userModelName'] ?? "";
// name = json['name'] ?? "";
// version = json['version'] ?? "";
// email = json['email'] ?? "";
// phoneNumber = json['phoneNumber'] ?? "";
// active = json['active'] ?? false;
// role = json['role'] ?? "";
// profilePictureUrl = json['profile_picture_url'] ?? "";
// deviceId = json['deviceId'] ?? "";
// verificationCode = json['verification_code'] ?? "";
// isVerified = json['is_verified'] ?? false;
// approved = json['approved'] ?? false;
// blocked = json['blocked'] ?? false;
// createdAt = json['createdAt'] ?? "";
// updatedAt = json['updatedAt'] ?? "";
// V = json['__v'] ?? -1;
// password = json['password'] ?? "";
// userSettings = json['userSettings'] ?? "";
// modelId = json['modelId'] ?? "";
// }
//
// Map<String, dynamic> toJson() {
// final data = <String, dynamic>{};
// data['fcm_tokens'] = fcmTokens.toJson();
// data['location'] = location.toJson();
// data['_id'] = id;
// data['userModelName'] = userModelName;
// data['name'] = name;
// data['version'] = version;
// data['email'] = email;
// data['phoneNumber'] = phoneNumber;
// data['active'] = active;
// data['role'] = role;
// data['profile_picture_url'] = profilePictureUrl;
// data['deviceId'] = deviceId;
// data['verification_code'] = verificationCode;
// data['is_verified'] = isVerified;
// data['approved'] = approved;
// data['blocked'] = blocked;
// data['createdAt'] = createdAt;
// data['updatedAt'] = updatedAt;
// data['__v'] = V;
// data['password'] = password;
// data['userSettings'] = userSettings;
// data['modelId'] = modelId;
// return data;
// }
// }

View File

@@ -0,0 +1,52 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
class MemoryListData {
MemoryListData({
this.addedBy,
this.userId,
this.note,
this.filePath,
this.isDeleted,
this.createdAt,
this.updatedAt,
this.id,
});
MemoryListData.fromJson(dynamic json) {
id = json['_id'];
addedBy =
json['addedBy'] != null ? UserData.fromJson(json['addedBy']) : null;
userId = json['userId'] != null ? UserData.fromJson(json['userId']) : null;
note = json['note'];
filePath = json['filePath'];
isDeleted = json['isDeleted'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
}
String? id;
UserData? addedBy;
UserData? userId;
String? note;
String? filePath;
bool? isDeleted;
String? createdAt;
String? updatedAt;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
if (addedBy != null) {
map['addedBy'] = addedBy?.toJson();
}
if (userId != null) {
map['userId'] = userId?.toJson();
}
map['note'] = note;
map['filePath'] = filePath;
map['isDeleted'] = isDeleted;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
return map;
}
}

View File

@@ -0,0 +1,30 @@
import 'MemoryListResponseData.dart';
class MemoryListResponse {
MemoryListResponse({
this.success,
this.status,
this.message,
this.data,});
MemoryListResponse.fromJson(dynamic json) {
status = json['status'];
message = json['message'];
data = json['data'] != null ? MemoryListResponseData.fromJson(json['data']) : null;
}
bool? success;
String? status;
String? message;
MemoryListResponseData? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['status'] = status;
map['message'] = message;
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}

View File

@@ -0,0 +1,38 @@
import 'MemoryListData.dart';
class MemoryListResponseData {
MemoryListResponseData({
this.list,
this.count,
this.offset,
this.limit,
});
MemoryListResponseData.fromJson(dynamic json) {
if (json['list'] != null) {
list = [];
json['list'].forEach((v) {
list?.add(MemoryListData.fromJson(v));
});
}
count = json['count'];
offset = json['offset'];
limit = json['limit'];
}
List<MemoryListData>? list;
int? count;
int? offset;
int? limit;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (list != null) {
map['list'] = list?.map((v) => v.toJson()).toList();
}
map['count'] = count;
map['offset'] = offset;
map['limit'] = limit;
return map;
}
}

View File

@@ -0,0 +1,48 @@
import 'package:quill_html_editor/quill_html_editor.dart';
class RecentIncidentsModel{
String incidentTitle = "";
String incidentId = "";
String userId = "";
String note = "";
int incidentDate = 0;
bool active = false;
String createdAt = "";
String updatedAt = "";
int v = 0;
QuillEditorController quillController = QuillEditorController();
RecentIncidentsModel.empty();
RecentIncidentsModel.fromJson(Map<String,dynamic> json){
incidentId = json['_id']??"";
userId = json['userId']??"";
note = json['note']??"";
incidentDate = json['incidentDate']??0;
active = json['active']??false;
createdAt = json['createdAt']??"";
updatedAt = json['updatedAt']??"";
incidentTitle = json['incidentTitle']??"";
v = json['__v']??0;
}
Map<String,dynamic> toJson(){
Map<String,dynamic> json = {
'_id' : incidentId,
'userId' : userId,
'note' : note,
'incidentDate' : incidentDate,
'active' : active,
'createdAt' : createdAt,
'updatedAt' : updatedAt,
'incidentTitle' : incidentTitle,
'__v' : v,
};
return json;
}
@override
String toString() {
return 'RecentIncidentsModel{incidentId: $incidentId, userId: $userId, note: $note, incidentDate: $incidentDate, active: $active, createdAt: $createdAt, updatedAt: $updatedAt, v: $v}';
}
}

View File

@@ -0,0 +1,35 @@
import 'RiskAssessmentData.dart';
class GetRiskAssessmentResponse {
GetRiskAssessmentResponse({
this.success,
this.status,
this.message,
this.data,});
GetRiskAssessmentResponse.fromJson(dynamic json) {
status = json['status'];
message = json['message'];
if (json['data'] != null) {
data = [];
json['data'].forEach((v) {
data?.add(RiskAssessmentData.fromJson(v));
});
}
}
bool? success;
String? status;
String? message;
List<RiskAssessmentData>? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['status'] = status;
map['message'] = message;
if (data != null) {
map['data'] = data?.map((v) => v.toJson()).toList();
}
return map;
}
}

View File

@@ -0,0 +1,20 @@
class InPlace {
InPlace({
this.y,
this.n,});
InPlace.fromJson(dynamic json) {
y = json['y'];
n = json['n'];
}
int? y;
int? n;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['y'] = y;
map['n'] = n;
return map;
}
}

View File

@@ -0,0 +1,24 @@
class PureRiskRating {
PureRiskRating({
this.c,
this.l,
this.r,});
PureRiskRating.fromJson(dynamic json) {
c = json['c'];
l = json['l'];
r = json['r'];
}
int? c;
int? l;
int? r;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['c'] = c;
map['l'] = l;
map['r'] = r;
return map;
}
}

View File

@@ -0,0 +1,24 @@
class ResidualRiskRating {
ResidualRiskRating({
this.c,
this.l,
this.r,});
ResidualRiskRating.fromJson(dynamic json) {
c = json['c'];
l = json['l'];
r = json['r'];
}
int? c;
int? l;
int? r;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['c'] = c;
map['l'] = l;
map['r'] = r;
return map;
}
}

View File

@@ -0,0 +1,72 @@
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;
}
}

View File

@@ -0,0 +1,350 @@
class ServiceUserModel {
AboutPatient aboutPatient = AboutPatient.empty();
String id = "";
String suLastName = "";
String suFirstMiddleName = "";
String suPreferredName = "";
String name = "";
String suSsn = "";
String providerName = "";
String suSex = "";
String suTitle = "";
DateTime suDob = DateTime.now();
String suAge = "";
String suReferredBy = "";
String suFamilyHead = "";
String suAddress1 = "";
String suAddress2 = "";
String suCity = "";
String suState = "";
String suZip = "";
DateTime suFirstVisitDate = DateTime.now();
DateTime suLastVisitDate = DateTime.now();
List<dynamic> suProvider = [];
bool currSu = false;
String suHomePhone = "";
String suWorkPhone = "";
String suMobileHomeNo = "";
String suMobileWorkNo = "";
String suEmailHome = "";
String suEmailWork = "";
String suPrefHomeNo = "";
String suPrefWorkNo = "";
String suEmergencyContact = "";
String seMedicalAlert = "";
String suNote = "";
List<Diagnosise> diagnosises = [];
String user = "";
List<dynamic> shifts = [];
List<dynamic> serviceUserMedications = [];
List<dynamic> homeVisitSignOut = [];
List<dynamic> srUsShiftsRequired = [];
List<dynamic> suEnquiries = [];
bool active = false;
DateTime createdAt = DateTime.now();
DateTime updatedAt = DateTime.now();
int v = 0;
ServiceUserModel({
required this.aboutPatient,
required this.id,
required this.suLastName,
required this.suFirstMiddleName,
required this.suPreferredName,
required this.name,
required this.suSsn,
required this.providerName,
required this.suSex,
required this.suTitle,
required this.suDob,
required this.suAge,
required this.suReferredBy,
required this.suFamilyHead,
required this.suAddress1,
required this.suAddress2,
required this.suCity,
required this.suState,
required this.suZip,
required this.suFirstVisitDate,
required this.suLastVisitDate,
required this.suProvider,
required this.currSu,
required this.suHomePhone,
required this.suWorkPhone,
required this.suMobileHomeNo,
required this.suMobileWorkNo,
required this.suEmailHome,
required this.suEmailWork,
required this.suPrefHomeNo,
required this.suPrefWorkNo,
required this.suEmergencyContact,
required this.seMedicalAlert,
required this.suNote,
required this.diagnosises,
required this.user,
required this.shifts,
required this.serviceUserMedications,
required this.homeVisitSignOut,
required this.srUsShiftsRequired,
required this.suEnquiries,
required this.active,
required this.createdAt,
required this.updatedAt,
required this.v,
});
String get phoneNo {
if (suMobileWorkNo.isNotEmpty) {
return suMobileWorkNo;
} else if (suMobileHomeNo.isNotEmpty) {
return suMobileHomeNo;
} else if (suEmergencyContact.isNotEmpty) {
return suEmergencyContact;
} else if (suPrefHomeNo.isNotEmpty) {
return suPrefHomeNo;
} else if (suPrefWorkNo.isNotEmpty) {
return suPrefWorkNo;
} else if (suWorkPhone.isNotEmpty) {
return suWorkPhone;
} else if (suHomePhone.isNotEmpty) {
return suHomePhone;
}
return "000000000000";
}
String get nameOfUser {
if (suFirstMiddleName.isNotEmpty) {
return suFirstMiddleName;
} else if (suLastName.isNotEmpty) {
return suLastName;
} else if (suPreferredName.isNotEmpty) {
return suPreferredName;
} else if (name.isNotEmpty) {
return name;
}
return "Name";
}
String get homeAddress {
if (suAddress1.isNotEmpty) {
return suAddress1;
} else if (suAddress2.isNotEmpty) {
return suAddress2;
}
return "Address";
}
ServiceUserModel.empty();
ServiceUserModel.fromJson(Map<String, dynamic> json) {
aboutPatient = json['aboutPatient'] != null
? AboutPatient.fromJson(json['aboutPatient'])
: AboutPatient.empty();
id = json['_id'] ?? "";
suLastName = json['suLastName'] ?? "";
suFirstMiddleName = json['suFirstMiddleName'] ?? "";
suPreferredName = json['suPreferredName'] ?? "";
name = json['name'] ?? "";
suSsn = json['suSsn'] ?? "";
providerName = json['providerName'] ?? "";
suSex = json['suSex'] ?? "";
suTitle = json['suTitle'] ?? "";
suDob = json['suDOB'] != null
? DateTime.parse(json['suDOB']).toLocal()
: DateTime.now();
suAge = json['suAge'] ?? '';
suReferredBy = json['suReferredBY'] ?? "";
suFamilyHead = json['suFamilyHead'] ?? "";
suAddress1 = json['suAddress1'] ?? "";
suAddress2 = json['suAddress2'] ?? "";
suCity = json['suCity'] ?? "";
suState = json['suState'] ?? "";
suZip = json['suZip'] ?? "";
suFirstVisitDate = json['suFirstVisitDate'] != null
? DateTime.parse(json['suFirstVisitDate']).toLocal()
: DateTime.now();
suLastVisitDate = json['suLastVisitDate'] != null
? DateTime.parse(json['suLastVisitDate']).toLocal()
: DateTime.now();
if (json['suProvider'] != null) {
suProvider = [];
json['suProvider'].forEach((v) {
suProvider.add(v);
});
}
currSu = json['currSU'] ?? false;
suHomePhone = json['suHomePhone'] ?? '';
suWorkPhone = json['suWorkPhone'] ?? '';
suMobileHomeNo = json['suMobileHomeNo'] ?? '';
suMobileWorkNo = json['suMobileWorkNo'] ?? '';
suEmailHome = json['suEmailHome'] ?? '';
suEmailWork = json['suEmailWork'] ?? '';
suPrefHomeNo = json['suPrefHomeNo'] ?? '';
suPrefWorkNo = json['suPrefWorkNo'] ?? '';
suEmergencyContact = json['suEmergencyContact'] ?? '';
seMedicalAlert = json['seMedicalAlert'] ?? '';
suNote = json['suNote'] ?? '';
if (json['diagnosises'] != null) {
diagnosises = [];
json['diagnosises'].forEach((v) {
diagnosises.add(Diagnosise.fromJson(v));
});
}
user = json['user'] ?? "";
if (json['shifts'] != null) {
shifts = [];
json['shifts'].forEach((v) {
shifts.add(v);
});
}
if (json['serviceUserMedications'] != null) {
serviceUserMedications = [];
json['serviceUserMedications'].forEach((v) {
serviceUserMedications.add(v);
});
}
if (json['homeVisitSignOut'] != null) {
homeVisitSignOut = [];
json['homeVisitSignOut'].forEach((v) {
homeVisitSignOut.add(v);
});
}
if (json['srUsShiftsRequired'] != null) {
srUsShiftsRequired = [];
json['srUsShiftsRequired'].forEach((v) {
srUsShiftsRequired.add(v);
});
}
if (json['suEnquiries'] != null) {
suEnquiries = [];
json['suEnquiries'].forEach((v) {
suEnquiries.add(v);
});
}
active = json['active'] ?? false;
createdAt = json['createdAt'] != null
? DateTime.parse(json['createdAt']).toLocal()
: DateTime.now();
updatedAt = json['updatedAt'] != null
? DateTime.parse(json['updatedAt']).toLocal()
: DateTime.now();
v = json['__v'] ?? 0;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
// data['aboutPatient'] = this.aboutPatient.toJson();
data['_id'] = id;
data['suLastName'] = suLastName;
data['suFirstMiddleName'] = suFirstMiddleName;
data['suPreferredName'] = suPreferredName;
data['name'] = name;
data['suSsn'] = suSsn;
data['providerName'] = providerName;
data['suSex'] = suSex;
data['suTitle'] = suTitle;
data['suDOB'] = suDob;
data['suAge'] = suAge;
data['suReferredBY'] = suReferredBy;
data['suFamilyHead'] = suFamilyHead;
data['suAddress1'] = suAddress1;
data['suAddress2'] = suAddress2;
data['suCity'] = suCity;
data['suState'] = suState;
data['suZip'] = suZip;
data['suFirstVisitDate'] = suFirstVisitDate;
data['suLastVisitDate'] = suLastVisitDate;
data['suProvider'] = suProvider.map((v) => v.toJson()).toList();
data['currSU'] = currSu;
data['suHomePhone'] = suHomePhone;
data['suWorkPhone'] = suWorkPhone;
data['suMobileHomeNo'] = suMobileHomeNo;
data['suMobileWorkNo'] = suMobileWorkNo;
data['suEmailHome'] = suEmailHome;
data['suEmailWork'] = suEmailWork;
data['suPrefHomeNo'] = suPrefHomeNo;
data['suPrefWorkNo'] = suPrefWorkNo;
data['suEmergencyContact'] = suEmergencyContact;
data['seMedicalAlert'] = seMedicalAlert;
data['suNote'] = suNote;
// data['diagnosises'] = this.diagnosises.map((v) => v.toJson()).toList();
data['user'] = user;
data['shifts'] = shifts.map((v) => v.toJson()).toList();
data['serviceUserMedications'] =
serviceUserMedications.map((v) => v.toJson()).toList();
data['homeVisitSignOut'] = homeVisitSignOut.map((v) => v.toJson()).toList();
data['srUsShiftsRequired'] =
srUsShiftsRequired.map((v) => v.toJson()).toList();
data['suEnquiries'] = suEnquiries.map((v) => v.toJson()).toList();
data['active'] = active;
data['createdAt'] = createdAt;
data['updatedAt'] = updatedAt;
data['__v'] = v;
return data;
}
@override
String toString() {
return 'ServiceUserModel{aboutPatient: $aboutPatient, id: $id, suLastName: $suLastName, suFirstMiddleName: $suFirstMiddleName, suPreferredName: $suPreferredName, name: $name, suSsn: $suSsn, providerName: $providerName, suSex: $suSex, suTitle: $suTitle, suDob: $suDob, suAge: $suAge, suReferredBy: $suReferredBy, suFamilyHead: $suFamilyHead, suAddress1: $suAddress1, suAddress2: $suAddress2, suCity: $suCity, suState: $suState, suZip: $suZip, suFirstVisitDate: $suFirstVisitDate, suLastVisitDate: $suLastVisitDate, suProvider: $suProvider, currSu: $currSu, suHomePhone: $suHomePhone, suWorkPhone: $suWorkPhone, suMobileHomeNo: $suMobileHomeNo, suMobileWorkNo: $suMobileWorkNo, suEmailHome: $suEmailHome, suEmailWork: $suEmailWork, suPrefHomeNo: $suPrefHomeNo, suPrefWorkNo: $suPrefWorkNo, suEmergencyContact: $suEmergencyContact, seMedicalAlert: $seMedicalAlert, suNote: $suNote, diagnosises: $diagnosises, user: $user, shifts: $shifts, serviceUserMedications: $serviceUserMedications, homeVisitSignOut: $homeVisitSignOut, srUsShiftsRequired: $srUsShiftsRequired, suEnquiries: $suEnquiries, active: $active, createdAt: $createdAt, updatedAt: $updatedAt, v: $v}';
}
}
class AboutPatient {
String aboutText = "";
DateTime aboutDate = DateTime.now();
String aboutBy = "";
AboutPatient({
required this.aboutText,
required this.aboutDate,
required this.aboutBy,
});
AboutPatient.empty();
AboutPatient.fromJson(Map<String, dynamic> json) {
aboutText = json['aboutText'] ?? "";
aboutDate = json['aboutDate'] != null
? DateTime.parse(json['aboutDate']).toLocal()
: DateTime.now();
aboutBy = json['aboutBy'] ?? "";
}
@override
String toString() {
return 'AboutPatient{aboutText: $aboutText, aboutDate: $aboutDate, aboutBy: $aboutBy}';
}
}
class Diagnosise {
String diagnosisText = "";
DateTime diagnosisDate = DateTime.now();
String diagnosisBy = "";
bool isCurrentDiagnosis = false;
String id = "";
Diagnosise({
required this.diagnosisText,
required this.diagnosisDate,
required this.diagnosisBy,
required this.isCurrentDiagnosis,
required this.id,
});
Diagnosise.empty();
Diagnosise.fromJson(Map<String, dynamic> json) {
diagnosisText = json['diagnosisText'] ?? "";
diagnosisDate = json['diagnosisDate'] != null
? DateTime.parse(json['diagnosisDate']).toLocal()
: DateTime.now();
diagnosisBy = json['diagnosisBy'] ?? "";
isCurrentDiagnosis = json['isCurrentDiagnosis'] ?? false;
id = json['_id'] ?? "";
}
@override
String toString() {
return 'Diagnosise{diagnosisText: $diagnosisText, diagnosisDate: $diagnosisDate, diagnosisBy: $diagnosisBy, isCurrentDiagnosis: $isCurrentDiagnosis, id: $id}';
}
}

View File

@@ -0,0 +1,105 @@
class CreateCarePlanRequest {
CreateCarePlanRequest({
this.eventDateTime,
this.userId,
this.addedby,
this.noteDetails,
this.noteType,
this.title,
this.flag,
this.isHTML,
this.healthNote,
this.category,
this.complaint,
this.moodRating,
});
int? eventDateTime;
String? userId;
String? addedby;
String? noteDetails;
String? noteType;
String? title;
bool? flag;
bool? isHTML;
String? healthNote;
String? category;
String? complaint;
String? moodRating;
//-------------------------------------
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (eventDateTime != null) map['eventDateTime'] = eventDateTime;
if (userId != null) map['userId'] = userId;
if (addedby != null) map['addedby'] = addedby;
if (noteDetails != null) map['noteDetails'] = noteDetails;
if (noteType != null) map['noteType'] = noteType;
if (title != null) map['title'] = title;
map['flag'] = flag ?? false;
map['isHTML'] = isHTML ?? false;
if (healthNote != null) map['healthNote'] = healthNote;
if (category != null) map['category'] = category;
if (complaint != null) map['complaint'] = complaint;
if (moodRating != null) map['moodRating'] = moodRating;
return map;
}
static String heightWeightHtmlReq(
String height, String weight, String comments) {
return """<div class="col-md-6">
<p><strong>Height - (CM): </strong><span id="heightData">$height</span></p>
</div>
<div class="col-md-6">
<p><strong>Weight - (KG): </strong><span id="weightData">$weight</span></p>
</div>
<div class="col-md-12">
<p><strong>Comments: </strong><span id="commentsData">$comments</span></p>
</div>""";
}
static String injuryHealthIssueHtmlReq({
required String nameOfWitnesses,
required String placeOfAccident,
required String accidentDescription,
required String recordOfInjury,
required String conditionOfPatient,
required String isParentContacted,
String? howParentContacted,
String? nameOfParentContacted,
String? parentContactedTime,
}) {
String ifParentContactedHtml = (isParentContacted == "Yes")
? """<div className="col-md-12">
<p><strong>If Yes how parent was contacted?: </strong><span id="howParentContactedData">$howParentContacted</span></p>
</div>
<div className="col-md-12">
<p><strong>Name of Parent Contacted: </strong>
<span id="nameOfParentContactedData">$nameOfParentContacted</span><br />
Contacted at:
<span id="parentContactedTimeData">$parentContactedTime</span>
</p>
</div>"""
: "";
return """<div className="col-md-12">
<p><strong>Name of witnesses/adults present: </strong><span id="nameOfWitnessesData">$nameOfWitnesses</span></p>
</div>
<div className="col-md-12">
<p><strong>Place accident occured: </strong><span id="placeOfAccidentData">$placeOfAccident </span></p>
</div>
<div className="col-md-12">
<p><strong>Description how the accident occured: </strong><span id="accidentDescriptionData">$accidentDescription</span></p>
</div>
<div className="col-md-12">
<p><strong>Record of any injury and action taken: </strong><span id="recordOfInjuryData">$recordOfInjury</span></p>
</div>
<div className="col-md-12">
<p><strong>Condition of the patient following of the accident: </strong><span id="conditionOfPatientData">$conditionOfPatient</span></p>
</div>
<div className="col-md-12">
<p><strong>Parent Contacted: </strong><span id="isParentContactedData">$isParentContacted</span></p>
</div>$ifParentContactedHtml
""";
}
}

View File

@@ -0,0 +1,6 @@
export 'response_model.dart';
export 'mark_dates_model.dart';
export 'rota_shift_model.dart';
export 'holiday_model.dart';
export 'user_model.dart';
export 'messages_list_model.dart';

View File

@@ -0,0 +1,21 @@
class HolidayModel{
String carriedOver = "";
String holidayEntitlement = "";
String holidayAllowance = "";
String remainingHolidays = "";
String timeLeftBeforeYearEnd = "";
HolidayModel({
required this.carriedOver,
required this.holidayEntitlement,
required this.holidayAllowance,
required this.remainingHolidays,
required this.timeLeftBeforeYearEnd,
});
@override
String toString() {
return 'HolidayModel{carriedOver: $carriedOver, holidayEntitlement: $holidayEntitlement, holidayAllowance: $holidayAllowance, remainingHolidays: $remainingHolidays, timeLeftBeforeYearEnd: $timeLeftBeforeYearEnd}';
}
}

View File

@@ -0,0 +1,13 @@
class MarkDatesModel{
DateTime date = DateTime.now();
String title = "title";
MarkDatesModel.empty();
MarkDatesModel.addDate({required this.date,required this.title});
@override
String toString() {
return 'MarkDatesModel{date: $date, title: $title}';
}
}

View File

@@ -0,0 +1,43 @@
import 'package:ftc_mobile_app/view/screens/chat/arguments/group_data_args.dart';
class MessagesListModel {
String otherUserId = "";
String image = "";
String title = "";
String previewOfLastMessage = "";
String messageType = "";
//in milliseconds
int date = DateTime.now().millisecondsSinceEpoch;
int noOfMessages = 0;
bool isRecent = false;
bool isGroup = false;
GroupDataArgs? groupData;
MessagesListModel.empty() {
date = DateTime.now().millisecondsSinceEpoch;
}
MessagesListModel({
this.otherUserId = "",
this.image = "",
this.title = "",
this.previewOfLastMessage = "",
this.messageType = "",
required this.date,
// this.messageDateTime = '',
this.noOfMessages = 0,
// this.personalMessageIndex = -1,
// this.groupMessageIndex = -1,
this.isRecent = false,
this.isGroup = false,
this.groupData,
});
@override
String toString() {
return 'MessagesListModel{profilePic: $image, nameOfSender: $title, previewOfLastMessage: $previewOfLastMessage, date: $date, '
// 'messageDayTime: $messageDateTime, '
'noOfMessages: $noOfMessages, isRecent: $isRecent, isGroup: $isGroup}';
}
}

View File

@@ -0,0 +1,6 @@
class MoodRatingData {
final String icon;
final String name;
MoodRatingData({required this.icon, required this.name});
}

View File

@@ -0,0 +1,23 @@
class FcmTokens {
FcmTokens({
this.token,
this.deviceType,
});
FcmTokens.empty();
FcmTokens.fromJson(dynamic json) {
token = json['token'];
deviceType = json['deviceType'];
}
String? token;
String? deviceType;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['token'] = token;
map['deviceType'] = deviceType;
return map;
}
}

View File

@@ -0,0 +1,22 @@
class LocationData {
LocationData({
this.type,
this.coordinates,});
LocationData.empty();
LocationData.fromJson(dynamic json) {
type = json['type'];
coordinates = json['coordinates'] != null ? json['coordinates'].cast<double>() : [];
}
String? type;
List<double>? coordinates;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['type'] = type;
map['coordinates'] = coordinates;
return map;
}
}

View File

@@ -0,0 +1,792 @@
// import 'package:ftc_mobile_app/models/profileData/LocationData.dart';
// import 'package:ftc_mobile_app/models/profileData/user_data.dart';
// import 'FcmTokens.dart';
//
// class ProfileDataModel {
// ProfileDataModel({
// this.statusCode,
// this.statusDescription,
// this.data,
// });
//
// ProfileDataModel.fromJson(dynamic json) {
// statusCode = json['statusCode'];
// statusDescription = json['statusDescription'];
// data = json['data'] != null ? Data.fromJson(json['data']) : null;
// }
//
// int? statusCode;
// String? statusDescription;
// Data? data;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['statusCode'] = statusCode;
// map['statusDescription'] = statusDescription;
// if (data != null) {
// map['data'] = data?.toJson();
// }
// return map;
// }
// }
//
// class Data {
// Data({
// this.staffMembers,
// this.totalSupervisionsCount,
// this.overdueSupervisionsCount,
// this.assignedSupervisionsCount,
// this.completedSupervisionsCount,
// this.count,
// this.offset,
// this.limit,
// });
//
// Data.fromJson(dynamic json) {
// if (json['staffMembers'] != null) {
// staffMembers = [];
// json['staffMembers'].forEach((v) {
// staffMembers?.add(StaffMembers.fromJson(v));
// });
// }
// totalSupervisionsCount = json['totalSupervisionsCount'];
// overdueSupervisionsCount = json['overdueSupervisionsCount'];
// assignedSupervisionsCount = json['assignedSupervisionsCount'];
// completedSupervisionsCount = json['completedSupervisionsCount'];
// count = json['count'];
// offset = json['offset'];
// limit = json['limit'];
// }
//
// List<StaffMembers>? staffMembers;
// int? totalSupervisionsCount;
// int? overdueSupervisionsCount;
// int? assignedSupervisionsCount;
// int? completedSupervisionsCount;
// int? count;
// int? offset;
// int? limit;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (staffMembers != null) {
// map['staffMembers'] = staffMembers?.map((v) => v.toJson()).toList();
// }
// map['totalSupervisionsCount'] = totalSupervisionsCount;
// map['overdueSupervisionsCount'] = overdueSupervisionsCount;
// map['assignedSupervisionsCount'] = assignedSupervisionsCount;
// map['completedSupervisionsCount'] = completedSupervisionsCount;
// map['count'] = count;
// map['offset'] = offset;
// map['limit'] = limit;
// return map;
// }
// }
//
// class StaffMembers {
// StaffMembers({
// this.contractedHours,
// this.id,
// this.staffMemberName,
// this.staffDesignation,
// this.staffOnLeave,
// this.holidays,
// this.complianceDocuments,
// this.niNumber,
// this.kin,
// this.user,
// this.managerId,
// this.clients,
// this.staffWorkLoads,
// this.staffHolidayRequests,
// this.staffTrainings,
// this.supervision,
// this.underSupervisions,
// this.staffWorkingDays,
// this.stafDob,
// this.active,
// this.covidCheck,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.staffDisciplinaries,
// this.staffReferences,
// this.remainingHolidayHours,
// });
//
// StaffMembers.fromJson(dynamic json) {
// contractedHours = json['contractedHours'] != null
// ? ContractedHours.fromJson(json['contractedHours'])
// : null;
// id = json['_id'];
// staffMemberName = json['staffMemberName'];
// staffDesignation = json['staffDesignation'];
// staffOnLeave = json['staffOnLeave'];
// holidays = List.castFrom<dynamic, dynamic>(json['holidays'] ?? "");
// complianceDocuments =
// List.castFrom<dynamic, dynamic>(json['complianceDocuments'] ?? "");
// niNumber = json['niNumber'];
// kin = json['kin'];
// user = json['user'] != null ? UserData.fromJson(json['user']) : null;
// managerId =
// json['managerId'] is Map ? UserData.fromJson(json['managerId']) : null;
// clients = List.castFrom<dynamic, dynamic>(json['clients']);
// if (json['staffWorkLoads'] != null) {
// staffWorkLoads = [];
// json['staffWorkLoads'].forEach((v) {
// if (v is Map) {
// staffWorkLoads?.add(StaffWorkLoads.fromJson(v));
// }
// });
// }
// staffHolidayRequests =
// List.castFrom<dynamic, dynamic>(json['staffHolidayRequests']);
// staffTrainings = List.castFrom<dynamic, dynamic>(json['staffTrainings']);
//
// supervision = json['supervision'] != null
// ? Supervision.fromJson(json['supervision'])
// : null;
// underSupervisions =
// List.castFrom<dynamic, dynamic>(json['underSupervisions']);
// staffWorkingDays =
// List.castFrom<dynamic, dynamic>(json['staffWorkingDays']);
// stafDob = json['stafDob'];
// active = json['active'];
// covidCheck = json['covidCheck'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// staffDisciplinaries = json['staffDisciplinaries'] is Map
// ? StaffDisciplinaries.fromJson(json['staffDisciplinaries'])
// : null;
// staffReferences = json['staffReferences'] is Map
// ? StaffReferences.fromJson(json['staffReferences'])
// : null;
// remainingHolidayHours = json['remainingHolidayHours'];
// }
//
// ContractedHours? contractedHours;
// String? id;
// String? staffMemberName;
// String? staffDesignation;
// bool? staffOnLeave;
// List<dynamic>? holidays;
// List<dynamic>? complianceDocuments;
// String? niNumber;
// String? kin;
// UserData? user;
// UserData? managerId;
// List<dynamic>? clients;
// List<StaffWorkLoads>? staffWorkLoads;
// List<dynamic>? staffHolidayRequests;
// List<dynamic>? staffTrainings;
// Supervision? supervision;
// List<dynamic>? underSupervisions;
// List<dynamic>? staffWorkingDays;
// String? stafDob;
// bool? active;
// bool? covidCheck;
// String? createdAt;
// String? updatedAt;
// int? v;
// StaffDisciplinaries? staffDisciplinaries;
// StaffReferences? staffReferences;
// int? remainingHolidayHours;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (contractedHours != null) {
// map['contractedHours'] = contractedHours?.toJson();
// }
// map['_id'] = id;
// map['staffMemberName'] = staffMemberName;
// map['staffDesignation'] = staffDesignation;
// map['staffOnLeave'] = staffOnLeave;
// if (holidays != null) {
// map['holidays'] = holidays?.map((v) => v.toJson()).toList();
// }
// if (complianceDocuments != null) {
// map['complianceDocuments'] =
// complianceDocuments?.map((v) => v.toJson()).toList();
// }
// map['niNumber'] = niNumber;
// map['kin'] = kin;
// if (user != null) {
// map['user'] = user?.toJson();
// }
// if (managerId != null) {
// map['managerId'] = managerId?.toJson();
// }
// if (clients != null) {
// map['clients'] = clients?.map((v) => v.toJson()).toList();
// }
// if (staffWorkLoads != null) {
// map['staffWorkLoads'] = staffWorkLoads?.map((v) => v.toJson()).toList();
// }
// if (staffHolidayRequests != null) {
// map['staffHolidayRequests'] =
// staffHolidayRequests?.map((v) => v.toJson()).toList();
// }
// if (staffTrainings != null) {
// map['staffTrainings'] = staffTrainings?.map((v) => v.toJson()).toList();
// }
// if (supervision != null) {
// map['supervision'] = supervision?.toJson();
// }
// if (underSupervisions != null) {
// map['underSupervisions'] =
// underSupervisions?.map((v) => v.toJson()).toList();
// }
// if (staffWorkingDays != null) {
// map['staffWorkingDays'] =
// staffWorkingDays?.map((v) => v.toJson()).toList();
// }
// map['stafDob'] = stafDob;
// map['active'] = active;
// map['covidCheck'] = covidCheck;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// if (staffDisciplinaries != null) {
// map['staffDisciplinaries'] = staffDisciplinaries?.toJson();
// }
// if (staffReferences != null) {
// map['staffReferences'] = staffReferences?.toJson();
// }
// map['remainingHolidayHours'] = remainingHolidayHours;
// return map;
// }
// }
//
// class StaffReferences {
// StaffReferences({
// this.id,
// this.docPaths,
// this.comments,
// this.staffMember,
// this.active,
// this.createdAt,
// this.updatedAt,
// this.v,
// });
//
// StaffReferences.empty();
//
// StaffReferences.fromJson(dynamic json) {
// id = json['_id'];
// docPaths = List.castFrom<dynamic, dynamic>(json['docPaths']);
// comments = List.castFrom<dynamic, dynamic>(json['comments']);
// staffMember = json['staffMember'];
// active = json['active'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// }
//
// String? id;
// List<dynamic>? docPaths;
// List<dynamic>? comments;
// String? staffMember;
// bool? active;
// String? createdAt;
// String? updatedAt;
// int? v;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['_id'] = id;
// if (docPaths != null) {
// map['docPaths'] = docPaths?.map((v) => v.toJson()).toList();
// }
// if (comments != null) {
// map['comments'] = comments?.map((v) => v.toJson()).toList();
// }
// map['staffMember'] = staffMember;
// map['active'] = active;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// return map;
// }
// }
//
// class StaffDisciplinaries {
// StaffDisciplinaries({
// this.id,
// this.docPaths,
// this.comments,
// this.staffMember,
// this.active,
// this.createdAt,
// this.updatedAt,
// this.v,
// });
//
// StaffDisciplinaries.empty();
//
// StaffDisciplinaries.fromJson(dynamic json) {
// id = json['_id'];
// docPaths = List.castFrom<dynamic, dynamic>(json['docPaths']);
// comments = List.castFrom<dynamic, dynamic>(json['comments']);
// staffMember = json['staffMember'];
// active = json['active'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// }
//
// String? id;
// List<dynamic>? docPaths;
// List<dynamic>? comments;
// String? staffMember;
// bool? active;
// String? createdAt;
// String? updatedAt;
// int? v;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['_id'] = id;
// if (docPaths != null) {
// map['docPaths'] = docPaths?.map((v) => v.toJson()).toList();
// }
// if (comments != null) {
// map['comments'] = comments?.map((v) => v.toJson()).toList();
// }
// map['staffMember'] = staffMember;
// map['active'] = active;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// return map;
// }
// }
//
// class Supervision {
// Supervision({
// this.supervisionName,
// this.sprDueDate,
// this.sprStatus,
// this.sprResult,
// this.templateTitleId,
// });
//
// Supervision.fromJson(dynamic json) {
// supervisionName = json['supervisionName'];
// sprDueDate = json['sprDueDate'];
// sprStatus = json['sprStatus'];
// sprResult = json['sprResult'];
// templateTitleId = json['templateTitleId'];
// }
//
// String? supervisionName;
// String? sprDueDate;
// String? sprStatus;
// String? sprResult;
// String? templateTitleId;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['supervisionName'] = supervisionName;
// map['sprDueDate'] = sprDueDate;
// map['sprStatus'] = sprStatus;
// map['sprResult'] = sprResult;
// map['templateTitleId'] = templateTitleId;
// return map;
// }
// }
//
// class StaffWorkLoads {
// StaffWorkLoads({
// this.holidayEntitlement,
// this.id,
// this.isCurrentWrkLd,
// this.startDate,
// this.endDate,
// this.holidayAlwnNoOfDys,
// this.holidayAlwnNoOfHours,
// this.holidaysAvailed,
// this.holidaysRemaining,
// this.staffMember,
// this.carriedOverHours,
// this.active,
// this.createdAt,
// this.updatedAt,
// this.v,
// });
//
// StaffWorkLoads.fromJson(dynamic json) {
// holidayEntitlement = json['holidayEntitlement'] != null
// ? HolidayEntitlement.fromJson(json['holidayEntitlement'])
// : null;
// id = json['_id'];
// isCurrentWrkLd = json['isCurrentWrkLd'];
// startDate = json['startDate'];
// endDate = json['endDate'];
// holidayAlwnNoOfDys = json['holidayAlwnNoOfDys'];
// holidayAlwnNoOfHours = json['holidayAlwnNoOfHours'];
// holidaysAvailed = json['holidaysAvailed'];
// holidaysRemaining = json['holidaysRemaining'];
// staffMember = json['staffMember'];
// carriedOverHours = json['carriedOverHours'];
// active = json['active'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// }
//
// HolidayEntitlement? holidayEntitlement;
// String? id;
// bool? isCurrentWrkLd;
// String? startDate;
// String? endDate;
// int? holidayAlwnNoOfDys;
// int? holidayAlwnNoOfHours;
// int? holidaysAvailed;
// int? holidaysRemaining;
// String? staffMember;
// int? carriedOverHours;
// bool? active;
// String? createdAt;
// String? updatedAt;
// int? v;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (holidayEntitlement != null) {
// map['holidayEntitlement'] = holidayEntitlement?.toJson();
// }
// map['_id'] = id;
// map['isCurrentWrkLd'] = isCurrentWrkLd;
// map['startDate'] = startDate;
// map['endDate'] = endDate;
// map['holidayAlwnNoOfDys'] = holidayAlwnNoOfDys;
// map['holidayAlwnNoOfHours'] = holidayAlwnNoOfHours;
// map['holidaysAvailed'] = holidaysAvailed;
// map['holidaysRemaining'] = holidaysRemaining;
// map['staffMember'] = staffMember;
// map['carriedOverHours'] = carriedOverHours;
// map['active'] = active;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// return map;
// }
// }
//
// class HolidayEntitlement {
// HolidayEntitlement({
// this.numberOfDays,
// this.numberOfHours,
// this.numberOfWeeks,
// });
//
// HolidayEntitlement.fromJson(dynamic json) {
// numberOfDays = json['numberOfDays'];
// numberOfHours = json['numberOfHours'];
// numberOfWeeks = json['numberOfWeeks'];
// }
//
// int? numberOfDays;
// int? numberOfHours;
// int? numberOfWeeks;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['numberOfDays'] = numberOfDays;
// map['numberOfHours'] = numberOfHours;
// map['numberOfWeeks'] = numberOfWeeks;
// return map;
// }
// }
//
// class ManagerId {
// ManagerId({
// this.fcmTokens,
// this.location,
// this.profileVideoUrl,
// this.id,
// this.userModelName,
// this.name,
// this.version,
// this.email,
// this.phoneNumber,
// this.active,
// this.role,
// this.profilePictureUrl,
// this.deviceId,
// this.verificationCode,
// this.isVerified,
// this.approved,
// this.blocked,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.password,
// this.userSettings,
// this.modelId,
// });
//
// ManagerId.fromJson(dynamic json) {
// fcmTokens = json['fcm_tokens'] != null
// ? FcmTokens.fromJson(json['fcm_tokens'])
// : null;
// location = json['location'] != null
// ? LocationData.fromJson(json['location'])
// : null;
// profileVideoUrl = json['profile_video_url'];
// id = json['_id'];
// userModelName = json['userModelName'];
// name = json['name'];
// version = json['version'];
// email = json['email'];
// phoneNumber = json['phoneNumber'];
// active = json['active'];
// role = json['role'];
// profilePictureUrl = json['profile_picture_url'];
// deviceId = json['deviceId'];
// verificationCode = json['verification_code'];
// isVerified = json['is_verified'];
// approved = json['approved'];
// blocked = json['blocked'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// password = json['password'];
// userSettings = json['userSettings'];
// modelId = json['modelId'];
// }
//
// FcmTokens? fcmTokens;
// LocationData? location;
// String? profileVideoUrl;
// String? id;
// String? userModelName;
// String? name;
// String? version;
// String? email;
// String? phoneNumber;
// bool? active;
// String? role;
// String? profilePictureUrl;
// String? deviceId;
// String? verificationCode;
// bool? isVerified;
// bool? approved;
// bool? blocked;
// String? createdAt;
// String? updatedAt;
// int? v;
// String? password;
// String? userSettings;
// String? modelId;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (fcmTokens != null) {
// map['fcm_tokens'] = fcmTokens?.toJson();
// }
// if (location != null) {
// map['location'] = location?.toJson();
// }
// map['profile_video_url'] = profileVideoUrl;
// map['_id'] = id;
// map['userModelName'] = userModelName;
// map['name'] = name;
// map['version'] = version;
// map['email'] = email;
// map['phoneNumber'] = phoneNumber;
// map['active'] = active;
// map['role'] = role;
// map['profile_picture_url'] = profilePictureUrl;
// map['deviceId'] = deviceId;
// map['verification_code'] = verificationCode;
// map['is_verified'] = isVerified;
// map['approved'] = approved;
// map['blocked'] = blocked;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// map['password'] = password;
// map['userSettings'] = userSettings;
// map['modelId'] = modelId;
// return map;
// }
// }
//
// // class Location {
// // Location({
// // this.type,
// // this.coordinates,});
// //
// // Location.fromJson(dynamic json) {
// // type = json['type'];
// // coordinates = json['coordinates'] != null ? json['coordinates'].cast<double>() : [];
// // }
// // String? type;
// // List<double>? coordinates;
// //
// // Map<String, dynamic> toJson() {
// // final map = <String, dynamic>{};
// // map['type'] = type;
// // map['coordinates'] = coordinates;
// // return map;
// // }
// //
// // }
//
// // class FcmTokens {
// // FcmTokens({
// // this.token,
// // this.deviceType,});
// //
// // FcmTokens.fromJson(dynamic json) {
// // token = json['token'];
// // deviceType = json['deviceType'];
// // }
// // String? token;
// // String? deviceType;
// //
// // Map<String, dynamic> toJson() {
// // final map = <String, dynamic>{};
// // map['token'] = token;
// // map['deviceType'] = deviceType;
// // return map;
// // }
// //
// // }
//
// // class User {
// // User({
// // this.fcmTokens,
// // this.location,
// // this.id,
// // this.userModelName,
// // this.name,
// // this.version,
// // this.email,
// // this.phoneNumber,
// // this.active,
// // this.role,
// // this.profilePictureUrl,
// // this.profileVideoUrl,
// // this.deviceId,
// // this.verificationCode,
// // this.isVerified,
// // this.approved,
// // this.blocked,
// // this.createdAt,
// // this.updatedAt,
// // this.v,
// // this.password,
// // this.userSettings,
// // this.modelId,});
// //
// // User.fromJson(dynamic json) {
// // fcmTokens = json['fcm_tokens'] != null ? FcmTokens.fromJson(json['fcm_tokens']) : null;
// // location = json['location'] != null ? LocationData.fromJson(json['location']) : null;
// // id = json['_id'];
// // userModelName = json['userModelName'];
// // name = json['name'];
// // version = json['version'];
// // email = json['email'];
// // phoneNumber = json['phoneNumber'];
// // active = json['active'];
// // role = json['role'];
// // profilePictureUrl = json['profile_picture_url'];
// // profileVideoUrl = json['profile_video_url'];
// // deviceId = json['deviceId'];
// // verificationCode = json['verification_code'];
// // isVerified = json['is_verified'];
// // approved = json['approved'];
// // blocked = json['blocked'];
// // createdAt = json['createdAt'];
// // updatedAt = json['updatedAt'];
// // v = json['__v'];
// // password = json['password'];
// // userSettings = json['userSettings'];
// // modelId = json['modelId'];
// // }
// // FcmTokens? fcmTokens;
// // LocationData? location;
// // String? id;
// // String? userModelName;
// // String? name;
// // String? version;
// // String? email;
// // String? phoneNumber;
// // bool? active;
// // String? role;
// // String? profilePictureUrl;
// // String? profileVideoUrl;
// // String? deviceId;
// // String? verificationCode;
// // bool? isVerified;
// // bool? approved;
// // bool? blocked;
// // String? createdAt;
// // String? updatedAt;
// // int? v;
// // String? password;
// // String? userSettings;
// // String? modelId;
// //
// // Map<String, dynamic> toJson() {
// // final map = <String, dynamic>{};
// // if (fcmTokens != null) {
// // map['fcm_tokens'] = fcmTokens?.toJson();
// // }
// // if (location != null) {
// // map['location'] = location?.toJson();
// // }
// // map['_id'] = id;
// // map['userModelName'] = userModelName;
// // map['name'] = name;
// // map['version'] = version;
// // map['email'] = email;
// // map['phoneNumber'] = phoneNumber;
// // map['active'] = active;
// // map['role'] = role;
// // map['profile_picture_url'] = profilePictureUrl;
// // map['profile_video_url'] = profileVideoUrl;
// // map['deviceId'] = deviceId;
// // map['verification_code'] = verificationCode;
// // map['is_verified'] = isVerified;
// // map['approved'] = approved;
// // map['blocked'] = blocked;
// // map['createdAt'] = createdAt;
// // map['updatedAt'] = updatedAt;
// // map['__v'] = v;
// // map['password'] = password;
// // map['userSettings'] = userSettings;
// // map['modelId'] = modelId;
// // return map;
// // }
// //
// // }
//
// class ContractedHours {
// ContractedHours({
// this.contractedHours,
// this.totalShiftHoursWeek,
// this.noOfShifts,
// });
//
// ContractedHours.fromJson(dynamic json) {
// contractedHours = json['contractedHours'];
// totalShiftHoursWeek = json['totalShiftHoursWeek'];
// noOfShifts = json['noOfShifts'];
// }
//
// int? contractedHours;
// int? totalShiftHoursWeek;
// int? noOfShifts;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['contractedHours'] = contractedHours;
// map['totalShiftHoursWeek'] = totalShiftHoursWeek;
// map['noOfShifts'] = noOfShifts;
// return map;
// }
// }

View File

@@ -0,0 +1,108 @@
import '../clients/service_users_model.dart';
import 'LocationData.dart';
class UserData {
UserData({
this.location,
this.id,
this.userModelName,
this.name,
this.version,
this.email,
this.phoneNumber,
this.active,
this.role,
this.profilePictureUrl,
this.profileVideoUrl,
this.deviceId,
this.verificationCode,
this.isVerified,
this.approved,
this.blocked,
this.createdAt,
this.updatedAt,
this.userSettings,
this.modelId,
});
UserData.fromJson(dynamic json) {
location = json['location'] is Map
? LocationData.fromJson(json['location'])
: null;
id = json['_id'];
userModelName = json['userModelName'];
name = json['name'];
version = json['version'];
email = json['email'];
phoneNumber = json['phoneNumber'];
active = json['active'];
role = json['role'];
profilePictureUrl = json['profile_picture_url'];
profileVideoUrl = json['profile_video_url'];
deviceId = json['deviceId'];
verificationCode = json['verification_code'];
isVerified = json['is_verified'];
approved = json['approved'];
blocked = json['blocked'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
userSettings = json['userSettings'] is String ? json['userSettings'] : null;
modelId = json['modelId'] is Map
? ServiceUserModel.fromJson(json['modelId'])
: null;
}
LocationData? location;
String? id;
String? userModelName;
String? name;
String? version;
String? email;
String? phoneNumber;
bool? active;
String? role;
String? profilePictureUrl;
String? profileVideoUrl;
String? deviceId;
String? verificationCode;
bool? isVerified;
bool? approved;
bool? blocked;
String? createdAt;
String? updatedAt;
String? userSettings;
ServiceUserModel? modelId;
String get displayName =>
(_fullName.trim().isNotEmpty) ? _fullName.trim() : (name ?? "");
String get _fullName =>
"${modelId?.suFirstMiddleName ?? ""} ${modelId?.suLastName ?? ""}";
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (location != null) {
map['location'] = location?.toJson();
}
map['_id'] = id;
map['userModelName'] = userModelName;
map['name'] = name;
map['version'] = version;
map['email'] = email;
map['phoneNumber'] = phoneNumber;
map['active'] = active;
map['role'] = role;
map['profile_picture_url'] = profilePictureUrl;
map['profile_video_url'] = profileVideoUrl;
map['deviceId'] = deviceId;
map['verification_code'] = verificationCode;
map['is_verified'] = isVerified;
map['approved'] = approved;
map['blocked'] = blocked;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
map['userSettings'] = userSettings;
map['modelId'] = modelId;
return map;
}
}

View File

@@ -0,0 +1,670 @@
import 'package:ftc_mobile_app/models/staffWorkload/StaffWorkloadResponse.dart';
import 'profileData/user_data.dart';
class ProfileDataModel {
ProfileDataModel({
this.statusCode,
this.statusDescription,
this.data,
});
ProfileDataModel.fromJson(dynamic json) {
statusCode = json['statusCode'];
statusDescription = json['statusDescription'];
data = json['data'] != null ? Data.fromJson(json['data']) : null;
}
int? statusCode;
String? statusDescription;
Data? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['statusCode'] = statusCode;
map['statusDescription'] = statusDescription;
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}
class Data {
Data({
this.staffMembers,
this.totalSupervisionsCount,
this.overdueSupervisionsCount,
this.assignedSupervisionsCount,
this.completedSupervisionsCount,
this.count,
this.offset,
this.limit,
});
Data.fromJson(dynamic json) {
if (json['staffMembers'] != null) {
staffMembers = [];
json['staffMembers'].forEach((v) {
staffMembers?.add(StaffMembers.fromJson(v));
});
}
totalSupervisionsCount = json['totalSupervisionsCount'];
overdueSupervisionsCount = json['overdueSupervisionsCount'];
assignedSupervisionsCount = json['assignedSupervisionsCount'];
completedSupervisionsCount = json['completedSupervisionsCount'];
count = json['count'];
offset = json['offset'];
limit = json['limit'];
}
List<StaffMembers>? staffMembers;
int? totalSupervisionsCount;
int? overdueSupervisionsCount;
int? assignedSupervisionsCount;
int? completedSupervisionsCount;
int? count;
int? offset;
int? limit;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (staffMembers != null) {
map['staffMembers'] = staffMembers?.map((v) => v.toJson()).toList();
}
map['totalSupervisionsCount'] = totalSupervisionsCount;
map['overdueSupervisionsCount'] = overdueSupervisionsCount;
map['assignedSupervisionsCount'] = assignedSupervisionsCount;
map['completedSupervisionsCount'] = completedSupervisionsCount;
map['count'] = count;
map['offset'] = offset;
map['limit'] = limit;
return map;
}
}
class StaffMembers {
StaffMembers({
this.contractedHours,
this.id,
this.staffMemberName,
this.staffDesignation,
this.staffOnLeave,
this.holidays,
this.complianceDocuments,
this.niNumber,
this.kin,
this.user,
this.managerId,
this.clients,
this.staffWorkLoads,
this.staffHolidayRequests,
this.staffTrainings,
this.supervision,
this.underSupervisions,
this.staffWorkingDays,
this.stafDob,
this.active,
this.covidCheck,
this.createdAt,
this.updatedAt,
this.staffDisciplinaries,
this.staffReferences,
this.remainingHolidayHours,
});
StaffMembers.fromJson(dynamic json) {
contractedHours = json['contractedHours'] != null
? ContractedHours.fromJson(json['contractedHours'])
: null;
id = json['_id'];
staffMemberName = json['staffMemberName'];
staffDesignation = json['staffDesignation'];
staffOnLeave = json['staffOnLeave'];
holidays = List.castFrom<dynamic, dynamic>(json['holidays'] ?? "");
complianceDocuments =
List.castFrom<dynamic, dynamic>(json['complianceDocuments'] ?? "");
niNumber = json['niNumber'];
kin = json['kin'];
user = json['user'] is Map ? UserData.fromJson(json['user']) : null;
managerId =
json['managerId'] is Map ? UserData.fromJson(json['managerId']) : null;
clients = List.castFrom<dynamic, dynamic>(json['clients']);
if (json['staffWorkLoads'] is List) {
staffWorkLoads = [];
json['staffWorkLoads'].forEach((v) {
if (v is Map) {
staffWorkLoads?.add(StaffWorkLoads.fromJson(v));
}
});
}
staffHolidayRequests =
List.castFrom<dynamic, dynamic>(json['staffHolidayRequests']);
staffTrainings = List.castFrom<dynamic, dynamic>(json['staffTrainings']);
supervision = json['supervision'] != null
? Supervision.fromJson(json['supervision'])
: null;
underSupervisions =
List.castFrom<dynamic, dynamic>(json['underSupervisions']);
staffWorkingDays =
List.castFrom<dynamic, dynamic>(json['staffWorkingDays']);
stafDob = json['stafDob'];
active = json['active'];
covidCheck = json['covidCheck'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
staffDisciplinaries = json['staffDisciplinaries'] is Map
? StaffDisciplinaries.fromJson(json['staffDisciplinaries'])
: null;
staffReferences = json['staffReferences'] is Map
? StaffReferences.fromJson(json['staffReferences'])
: null;
remainingHolidayHours = json['remainingHolidayHours'];
}
ContractedHours? contractedHours;
String? id;
String? staffMemberName;
String? staffDesignation;
bool? staffOnLeave;
List<dynamic>? holidays;
List<dynamic>? complianceDocuments;
String? niNumber;
String? kin;
UserData? user;
UserData? managerId;
List<dynamic>? clients;
List<StaffWorkLoads>? staffWorkLoads;
List<dynamic>? staffHolidayRequests;
List<dynamic>? staffTrainings;
Supervision? supervision;
List<dynamic>? underSupervisions;
List<dynamic>? staffWorkingDays;
String? stafDob;
bool? active;
bool? covidCheck;
String? createdAt;
String? updatedAt;
StaffDisciplinaries? staffDisciplinaries;
StaffReferences? staffReferences;
int? remainingHolidayHours;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (contractedHours != null) {
map['contractedHours'] = contractedHours?.toJson();
}
map['_id'] = id;
map['staffMemberName'] = staffMemberName;
map['staffDesignation'] = staffDesignation;
map['staffOnLeave'] = staffOnLeave;
if (holidays != null) {
map['holidays'] = holidays?.map((v) => v.toJson()).toList();
}
if (complianceDocuments != null) {
map['complianceDocuments'] =
complianceDocuments?.map((v) => v.toJson()).toList();
}
map['niNumber'] = niNumber;
map['kin'] = kin;
if (user != null) {
map['user'] = user?.toJson();
}
if (managerId != null) {
map['managerId'] = managerId?.toJson();
}
if (clients != null) {
map['clients'] = clients?.map((v) => v.toJson()).toList();
}
if (staffWorkLoads != null) {
map['staffWorkLoads'] = staffWorkLoads?.map((v) => v.toJson()).toList();
}
if (staffHolidayRequests != null) {
map['staffHolidayRequests'] =
staffHolidayRequests?.map((v) => v.toJson()).toList();
}
if (staffTrainings != null) {
map['staffTrainings'] = staffTrainings?.map((v) => v.toJson()).toList();
}
if (supervision != null) {
map['supervision'] = supervision?.toJson();
}
if (underSupervisions != null) {
map['underSupervisions'] =
underSupervisions?.map((v) => v.toJson()).toList();
}
if (staffWorkingDays != null) {
map['staffWorkingDays'] =
staffWorkingDays?.map((v) => v.toJson()).toList();
}
map['stafDob'] = stafDob;
map['active'] = active;
map['covidCheck'] = covidCheck;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
if (staffDisciplinaries != null) {
map['staffDisciplinaries'] = staffDisciplinaries?.toJson();
}
if (staffReferences != null) {
map['staffReferences'] = staffReferences?.toJson();
}
map['remainingHolidayHours'] = remainingHolidayHours;
return map;
}
}
class StaffReferences {
StaffReferences({
this.id,
this.docPaths,
this.comments,
this.staffMember,
this.active,
this.createdAt,
this.updatedAt,
this.v,
});
StaffReferences.empty();
StaffReferences.fromJson(dynamic json) {
id = json['_id'];
docPaths = List.castFrom<dynamic, dynamic>(json['docPaths']);
comments = List.castFrom<dynamic, dynamic>(json['comments']);
staffMember = json['staffMember'];
active = json['active'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
v = json['__v'];
}
String? id;
List<dynamic>? docPaths;
List<dynamic>? comments;
String? staffMember;
bool? active;
String? createdAt;
String? updatedAt;
int? v;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
if (docPaths != null) {
map['docPaths'] = docPaths?.map((v) => v.toJson()).toList();
}
if (comments != null) {
map['comments'] = comments?.map((v) => v.toJson()).toList();
}
map['staffMember'] = staffMember;
map['active'] = active;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
map['__v'] = v;
return map;
}
}
class StaffDisciplinaries {
StaffDisciplinaries({
this.id,
this.docPaths,
this.comments,
this.staffMember,
this.active,
this.createdAt,
this.updatedAt,
this.v,
});
StaffDisciplinaries.empty();
StaffDisciplinaries.fromJson(dynamic json) {
id = json['_id'];
docPaths = List.castFrom<dynamic, dynamic>(json['docPaths']);
comments = List.castFrom<dynamic, dynamic>(json['comments']);
staffMember = json['staffMember'];
active = json['active'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
v = json['__v'];
}
String? id;
List<dynamic>? docPaths;
List<dynamic>? comments;
String? staffMember;
bool? active;
String? createdAt;
String? updatedAt;
int? v;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
if (docPaths != null) {
map['docPaths'] = docPaths?.map((v) => v.toJson()).toList();
}
if (comments != null) {
map['comments'] = comments?.map((v) => v.toJson()).toList();
}
map['staffMember'] = staffMember;
map['active'] = active;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
map['__v'] = v;
return map;
}
}
class Supervision {
Supervision({
this.supervisionName,
this.sprDueDate,
this.sprStatus,
this.sprResult,
this.templateTitleId,
});
Supervision.fromJson(dynamic json) {
supervisionName = json['supervisionName'];
sprDueDate = json['sprDueDate'];
sprStatus = json['sprStatus'];
sprResult = json['sprResult'];
templateTitleId = json['templateTitleId'];
}
String? supervisionName;
String? sprDueDate;
String? sprStatus;
String? sprResult;
String? templateTitleId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['supervisionName'] = supervisionName;
map['sprDueDate'] = sprDueDate;
map['sprStatus'] = sprStatus;
map['sprResult'] = sprResult;
map['templateTitleId'] = templateTitleId;
return map;
}
}
// class StaffWorkLoads {
// StaffWorkLoads({
// this.holidayEntitlement,
// this.id,
// this.isCurrentWrkLd,
// this.startDate,
// this.endDate,
// this.holidayAlwnNoOfDys,
// this.holidayAlwnNoOfHours,
// this.holidaysAvailed,
// this.holidaysRemaining,
// this.staffMember,
// this.carriedOverHours,
// this.active,
// this.createdAt,
// this.updatedAt,
// this.v,});
//
// StaffWorkLoads.fromJson(dynamic json) {
// holidayEntitlement = json['holidayEntitlement'] != null ? HolidayEntitlement.fromJson(json['holidayEntitlement']) : null;
// id = json['_id'];
// isCurrentWrkLd = json['isCurrentWrkLd'];
// startDate = json['startDate'];
// endDate = json['endDate'];
// holidayAlwnNoOfDys = json['holidayAlwnNoOfDys'];
// holidayAlwnNoOfHours = json['holidayAlwnNoOfHours'];
// holidaysAvailed = json['holidaysAvailed'];
// holidaysRemaining = json['holidaysRemaining'];
// staffMember = json['staffMember'];
// carriedOverHours = json['carriedOverHours'];
// active = json['active'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// }
// HolidayEntitlement? holidayEntitlement;
// String? id;
// bool? isCurrentWrkLd;
// String? startDate;
// String? endDate;
// int? holidayAlwnNoOfDys;
// int? holidayAlwnNoOfHours;
// int? holidaysAvailed;
// int? holidaysRemaining;
// String? staffMember;
// int? carriedOverHours;
// bool? active;
// String? createdAt;
// String? updatedAt;
// int? v;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (holidayEntitlement != null) {
// map['holidayEntitlement'] = holidayEntitlement?.toJson();
// }
// map['_id'] = id;
// map['isCurrentWrkLd'] = isCurrentWrkLd;
// map['startDate'] = startDate;
// map['endDate'] = endDate;
// map['holidayAlwnNoOfDys'] = holidayAlwnNoOfDys;
// map['holidayAlwnNoOfHours'] = holidayAlwnNoOfHours;
// map['holidaysAvailed'] = holidaysAvailed;
// map['holidaysRemaining'] = holidaysRemaining;
// map['staffMember'] = staffMember;
// map['carriedOverHours'] = carriedOverHours;
// map['active'] = active;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// return map;
// }
//
// }
//
// class HolidayEntitlement {
// HolidayEntitlement({
// this.numberOfDays,
// this.numberOfHours,
// this.numberOfWeeks,});
//
// HolidayEntitlement.fromJson(dynamic json) {
// numberOfDays = json['numberOfDays'];
// numberOfHours = json['numberOfHours'];
// numberOfWeeks = json['numberOfWeeks'];
// }
// int? numberOfDays;
// int? numberOfHours;
// int? numberOfWeeks;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['numberOfDays'] = numberOfDays;
// map['numberOfHours'] = numberOfHours;
// map['numberOfWeeks'] = numberOfWeeks;
// return map;
// }
//
// }
// class ManagerId {
// ManagerId({
// this.fcmTokens,
// this.location,
// this.profileVideoUrl,
// this.id,
// this.userModelName,
// this.name,
// this.version,
// this.email,
// this.phoneNumber,
// this.active,
// this.role,
// this.profilePictureUrl,
// this.deviceId,
// this.verificationCode,
// this.isVerified,
// this.approved,
// this.blocked,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.password,
// this.userSettings,
// this.modelId,});
//
// ManagerId.fromJson(dynamic json) {
// fcmTokens = json['fcm_tokens'] != null ? FcmTokens.fromJson(json['fcm_tokens']) : null;
// location = json['location'] != null ? LocationData.fromJson(json['location']) : null;
// profileVideoUrl = json['profile_video_url'];
// id = json['_id'];
// userModelName = json['userModelName'];
// name = json['name'];
// version = json['version'];
// email = json['email'];
// phoneNumber = json['phoneNumber'];
// active = json['active'];
// role = json['role'];
// profilePictureUrl = json['profile_picture_url'];
// deviceId = json['deviceId'];
// verificationCode = json['verification_code'];
// isVerified = json['is_verified'];
// approved = json['approved'];
// blocked = json['blocked'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// password = json['password'];
// userSettings = json['userSettings'];
// modelId = json['modelId'];
// }
// FcmTokens? fcmTokens;
// LocationData? location;
// String? profileVideoUrl;
// String? id;
// String? userModelName;
// String? name;
// String? version;
// String? email;
// String? phoneNumber;
// bool? active;
// String? role;
// String? profilePictureUrl;
// String? deviceId;
// String? verificationCode;
// bool? isVerified;
// bool? approved;
// bool? blocked;
// String? createdAt;
// String? updatedAt;
// int? v;
// String? password;
// String? userSettings;
// String? modelId;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (fcmTokens != null) {
// map['fcm_tokens'] = fcmTokens?.toJson();
// }
// if (location != null) {
// map['location'] = location?.toJson();
// }
// map['profile_video_url'] = profileVideoUrl;
// map['_id'] = id;
// map['userModelName'] = userModelName;
// map['name'] = name;
// map['version'] = version;
// map['email'] = email;
// map['phoneNumber'] = phoneNumber;
// map['active'] = active;
// map['role'] = role;
// map['profile_picture_url'] = profilePictureUrl;
// map['deviceId'] = deviceId;
// map['verification_code'] = verificationCode;
// map['is_verified'] = isVerified;
// map['approved'] = approved;
// map['blocked'] = blocked;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// map['password'] = password;
// map['userSettings'] = userSettings;
// map['modelId'] = modelId;
// return map;
// }
//
// }
// class Location {
// Location({
// this.type,
// this.coordinates,});
//
// Location.fromJson(dynamic json) {
// type = json['type'];
// coordinates = json['coordinates'] != null ? json['coordinates'].cast<double>() : [];
// }
// String? type;
// List<double>? coordinates;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['type'] = type;
// map['coordinates'] = coordinates;
// return map;
// }
//
// }
// class FcmTokens {
// FcmTokens({
// this.token,
// this.deviceType,});
//
// FcmTokens.fromJson(dynamic json) {
// token = json['token'];
// deviceType = json['deviceType'];
// }
// String? token;
// String? deviceType;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['token'] = token;
// map['deviceType'] = deviceType;
// return map;
// }
//
// }
class ContractedHours {
ContractedHours({
this.contractedHours,
this.totalShiftHoursWeek,
this.noOfShifts,
});
ContractedHours.fromJson(dynamic json) {
contractedHours = json['contractedHours'];
totalShiftHoursWeek = json['totalShiftHoursWeek'];
noOfShifts = json['noOfShifts'];
}
int? contractedHours;
int? totalShiftHoursWeek;
int? noOfShifts;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['contractedHours'] = contractedHours;
map['totalShiftHoursWeek'] = totalShiftHoursWeek;
map['noOfShifts'] = noOfShifts;
return map;
}
}

View File

@@ -0,0 +1,41 @@
class HolidayRequestData {
HolidayRequestData({
this.hldRqStartDate,
this.hldRqEndDate,
this.hldRqTotalDays,
this.hldRqTotalHours,
this.hldRqStatus,
this.hldRequestType,
this.staffRequester,
});
HolidayRequestData.fromJson(dynamic json) {
hldRqStartDate = json['hldRqStartDate'];
hldRqEndDate = json['hldRqEndDate'];
hldRqTotalDays = json['hldRqTotalDays'];
hldRqTotalHours = json['hldRqTotalHours'];
hldRqStatus = json['hldRqStatus'];
hldRequestType = json['hldRequestType'];
staffRequester = json['staffRequester'];
}
int? hldRqStartDate;
int? hldRqEndDate;
int? hldRqTotalDays;
int? hldRqTotalHours;
String? hldRqStatus;
String? hldRequestType;
String? staffRequester;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['hldRqStartDate'] = hldRqStartDate;
map['hldRqEndDate'] = hldRqEndDate;
map['hldRqTotalDays'] = hldRqTotalDays;
map['hldRqTotalHours'] = hldRqTotalHours;
map['hldRqStatus'] = hldRqStatus;
map['hldRequestType'] = hldRequestType;
map['staffRequester'] = staffRequester;
return map;
}
}

View File

@@ -0,0 +1,39 @@
class ResponseModel{
int statusCode = -1;
String statusDescription = "";
dynamic data ="";
String userToken = "";
Map<String,String> header = {};
ResponseModel();
ResponseModel.named({
required this.statusCode,
required this.statusDescription,
this.data,
});
ResponseModel.fromJson(Map<String, dynamic> json, {this.statusCode = 0}) {
statusDescription = json["message"]??"";
data = json["data"] ?? json;
userToken = json["token"] ?? "";
}
ResponseModel.errorFromJson(Map<String, dynamic> json,{this.statusCode = 0}){
statusDescription = json['error'] ?? '';
data = json["data"] ?? json;
}
Map<String, dynamic> toJson() {
return {
'statusCode': statusCode,
'statusDescription': statusDescription,
'data': data,
};
}
@override
String toString() {
return 'ResponseModel{statusCode: $statusCode, statusDescription: $statusDescription, data: $data, userToken: $userToken, header: $header}';
}
}

62
lib/models/rota/Days.dart Normal file
View File

@@ -0,0 +1,62 @@
import '../profileData/user_data.dart';
class Days {
Days({
this.day,
this.shiftStartTime,
this.shiftEndTime,
this.workHrs,
this.patientId,
this.isSleepOver,
this.isOverNightStay,
this.addedby,
this.note,
this.id,
this.templateId,
});
Days.fromJson(dynamic json) {
day = json['day'];
shiftStartTime = json['shiftStartTime'];
shiftEndTime = json['shiftEndTime'];
workHrs = json['workHrs'];
patientId =
json['patientId'] != null ? UserData.fromJson(json['patientId']) : null;
isSleepOver = json['isSleepOver'];
isOverNightStay = json['isOverNightStay'];
addedby = json['addedby'];
note = json['note'];
id = json['_id'];
templateId = json['templateId'];
}
String? day;
int? shiftStartTime;
int? shiftEndTime;
String? workHrs;
UserData? patientId;
bool? isSleepOver;
bool? isOverNightStay;
String? addedby;
String? note;
String? id;
String? templateId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['day'] = day;
map['shiftStartTime'] = shiftStartTime;
map['shiftEndTime'] = shiftEndTime;
map['workHrs'] = workHrs;
if (patientId != null) {
map['patientId'] = patientId?.toJson();
}
map['isSleepOver'] = isSleepOver;
map['isOverNightStay'] = isOverNightStay;
map['addedby'] = addedby;
map['note'] = note;
map['_id'] = id;
map['templateId'] = templateId;
return map;
}
}

View File

@@ -0,0 +1,32 @@
class Diagnosises {
Diagnosises({
this.diagnosisText,
this.diagnosisDate,
this.diagnosisBy,
this.isCurrentDiagnosis,
this.id,});
Diagnosises.fromJson(dynamic json) {
diagnosisText = json['diagnosisText'];
diagnosisDate = json['diagnosisDate'];
diagnosisBy = json['diagnosisBy'];
isCurrentDiagnosis = json['isCurrentDiagnosis'];
id = json['_id'];
}
String? diagnosisText;
String? diagnosisDate;
String? diagnosisBy;
bool? isCurrentDiagnosis;
String? id;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['diagnosisText'] = diagnosisText;
map['diagnosisDate'] = diagnosisDate;
map['diagnosisBy'] = diagnosisBy;
map['isCurrentDiagnosis'] = isCurrentDiagnosis;
map['_id'] = id;
return map;
}
}

View File

@@ -0,0 +1,27 @@
import 'WeekArrayData.dart';
class LiveRoasterResponseData {
LiveRoasterResponseData({
this.daysArray,
});
LiveRoasterResponseData.fromJson(dynamic json) {
if (json['data'] != null && json['data'] is List) {
daysArray = [];
json['data'].forEach((v) {
daysArray?.add(DaysArrayData.fromJson(v));
});
}
}
// List<LiveRoster>? liveRoster;
List<DaysArrayData>? daysArray;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (daysArray != null) {
map['data'] = daysArray?.map((v) => v.toJson()).toList();
}
return map;
}
}

View File

@@ -0,0 +1,65 @@
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;
}
}

View File

@@ -0,0 +1,28 @@
import 'LiveRoasterResponseData.dart';
class LiveRoasterResponse {
LiveRoasterResponse({
this.status,
this.message,
this.data,});
LiveRoasterResponse.fromJson(dynamic json) {
status = json['status'];
message = json['message'];
data = json['data'] != null ? LiveRoasterResponseData.fromJson(json['data']) : null;
}
String? status;
String? message;
LiveRoasterResponseData? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['status'] = status;
map['message'] = message;
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}

View File

@@ -0,0 +1,113 @@
import 'package:ftc_mobile_app/models/profile_screen_model.dart';
import '../profileData/user_data.dart';
import 'LiveRoster.dart';
import 'Days.dart';
import 'StaffHolidays.dart';
class ShiftArray {
ShiftArray({
this.liveRoster,
this.staffHolidays,
this.staffUserId,
this.primaryWeek1EndDate,
this.primaryWeek2EndDate,
this.primaryWeek3EndDate,
this.rosterEndDate,
this.shiftStartTime,
this.shiftEndTime,
this.workHrs,
this.patientId,
this.secondaryWeeks,
this.primaryWeekNo,
this.noOfShifts,
this.addedby,
this.active,
this.isDelete,
this.days,
this.id,
this.templateId,});
ShiftArray.fromJson(dynamic json) {
liveRoster = json['liveRoster'] != null ? LiveRoster.fromJson(json['liveRoster']) : null;
staffHolidays = json['staffHolidays'] != null ? StaffHolidays.fromJson(json['staffHolidays']) : null;
staffUserId = json['staffUserId'] != null ? StaffMembers.fromJson(json['staffUserId']) : null;
primaryWeek1EndDate = json['primaryWeek1EndDate'];
primaryWeek2EndDate = json['primaryWeek2EndDate'];
primaryWeek3EndDate = json['primaryWeek3EndDate'];
rosterEndDate = json['rosterEndDate'];
shiftStartTime = json['shiftStartTime'];
shiftEndTime = json['shiftEndTime'];
workHrs = json['workHrs'];
patientId = json['patientId'] != null ? UserData.fromJson(json['patientId']) : null;
secondaryWeeks = json['secondaryWeeks'] != null ? json['secondaryWeeks'].cast<String>() : [];
primaryWeekNo = json['primaryWeekNo'];
noOfShifts = json['noOfShifts'];
addedby = json['addedby'];
active = json['active'];
isDelete = json['isDelete'];
if (json['days'] != null) {
days = [];
json['days'].forEach((v) {
days?.add(Days.fromJson(v));
});
}
id = json['_id'];
templateId = json['templateId'];
}
LiveRoster? liveRoster;
StaffHolidays? staffHolidays;
StaffMembers? staffUserId;
int? primaryWeek1EndDate;
int? primaryWeek2EndDate;
int? primaryWeek3EndDate;
int? rosterEndDate;
int? shiftStartTime;
int? shiftEndTime;
int? workHrs;
UserData? patientId;
List<String>? secondaryWeeks;
int? primaryWeekNo;
int? noOfShifts;
String? addedby;
bool? active;
bool? isDelete;
List<Days>? days;
String? id;
String? templateId;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (liveRoster != null) {
map['liveRoster'] = liveRoster?.toJson();
}
if (staffHolidays != null) {
map['staffHolidays'] = staffHolidays?.toJson();
}
if (staffUserId != null) {
map['staffUserId'] = staffUserId?.toJson();
}
map['primaryWeek1EndDate'] = primaryWeek1EndDate;
map['primaryWeek2EndDate'] = primaryWeek2EndDate;
map['primaryWeek3EndDate'] = primaryWeek3EndDate;
map['rosterEndDate'] = rosterEndDate;
map['shiftStartTime'] = shiftStartTime;
map['shiftEndTime'] = shiftEndTime;
map['workHrs'] = workHrs;
if (patientId != null) {
map['patientId'] = patientId?.toJson();
}
map['secondaryWeeks'] = secondaryWeeks;
map['primaryWeekNo'] = primaryWeekNo;
map['noOfShifts'] = noOfShifts;
map['addedby'] = addedby;
map['active'] = active;
map['isDelete'] = isDelete;
if (days != null) {
map['days'] = days?.map((v) => v.toJson()).toList();
}
map['_id'] = id;
map['templateId'] = templateId;
return map;
}
}

View File

@@ -0,0 +1,33 @@
import 'WeekArrayData.dart';
class ShiftLocation {
ShiftLocation({
this.locationId,
this.weekArray,
this.id,});
ShiftLocation.fromJson(dynamic json) {
locationId = json['locationId'];
if (json['weekArray'] != null && json['weekArray'] is List) {
weekArray = [];
json['weekArray'].forEach((v) {
weekArray?.add(WeekArrayData.fromJson(v));
});
}
id = json['_id'];
}
String? locationId;
List<WeekArrayData>? weekArray;
String? id;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['locationId'] = locationId;
if (weekArray != null) {
map['weekArray'] = weekArray?.map((v) => v.toJson()).toList();
}
map['_id'] = id;
return map;
}
}

View File

@@ -0,0 +1,36 @@
class ShiftLocationData {
ShiftLocationData({
this.id,
this.shiftLocationName,
this.addedby,
this.active,
this.createdAt,
this.updatedAt,});
ShiftLocationData.fromJson(dynamic json) {
id = json['_id'];
shiftLocationName = json['shiftLocationName'];
addedby = json['addedby'];
active = json['active'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
}
String? id;
String? shiftLocationName;
String? addedby;
bool? active;
String? createdAt;
String? updatedAt;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
map['shiftLocationName'] = shiftLocationName;
map['addedby'] = addedby;
map['active'] = active;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
return map;
}
}

View File

@@ -0,0 +1,27 @@
class StaffHolidays {
StaffHolidays({
this.isStaffHolidays,
this.calculatedDates,});
StaffHolidays.fromJson(dynamic json) {
isStaffHolidays = json['isStaffHolidays'];
// if (json['calculatedDates'] != null) {
// calculatedDates = [];
// json['calculatedDates'].forEach((v) {
// calculatedDates?.add(Dynamic.fromJson(v));
// });
// }
}
bool? isStaffHolidays;
List<dynamic>? calculatedDates;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['isStaffHolidays'] = isStaffHolidays;
if (calculatedDates != null) {
map['calculatedDates'] = calculatedDates?.map((v) => v.toJson()).toList();
}
return map;
}
}

View File

@@ -0,0 +1,838 @@
import 'package:flutter/material.dart';
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
import 'package:ftc_mobile_app/models/profile_screen_model.dart';
import 'package:ftc_mobile_app/utilities/date_formatter.dart';
import 'ShiftLocationData.dart';
class WeekArrayData {
WeekArrayData({
this.weekNo,
this.daysArray,
this.id,
});
WeekArrayData.fromJson(dynamic json) {
weekNo = json['weekNo'];
if (json['daysArray'] != null) {
daysArray = [];
json['daysArray'].forEach((v) {
daysArray?.add(DaysArrayData.fromJson(v));
});
}
id = json['_id'];
}
int? weekNo;
List<DaysArrayData>? daysArray;
String? id;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['weekNo'] = weekNo;
if (daysArray != null) {
map['daysArray'] = daysArray?.map((v) => v.toJson()).toList();
}
map['_id'] = id;
return map;
}
}
class DaysArrayData {
DaysArrayData({
this.dayName,
this.staffAssigned,
this.serviceUserAssigned,
this.staffUserId,
this.shiftDate,
this.shiftStartTime,
this.shiftEndTime,
this.workHrs,
this.note,
this.serviceUserId,
this.isSleepOver,
this.isOverNightStay,
this.lastModifiedBy,
this.active,
this.isDelete,
this.locationId,
this.rosterId,
this.isRequested,
this.id,
});
DaysArrayData.fromJson(dynamic json) {
dayName = json['dayName'];
staffAssigned = json['staffAssigned'];
serviceUserAssigned = json['serviceUserAssigned'];
staffUserId = json['staffUserId'] != null
? StaffMembers.fromJson(json['staffUserId'])
: null;
shiftDate = json['shiftDate'];
shiftStartTime = json['shiftStartTime'];
shiftEndTime = json['shiftEndTime'];
workHrs = json['workHrs'];
note = json['note'];
serviceUserId = json['serviceUserId'] != null
? UserData.fromJson(json['serviceUserId'])
: null;
locationId = json['locationId'] is Map
? ShiftLocationData.fromJson(json['locationId'])
: null;
isSleepOver = json['isSleepOver'];
isOverNightStay = json['isOverNightStay'];
lastModifiedBy = json['lastModifiedBy'];
active = json['active'];
isDelete = json['isDelete'];
rosterId = json['rosterId'];
isRequested = json['isRequested'];
id = json['_id'];
if (shiftDate != null) {
shiftDateTime = DateTime.fromMillisecondsSinceEpoch(shiftDate!).toLocal();
}
final f = DateFormatter();
startTime = f.time24to12format(time: shiftStartTime ?? "");
endTime = f.time24to12format(time: shiftEndTime ?? "");
}
String? dayName;
bool? staffAssigned;
bool? serviceUserAssigned;
StaffMembers? staffUserId;
int? shiftDate;
String? shiftStartTime;
String? shiftEndTime;
int? workHrs;
String? note;
UserData? serviceUserId;
bool? isSleepOver;
bool? isOverNightStay;
String? lastModifiedBy;
bool? active;
bool? isDelete;
String? rosterId;
bool? isRequested;
String? id;
ShiftLocationData? locationId;
// local usage vars
DateTime? shiftDateTime;
///stores 12hour format of [shiftStartTime] and [shiftEndTime]
TimeOfDay? startTime, endTime;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['dayName'] = dayName;
map['staffAssigned'] = staffAssigned;
map['serviceUserAssigned'] = serviceUserAssigned;
if (staffUserId != null) {
map['staffUserId'] = staffUserId?.toJson();
}
map['shiftDate'] = shiftDate;
map['shiftStartTime'] = shiftStartTime;
map['shiftEndTime'] = shiftEndTime;
map['workHrs'] = workHrs;
map['note'] = note;
if (serviceUserId != null) {
map['serviceUserId'] = serviceUserId?.toJson();
}
if (locationId != null) {
map['locationId'] = locationId?.toJson();
}
map['isSleepOver'] = isSleepOver;
map['isOverNightStay'] = isOverNightStay;
map['lastModifiedBy'] = lastModifiedBy;
map['active'] = active;
map['isDelete'] = isDelete;
map['rosterId'] = rosterId;
map['isRequested'] = isRequested;
map['_id'] = id;
return map;
}
}
// class ServiceUserId {
// ServiceUserId({
// this.fcmTokens,
// this.location,
// this.profileVideoUrl,
// this.id,
// this.userModelName,
// this.name,
// this.version,
// this.email,
// this.phoneNumber,
// this.active,
// this.role,
// this.profilePictureUrl,
// this.deviceId,
// this.verificationCode,
// this.isVerified,
// this.approved,
// this.blocked,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.password,
// this.userSettings,
// this.modelId,});
//
// ServiceUserId.fromJson(dynamic json) {
// fcmTokens = json['fcm_tokens'] != null ? FcmTokens.fromJson(json['fcm_tokens']) : null;
// location = json['location'] != null ? Location.fromJson(json['location']) : null;
// profileVideoUrl = json['profile_video_url'];
// id = json['_id'];
// userModelName = json['userModelName'];
// name = json['name'];
// version = json['version'];
// email = json['email'];
// phoneNumber = json['phoneNumber'];
// active = json['active'];
// role = json['role'];
// profilePictureUrl = json['profile_picture_url'];
// deviceId = json['deviceId'];
// verificationCode = json['verification_code'];
// isVerified = json['is_verified'];
// approved = json['approved'];
// blocked = json['blocked'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// password = json['password'];
// userSettings = json['userSettings'];
// modelId = json['modelId'] != null ? ModelId.fromJson(json['modelId']) : null;
// }
// FcmTokens? fcmTokens;
// Location? location;
// String? profileVideoUrl;
// String? id;
// String? userModelName;
// String? name;
// String? version;
// String? email;
// String? phoneNumber;
// bool? active;
// String? role;
// String? profilePictureUrl;
// String? deviceId;
// String? verificationCode;
// bool? isVerified;
// bool? approved;
// bool? blocked;
// String? createdAt;
// String? updatedAt;
// int? v;
// String? password;
// String? userSettings;
// ModelId? modelId;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (fcmTokens != null) {
// map['fcm_tokens'] = fcmTokens?.toJson();
// }
// if (location != null) {
// map['location'] = location?.toJson();
// }
// map['profile_video_url'] = profileVideoUrl;
// map['_id'] = id;
// map['userModelName'] = userModelName;
// map['name'] = name;
// map['version'] = version;
// map['email'] = email;
// map['phoneNumber'] = phoneNumber;
// map['active'] = active;
// map['role'] = role;
// map['profile_picture_url'] = profilePictureUrl;
// map['deviceId'] = deviceId;
// map['verification_code'] = verificationCode;
// map['is_verified'] = isVerified;
// map['approved'] = approved;
// map['blocked'] = blocked;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// map['password'] = password;
// map['userSettings'] = userSettings;
// if (modelId != null) {
// map['modelId'] = modelId?.toJson();
// }
// return map;
// }
//
// }
//
// class ModelId {
// ModelId({
// this.aboutPatient,
// this.id,
// this.suLastName,
// this.suFirstMiddleName,
// this.suPreferredName,
// this.name,
// this.suSsn,
// this.providerName,
// this.suSex,
// this.suTitle,
// this.suDOB,
// this.suAge,
// this.suReferredBY,
// this.suFamilyHead,
// this.suAddress1,
// this.suAddress2,
// this.suCity,
// this.suState,
// this.suZip,
// this.suFirstVisitDate,
// this.suLastVisitDate,
// this.suProvider,
// this.currSU,
// this.suHomePhone,
// this.suWorkPhone,
// this.suMobileHomeNo,
// this.suMobileWorkNo,
// this.suEmailHome,
// this.suEmailWork,
// this.suPrefHomeNo,
// this.suPrefWorkNo,
// this.suEmergencyContact,
// this.seMedicalAlert,
// this.suNote,
// this.diagnosises,
// this.user,
// this.shifts,
// this.serviceUserMedications,
// this.homeVisitSignOut,
// this.srUsShiftsRequired,
// this.suEnquiries,
// this.active,
// this.createdAt,
// this.updatedAt,
// this.v,});
//
// ModelId.fromJson(dynamic json) {
// aboutPatient = json['aboutPatient'] != null ? AboutPatient.fromJson(json['aboutPatient']) : null;
// id = json['_id'];
// suLastName = json['suLastName'];
// suFirstMiddleName = json['suFirstMiddleName'];
// suPreferredName = json['suPreferredName'];
// name = json['name'];
// suSsn = json['suSsn'];
// providerName = json['providerName'];
// suSex = json['suSex'];
// suTitle = json['suTitle'];
// suDOB = json['suDOB'];
// suAge = json['suAge'];
// suReferredBY = json['suReferredBY'];
// suFamilyHead = json['suFamilyHead'];
// suAddress1 = json['suAddress1'];
// suAddress2 = json['suAddress2'];
// suCity = json['suCity'];
// suState = json['suState'];
// suZip = json['suZip'];
// suFirstVisitDate = json['suFirstVisitDate'];
// suLastVisitDate = json['suLastVisitDate'];
// if (json['suProvider'] != null) {
// suProvider = [];
// json['suProvider'].forEach((v) {
// suProvider?.add(Dynamic.fromJson(v));
// });
// }
// currSU = json['currSU'];
// suHomePhone = json['suHomePhone'];
// suWorkPhone = json['suWorkPhone'];
// suMobileHomeNo = json['suMobileHomeNo'];
// suMobileWorkNo = json['suMobileWorkNo'];
// suEmailHome = json['suEmailHome'];
// suEmailWork = json['suEmailWork'];
// suPrefHomeNo = json['suPrefHomeNo'];
// suPrefWorkNo = json['suPrefWorkNo'];
// suEmergencyContact = json['suEmergencyContact'];
// seMedicalAlert = json['seMedicalAlert'];
// suNote = json['suNote'];
// if (json['diagnosises'] != null) {
// diagnosises = [];
// json['diagnosises'].forEach((v) {
// diagnosises?.add(Diagnosises.fromJson(v));
// });
// }
// user = json['user'];
// if (json['shifts'] != null) {
// shifts = [];
// json['shifts'].forEach((v) {
// shifts?.add(Dynamic.fromJson(v));
// });
// }
// if (json['serviceUserMedications'] != null) {
// serviceUserMedications = [];
// json['serviceUserMedications'].forEach((v) {
// serviceUserMedications?.add(Dynamic.fromJson(v));
// });
// }
// if (json['homeVisitSignOut'] != null) {
// homeVisitSignOut = [];
// json['homeVisitSignOut'].forEach((v) {
// homeVisitSignOut?.add(Dynamic.fromJson(v));
// });
// }
// if (json['srUsShiftsRequired'] != null) {
// srUsShiftsRequired = [];
// json['srUsShiftsRequired'].forEach((v) {
// srUsShiftsRequired?.add(Dynamic.fromJson(v));
// });
// }
// if (json['suEnquiries'] != null) {
// suEnquiries = [];
// json['suEnquiries'].forEach((v) {
// suEnquiries?.add(Dynamic.fromJson(v));
// });
// }
// active = json['active'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// }
// AboutPatient? aboutPatient;
// String? id;
// String? suLastName;
// String? suFirstMiddleName;
// String? suPreferredName;
// String? name;
// String? suSsn;
// String? providerName;
// String? suSex;
// String? suTitle;
// String? suDOB;
// String? suAge;
// String? suReferredBY;
// String? suFamilyHead;
// String? suAddress1;
// String? suAddress2;
// String? suCity;
// String? suState;
// String? suZip;
// String? suFirstVisitDate;
// String? suLastVisitDate;
// List<dynamic>? suProvider;
// bool? currSU;
// String? suHomePhone;
// String? suWorkPhone;
// String? suMobileHomeNo;
// String? suMobileWorkNo;
// String? suEmailHome;
// String? suEmailWork;
// String? suPrefHomeNo;
// String? suPrefWorkNo;
// String? suEmergencyContact;
// String? seMedicalAlert;
// String? suNote;
// List<Diagnosises>? diagnosises;
// String? user;
// List<dynamic>? shifts;
// List<dynamic>? serviceUserMedications;
// List<dynamic>? homeVisitSignOut;
// List<dynamic>? srUsShiftsRequired;
// List<dynamic>? suEnquiries;
// bool? active;
// String? createdAt;
// String? updatedAt;
// int? v;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (aboutPatient != null) {
// map['aboutPatient'] = aboutPatient?.toJson();
// }
// map['_id'] = id;
// map['suLastName'] = suLastName;
// map['suFirstMiddleName'] = suFirstMiddleName;
// map['suPreferredName'] = suPreferredName;
// map['name'] = name;
// map['suSsn'] = suSsn;
// map['providerName'] = providerName;
// map['suSex'] = suSex;
// map['suTitle'] = suTitle;
// map['suDOB'] = suDOB;
// map['suAge'] = suAge;
// map['suReferredBY'] = suReferredBY;
// map['suFamilyHead'] = suFamilyHead;
// map['suAddress1'] = suAddress1;
// map['suAddress2'] = suAddress2;
// map['suCity'] = suCity;
// map['suState'] = suState;
// map['suZip'] = suZip;
// map['suFirstVisitDate'] = suFirstVisitDate;
// map['suLastVisitDate'] = suLastVisitDate;
// if (suProvider != null) {
// map['suProvider'] = suProvider?.map((v) => v.toJson()).toList();
// }
// map['currSU'] = currSU;
// map['suHomePhone'] = suHomePhone;
// map['suWorkPhone'] = suWorkPhone;
// map['suMobileHomeNo'] = suMobileHomeNo;
// map['suMobileWorkNo'] = suMobileWorkNo;
// map['suEmailHome'] = suEmailHome;
// map['suEmailWork'] = suEmailWork;
// map['suPrefHomeNo'] = suPrefHomeNo;
// map['suPrefWorkNo'] = suPrefWorkNo;
// map['suEmergencyContact'] = suEmergencyContact;
// map['seMedicalAlert'] = seMedicalAlert;
// map['suNote'] = suNote;
// if (diagnosises != null) {
// map['diagnosises'] = diagnosises?.map((v) => v.toJson()).toList();
// }
// map['user'] = user;
// if (shifts != null) {
// map['shifts'] = shifts?.map((v) => v.toJson()).toList();
// }
// if (serviceUserMedications != null) {
// map['serviceUserMedications'] = serviceUserMedications?.map((v) => v.toJson()).toList();
// }
// if (homeVisitSignOut != null) {
// map['homeVisitSignOut'] = homeVisitSignOut?.map((v) => v.toJson()).toList();
// }
// if (srUsShiftsRequired != null) {
// map['srUsShiftsRequired'] = srUsShiftsRequired?.map((v) => v.toJson()).toList();
// }
// if (suEnquiries != null) {
// map['suEnquiries'] = suEnquiries?.map((v) => v.toJson()).toList();
// }
// map['active'] = active;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// return map;
// }
//
// }
//
// class Diagnosises {
// Diagnosises({
// this.diagnosisText,
// this.diagnosisDate,
// this.diagnosisBy,
// this.isCurrentDiagnosis,
// this.id,});
//
// Diagnosises.fromJson(dynamic json) {
// diagnosisText = json['diagnosisText'];
// diagnosisDate = json['diagnosisDate'];
// diagnosisBy = json['diagnosisBy'];
// isCurrentDiagnosis = json['isCurrentDiagnosis'];
// id = json['_id'];
// }
// String? diagnosisText;
// String? diagnosisDate;
// String? diagnosisBy;
// bool? isCurrentDiagnosis;
// String? id;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['diagnosisText'] = diagnosisText;
// map['diagnosisDate'] = diagnosisDate;
// map['diagnosisBy'] = diagnosisBy;
// map['isCurrentDiagnosis'] = isCurrentDiagnosis;
// map['_id'] = id;
// return map;
// }
//
// }
//
// class AboutPatient {
// AboutPatient({
// this.aboutText,
// this.aboutDate,
// this.aboutBy,});
//
// AboutPatient.fromJson(dynamic json) {
// aboutText = json['aboutText'];
// aboutDate = json['aboutDate'];
// aboutBy = json['aboutBy'];
// }
// String? aboutText;
// String? aboutDate;
// String? aboutBy;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['aboutText'] = aboutText;
// map['aboutDate'] = aboutDate;
// map['aboutBy'] = aboutBy;
// return map;
// }
//
// }
//
// class Location {
// Location({
// this.type,
// this.coordinates,});
//
// Location.fromJson(dynamic json) {
// type = json['type'];
// coordinates = json['coordinates'] != null ? json['coordinates'].cast<double>() : [];
// }
// String? type;
// List<double>? coordinates;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['type'] = type;
// map['coordinates'] = coordinates;
// return map;
// }
//
// }
//
// class FcmTokens {
// FcmTokens({
// this.token,
// this.deviceType,});
//
// FcmTokens.fromJson(dynamic json) {
// token = json['token'];
// deviceType = json['deviceType'];
// }
// String? token;
// String? deviceType;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['token'] = token;
// map['deviceType'] = deviceType;
// return map;
// }
//
// }
// class StaffUserId {
// StaffUserId({
// this.contractedHours,
// this.id,
// this.staffMemberName,
// this.staffDesignation,
// this.staffOnLeave,
// this.supervisorId,
// this.holidays,
// this.complianceDocuments,
// this.niNumber,
// this.kin,
// this.user,
// this.clients,
// this.staffWorkLoads,
// this.staffHolidayRequests,
// this.staffTrainings,
// this.supervision,
// this.underSupervisions,
// this.staffWorkingDays,
// this.stafDob,
// this.active,
// this.covidCheck,
// this.createdAt,
// this.updatedAt,
// this.v,
// this.staffDisciplinaries,
// this.staffReferences,});
//
// StaffUserId.fromJson(dynamic json) {
// contractedHours = json['contractedHours'] != null ? ContractedHours.fromJson(json['contractedHours']) : null;
// id = json['_id'];
// staffMemberName = json['staffMemberName'];
// staffDesignation = json['staffDesignation'];
// staffOnLeave = json['staffOnLeave'];
// supervisorId = json['supervisorId'];
// if (json['holidays'] != null) {
// holidays = [];
// json['holidays'].forEach((v) {
// holidays?.add(Dynamic.fromJson(v));
// });
// }
// if (json['complianceDocuments'] != null) {
// complianceDocuments = [];
// json['complianceDocuments'].forEach((v) {
// complianceDocuments?.add(Dynamic.fromJson(v));
// });
// }
// niNumber = json['niNumber'];
// kin = json['kin'];
// user = json['user'];
// if (json['clients'] != null) {
// clients = [];
// json['clients'].forEach((v) {
// clients?.add(Dynamic.fromJson(v));
// });
// }
// staffWorkLoads = json['staffWorkLoads'] != null ? json['staffWorkLoads'].cast<String>() : [];
// if (json['staffHolidayRequests'] != null) {
// staffHolidayRequests = [];
// json['staffHolidayRequests'].forEach((v) {
// staffHolidayRequests?.add(Dynamic.fromJson(v));
// });
// }
// if (json['staffTrainings'] != null) {
// staffTrainings = [];
// json['staffTrainings'].forEach((v) {
// staffTrainings?.add(Dynamic.fromJson(v));
// });
// }
// supervision = json['supervision'] != null ? Supervision.fromJson(json['supervision']) : null;
// if (json['underSupervisions'] != null) {
// underSupervisions = [];
// json['underSupervisions'].forEach((v) {
// underSupervisions?.add(Dynamic.fromJson(v));
// });
// }
// if (json['staffWorkingDays'] != null) {
// staffWorkingDays = [];
// json['staffWorkingDays'].forEach((v) {
// staffWorkingDays?.add(Dynamic.fromJson(v));
// });
// }
// stafDob = json['stafDob'];
// active = json['active'];
// covidCheck = json['covidCheck'];
// createdAt = json['createdAt'];
// updatedAt = json['updatedAt'];
// v = json['__v'];
// staffDisciplinaries = json['staffDisciplinaries'];
// staffReferences = json['staffReferences'];
// }
// ContractedHours? contractedHours;
// String? id;
// String? staffMemberName;
// String? staffDesignation;
// bool? staffOnLeave;
// String? supervisorId;
// List<dynamic>? holidays;
// List<dynamic>? complianceDocuments;
// String? niNumber;
// String? kin;
// String? user;
// List<dynamic>? clients;
// List<String>? staffWorkLoads;
// List<dynamic>? staffHolidayRequests;
// List<dynamic>? staffTrainings;
// Supervision? supervision;
// List<dynamic>? underSupervisions;
// List<dynamic>? staffWorkingDays;
// String? stafDob;
// bool? active;
// bool? covidCheck;
// String? createdAt;
// String? updatedAt;
// int? v;
// String? staffDisciplinaries;
// String? staffReferences;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// if (contractedHours != null) {
// map['contractedHours'] = contractedHours?.toJson();
// }
// map['_id'] = id;
// map['staffMemberName'] = staffMemberName;
// map['staffDesignation'] = staffDesignation;
// map['staffOnLeave'] = staffOnLeave;
// map['supervisorId'] = supervisorId;
// if (holidays != null) {
// map['holidays'] = holidays?.map((v) => v.toJson()).toList();
// }
// if (complianceDocuments != null) {
// map['complianceDocuments'] = complianceDocuments?.map((v) => v.toJson()).toList();
// }
// map['niNumber'] = niNumber;
// map['kin'] = kin;
// map['user'] = user;
// if (clients != null) {
// map['clients'] = clients?.map((v) => v.toJson()).toList();
// }
// map['staffWorkLoads'] = staffWorkLoads;
// if (staffHolidayRequests != null) {
// map['staffHolidayRequests'] = staffHolidayRequests?.map((v) => v.toJson()).toList();
// }
// if (staffTrainings != null) {
// map['staffTrainings'] = staffTrainings?.map((v) => v.toJson()).toList();
// }
// if (supervision != null) {
// map['supervision'] = supervision?.toJson();
// }
// if (underSupervisions != null) {
// map['underSupervisions'] = underSupervisions?.map((v) => v.toJson()).toList();
// }
// if (staffWorkingDays != null) {
// map['staffWorkingDays'] = staffWorkingDays?.map((v) => v.toJson()).toList();
// }
// map['stafDob'] = stafDob;
// map['active'] = active;
// map['covidCheck'] = covidCheck;
// map['createdAt'] = createdAt;
// map['updatedAt'] = updatedAt;
// map['__v'] = v;
// map['staffDisciplinaries'] = staffDisciplinaries;
// map['staffReferences'] = staffReferences;
// return map;
// }
//
// }
//
// class Supervision {
// Supervision({
// this.supervisionName,
// this.sprDueDate,
// this.sprStatus,
// this.sprResult,
// this.templateTitleId,});
//
// Supervision.fromJson(dynamic json) {
// supervisionName = json['supervisionName'];
// sprDueDate = json['sprDueDate'];
// sprStatus = json['sprStatus'];
// sprResult = json['sprResult'];
// templateTitleId = json['templateTitleId'];
// }
// String? supervisionName;
// String? sprDueDate;
// String? sprStatus;
// String? sprResult;
// String? templateTitleId;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['supervisionName'] = supervisionName;
// map['sprDueDate'] = sprDueDate;
// map['sprStatus'] = sprStatus;
// map['sprResult'] = sprResult;
// map['templateTitleId'] = templateTitleId;
// return map;
// }
//
// }
//
// class ContractedHours {
// ContractedHours({
// this.contractedHours,
// this.totalShiftHoursWeek,
// this.noOfShifts,});
//
// ContractedHours.fromJson(dynamic json) {
// contractedHours = json['contractedHours'];
// totalShiftHoursWeek = json['totalShiftHoursWeek'];
// noOfShifts = json['noOfShifts'];
// }
// int? contractedHours;
// int? totalShiftHoursWeek;
// int? noOfShifts;
//
// Map<String, dynamic> toJson() {
// final map = <String, dynamic>{};
// map['contractedHours'] = contractedHours;
// map['totalShiftHoursWeek'] = totalShiftHoursWeek;
// map['noOfShifts'] = noOfShifts;
// return map;
// }
//
// }

View File

@@ -0,0 +1,173 @@
class RotaShift {
String managerName = '';
String name = '';
String staffRequired = '';
String workerType = '';
String location = '';
String id = ''; //from service
String startTime = ''; //from service
String endTime = ''; //from service
String breakTime = '';
String notes = '';
RotaShift.empty();
bool get havingShift {
return id.isNotEmpty || startTime.isNotEmpty || endTime.isNotEmpty;
}
DateTime get shiftTime {
return DateTime.parse(startTime).toLocal();
}
DateTime get shiftStartTime {
return DateTime.parse(startTime).toLocal();
}
DateTime get shiftEndTime {
return endTime.isNotEmpty
? DateTime.parse(endTime).toLocal()
: DateTime.now();
}
RotaShift({
this.id = '',
required this.name,
required this.staffRequired,
required this.workerType,
required this.location,
required this.startTime,
required this.endTime,
required this.breakTime,
required this.notes,
this.managerName = "Emily Smith",
});
RotaShift.fromJson(Map<String, dynamic> json) {
id = json["_id"] ?? "";
startTime = json["shftStartTime"] ?? "";
endTime = json["shftEndTime"] ?? "";
}
@override
String toString() {
return 'RotaShift{managerName: $managerName, name: $name, staffRequired: $staffRequired, workerType: $workerType, location: $location, id: $id, startTime: $startTime, endTime: $endTime, breakTime: $breakTime, notes: $notes}';
}
}
class DayWiseRecord {
bool dayOn = false;
bool sleepOverRequired = false;
RotaShift rotaShift = RotaShift.empty();
DayWiseRecord.empty();
DayWiseRecord({
required this.dayOn,
required this.sleepOverRequired,
required this.rotaShift,
});
DayWiseRecord.fromJson(Map<String, dynamic> json) {
dayOn = json["dayOn"] ?? false;
sleepOverRequired = json["sleepOverRequired"] ?? false;
if (json["shifts"] is List && json['shifts'].length != 0) {
rotaShift = RotaShift.fromJson(json["shifts"][0] ?? "");
}
}
@override
String toString() {
return 'DayWiseRecord{dayOn: $dayOn, sleepOverRequired: $sleepOverRequired, rotaShift: $rotaShift}';
}
}
class WeekWiseRecord {
DayWiseRecord mondayRecord = DayWiseRecord.empty();
DayWiseRecord tuesdayRecord = DayWiseRecord.empty();
DayWiseRecord wednesdayRecord = DayWiseRecord.empty();
DayWiseRecord thursdayRecord = DayWiseRecord.empty();
DayWiseRecord fridayRecord = DayWiseRecord.empty();
DayWiseRecord saturdayRecord = DayWiseRecord.empty();
DayWiseRecord sundayRecord = DayWiseRecord.empty();
bool weekIncluded = false;
WeekWiseRecord.empty();
WeekWiseRecord({
required this.mondayRecord,
required this.tuesdayRecord,
required this.wednesdayRecord,
required this.thursdayRecord,
required this.fridayRecord,
required this.saturdayRecord,
required this.sundayRecord,
required this.weekIncluded,
});
WeekWiseRecord.fromJson(dynamic json) {
mondayRecord = DayWiseRecord.fromJson(json['monday'] ?? "");
tuesdayRecord = DayWiseRecord.fromJson(json['tuesday'] ?? "");
wednesdayRecord = DayWiseRecord.fromJson(json['wednesday'] ?? "");
thursdayRecord = DayWiseRecord.fromJson(json['thursday'] ?? "");
fridayRecord = DayWiseRecord.fromJson(json['friday'] ?? "");
saturdayRecord = DayWiseRecord.fromJson(json['saturday'] ?? "");
sundayRecord = DayWiseRecord.fromJson(json['sunday'] ?? "");
weekIncluded = json['weekIncluded'] ?? false;
}
@override
String toString() {
return 'WeekWiseRecord{mondayRecord: $mondayRecord, tuesdayRecord: $tuesdayRecord, wednesdayRecord: $wednesdayRecord, thursdayRecord: $thursdayRecord, fridayRecord: $fridayRecord, saturdayRecord: $saturdayRecord, sundayRecord: $sundayRecord, weekIncluded: $weekIncluded}';
}
}
//make variable for this model
class MonthWiseRecord {
WeekWiseRecord week1 = WeekWiseRecord.empty();
WeekWiseRecord week2 = WeekWiseRecord.empty();
WeekWiseRecord week3 = WeekWiseRecord.empty();
WeekWiseRecord week4 = WeekWiseRecord.empty();
String id = "";
String serviceUser = "";
String addedBy = "";
String createdAt = "";
String updatedAt = "";
bool active = false;
int v = -1;
MonthWiseRecord.empty();
MonthWiseRecord({
required this.week1,
required this.week2,
required this.week3,
required this.week4,
required this.id,
required this.serviceUser,
required this.addedBy,
required this.createdAt,
required this.updatedAt,
required this.active,
required this.v,
});
MonthWiseRecord.fromJson(Map<String, dynamic> json) {
week1 = WeekWiseRecord.fromJson(json['week1'] ?? {});
week2 = WeekWiseRecord.fromJson(json['week2'] ?? {});
week3 = WeekWiseRecord.fromJson(json['week3'] ?? {});
week4 = WeekWiseRecord.fromJson(json['week4'] ?? {});
id = json["id"] ?? "";
serviceUser = json["serviceUser"] ?? "";
addedBy = json["addedBy"] ?? "";
createdAt = json["createdAt"] ?? "";
updatedAt = json["updatedAt"] ?? "";
active = json["active"] ?? false;
v = json["v"] ?? -1;
}
@override
String toString() {
return 'MonthWiseRecord{week1: $week1, week2: $week2, week3: $week3, week4: $week4, id: $id, serviceUser: $serviceUser, addedBy: $addedBy, createdAt: $createdAt, updatedAt: $updatedAt, active: $active, v: $v}';
}
}

View File

@@ -0,0 +1,208 @@
class StaffWorkloadResponse {
StaffWorkloadResponse({
this.status,
this.message,
this.data,});
StaffWorkloadResponse.fromJson(dynamic json) {
status = json['status'];
message = json['message'];
data = json['data'] != null ? StaffWorkloadData.fromJson(json['data']) : null;
}
String? status;
String? message;
StaffWorkloadData? data;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['status'] = status;
map['message'] = message;
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}
class StaffWorkloadData {
StaffWorkloadData({
this.staffWorkLoads,
this.count,
this.offset,
this.limit,});
StaffWorkloadData.fromJson(dynamic json) {
if (json['staffWorkLoads'] != null) {
staffWorkLoads = [];
json['staffWorkLoads'].forEach((v) {
staffWorkLoads?.add(StaffWorkLoads.fromJson(v));
});
}
count = json['count'];
offset = json['offset'];
limit = json['limit'];
}
List<StaffWorkLoads>? staffWorkLoads;
int? count;
int? offset;
int? limit;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (staffWorkLoads != null) {
map['staffWorkLoads'] = staffWorkLoads?.map((v) => v.toJson()).toList();
}
map['count'] = count;
map['offset'] = offset;
map['limit'] = limit;
return map;
}
}
class StaffWorkLoads {
StaffWorkLoads({
this.holidayEntitlement,
this.id,
this.isCurrentWrkLd,
this.startDate,
this.endDate,
this.holidayAlwnNoOfDys,
this.holidayAlwnNoOfHours,
this.holidaysAvailed,
this.holidaysRemaining,
this.staffMember,
this.carriedOverHours,
this.active,
this.createdAt,
this.updatedAt,});
StaffWorkLoads.fromJson(dynamic json) {
holidayEntitlement = json['holidayEntitlement'] != null ? HolidayEntitlement.fromJson(json['holidayEntitlement']) : null;
id = json['_id'];
isCurrentWrkLd = json['isCurrentWrkLd'];
startDate = json['startDate'];
endDate = json['endDate'];
holidayAlwnNoOfDys = json['holidayAlwnNoOfDys'];
holidayAlwnNoOfHours = json['holidayAlwnNoOfHours'];
holidaysAvailed = json['holidaysAvailed'];
holidaysRemaining = json['holidaysRemaining'];
staffMember = json['staffMember'] is Map ? StaffMember.fromJson(json['staffMember']) : null;
carriedOverHours = json['carriedOverHours'];
active = json['active'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
}
HolidayEntitlement? holidayEntitlement;
String? id;
bool? isCurrentWrkLd;
String? startDate;
String? endDate;
int? holidayAlwnNoOfDys;
int? holidayAlwnNoOfHours;
int? holidaysAvailed;
int? holidaysRemaining;
StaffMember? staffMember;
int? carriedOverHours;
bool? active;
String? createdAt;
String? updatedAt;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (holidayEntitlement != null) {
map['holidayEntitlement'] = holidayEntitlement?.toJson();
}
map['_id'] = id;
map['isCurrentWrkLd'] = isCurrentWrkLd;
map['startDate'] = startDate;
map['endDate'] = endDate;
map['holidayAlwnNoOfDys'] = holidayAlwnNoOfDys;
map['holidayAlwnNoOfHours'] = holidayAlwnNoOfHours;
map['holidaysAvailed'] = holidaysAvailed;
map['holidaysRemaining'] = holidaysRemaining;
if (staffMember != null) {
map['staffMember'] = staffMember?.toJson();
}
map['carriedOverHours'] = carriedOverHours;
map['active'] = active;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
return map;
}
}
class StaffMember {
StaffMember({
this.id,
this.user,});
StaffMember.fromJson(dynamic json) {
id = json['_id'];
user = json['user'] != null ? User.fromJson(json['user']) : null;
}
String? id;
User? user;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
if (user != null) {
map['user'] = user?.toJson();
}
return map;
}
}
class User {
User({
this.id,
this.name,
this.profilePictureUrl,});
User.fromJson(dynamic json) {
id = json['_id'];
name = json['name'];
profilePictureUrl = json['profile_picture_url'];
}
String? id;
String? name;
String? profilePictureUrl;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
map['name'] = name;
map['profile_picture_url'] = profilePictureUrl;
return map;
}
}
class HolidayEntitlement {
HolidayEntitlement({
this.numberOfDays,
this.numberOfHours,
this.numberOfWeeks,});
HolidayEntitlement.fromJson(dynamic json) {
numberOfDays = json['numberOfDays'];
numberOfHours = json['numberOfHours'];
numberOfWeeks = json['numberOfWeeks'];
}
int? numberOfDays;
int? numberOfHours;
int? numberOfWeeks;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['numberOfDays'] = numberOfDays;
map['numberOfHours'] = numberOfHours;
map['numberOfWeeks'] = numberOfWeeks;
return map;
}
}

View File

@@ -0,0 +1,168 @@
import 'package:ftc_mobile_app/models/profileData/user_data.dart';
class TrainingResponseData {
TrainingResponseData({
this.proposedTrainings,
this.count,
this.offset,
this.limit,
});
TrainingResponseData.fromJson(dynamic json) {
if (json['proposedTrainings'] != null) {
proposedTrainings = [];
json['proposedTrainings'].forEach((v) {
proposedTrainings?.add(TrainingUsers.fromJson(v));
});
}
count = json['count'];
offset = json['offset'];
limit = json['limit'];
}
List<TrainingUsers>? proposedTrainings;
int? count;
int? offset;
int? limit;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (proposedTrainings != null) {
map['proposedTrainings'] =
proposedTrainings?.map((v) => v.toJson()).toList();
}
map['count'] = count;
map['offset'] = offset;
map['limit'] = limit;
return map;
}
}
class TrainingUsers {
TrainingUsers({
this.id,
this.user,
this.trainingId,
this.active,
this.createdAt,
this.updatedAt,
});
TrainingUsers.fromJson(dynamic json) {
id = json['_id'];
user = json['user'] != null ? UserData.fromJson(json['user']) : null;
trainingId = json['trainingId'] != null
? ProposedTrainings.fromJson(json['trainingId'])
: null;
active = json['active'];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
}
String? id;
UserData? user;
ProposedTrainings? trainingId;
bool? active;
String? createdAt;
String? updatedAt;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
if (user != null) {
map['user'] = user?.toJson();
}
if (trainingId != null) {
map['trainingId'] = trainingId?.toJson();
}
map['active'] = active;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
return map;
}
}
class ProposedTrainings {
ProposedTrainings({
this.id,
this.prpsName,
this.prpsDescription,
this.prpsTrgType,
this.prpsTrgClass,
this.prpsTrgStatus,
this.prpsTrgStartDate,
this.prpsTrgEndDate,
this.prpsTrgRegisterationDate,
this.addedby,
this.active,
this.contentType,
this.content,
this.createdAt,
this.updatedAt,
// this.users,
});
ProposedTrainings.fromJson(dynamic json) {
id = json['_id'];
prpsName = json['prpsName'];
prpsDescription = json['prpsDescription'];
prpsTrgType = json['prpsTrgType'];
prpsTrgClass = json['prpsTrgClass'];
prpsTrgStatus = json['prpsTrgStatus'];
prpsTrgStartDate = json['prpsTrgStartDate'];
prpsTrgEndDate = json['prpsTrgEndDate'];
prpsTrgRegisterationDate = json['prpsTrgRegisterationDate'];
addedby = json['addedby'];
active = json['active'];
contentType = json['contentType'];
content = json['content'] != null ? json['content'].cast<String>() : [];
createdAt = json['createdAt'];
updatedAt = json['updatedAt'];
// if (json['users'] != null) {
// users = [];
// json['users'].forEach((v) {
// users?.add(TrainingUsers.fromJson(v));
// });
// }
}
String? id;
String? prpsName;
String? prpsDescription;
String? prpsTrgType;
String? prpsTrgClass;
String? prpsTrgStatus;
int? prpsTrgStartDate;
int? prpsTrgEndDate;
int? prpsTrgRegisterationDate;
dynamic addedby;
bool? active;
String? contentType;
List<String>? content;
String? createdAt;
String? updatedAt;
// List<TrainingUsers>? users;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['_id'] = id;
map['prpsName'] = prpsName;
map['prpsDescription'] = prpsDescription;
map['prpsTrgType'] = prpsTrgType;
map['prpsTrgClass'] = prpsTrgClass;
map['prpsTrgStatus'] = prpsTrgStatus;
map['prpsTrgStartDate'] = prpsTrgStartDate;
map['prpsTrgEndDate'] = prpsTrgEndDate;
map['prpsTrgRegisterationDate'] = prpsTrgRegisterationDate;
map['addedby'] = addedby;
map['active'] = active;
map['contentType'] = contentType;
map['content'] = content;
map['createdAt'] = createdAt;
map['updatedAt'] = updatedAt;
// if (users != null) {
// map['users'] = users?.map((v) => v.toJson()).toList();
// }
return map;
}
}

224
lib/models/user_model.dart Normal file
View File

@@ -0,0 +1,224 @@
class UserModel {
FcmTokenModel fcmTokens = FcmTokenModel.empty();
LocationModel locationModel = LocationModel.empty();
String id = "";
String userModelName = "";
String name = "";
String version = "" ;
String email = "" ;
String phoneNumber = "";
bool active = false;
String role = "" ;
String profilePictureUrl = "" ;
String deviceId = "" ;
String verificationCode = "" ;
bool isVerified = false;
bool approved = false;
bool blocked = false;
String createdAt = "" ;
String updatedAt = "" ;
int v = -1;
String password = "" ;
UserSettingsModel userSettingsModel = UserSettingsModel.empty();
bool newUser = false;
//old fields for UI
String profilePicture = "";
String homeAddress = "";
String nextOfKin = "";
String diagnosisHistory = "";
String diagnosisDate = "";
String aboutPatient = "";
UserModel.empty();
UserModel({
required this.name,
required this.profilePicture,
required this.phoneNumber,
required this.homeAddress,
required this.nextOfKin,
required this.diagnosisHistory,
required this.diagnosisDate,
required this.aboutPatient,
this.role ="",
});
@override
String toString() {
return 'UserModel{fcmTokens: $fcmTokens, locationModel: $locationModel, id: $id, userModelName: $userModelName, name: $name, version: $version, email: $email, phoneNumber: $phoneNumber, active: $active, role: $role, profilePictureUrl: $profilePictureUrl, deviceId: $deviceId, verificationCode: $verificationCode, isVerified: $isVerified, approved: $approved, blocked: $blocked, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, password: $password, userSettingsModel: $userSettingsModel, newUser: $newUser, profilePicture: $profilePicture, homeAddress: $homeAddress, nextOfKin: $nextOfKin, diagnosisHistory: $diagnosisHistory, diagnosisDate: $diagnosisDate, aboutPatient: $aboutPatient}';
}
UserModel.fromJson(Map<String,dynamic> json){
fcmTokens = FcmTokenModel.fromJson(json['fcm_tokens']??"");
locationModel = LocationModel.fromJson(json['location']??"");
id = json["_id"]??"";
userModelName = json["userModelName"]??"";
name = json["name"]??"";
version = json["version"]??'';
email = json["email"]??'';
phoneNumber = json["phoneNumber"]??'';
active = json["active"]??false;
role = json["role"]??'';
profilePictureUrl = json["profile_picture_url"]??'';
deviceId = json["deviceId"]??'';
verificationCode = json["verification_code"]??'';
isVerified = json["is_verified"]??false;
approved = json["approved"]??false;
blocked = json["blocked"]??false;
createdAt = json["createdAt"]??'';
updatedAt = json["updatedAt"]??'';
v = json["__v"]??-1;
password = json["password"]??'';
userSettingsModel = UserSettingsModel.fromJson(json["userSettings"]??"");
newUser = json['new_user'];
}
Map<String,dynamic> toJson(){
Map<String,dynamic> json = {};
json['fcm_tokens'] = fcmTokens.toJson();
json['location'] = locationModel.toJson();
json["_id"] = id;
json["userModelName"] = userModelName;
json["name"] = name;
json["version"] = version;
json["email"] = email;
json["phoneNumber"] = phoneNumber;
json["active"] = active;
json["role"] = role;
json["profile_picture_url"] = profilePictureUrl;
json["deviceId"] = deviceId;
json["verification_code"] = verificationCode;
json["is_verified"] = isVerified ;
json["approved"] = approved ;
json["blocked"] = blocked ;
json["createdAt"] = createdAt;
json["updatedAt"] = updatedAt;
json["__v"] = v;
json["password"] = password;
json["userSettings"] = userSettingsModel.toJson();
json['new_user'] = newUser;
return json;
}
}
class FcmTokenModel{
String token = "";
String deviceType = "";
FcmTokenModel.empty();
FcmTokenModel.fromJson(Map<String,dynamic> json){
token = json["token"] ?? "";
deviceType = json["deviceType"] ?? "";
}
Map<String,dynamic> toJson(){
Map<String,dynamic> json = {};
json["token"] = token ;
json["deviceType"] = deviceType ;
return json;
}
@override
String toString() {
return 'FcmTokenModel{token: $token, deviceType: $deviceType}';
}
}
class LocationModel{
String type = "";
List coordinates = [];
LocationModel.empty();
LocationModel.fromJson(Map<String,dynamic> json){
type = json["type"]??"";
coordinates = json["coordinates"]??[];
}
double getLatitude(){return coordinates.first;}
double getLongitude(){return coordinates.last;}
Map<String,dynamic> toJson(){
Map<String,dynamic> json = {};
json["type"] = type ;
json["coordinates"] = coordinates ;
return json;
}
@override
String toString() {
return 'LocationModel{type: $type, coordinates: $coordinates}';
}
}
class UserSettingsModel{
String id = "";
String user = "";
bool active = false;
String createdAt = "";
String updatedAt = "";
String v = "";
NotificationSettings notificationSettings = NotificationSettings.empty();
UserSettingsModel.empty();
UserSettingsModel.fromJson(Map<String,dynamic> json){
id = json["id"]??"";
user = json["user"]??"";
active = json["active"]??false;
createdAt = json["createdAt"]??"";
updatedAt = json["updatedAt"]??"";
v = json["v"]??"";
notificationSettings =
NotificationSettings.fromJson(json["notificationSettings"] ?? {"": ""});
}
Map<String,dynamic> toJson(){
Map<String,dynamic> json = {};
json["id"] = id;
json["user"] = user;
json["active"] = active;
json["createdAt"] = createdAt;
json["updatedAt"] = updatedAt;
json["v"] = v;
return json;
}
@override
String toString() {
return 'UserSettingsModel{id: $id, user: $user, active: $active, createdAt: $createdAt, updatedAt: $updatedAt, v: $v, notificationSettings: $notificationSettings}';
}
}
class NotificationSettings{
bool showActive = false;
bool pauseNotification = false;
String pauseDuration = "";
String durationUnit = "";
NotificationSettings.empty();
NotificationSettings.fromJson(Map<String,dynamic> json){
showActive = json["showActive"]??false;
pauseNotification = json["pauseNotification"]??false;
pauseDuration = json["pauseDuration"]??"";
durationUnit = json["durationUnit"]??"";
}
Map<String,dynamic> toJson(){
Map<String,dynamic> json = {};
json["showActive"] = showActive;
json["pauseNotification"] = pauseNotification;
json["pauseDuration"] = pauseDuration;
json["durationUnit"] = durationUnit;
return json;
}
@override
String toString() {
return 'NotificationSettings{showActive: $showActive, pauseNotification: $pauseNotification, pauseDuration: $pauseDuration, durationUnit: $durationUnit}';
}
}