# Generated by Django 3.0.7 on 2021-07-27 17:49

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('filename', models.CharField(max_length=2000)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('text', models.CharField(max_length=200)),
                ('category', models.CharField(default='', max_length=200)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Material',
                'verbose_name_plural': 'Materialen',
                'ordering': ('category', 'text'),
            },
        ),
        migrations.CreateModel(
            name='Offer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('provider_type', models.CharField(choices=[('PRIVATE', 'Privat'), ('COMMERCIAL', 'Kommerziell')], default='PRIVATE', max_length=100, verbose_name='provider_type')),
                ('provider_description', models.CharField(blank=True, max_length=1000, null=True)),
                ('email', models.EmailField(max_length=254)),
                ('person_name', models.CharField(max_length=200, null=True, verbose_name='Name')),
                ('phone_number', models.CharField(max_length=50, null=True, verbose_name='Telefonnummer')),
                ('message', models.TextField(blank=True, null=True, verbose_name='Nachricht')),
                ('import_preferences', models.TextField(choices=[('PICKUP', 'Abholung'), ('DELIVERY', 'Lieferung an Material Mafia (bevorzugt)')], default='PICKUP', max_length=9, null=True, verbose_name='Lieferpräferenzen')),
                ('import_at', models.DateTimeField(blank=True, null=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('images', models.ManyToManyField(blank=True, related_name='offer_images', to='inventory.Image')),
            ],
            options={
                'verbose_name': 'Angebot',
                'verbose_name_plural': 'Angebote',
                'ordering': ['-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='OfferStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('text', models.CharField(max_length=40)),
                ('display_name', models.CharField(max_length=200)),
                ('help_text', models.TextField(blank=True, null=True)),
                ('ordering', models.IntegerField(default=0)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='Email')),
                ('name', models.CharField(blank=True, max_length=200, null=True, verbose_name='Name')),
                ('phone_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='Telefonnummer')),
                ('notes', models.TextField(blank=True, null=True, verbose_name='Notiz')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Personen',
            },
        ),
        migrations.CreateModel(
            name='OfferStatusLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('offer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.Offer')),
                ('offer_status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.OfferStatus')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='offer',
            name='offer_status',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='inventory.OfferStatus'),
        ),
        migrations.AddField(
            model_name='offer',
            name='thumbnail_image',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='offer_thumbnail_image', to='inventory.Image'),
        ),
        migrations.CreateModel(
            name='Objekt',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('title', models.CharField(max_length=200, verbose_name='Haupttitel')),
                ('unit', models.CharField(choices=[('QUADRATMETER', 'Quadratmeter'), ('LFM', 'LFM'), ('STUECK', 'Stück')], default='QUADRATMETER', max_length=200, null=True, verbose_name='Einheit')),
                ('width', models.FloatField(blank=True, default=None, null=True, verbose_name='Breite (cm)')),
                ('height', models.FloatField(blank=True, default=None, null=True, verbose_name='Höhe (cm)')),
                ('depth', models.FloatField(blank=True, default=None, null=True, verbose_name='Tiefe (cm)')),
                ('treatment_notes', models.TextField(blank=True, null=True, verbose_name='Behandlungshinweise')),
                ('mass', models.FloatField(blank=True, default=None, null=True, verbose_name='Gewicht (kg)')),
                ('count', models.IntegerField(blank=True, default=0, null=True, verbose_name='Stückanzahl')),
                ('condition', models.CharField(choices=[('NEW', 'Neu/Neuwertig'), ('USED', 'Gebraucht'), ('VERY_USED', 'Sehr gebraucht')], default='NEW', max_length=9, null=True, verbose_name='Zustand')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Beschreibung')),
                ('price', models.FloatField(blank=True, null=True, verbose_name='Verkaufspreis (€/Einheit)')),
                ('reference_price', models.FloatField(blank=True, null=True, verbose_name='Referenzpreis (€/Einheit)')),
                ('eco_cost', models.FloatField(blank=True, null=True, verbose_name='Ecocost (€/Einheit)')),
                ('available_on_restado', models.BooleanField(default=False)),
                ('knowledge_base', models.BooleanField(default=False)),
                ('sold_at', models.DateTimeField(null=True)),
                ('sold_count', models.IntegerField(null=True)),
                ('sold_price_per_unit', models.FloatField(null=True)),
                ('archived_at', models.DateTimeField(blank=True, null=True)),
                ('cloned_from', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='cloned_from_children', to='inventory.Objekt')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('images', models.ManyToManyField(blank=True, related_name='objekt_images', to='inventory.Image')),
                ('material', models.ManyToManyField(to='inventory.Material', verbose_name='Material')),
                ('offer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.Offer')),
                ('partial_sale_parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='partial_sale_children', to='inventory.Objekt')),
                ('sold_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sold_by', to=settings.AUTH_USER_MODEL)),
                ('thumbnail_image', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='objekt_thumbnail_image', to='inventory.Image')),
            ],
            options={
                'verbose_name': 'Objekt',
                'verbose_name_plural': 'Objekte',
                'ordering': ['-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('text', models.TextField(blank=True, null=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('objekt', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='comments', to='inventory.Objekt')),
            ],
            options={
                'verbose_name': 'Bemerkung',
                'verbose_name_plural': 'Bemerkungen',
            },
        ),
    ]

