Compare commits

...

3 Commits

Author SHA1 Message Date
2f56f6bb49 Merge pull request 'feature/meetings' (#42) from feature/meetings into main
Reviewed-on: https://gitea.blackbusinesslabs.com/ATTUNE-HEART-THERAPY/alternative-backend-service/pulls/42
2025-11-27 15:00:44 +00:00
0e7e51dc7d Deleting migrations 2025-11-27 15:00:16 +00:00
7d5d3217a0 fix: allow null values for Jitsi fields in AppointmentRequest
Add `null=True` to `jitsi_meet_url` and `jitsi_room_id` fields in the AppointmentRequest model. This allows these optional fields to be NULL at the database level in addition to accepting blank values, which is the proper Django pattern for optional string-based fields.

This change requires a database migration to be generated and applied.
2025-11-27 14:56:37 +00:00
2 changed files with 2 additions and 58 deletions

View File

@ -1,56 +0,0 @@
# Generated by Django 5.2.8 on 2025-11-27 14:43
import meetings.models
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AdminWeeklyAvailability',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('availability_schedule', models.JSONField(default=dict, help_text='Dictionary with days as keys and lists of time slots as values')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Admin Weekly Availability',
'verbose_name_plural': 'Admin Weekly Availability',
},
),
migrations.CreateModel(
name='AppointmentRequest',
fields=[
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('first_name', meetings.models.EncryptedCharField(max_length=255)),
('last_name', meetings.models.EncryptedCharField(max_length=255)),
('email', meetings.models.EncryptedEmailField(max_length=254)),
('phone', meetings.models.EncryptedCharField(blank=True, max_length=255)),
('reason', meetings.models.EncryptedTextField(blank=True)),
('preferred_dates', models.JSONField(help_text='List of preferred dates (YYYY-MM-DD format)')),
('preferred_time_slots', models.JSONField(help_text='List of preferred time slots (morning/afternoon/evening)')),
('status', models.CharField(choices=[('pending_review', 'Pending Review'), ('scheduled', 'Scheduled'), ('rejected', 'Rejected'), ('completed', 'Completed'), ('cancelled', 'Cancelled')], default='pending_review', max_length=20)),
('scheduled_datetime', models.DateTimeField(blank=True, null=True)),
('scheduled_duration', models.PositiveIntegerField(default=60, help_text='Duration in minutes')),
('rejection_reason', meetings.models.EncryptedTextField(blank=True)),
('jitsi_meet_url', models.URLField(blank=True, help_text='Jitsi Meet URL for the video session')),
('jitsi_room_id', models.CharField(blank=True, help_text='Jitsi room ID', max_length=100, unique=True)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
options={
'verbose_name': 'Appointment Request',
'verbose_name_plural': 'Appointment Requests',
'ordering': ['-created_at'],
'indexes': [models.Index(fields=['status', 'scheduled_datetime'], name='meetings_ap_status_4e4e26_idx'), models.Index(fields=['email', 'created_at'], name='meetings_ap_email_b8ed9d_idx')],
},
),
]

View File

@ -203,8 +203,8 @@ class AppointmentRequest(models.Model):
)
rejection_reason = EncryptedTextField(blank=True)
jitsi_meet_url = models.URLField(blank=True, help_text="Jitsi Meet URL for the video session")
jitsi_room_id = models.CharField(max_length=100, unique=True, blank=True, help_text="Jitsi room ID")
jitsi_meet_url = models.URLField(blank=True, null=True, help_text="Jitsi Meet URL for the video session")
jitsi_room_id = models.CharField(max_length=100, unique=True, null=True, blank=True, help_text="Jitsi room ID")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)