# Generated by Django 3.1.1 on 2021-01-25 09:38

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='Address2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_sfk', models.CharField(blank=True, max_length=100, null=True, verbose_name='Firma subiekta')),
                ('name', models.CharField(help_text='Nazwa adresowa', max_length=30)),
                ('nr_dom', models.CharField(blank=True, max_length=100, null=True, verbose_name='Nr domu')),
                ('nr_lok', models.CharField(blank=True, max_length=100, null=True, verbose_name='Nr lokalu')),
                ('city', models.CharField(blank=True, max_length=100, null=True, verbose_name='Miasto')),
                ('street', models.CharField(blank=True, max_length=100, null=True, verbose_name='Ulica')),
                ('distance', models.IntegerField(blank=True, help_text='Dystans do klienta w km', null=True, verbose_name='Km')),
                ('is_default', models.BooleanField(default=False, verbose_name='Domyślna')),
            ],
            options={
                'verbose_name': 'Adres2',
                'verbose_name_plural': 'Adresy2',
            },
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa firmy')),
                ('nip', models.BigIntegerField(unique=True, verbose_name='nip')),
                ('is_accepted', models.BooleanField(default=False, help_text='Tylko dla zaakceptowanych firm można utworzyć nowe umowy', verbose_name='Zaakceptowana firma')),
                ('care', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='opiekun')),
                ('care_substitute', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='zastepca', to=settings.AUTH_USER_MODEL, verbose_name='Zastepca opiekuna')),
            ],
            options={
                'verbose_name': 'Firma',
                'verbose_name_plural': 'Firmy',
            },
        ),
        migrations.CreateModel(
            name='Customer2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa')),
                ('street', models.CharField(blank=True, default='', max_length=50, verbose_name='Ulica')),
                ('postal_code', models.CharField(blank=True, default='', max_length=50, verbose_name='Kod pocztowy')),
                ('city', models.CharField(blank=True, default='', max_length=50, verbose_name='Miasto')),
                ('nip', models.CharField(blank=True, default='', max_length=13, verbose_name='NIP')),
                ('phone', models.CharField(blank=True, default='', max_length=20, verbose_name='Telefon')),
                ('cellphone', models.CharField(blank=True, default='', max_length=20, verbose_name='Komórka')),
                ('email', models.CharField(blank=True, default='', max_length=50, verbose_name='Email')),
            ],
            options={
                'verbose_name': 'Klient',
                'verbose_name_plural': 'Klienci',
            },
        ),
        migrations.CreateModel(
            name='DistanceCalcProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Nazwa profilu')),
                ('cost', models.FloatField(verbose_name='Koszt per km')),
                ('start', models.DateTimeField(help_text='Obowiązuje dla przeliczeń zleceń', null=True, verbose_name='Obowiązuje od')),
                ('end', models.DateTimeField(help_text='Obowiązuje dla przeliczeń zleceń', null=True, verbose_name='Obowiązuje do')),
            ],
            options={
                'verbose_name': 'Profil kosztów kilometrowych',
                'verbose_name_plural': 'Profile kosztów kilometrowych',
            },
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_sfk', models.CharField(help_text='Unikalny Symbol obiektu do komunikacji z API', max_length=50, null=True, verbose_name='Firma subiekta')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa')),
                ('start_date', models.DateField(null=True, verbose_name='Data zawarcia')),
                ('end_date', models.DateField(null=True, verbose_name='Data zakończenia')),
            ],
            options={
                'verbose_name': 'Dokument',
                'verbose_name_plural': 'Dokumenty',
            },
        ),
        migrations.CreateModel(
            name='DocumentStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa statusu')),
                ('description', models.TextField(verbose_name='Opis')),
            ],
            options={
                'verbose_name': 'Status umowy',
                'verbose_name_plural': 'Statusy umowy',
            },
        ),
        migrations.CreateModel(
            name='DocumentType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='Nazwa typu dokumentu')),
                ('description', models.TextField(blank=True, max_length=100, null=True, verbose_name='Opis typu dokumentu')),
            ],
            options={
                'verbose_name': 'Typ dokumentu',
                'verbose_name_plural': 'Typy dokumentów',
            },
        ),
        migrations.CreateModel(
            name='ImplementationType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Typ realizacji')),
                ('is_traveled', models.BooleanField(default=False, verbose_name='Wymaga dojazdu?')),
            ],
            options={
                'verbose_name': 'Typ realizacji',
                'verbose_name_plural': 'Typy realizacji',
            },
        ),
        migrations.CreateModel(
            name='OrderCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa')),
                ('description', models.TextField(blank=True, verbose_name='Opis')),
            ],
            options={
                'verbose_name': 'Kategoria zlecenia',
                'verbose_name_plural': 'Kategorie zleceń',
            },
        ),
        migrations.CreateModel(
            name='OrderStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Stan zlecenia')),
                ('description', models.TextField(blank=True, verbose_name='Opis')),
            ],
            options={
                'verbose_name': 'Stan zlecenia',
                'verbose_name_plural': 'Stany zleceń',
            },
        ),
        migrations.CreateModel(
            name='OrderType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, null=True, verbose_name='Nazwa')),
                ('description', models.TextField(blank=True, verbose_name='Opis')),
            ],
            options={
                'verbose_name': 'Typ zlecenia',
                'verbose_name_plural': 'Typy zleceń',
            },
        ),
        migrations.CreateModel(
            name='ProfileGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa')),
                ('description', models.TextField(blank=True, verbose_name='Opis')),
            ],
            options={
                'verbose_name': 'Grupy użytkowników',
                'verbose_name_plural': 'Grupy użytkowników',
            },
        ),
        migrations.CreateModel(
            name='ProfileType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa')),
                ('description', models.TextField(blank=True, verbose_name='Opis')),
            ],
            options={
                'verbose_name': 'Typ użytkownika',
                'verbose_name_plural': 'Typy użytkowników',
            },
        ),
        migrations.CreateModel(
            name='Rate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa')),
                ('start', models.TimeField(verbose_name='Od')),
                ('stop', models.TimeField(verbose_name='Do')),
                ('price', models.FloatField(verbose_name='Stawka godzinowa')),
                ('is_default', models.BooleanField(default=False, help_text='Stawka domyślna wg której będą rozliczane godziny w pakiecie', verbose_name='Domyślna stawka rozliczeniowa')),
            ],
            options={
                'verbose_name': 'Stawka',
                'verbose_name_plural': 'Stawki',
            },
        ),
        migrations.CreateModel(
            name='UserSettings',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email_notifications', models.BooleanField(default=True, verbose_name='Powiadomienia email')),
                ('alert_notifications', models.BooleanField(default=True, verbose_name='Powiadomienia o alertach')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Użytkownik')),
            ],
            options={
                'verbose_name': 'Ustawienia użytkownika',
                'verbose_name_plural': 'Ustawienia użytkowników',
            },
        ),
        migrations.CreateModel(
            name='RateStack',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa pakietu godzinowego')),
                ('start', models.DateTimeField(help_text='Obowiązuje dla przeliczeń zleceń', null=True, verbose_name='Obowiązuje od')),
                ('end', models.DateTimeField(help_text='Obowiązuje dla przeliczeń zleceń', null=True, verbose_name='Obowiązuje do')),
                ('rate', models.ManyToManyField(to='HD_app.Rate', verbose_name='Rate')),
            ],
            options={
                'verbose_name': 'Zestaw stawek',
                'verbose_name_plural': 'Zestawy stawek',
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cellphone', models.DecimalField(blank=True, decimal_places=0, max_digits=12, null=True, verbose_name='Telefon komórkowy')),
                ('thumb', models.ImageField(blank=True, default=None, help_text='Akceptowalne pliki: *jpg, *png', upload_to='thumbs/', verbose_name='Thumb')),
                ('idf', models.DecimalField(blank=True, decimal_places=0, max_digits=10, null=True, verbose_name='Klucz obcy')),
                ('tablef', models.CharField(blank=True, max_length=50, verbose_name='Tabela obca')),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.company', verbose_name='Firma')),
                ('group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.profilegroup', verbose_name='Grupa użytkowników')),
                ('typ', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='HD_app.profiletype', verbose_name='Typ')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Profil użytkownika',
                'verbose_name_plural': 'Profile użytkowników',
            },
        ),
        migrations.CreateModel(
            name='Pakiet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Nazwa')),
                ('included_hours', models.FloatField(default=0.0, help_text='Czas w ramach którego, klient nie pomosi dodatkowych kosztów za wsparcie w ramach umowy', verbose_name='Godziny w pakiecie')),
                ('abonament', models.FloatField(default=0, help_text='Abonament z PLN', verbose_name='Abonament')),
                ('ratestack', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.ratestack', verbose_name='Stawki godzinowe')),
            ],
            options={
                'verbose_name': 'Pakiet',
                'verbose_name_plural': 'Pakiety',
            },
        ),
        migrations.CreateModel(
            name='OrderTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Nazwa')),
                ('description', models.TextField(verbose_name='Opis')),
                ('implementation_type', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='HD_app.implementationtype', verbose_name='Domyślny typ realizacji zlecenia')),
                ('order_status', models.ForeignKey(default=3, on_delete=django.db.models.deletion.CASCADE, to='HD_app.orderstatus', verbose_name='Domyślny status zlecenia')),
                ('order_type', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='HD_app.ordertype', verbose_name='Domyślny typ zlecenia')),
            ],
            options={
                'verbose_name': 'Opis zlecenia',
                'verbose_name_plural': 'Opis zleceń',
            },
        ),
        migrations.CreateModel(
            name='Order2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', help_text='Krótka nazwa zlecenia', max_length=90, verbose_name='Nazwa')),
                ('start_datetime', models.DateTimeField(blank=True, null=True, verbose_name='Start')),
                ('end_datetime', models.DateTimeField(blank=True, null=True, verbose_name='Koniec')),
                ('description', models.TextField(default='', help_text='Tutaj opisz zlecenie. Możesz używać szablonów do wklejania poniej', max_length=999, verbose_name='Opis')),
                ('created_date', models.DateTimeField(blank=True, null=True, verbose_name='Data utworzenia')),
                ('updated_date', models.DateTimeField(blank=True, null=True, verbose_name='Data operacji na rekordzie')),
                ('address', models.ForeignKey(blank=True, help_text='Adres dojazdu. Wypełnij jeśli zlecenie wykonujesz u klienta. Automatycznie ustawiany jest domyślny dla firmy', null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.address2', verbose_name='Adres')),
                ('care', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Opiekun IT')),
                ('document', models.ForeignKey(help_text='Aktywne umowy klienckie', on_delete=django.db.models.deletion.CASCADE, to='HD_app.document', verbose_name='Umowa')),
                ('implementation_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.implementationtype', verbose_name='Typ realizacji')),
                ('order_status', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.orderstatus', verbose_name='Stan zlecenia')),
                ('order_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.ordertype', verbose_name='Typ zlecenia')),
            ],
            options={
                'verbose_name': 'Zlecenie',
                'verbose_name_plural': 'Zlecenia',
            },
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Tytuł')),
                ('description', models.TextField(blank=True, verbose_name='Wiadomość')),
                ('is_read', models.BooleanField(default=False, verbose_name='Przeczytana')),
                ('receipt', models.ManyToManyField(to=settings.AUTH_USER_MODEL, verbose_name='Adresat')),
                ('sender', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sender', to=settings.AUTH_USER_MODEL, verbose_name='Sender')),
            ],
            options={
                'verbose_name': 'Message',
                'verbose_name_plural': 'Messages',
            },
        ),
        migrations.AddField(
            model_name='document',
            name='document_type',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='HD_app.documenttype', verbose_name='Typ dokumentu'),
        ),
        migrations.AddField(
            model_name='document',
            name='status',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='HD_app.documentstatus', verbose_name='Status umowy'),
        ),
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_sfk', models.CharField(blank=True, max_length=100, null=True, verbose_name='Firma subiekta')),
                ('name', models.CharField(help_text='Nazwa adresowa', max_length=30)),
                ('nr_dom', models.CharField(blank=True, max_length=100, null=True, verbose_name='Nr domu')),
                ('nr_lok', models.CharField(blank=True, max_length=100, null=True, verbose_name='Nr lokalu')),
                ('address', models.CharField(blank=True, max_length=100, null=True, verbose_name='Adres')),
                ('city', models.CharField(blank=True, max_length=100, null=True, verbose_name='Miasto')),
                ('street', models.CharField(blank=True, max_length=100, null=True, verbose_name='Ulica')),
                ('distance', models.IntegerField(help_text='Dystans do klienta w km', verbose_name='Km')),
                ('is_default', models.BooleanField(default=False, verbose_name='Domyślna')),
                ('company', models.ForeignKey(blank=True, help_text='Dopnij firmę do tego adresu', null=True, on_delete=django.db.models.deletion.CASCADE, to='HD_app.company', verbose_name='Firma')),
            ],
            options={
                'verbose_name': 'Adres',
                'verbose_name_plural': 'Adresy',
            },
        ),
    ]
