# Generated by Django 2.2.7 on 2019-11-09 01:49

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('is_superuser', models.BooleanField(default=False)),
                ('username', models.CharField(max_length=30, unique=True)),
                ('user_type', models.CharField(choices=[('D', 'Driver'), ('O', 'Official')], default='D', max_length=1, verbose_name='User Type')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', 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={
                'ordering': ('-created_at',),
            },
        ),
        migrations.CreateModel(
            name='Driver',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='License',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_issued', models.DateField(verbose_name='Date Issued')),
                ('date_of_expiry', models.DateField(verbose_name='Date of Expiry')),
                ('restriction_numbers', models.CharField(max_length=8, verbose_name='Restriction Numbers')),
                ('condition_code', models.CharField(blank=True, choices=[('A', 'Wear eyeglasses'), ('B', 'Drive with special equipment for upper limbs'), ('C', 'Drive with special equipment for lower limbs'), ('D', 'Daylight driving only'), ('E', 'Should always be accompanied by a person without hearing impairment')], max_length=1, null=True)),
                ('agency_code', models.CharField(max_length=3, verbose_name='Agency Code')),
                ('license_number', models.CharField(max_length=15, verbose_name='License Number')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=30)),
                ('middle_name', models.CharField(blank=True, max_length=30, null=True)),
                ('last_name', models.CharField(max_length=30)),
                ('email', models.EmailField(blank=True, max_length=254, null=True, unique=True)),
                ('contact_number', models.CharField(blank=True, max_length=15, null=True)),
                ('profile_pic', models.ImageField(blank=True, null=True, upload_to='users/profile-pictures/', verbose_name='Profile Picture')),
                ('sex', models.CharField(blank=True, choices=[('M', 'Male'), ('F', 'Female')], max_length=1, null=True)),
                ('address', models.CharField(blank=True, max_length=100, null=True)),
                ('blood_type', models.CharField(choices=[('O+', 'O+'), ('O-', 'O-'), ('A+', 'A+'), ('A-', 'A-'), ('B+', 'B+'), ('B-', 'B-'), ('AB+', 'AB+'), ('AB-', 'AB-')], max_length=2, verbose_name='Blood Type')),
                ('eye_color', models.CharField(max_length=10)),
                ('height', models.PositiveSmallIntegerField(verbose_name='Height (cm)')),
                ('weight', models.PositiveSmallIntegerField(verbose_name='Weight (kg)')),
                ('nationality', models.CharField(max_length=20)),
                ('birth_date', models.DateField(verbose_name='Birth Date')),
                ('points', models.PositiveIntegerField(default=20)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Violation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30)),
                ('short_description', models.CharField(blank=True, max_length=150, null=True, verbose_name='Short Description')),
                ('description', models.TextField()),
                ('datetime_issued', models.DateTimeField(verbose_name='Datetime Issued')),
                ('location', models.CharField(max_length=100)),
                ('driver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.Driver')),
            ],
        ),
        migrations.CreateModel(
            name='Vehicle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('make', models.CharField(max_length=30)),
                ('model', models.CharField(max_length=30)),
                ('year', models.PositiveIntegerField()),
                ('plate_number', models.CharField(max_length=11, verbose_name='Plate Number')),
                ('status_type', models.CharField(choices=[('CO', 'Traffic Collision'), ('CL', 'Clamped'), ('TO', 'Towed'), ('OK', 'OK')], default='OK', max_length=2)),
                ('driver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vehicles', to='users.Driver')),
            ],
            options={
                'default_related_name': 'vehicles',
            },
        ),
        migrations.CreateModel(
            name='PartyInvolved',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('involvement_description', models.CharField(max_length=150, verbose_name='Involvement Description')),
                ('license', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='parties_involved', to='users.License')),
                ('vehicle', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='parties_involved', to='users.Vehicle')),
                ('violation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parties_involved', to='users.Violation')),
            ],
            options={
                'default_related_name': 'parties_involved',
            },
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_viewed', models.BooleanField(default=False)),
                ('description', models.CharField(max_length=150)),
                ('notification_type', models.CharField(choices=[('CO', 'Traffic Collision'), ('CL', 'Clamped'), ('TO', 'Towed'), ('OK', 'OK')], max_length=1, verbose_name='Notification Type')),
                ('driver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='users.Driver')),
            ],
            options={
                'default_related_name': 'notifications',
            },
        ),
        migrations.CreateModel(
            name='Fee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deadline', models.DateField()),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('is_paid', models.BooleanField(default=False)),
                ('driver', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fees', to='users.Driver')),
                ('violation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='fees', to='users.Violation')),
            ],
            options={
                'default_related_name': 'fees',
            },
        ),
        migrations.AddField(
            model_name='driver',
            name='license',
            field=models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, to='users.License'),
        ),
        migrations.AddField(
            model_name='driver',
            name='profile',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='users.Profile'),
        ),
        migrations.AddField(
            model_name='driver',
            name='user',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
