# Generated by Django 4.2.13 on 2024-08-29 15:31

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

# Project
import kapt_ads.models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Advertiser",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=250, verbose_name="Name")),
            ],
            options={
                "verbose_name": "Advertiser",
                "verbose_name_plural": "Advertisers",
            },
        ),
        migrations.CreateModel(
            name="Ad",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("label", models.CharField(max_length=150, verbose_name="Label")),
                (
                    "image",
                    models.ImageField(
                        upload_to=kapt_ads.models.get_ad_filename, verbose_name="Image"
                    ),
                ),
                ("text", models.TextField(blank=True, null=True, verbose_name="Text")),
                (
                    "target_url",
                    models.URLField(blank=True, null=True, verbose_name="Target URL"),
                ),
                (
                    "date_start",
                    models.DateField(blank=True, null=True, verbose_name="Start date"),
                ),
                (
                    "date_end",
                    models.DateField(blank=True, null=True, verbose_name="End date"),
                ),
                (
                    "clicks_limit",
                    models.PositiveIntegerField(
                        blank=True, null=True, verbose_name="Clicks limit"
                    ),
                ),
                (
                    "clicks_count",
                    models.PositiveIntegerField(
                        blank=True,
                        default=0,
                        editable=False,
                        verbose_name="Clicks count",
                    ),
                ),
                (
                    "prints_limit",
                    models.PositiveIntegerField(
                        blank=True, null=True, verbose_name="Prints limit"
                    ),
                ),
                (
                    "prints_count",
                    models.PositiveIntegerField(
                        blank=True,
                        default=0,
                        editable=False,
                        verbose_name="Prints count",
                    ),
                ),
                (
                    "page_location",
                    models.CharField(
                        choices=[], max_length=50, verbose_name="Location on page"
                    ),
                ),
                (
                    "is_paused",
                    models.BooleanField(default=False, verbose_name="Is paused"),
                ),
                (
                    "advertiser",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ads",
                        to="kapt_ads.advertiser",
                        verbose_name="Advertiser",
                    ),
                ),
            ],
            options={
                "verbose_name": "Ad",
                "verbose_name_plural": "Ads",
            },
        ),
    ]
