# Generated by Django 5.0.3 on 2026-04-01 06:08

import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Bengkel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True)),
                ('tarikh', models.DateTimeField()),
                ('tarikh_tamat', models.DateTimeField(blank=True, null=True)),
                ('lokasi_nama', models.CharField(max_length=300)),
                ('lokasi_alamat', models.TextField(blank=True)),
                ('organizer_nama', models.CharField(max_length=200)),
                ('organizer_email', models.EmailField(blank=True, max_length=254)),
                ('organizer_telefon', models.CharField(blank=True, max_length=30)),
                ('video_ucapan_url', models.URLField(blank=True)),
                ('video_arah_url', models.URLField(blank=True)),
                ('had_peserta', models.PositiveIntegerField(default=0)),
                ('status', models.CharField(choices=[('draft', 'Draf'), ('published', 'Diterbitkan'), ('completed', 'Selesai'), ('cancelled', 'Dibatalkan')], default='draft', max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='bengkel_dicipta', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Bengkel',
                'verbose_name_plural': 'Senarai Bengkel',
                'ordering': ['-tarikh'],
            },
        ),
        migrations.CreateModel(
            name='Jemputan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nama', models.CharField(max_length=200)),
                ('email', models.EmailField(max_length=254)),
                ('organisasi', models.CharField(blank=True, max_length=200)),
                ('jawatan', models.CharField(blank=True, max_length=200)),
                ('token', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('qr_token', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('status', models.CharField(choices=[('pending', 'Menunggu'), ('accepted', 'Diterima'), ('rejected', 'Ditolak')], default='pending', max_length=20)),
                ('responded_at', models.DateTimeField(blank=True, null=True)),
                ('catatan_invitee', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('bengkel', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jemputan', to='bengkel.bengkel')),
                ('dijemput_oleh', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='jemputan_dihantar', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Jemputan',
                'verbose_name_plural': 'Senarai Jemputan',
                'ordering': ['-created_at'],
                'unique_together': {('bengkel', 'email')},
            },
        ),
        migrations.CreateModel(
            name='Kehadiran',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('checked_in_at', models.DateTimeField(auto_now_add=True)),
                ('checked_in_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='check_ins', to=settings.AUTH_USER_MODEL)),
                ('jemputan', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='kehadiran', to='bengkel.jemputan')),
            ],
            options={
                'verbose_name': 'Kehadiran',
                'verbose_name_plural': 'Rekod Kehadiran',
            },
        ),
    ]
