object and router files update

This commit is contained in:
2024-09-17 16:14:54 +02:00
parent fcd045ac40
commit 5b905be74b
44 changed files with 88 additions and 88 deletions

View File

@@ -0,0 +1,55 @@
class AccessRequest {
final int idpatient_queue;
final String business_id;
final String app_id;
final String date_time;
final String access;
final String revoke_date;
final String Name;
final String type;
final String logo_path;
final String contact_no;
const AccessRequest({
required this.idpatient_queue,
required this.business_id,
required this.app_id,
required this.date_time,
required this.access,
required this.revoke_date,
required this.Name,
required this.type,
required this.logo_path,
required this.contact_no,
});
factory AccessRequest.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
"idpatient_queue": int idpatient_queue,
'business_id': String business_id,
'app_id': String app_id,
'date_time': String date_time,
'access': String access,
'revoke_date': String revoke_date,
'Name': String Name,
'type': String type,
'logo_path': String logo_path,
'contact_no': String contact_no,
} =>
AccessRequest(
idpatient_queue: idpatient_queue,
business_id: business_id,
app_id: app_id,
date_time: date_time,
access: access,
revoke_date: revoke_date,
Name: Name,
type: type,
logo_path: logo_path,
contact_no: contact_no,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}

View File

@@ -0,0 +1,35 @@
// ignore: file_names
class AppUser {
final int idUser;
final String email;
final String fname;
final String lname;
final String type;
final String app_id;
final String username;
final String pro_pic_path;
const AppUser(
this.idUser,
this.email,
this.fname,
this.lname,
this.type,
this.app_id,
this.username,
this.pro_pic_path,
);
factory AppUser.fromJson(dynamic json) {
return AppUser(
json['idUser'],
json['email'],
json['fname'],
json['lname'],
json['type'],
json['app_id'],
json['username'],
json['pro_pic_path'],
);
}
}

View File

@@ -0,0 +1,74 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/mih_objects/app_user.dart';
import 'package:patient_manager/mih_objects/business.dart';
import 'package:patient_manager/mih_objects/business_user.dart';
import 'package:patient_manager/mih_objects/patients.dart';
class BusinessArguments {
final AppUser signedInUser;
final BusinessUser? businessUser;
final Business? business;
BusinessArguments(
this.signedInUser,
this.businessUser,
this.business,
);
}
class HomeArguments {
final AppUser signedInUser;
final BusinessUser? businessUser;
final Business? business;
final String profilePicUrl;
HomeArguments(
this.signedInUser,
this.businessUser,
this.business,
this.profilePicUrl,
);
}
class AppProfileUpdateArguments {
final AppUser signedInUser;
final ImageProvider<Object>? propicFile;
AppProfileUpdateArguments(this.signedInUser, this.propicFile);
}
class FileViewArguments {
final String link;
final String path;
FileViewArguments(
this.link,
this.path,
);
}
class PatientViewArguments {
final AppUser signedInUser;
final Patient? selectedPatient;
final BusinessUser? businessUser;
final Business? business;
final String type;
PatientViewArguments(
this.signedInUser,
this.selectedPatient,
this.businessUser,
this.business,
this.type,
);
}
class PatientEditArguments {
final AppUser signedInUser;
final Patient selectedPatient;
PatientEditArguments(
this.signedInUser,
this.selectedPatient,
);
}

View File

@@ -0,0 +1,38 @@
// ignore: file_names
class Business {
final String business_id;
final String Name;
final String type;
final String registration_no;
final String logo_name;
final String logo_path;
final String contact_no;
final String bus_email;
final String app_id;
const Business(
this.business_id,
this.Name,
this.type,
this.registration_no,
this.logo_name,
this.logo_path,
this.contact_no,
this.bus_email,
this.app_id,
);
factory Business.fromJson(dynamic json) {
return Business(
json['business_id'],
json['Name'],
json['type'],
json['registration_no'],
json['logo_name'],
json['logo_path'],
json['contact_no'],
json['bus_email'],
json['app_id'],
);
}
}

