# Generated by Django 4.2.2 on 2023-07-19 13:16

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

from django.utils.module_loading import import_string
from django.conf import settings

models_AutoField = import_string(settings.DEFAULT_AUTO_FIELD)


class Migration(migrations.Migration):
    dependencies = [
        ("order", "0014_tax_code"),
    ]

    operations = [
        migrations.CreateModel(
            name="OrderLineDiscount",
            fields=[
                (
                    "id",
                    models_AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_incl_tax", models.BooleanField()),
                (
                    "amount",
                    models.DecimalField(
                        decimal_places=2,
                        default=0,
                        max_digits=12,
                        verbose_name="Line discount (excl. tax)",
                    ),
                ),
                (
                    "line",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="discounts",
                        to="order.line",
                        verbose_name="Line",
                    ),
                ),
                (
                    "order_discount",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="discount_lines",
                        to="order.orderdiscount",
                        verbose_name="Order discount",
                    ),
                ),
            ],
            options={
                "verbose_name": "Order line discount",
                "verbose_name_plural": "Order line discounts",
                "ordering": ["pk"],
                "abstract": False,
            },
        ),
    ]
