medora-provider/lib/controllers/doctor _controller.dart
DhanshCOSQ 66c3b2fb9c Patient registration complete with authentication flow fixed (#3)
Patient registration complete with authentication flow fixed

Co-authored-by: Benoy Bose <benoybose@gmail.com>
Co-authored-by: Jipson George <152465898+Jipson-cosq@users.noreply.github.com>
Reviewed-on: cosqnet/telemednet#3
Reviewed-by: Benoy Bose <benoybose@cosq.net>
Co-authored-by: DhanshCOSQ <dhanshas@cosq.net>
Co-committed-by: DhanshCOSQ <dhanshas@cosq.net>
2024-10-31 14:20:35 +00:00

116 lines
2.5 KiB
Dart

import 'package:telemednet/data/models/doctor.dart';
class DoctorController {
Doctor model = Doctor(
address: Address(floorBuilding: ''),
profile: Profile(qualifications: []),
);
final ProfileController profileController = ProfileController();
final AddressController addressController = AddressController();
// Doctor Specific Updates
void updateSpeciality(String speciality) {
model.speciality = speciality;
}
void updateAchievements(List<String> achievements) {
model.achievements = achievements;
}
// Add single achievement
void addAchievement(String achievement) {
model.achievements.add(achievement);
}
// Remove achievement
void removeAchievement(String achievement) {
model.achievements.remove(achievement);
}
void updateYearsOfExperience(String years) {
model.yearsOfExperience = years;
}
void updateLicenseNumber(String license) {
model.licenseNumber = license;
}
void updateProfileDescription(String description) {
model.profileDescription = description;
}
void updateDigitalSignature(String signature) {
model.digitalSignature = signature;
}
// Validation logic can be added here
bool validateProfile() {
return model.speciality != null && model.licenseNumber != null;
}
}
class ProfileController {
Profile model = Profile(qualifications: []);
void updateTitle(String title) {
model.title = title;
}
void updateSurName(String surName) {
model.surName = surName;
}
void updateMiddleName(String middleName) {
model.middleName = middleName;
}
void updateLastName(String lastName) {
model.lastName = lastName;
}
void addQualification(String qualification) {
model.qualifications.add(qualification);
}
void removeQualification(String qualification) {
model.qualifications.remove(qualification);
}
bool validateProfile() {
return model.qualifications.isNotEmpty;
}
}
class AddressController {
Address model = Address(floorBuilding: '');
void updateFloorBuilding(String floorBuilding) {
model.floorBuilding = floorBuilding;
}
void updateStreet(String street) {
model.street = street;
}
void updateCity(String city) {
model.city = city;
}
void updateState(String state) {
model.state = state;
}
void updateCountry(String country) {
model.country = country;
}
void updatePostalCode(String postalCode) {
model.postalCode = postalCode;
}
// bool validateAddress() {
// return model.floorBuilding.isNotEmpty;
// }
}