1
1
# Appointment Scheduler
2
+
2
3
This application helps you to schedule appointments with your clients. It is a simple application that allows any client
3
4
to schedule an appointment for a service.
4
5
5
6
## Model Structure
6
- The application has 4 models:
7
- - Service
8
- - Appointment Request
9
- - Appointment
10
- - Config
7
+
8
+ The application has 6 models:
9
+
10
+ - [ Service] ( models.md#service )
11
+ - [ Appointment Request] ( models.md#appointmentrequest )
12
+ - [ Appointment] ( models.md#appointment )
13
+ - [ Config] ( models.md#config )
14
+ - [ PaymentInfo] ( models.md#paymentinfo )
15
+ - [ EmailVerificationCode] ( models.md#emailverificationcode )
11
16
12
17
### Service
18
+
13
19
The service model is used to define the services that you offer. It has the following fields:
20
+
14
21
- name: The name of the service
15
22
- description: A description of the service
16
23
- duration: The duration of the service (Duration field)
17
24
- price: The price of the service
18
25
- image: An image of the service
19
26
20
27
### Appointment Request
21
- The appointment request model is used to define the appointment requests that your clients make. It has the following fields:
28
+
29
+ The appointment request model is used to define the appointment requests that your clients make. It has the following
30
+ fields:
31
+
22
32
- date: The date of the appointment request
23
33
- start_time: The start time of the appointment request
24
34
- end_time: The end time of the appointment request
25
35
- service: The service that the appointment request is for
26
36
- id_request: The id of the appointment request
27
37
28
- The appointment request is used to create the appointment. An appointment is considered having more information than
29
- that, and since we don't want to overload the appointment model, we use the appointment request to store all
38
+ The appointment request is used to create the appointment. An appointment is considered having more information than
39
+ that, and since we don't want to overload the appointment model, we use the appointment request to store all
30
40
the information about the appointment.
31
41
32
42
### Appointment
43
+
33
44
The appointment model is used to define the last step in the appointment scheduling. It has the following fields:
45
+
34
46
- client: The client that made the appointment
35
47
- appointment_request: The appointment request that the appointment is based on
36
48
- phone: The phone number of the client
@@ -42,17 +54,42 @@ The appointment model is used to define the last step in the appointment schedul
42
54
- id_request: The id of the appointment request
43
55
44
56
### Config
57
+
45
58
The config model is used to define the configuration of the application. It has the following fields:
59
+
46
60
- slot_duration: The duration of each slot in the calendar
47
61
- lead_time: The time of the day that the calendar starts
48
62
- finish_time: The time of the day that the calendar ends
63
+ - appointment_buffer_time: Time between now and the first available slot for the current day (doesn't affect tomorrow).
64
+ - website_name: The name of the website
65
+
66
+ ### PaymentInfo
67
+
68
+ The PaymentInfo model is used to represent payment information for an appointment. It has the following fields:
69
+
70
+ - appointment: A foreign key reference to the Appointment model
71
+
72
+ The model provides several methods to access related appointment details, such as service name, price, currency, client
73
+ name, and email.
74
+ It also includes a method to update the payment status.
75
+
76
+ ### EmailVerificationCode
77
+
78
+ The EmailVerificationCode model is used to represent an email verification code for a user when the email already exists
79
+ in the database.
80
+ It has the following fields:
81
+
82
+ - user: A foreign key reference to the user model defined in ` APPOINTMENT_CLIENT_MODEL `
83
+ - code: A randomly generated 6-character alphanumeric code
84
+
85
+ The model includes a class method to generate a new verification code for a user.
49
86
50
87
## Configuration
51
88
52
89
In your Django project's settings.py, you can override the default values for the appointment scheduler:
53
90
54
91
``` python
55
- APPOINTMENT_CLIENT_MODEL = ' auth.User' # file.Model
92
+ APPOINTMENT_CLIENT_MODEL = ' auth.User' # file.Model
56
93
APPOINTMENT_BASE_TEMPLATE = ' base_templates/base.html'
57
94
APPOINTMENT_WEBSITE_NAME = ' Website'
58
95
APPOINTMENT_PAYMENT_URL = None
@@ -61,3 +98,4 @@ APPOINTMENT_SLOT_DURATION = 30 # minutes
61
98
APPOINTMENT_LEAD_TIME = (9 , 0 ) # (hour, minute) 24-hour format
62
99
APPOINTMENT_FINISH_TIME = (16 , 30 ) # (hour, minute) 24-hour format
63
100
```
101
+
0 commit comments