# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-10-11 22:43
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('business_unit', '__first__'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('milestone', '__first__'),
        ('users', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='DevelopmentEntity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120, verbose_name='resource')),
                ('quantity', models.IntegerField(default=1, verbose_name='quantity')),
                ('category', models.CharField(blank=True, choices=[(b'hardware', b'hardware'), (b'software', b'software')], max_length=8, verbose_name='category')),
            ],
            options={
                'verbose_name': 'DevelopmentEntity',
                'verbose_name_plural': 'DevelopmentEntities',
            },
        ),
        migrations.CreateModel(
            name='DevelopmentProcess',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Domain',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('version_no', models.CharField(blank=True, max_length=20, null=True, verbose_name='Version Number')),
                ('approval_reference', models.CharField(blank=True, max_length=300, null=True, verbose_name='Approval Reference Detail')),
                ('objective', models.TextField(blank=True, null=True, verbose_name='Project Objectives')),
                ('goals', models.TextField(blank=True, null=True, verbose_name='5G Goals')),
                ('project_scope', models.TextField(blank=True, null=True, verbose_name='Scope of Project')),
                ('code', models.CharField(max_length=100, unique=True)),
                ('name', models.CharField(max_length=120, unique=True, verbose_name='Project Name')),
                ('project_no', models.IntegerField(verbose_name='Project Id')),
                ('short_name', models.CharField(max_length=80, verbose_name='Short Name')),
                ('approval_type', models.CharField(choices=[(b'internal', b'internal'), (b'external', b'external')], max_length=120, verbose_name='Approval Type')),
                ('planned_effort', models.DecimalField(blank=True, decimal_places=2, help_text='In Days', max_digits=10, null=True, verbose_name='Estimated Effort(man-days)')),
                ('other_project_type', models.CharField(blank=True, max_length=128, null=True, verbose_name='Other_project_type')),
                ('is_project_group', models.BooleanField(default=False)),
                ('is_active', models.BooleanField(default=True)),
                ('is_approved', models.BooleanField(default=True)),
                ('cancel', models.BooleanField(default=False)),
                ('estimated_time_exceed', models.BooleanField()),
                ('rejection_reason', models.TextField()),
                ('ex_approval', models.BooleanField(default=False)),
                ('apex_body_owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_apex', to=settings.AUTH_USER_MODEL, verbose_name='Apex Body Owner')),
                ('approved_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_approved_by', to=settings.AUTH_USER_MODEL, verbose_name='Request To')),
                ('business_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_business_unit', to='business_unit.BusinessUnit', verbose_name='Business unit')),
                ('customer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_customer', to='business_unit.BusinessUnit', verbose_name='Client Details')),
                ('customer_contact', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='users.UserProfile', verbose_name='Client Details')),
                ('delivery_centre', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_delivery_centre', to='business_unit.BusinessUnit', verbose_name='Delivery Centre')),
                ('development_environment', models.ManyToManyField(blank=True, related_name='projects_project_development_environment', to='projects.DevelopmentEntity', verbose_name='Development Environment')),
                ('development_process', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_development_process', to='projects.DevelopmentProcess', verbose_name='Development Process')),
                ('domain', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='projects.Domain', verbose_name='Domain')),
                ('milestone', models.ManyToManyField(to='milestone.Milestone', verbose_name='Milestone')),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_owner', to=settings.AUTH_USER_MODEL, verbose_name='Project Manager/Lead')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_parent', to='projects.Project', verbose_name='Parent')),
                ('project_owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_project_owner', to=settings.AUTH_USER_MODEL, verbose_name='Project Owner')),
            ],
            options={
                'verbose_name': 'Project',
                'verbose_name_plural': 'Projects',
            },
        ),
        migrations.CreateModel(
            name='ProjectAlertTime',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('record_id', models.CharField(max_length=255)),
                ('raised_on', models.DateField()),
            ],
        ),
        migrations.CreateModel(
            name='ProjectMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.Project')),
                ('roles', models.ManyToManyField(to='auth.Group')),
            ],
        ),
        migrations.CreateModel(
            name='ProjectRole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='auth.Group')),
            ],
        ),
        migrations.CreateModel(
            name='ProjectSchedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('expected_start_date', models.DateField(blank=True, null=True, verbose_name='Expected Start Date')),
                ('expected_end_date', models.DateField(blank=True, null=True, verbose_name='Expected End Date')),
                ('planned_start_date', models.DateField(blank=True, null=True, verbose_name='Planned Start Date')),
                ('planned_end_date', models.DateField(blank=True, null=True, verbose_name='Planned End Date')),
                ('approval_date', models.DateField(blank=True, null=True, verbose_name='Approval Date')),
                ('kick_off_meeting_planned_date', models.DateField(blank=True, null=True, verbose_name='Kick Off Meeting Planned Date')),
                ('kick_off_meeting_actual_date', models.DateField(blank=True, null=True, verbose_name='Kick Off Meeting Actual Date')),
                ('actual_start_date', models.DateField(blank=True, null=True, verbose_name='Actual Start Date')),
                ('actual_end_date', models.DateField(blank=True, null=True, verbose_name='Actual End Date')),
                ('initiation_request_date', models.DateField(blank=True, null=True, verbose_name='Requested By')),
                ('approved_date', models.DateField(blank=True, null=True, verbose_name='Approved on')),
                ('next_invoice_date', models.DateField(blank=True, null=True, verbose_name='Next Invoice Date')),
            ],
            options={
                'verbose_name': 'Project Schedule',
                'verbose_name_plural': 'Project Schedule',
            },
        ),
        migrations.CreateModel(
            name='ProjectType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('level', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Technology',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
            ],
            options={
                'ordering': ['name'],
                'verbose_name': 'Technology',
                'verbose_name_plural': 'Technologies',
            },
        ),
        migrations.AddField(
            model_name='project',
            name='project_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='projects.ProjectType', verbose_name='Project Type'),
        ),
        migrations.AddField(
            model_name='project',
            name='requested_by',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='projects_project_requested_by', to=settings.AUTH_USER_MODEL, verbose_name='Requested By'),
        ),
        migrations.AddField(
            model_name='project',
            name='schedules',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='projects.ProjectSchedule', verbose_name='Project Schedule'),
        ),
        migrations.AddField(
            model_name='project',
            name='team',
            field=models.ManyToManyField(related_name='projects_project_team', through='projects.ProjectMembership', to=settings.AUTH_USER_MODEL, verbose_name='team'),
        ),
        migrations.AddField(
            model_name='project',
            name='technology',
            field=models.ManyToManyField(blank=True, related_name='projects_project_technology', to='projects.Technology', verbose_name='technology'),
        ),
    ]
