# Generated by Django 3.2.5 on 2021-07-24 15:19

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('vendor_id', models.IntegerField()),
                ('customer_id', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Promotion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='VendorCommisions',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField()),
                ('vendor_id', models.IntegerField()),
                ('rate', models.DecimalField(decimal_places=2, max_digits=8)),
            ],
        ),
        migrations.CreateModel(
            name='ProductPromotion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField()),
                ('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='metrics_report.product')),
                ('promotion_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='metrics_report.promotion')),
            ],
        ),
        migrations.CreateModel(
            name='OrderLine',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product_description', models.CharField(max_length=255)),
                ('product_price', models.DecimalField(decimal_places=2, max_digits=8)),
                ('product_vat_rate', models.DecimalField(decimal_places=2, max_digits=3)),
                ('discount_rate', models.IntegerField()),
                ('quantity', models.IntegerField()),
                ('full_price_amount', models.DecimalField(decimal_places=2, max_digits=8)),
                ('dicounted_amount', models.DecimalField(decimal_places=2, max_digits=8)),
                ('vat_amount', models.IntegerField()),
                ('total_amount', models.IntegerField()),
                ('order_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='metrics_report.order')),
                ('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='metrics_report.product')),
            ],
        ),
    ]
