-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppointmentManager.h
40 lines (31 loc) · 1.37 KB
/
AppointmentManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include "qtmetamacros.h"
#include <QLoggingCategory>
#include <QObject>
#include <QSqlDatabase>
#include <QVariantMap>
Q_DECLARE_LOGGING_CATEGORY(appointmentManager)
class AppointmentManager : public QObject {
Q_OBJECT
public:
explicit AppointmentManager(QSqlDatabase &db, QObject *parent = nullptr);
// When no healthCondition are given calls this function
Q_INVOKABLE bool scheduleAppointment(const QString &userEmail,
const QString &hospitalEmail,
const QDateTime &appointmentDate);
Q_INVOKABLE QVariantList getUserAppointments(const QString &userEmail);
Q_INVOKABLE QVariantList
getHospitalAppointments(const QString &hospitalEmail);
Q_INVOKABLE bool cancelAppointment(int appointmentId);
Q_INVOKABLE QVariantList getAvailableTimeSlots(const QString &hospitalEmail,
const QDate &date);
Q_INVOKABLE bool scheduleAppointment(const QString &userEmail,
const QString &hospitalEmail,
const QString &appointmentDate,
const QString &healthCondition);
public slots:
void removeUserAppointments(const QString &userEmail);
void removeHospitalAppointments(const QString &hospitalEmail);
private:
QSqlDatabase &m_db;
};