Add comprehensive API documentation for user management endpoints including profile updates, user listing, and admin user management features. Update appointment model to include additional status options (completed, cancelled) and add max_length constraint to email field. Change appointment creation endpoint to require user authentication instead of being public. Changes: - Add API docs for update_profile, get_profile, all-users endpoints - Add API docs for activate-deactivate-user and delete-user admin endpoints - Update appointment creation to require authentication - Add 'completed' and 'cancelled' status options to Appointment model - Add max_length constraint to EncryptedEmailField - Regenerate initial migration with updated model definitions
56 lines
2.8 KiB
Python
56 lines
2.8 KiB
Python
# Generated by Django 5.2.8 on 2025-11-23 12:42
|
|
|
|
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')),
|
|
('available_days', models.JSONField(default=list, help_text='List of weekdays (0-6) when appointments are accepted')),
|
|
('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=100)),
|
|
('last_name', meetings.models.EncryptedCharField(max_length=100)),
|
|
('email', meetings.models.EncryptedEmailField(max_length=254)),
|
|
('phone', meetings.models.EncryptedCharField(blank=True, max_length=20)),
|
|
('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'],
|
|
},
|
|
),
|
|
]
|