Files
Salon/backend/apps/accounts/migrations/0001_initial.py
T
mohd dc68ecfe4c Summary of what I changed and added:
Added initial migrations for accounts, salons, bookings, payments.
0001_initial.py
0001_initial.py
0001_initial.py
0001_initial.py
Added demo seeding command.
seed_demo.py
OTP provider abstraction now includes Twilio + Unifonic adapter scaffolds (not implemented yet, they raise).
otp.py
Moyasar gateway scaffold added (not implemented yet, raises).
gateway.py
Added .env loading in settings and expanded .env.example for OTP and Moyasar.
settings.py
.env.example
Captured current gaps/risks in a tracked doc as requested.
risks.md
Updated README with seeding guidance and risk doc pointer.
README.md
2026-02-27 15:10:30 +03:00

94 lines
3.9 KiB
Python

from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
]
operations = [
migrations.CreateModel(
name="User",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("password", models.CharField(max_length=128, verbose_name="password")),
("last_login", models.DateTimeField(blank=True, null=True, verbose_name="last login")),
(
"is_superuser",
models.BooleanField(
default=False,
help_text="Designates that this user has all permissions without explicitly assigning them.",
verbose_name="superuser status",
),
),
("email", models.EmailField(max_length=254, unique=True)),
("phone_number", models.CharField(blank=True, max_length=20, null=True, unique=True)),
(
"role",
models.CharField(
choices=[
("admin", "Admin"),
("manager", "Salon Manager"),
("staff", "Staff"),
("customer", "Customer"),
],
default="customer",
max_length=20,
),
),
("first_name", models.CharField(blank=True, max_length=150)),
("last_name", models.CharField(blank=True, max_length=150)),
("is_phone_verified", models.BooleanField(default=False)),
("is_active", models.BooleanField(default=True)),
("is_staff", models.BooleanField(default=False)),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
(
"groups",
models.ManyToManyField(
blank=True,
help_text="The groups this user belongs to.",
related_name="user_set",
related_query_name="user",
to="auth.group",
verbose_name="groups",
),
),
(
"user_permissions",
models.ManyToManyField(
blank=True,
help_text="Specific permissions for this user.",
related_name="user_set",
related_query_name="user",
to="auth.permission",
verbose_name="user permissions",
),
),
],
options={"abstract": False},
),
migrations.CreateModel(
name="PhoneOTP",
fields=[
("id", models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
("phone_number", models.CharField(max_length=20)),
(
"channel",
models.CharField(
choices=[("sms", "SMS"), ("whatsapp", "WhatsApp")],
max_length=20,
),
),
("provider", models.CharField(max_length=50)),
("code_hash", models.CharField(max_length=128)),
("created_at", models.DateTimeField(auto_now_add=True)),
("expires_at", models.DateTimeField()),
("verified_at", models.DateTimeField(blank=True, null=True)),
],
),
]