# Generated by Django 3.0.4 on 2020-03-12 19:42

from django.conf import settings
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='invoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('invoice_no', models.CharField(max_length=20)),
                ('issue_date', models.DateTimeField()),
                ('due_date', models.DateTimeField()),
                ('amount', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='invoice_fee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rate', models.FloatField()),
                ('is_hourly_charge', models.BooleanField()),
                ('hours', models.FloatField()),
                ('total', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='invoice_status',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status_name', models.CharField(max_length=100)),
                ('logo', models.CharField(max_length=100)),
                ('color_code', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='payment_methods',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('method', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='TicketAssign',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('team', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='TicketChat',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField()),
                ('message', models.CharField(max_length=600)),
                ('status', models.BooleanField(default=False)),
                ('send_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TicketPriority',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('priority', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TicketsAttachments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(upload_to='ticket_attachments/')),
            ],
        ),
        migrations.CreateModel(
            name='TicketService',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TicketStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(blank=True, max_length=100, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Tickets',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=200)),
                ('description', models.TextField()),
                ('created_at', models.DateTimeField(auto_now=True)),
                ('mode', models.CharField(blank=True, max_length=30, null=True)),
                ('user_assigned', models.CharField(blank=True, max_length=30, null=True)),
                ('jira_key', models.CharField(blank=True, max_length=30, null=True)),
                ('jira_id', models.IntegerField(blank=True, null=True)),
                ('assign_to', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ticket_team', to='invoice_and_tickets.TicketAssign')),
                ('attachments', models.ManyToManyField(blank=True, null=True, to='invoice_and_tickets.TicketsAttachments')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ticket_created_by', to=settings.AUTH_USER_MODEL)),
                ('priority', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='invoice_and_tickets.TicketPriority')),
                ('service', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='invoice_and_tickets.TicketService')),
                ('status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='invoice_and_tickets.TicketStatus')),
            ],
        ),
        migrations.CreateModel(
            name='TicketChatAttachments',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField()),
                ('type', models.CharField(max_length=35)),
                ('attachment', models.FileField(upload_to='ticket_attachment/')),
                ('ticketchat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='invoice_and_tickets.TicketChat')),
            ],
        ),
        migrations.AddField(
            model_name='ticketchat',
            name='tickets',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='invoice_and_tickets.Tickets'),
        ),
        migrations.CreateModel(
            name='invoice_payment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.FloatField()),
                ('invoice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='invoice_and_tickets.invoice')),
                ('payment_method', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='invoice_and_tickets.payment_methods')),
            ],
        ),
    ]
