# Generated by Django 3.0.3 on 2021-04-19 19:43

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('firstName', models.CharField(max_length=50)),
                ('lastName', models.CharField(max_length=50)),
                ('number', models.CharField(max_length=11, validators=[django.core.validators.RegexValidator(message="Phone number must be 11 digits format '00000000000'", regex='^\\d{11}$')])),
                ('email', models.EmailField(max_length=254, null=True)),
                ('address', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ticketName', models.CharField(max_length=100)),
                ('deviceMake', models.CharField(max_length=30)),
                ('deviceModel', models.CharField(max_length=50)),
                ('deviceType', models.CharField(choices=[('Mobile Phone', 'Mobile Phone'), ('Laptop', 'Laptop'), ('Desktop', 'Desktop'), ('Games Console', 'Games Console'), ('Tablet', 'Tablet'), ('Smart device', 'Smart Device'), ('Other', 'Other')], max_length=15)),
                ('createdDate', models.DateTimeField(auto_now_add=True)),
                ('lastUpdated', models.DateTimeField(auto_now=True)),
                ('ticketDescription', models.TextField()),
                ('ticketStatus', models.CharField(choices=[('Open', 'Open'), ('Waiting on Customer', 'Waiting on Customer'), ('Waiting for Parts', 'Waiting for Parts'), ('Closed', 'Closed')], max_length=30)),
                ('assigned', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='assignedTechnician', to=settings.AUTH_USER_MODEL)),
                ('createdBy', models.ForeignKey(editable=False, on_delete=models.SET('Admin'), related_name='createdByTechnician', to=settings.AUTH_USER_MODEL)),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='ticketingsystem.Customer')),
                ('updatedBy', models.ForeignKey(editable=False, on_delete=models.SET('Admin'), related_name='updatedByTechnician', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