View File

@@ -0,0 +1,35 @@
// ignore: file_names
class BusinessEmployee {
final String business_id;
final String app_id;
final String title;
final String access;
final String fname;
final String lname;
final String email;
final String username;
const BusinessEmployee(
this.business_id,
this.app_id,
this.title,
this.access,
this.fname,
this.lname,
this.email,
this.username,
);
factory BusinessEmployee.fromJson(dynamic json) {
return BusinessEmployee(
json['business_id'],
json['app_id'],
json['title'],
json['access'],
json['fname'],
json['lname'],
json['email'],
json['username'],
);
}
}

View File

@@ -0,0 +1,32 @@
// ignore: file_names
class BusinessUser {
final int idbusiness_users;
final String business_id;
final String app_id;
final String signature;
final String sig_path;
final String title;
final String access;
const BusinessUser(
this.idbusiness_users,
this.business_id,
this.app_id,
this.signature,
this.sig_path,
this.title,
this.access,
);
factory BusinessUser.fromJson(dynamic json) {
return BusinessUser(
json['idbusiness_users'],
json['business_id'],
json['app_id'],
json['signature'],
json['sig_path'],
json['title'],
json['access'],
);
}
}

View File

@@ -0,0 +1,6 @@
class EditScreenArguments {
final String useremail;
final String selectedPatient;
EditScreenArguments({required this.useremail, required this.selectedPatient});
}

View File

@@ -0,0 +1,25 @@
class PFile {
final int idpatient_files;
final String file_path;
final String file_name;
final String insert_date;
final String app_id;
const PFile(
this.idpatient_files,
this.file_path,
this.file_name,
this.insert_date,
this.app_id,
);
factory PFile.fromJson(dynamic json) {
return PFile(
json['idpatient_files'],
json['file_path'],
json['file_name'],
json['insert_date'],
json['app_id'],
);
}
}

View File

@@ -0,0 +1,19 @@
class Medicine {
final String name;
final String unit;
final String form;
const Medicine(
this.name,
this.unit,
this.form,
);
factory Medicine.fromJson(dynamic json) {
return Medicine(
json['name'],
json['unit'],
json['dosage form'],
);
}
}

View File

@@ -0,0 +1,43 @@
class Note {
final int idpatient_notes;
final String note_name;
final String note_text;
final String insert_date;
final String doc_office;
final String doctor;
final String app_id;
const Note({
required this.idpatient_notes,
required this.note_name,
required this.note_text,
required this.insert_date,
required this.doc_office,
required this.doctor,
required this.app_id,
});
factory Note.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
"idpatient_notes": int idpatient_notes,
"note_name": String note_name,
"note_text": String note_text,
"insert_date": String insert_date,
"doc_office": String doc_office,
"doctor": String doctor,
"app_id": String app_id,
} =>
Note(
idpatient_notes: idpatient_notes,
note_name: note_name,
note_text: note_text,
insert_date: insert_date,
doc_office: doc_office,
doctor: doctor,
app_id: app_id,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}

View File

@@ -0,0 +1,55 @@
class PatientQueue {
final int idpatient_queue;
final String business_id;
final String app_id;
final String date_time;
final String access;
final String id_no;
final String first_name;
final String last_name;
final String medical_aid_no;
final String revoke_date;
const PatientQueue({
required this.idpatient_queue,
required this.business_id,
required this.app_id,
required this.date_time,
required this.access,
required this.id_no,
required this.first_name,
required this.last_name,
required this.medical_aid_no,
required this.revoke_date,
});
factory PatientQueue.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
"idpatient_queue": int idpatient_queue,
'business_id': String business_id,
'app_id': String app_id,
'date_time': String date_time,
'access': String access,
'id_no': String id_no,
'first_name': String first_name,
'last_name': String last_name,
'medical_aid_no': String medical_aid_no,
'revoke_date': String revoke_date,
} =>
PatientQueue(
idpatient_queue: idpatient_queue,
business_id: business_id,
app_id: app_id,
date_time: date_time,
access: access,
id_no: id_no,
first_name: first_name,
last_name: last_name,
medical_aid_no: medical_aid_no,
revoke_date: revoke_date,
),
_ => throw const FormatException('Failed to load album.'),
};
}
}

