# Generated by Django 2.2.1 on 2019-05-21 10:50

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('emp_number', models.CharField(max_length=6, validators=[django.core.validators.RegexValidator('[A-Z]{2}[0-9]{4}', 'Employee number format needs to be AA0000')], verbose_name='Employee Number')),
                ('phone_number', models.CharField(max_length=10, validators=[django.core.validators.RegexValidator('{\\d{10}}', 'Phone number format needs to be #########')], verbose_name='Phone Number')),
                ('first_name', models.CharField(max_length=25, verbose_name='First Name')),
                ('last_name', models.CharField(max_length=30, verbose_name='Last Name')),
            ],
            options={
                'verbose_name': 'Employee',
                'ordering': ['last_name', 'first_name', 'emp_number'],
                'unique_together': {('last_name', 'first_name', 'emp_number')},
            },
        ),
        migrations.CreateModel(
            name='Leave',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Start Date')),
                ('end_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='End Date')),
                ('days_of_leave', models.IntegerField(default=0)),
                ('status', models.CharField(choices=[('New', 'New'), ('Approved', 'Approved'), ('Declined', 'Declined')], default='Approved', max_length=10)),
                ('employee_pk', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='leavemanage.Employee')),
            ],
            options={
                'verbose_name': 'Leave',
                'ordering': ['start_date', 'end_date', 'employee_pk'],
                'unique_together': {('start_date', 'end_date', 'employee_pk')},
            },
        ),
    ]
