103 lines
2.7 KiB
Dart
103 lines
2.7 KiB
Dart
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;
|
|
}
|
|
|
|
} |