View File

@@ -0,0 +1,75 @@
class Patient {
final int idpatients;
final String id_no;
final String first_name;
final String last_name;
final String email;
final String cell_no;
final String medical_aid;
final String medical_aid_name;
final String medical_aid_no;
final String medical_aid_main_member;
final String medical_aid_code;
final String medical_aid_scheme;
final String address;
final String app_id;
const Patient({
required this.idpatients,
required this.id_no,
required this.first_name,
required this.last_name,
required this.email,
required this.cell_no,
required this.medical_aid,
required this.medical_aid_name,
required this.medical_aid_no,
required this.medical_aid_main_member,
required this.medical_aid_code,
required this.medical_aid_scheme,
required this.address,
required this.app_id,
});
factory Patient.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
"idpatients": int idpatients,
'id_no': String id_no,
'first_name': String first_name,
'last_name': String last_name,
'email': String email,
'cell_no': String cell_no,
'medical_aid': String medical_aid,
'medical_aid_name': String medical_aid_name,
'medical_aid_no': String medical_aid_no,
'medical_aid_main_member': String medical_aid_main_member,
'medical_aid_code': String medical_aid_code,
'medical_aid_scheme': String medical_aid_scheme,
'address': String address,
'app_id': String app_id,
} =>
Patient(
idpatients: idpatients,
id_no: id_no,
first_name: first_name,
last_name: last_name,
email: email,
cell_no: cell_no,
medical_aid: medical_aid,
medical_aid_name: medical_aid_name,
medical_aid_no: medical_aid_no,
medical_aid_main_member: medical_aid_main_member,
medical_aid_code: medical_aid_code,
medical_aid_scheme: medical_aid_scheme,
address: address,
app_id: app_id,
),
_ => throw const FormatException('Failed to load album.'),
};
}
String getIDNum() {
return id_no;
}
}

View File

@@ -0,0 +1,65 @@
class Perscription {
final String name;
final String unit;
final String form;
final String fullForm;
final String quantity;
final String dosage;
final String times;
final String days;
final String repeats;
const Perscription({
required this.name,
required this.unit,
required this.form,
required this.fullForm,
required this.quantity,
required this.dosage,
required this.times,
required this.days,
required this.repeats,
});
factory Perscription.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
"name": String name,
'unit': String unit,
'form': String form,
'fullForm': String fullForm,
'quantity': String quantity,
'dosage': String dosage,
'times': String times,
'days': String days,
'repeats': String repeats,
} =>
Perscription(
name: name,
unit: unit,
form: form,
fullForm: fullForm,
quantity: quantity,
dosage: dosage,
times: times,
days: days,
repeats: repeats,
),
_ => throw const FormatException('Failed to load album.'),
};
}
Map<String, dynamic> toJson() {
return {
"name": name,
'unit': unit,
'form': form,
'fullForm': fullForm,
'quantity': quantity,
'dosage': dosage,
'times': times,
'days': days,
'repeats': repeats,
};
}
}

View File

@@ -0,0 +1,23 @@
class SessionST {
final String status;
final bool exists;
const SessionST({
required this.status,
required this.exists,
});
factory SessionST.fromJson(Map<String, dynamic> json) {
return switch (json) {
{
'status': String status,
'exists': bool exists,
} =>
SessionST(
status: status,
exists: exists,
),
_ => throw const FormatException('Failed to load SessionST.'),
};
}
}