# Generated by Django 3.0.7 on 2021-07-27 17:49

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('filename', models.CharField(max_length=2000)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('text', models.CharField(max_length=200)),
                ('category', models.CharField(default='', max_length=200)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Material',
                'verbose_name_plural': 'Materialen',
                'ordering': ('category', 'text'),
            },
        ),
        migrations.CreateModel(
            name='Offer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('provider_type', models.CharField(choices=[('PRIVATE', 'Privat'), ('COMMERCIAL', 'Kommerziell')], default='PRIVATE', max_length=100, verbose_name='provider_type')),
                ('provider_description', models.CharField(blank=True, max_length=1000, null=True)),
                ('email', models.EmailField(max_length=254)),
                ('person_name', models.CharField(max_length=200, null=True, verbose_name='Name')),
                ('phone_number', models.CharField(max_length=50, null=True, verbose_name='Telefonnummer')),
                ('message', models.TextField(blank=True, null=True, verbose_name='Nachricht')),
                ('import_preferences', models.TextField(choices=[('PICKUP', 'Abholung'), ('DELIVERY', 'Lieferung an Material Mafia (bevorzugt)')], default='PICKUP', max_length=9, null=True, verbose_name='Lieferpräferenzen')),
                ('import_at', models.DateTimeField(blank=True, null=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('images', models.ManyToManyField(blank=True, related_name='offer_images', to='inventory.Image')),
            ],
            options={
                'verbose_name': 'Angebot',
                'verbose_name_plural': 'Angebote',
                'ordering': ['-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='OfferStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('text', models.CharField(max_length=40)),
                ('display_name', models.CharField(max_length=200)),
                ('help_text', models.TextField(blank=True, null=True)),
                ('ordering', models.IntegerField(default=0)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='Email')),
                ('name', models.CharField(blank=True, max_length=200, null=True, verbose_name='Name')),
                ('phone_number', models.CharField(blank=True, max_length=50, null=True, verbose_name='Telefonnummer')),
                ('notes', models.TextField(blank=True, null=True, verbose_name='Notiz')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Personen',
            },
        ),
        migrations.CreateModel(
            name='OfferStatusLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('offer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.Offer')),
                ('offer_status', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.OfferStatus')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='offer',
            name='offer_status',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, to='inventory.OfferStatus'),
        ),
        migrations.AddField(
            model_name='offer',
            name='thumbnail_image',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='offer_thumbnail_image', to='inventory.Image'),
        ),
        migrations.CreateModel(
            name='Objekt',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('title', models.CharField(max_length=200, verbose_name='Haupttitel')),
                ('unit', models.CharField(choices=[('QUADRATMETER', 'Quadratmeter'), ('LFM', 'LFM'), ('STUECK', 'Stück')], default='QUADRATMETER', max_length=200, null=True, verbose_name='Einheit')),
                ('width', models.FloatField(blank=True, default=None, null=True, verbose_name='Breite (cm)')),
                ('height', models.FloatField(blank=True, default=None, null=True, verbose_name='Höhe (cm)')),
                ('depth', models.FloatField(blank=True, default=None, null=True, verbose_name='Tiefe (cm)')),
                ('treatment_notes', models.TextField(blank=True, null=True, verbose_name='Behandlungshinweise')),
                ('mass', models.FloatField(blank=True, default=None, null=True, verbose_name='Gewicht (kg)')),
                ('count', models.IntegerField(blank=True, default=0, null=True, verbose_name='Stückanzahl')),
                ('condition', models.CharField(choices=[('NEW', 'Neu/Neuwertig'), ('USED', 'Gebraucht'), ('VERY_USED', 'Sehr gebraucht')], default='NEW', max_length=9, null=True, verbose_name='Zustand')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Beschreibung')),
                ('price', models.FloatField(blank=True, null=True, verbose_name='Verkaufspreis (€/Einheit)')),
                ('reference_price', models.FloatField(blank=True, null=True, verbose_name='Referenzpreis (€/Einheit)')),
                ('eco_cost', models.FloatField(blank=True, null=True, verbose_name='Ecocost (€/Einheit)')),
                ('available_on_restado', models.BooleanField(default=False)),
                ('knowledge_base', models.BooleanField(default=False)),
                ('sold_at', models.DateTimeField(null=True)),
                ('sold_count', models.IntegerField(null=True)),
                ('sold_price_per_unit', models.FloatField(null=True)),
                ('archived_at', models.DateTimeField(blank=True, null=True)),
                ('cloned_from', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='cloned_from_children', to='inventory.Objekt')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('images', models.ManyToManyField(blank=True, related_name='objekt_images', to='inventory.Image')),
                ('material', models.ManyToManyField(to='inventory.Material', verbose_name='Material')),
                ('offer', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.Offer')),
                ('partial_sale_parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='partial_sale_children', to='inventory.Objekt')),
                ('sold_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sold_by', to=settings.AUTH_USER_MODEL)),
                ('thumbnail_image', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='objekt_thumbnail_image', to='inventory.Image')),
            ],
            options={
                'verbose_name': 'Objekt',
                'verbose_name_plural': 'Objekte',
                'ordering': ['-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('text', models.TextField(blank=True, null=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('objekt', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='comments', to='inventory.Objekt')),
            ],
            options={
                'verbose_name': 'Bemerkung',
                'verbose_name_plural': 'Bemerkungen',
            },
        ),
    ]

# Generated by Django 3.0.7 on 2021-07-27 17:49