# Generated by Django 5.1.6 on 2025-02-17 18:16

import apps.campaign.models
import django.core.validators
import django.db.models.deletion
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('advertiser', '0001_initial'),
        ('client', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Campaign',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('impressions_limit', models.PositiveBigIntegerField()),
                ('clicks_limit', models.PositiveBigIntegerField()),
                ('cost_per_impression', models.FloatField(validators=[django.core.validators.MinValueValidator(0)])),
                ('cost_per_click', models.FloatField(validators=[django.core.validators.MinValueValidator(0)])),
                ('ad_title', models.TextField()),
                ('ad_text', models.TextField()),
                ('ad_image', models.ImageField(blank=True, max_length=256, null=True, upload_to=apps.campaign.models.Campaign.ad_image_directory_path)),
                ('start_date', models.PositiveIntegerField()),
                ('end_date', models.PositiveIntegerField()),
                ('gender', models.CharField(blank=True, choices=[('MALE', 'MALE'), ('FEMALE', 'FEMALE'), ('ALL', 'ALL')], max_length=6, null=True)),
                ('age_from', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(100)])),
                ('age_to', models.PositiveSmallIntegerField(blank=True, null=True, validators=[django.core.validators.MaxValueValidator(100)])),
                ('location', models.TextField(blank=True, null=True, validators=[django.core.validators.MinLengthValidator(1)])),
                ('advertiser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='campaigns', to='advertiser.advertiser')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CampaignClick',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('price', models.FloatField()),
                ('date', models.PositiveIntegerField()),
                ('campaign', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='clicks', to='campaign.campaign')),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='clicks', to='client.client')),
            ],
            options={
                'unique_together': {('campaign', 'client')},
            },
        ),
        migrations.CreateModel(
            name='CampaignImpression',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('price', models.FloatField()),
                ('date', models.PositiveIntegerField()),
                ('campaign', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='impressions', to='campaign.campaign')),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='impressions', to='client.client')),
            ],
            options={
                'unique_together': {('campaign', 'client')},
            },
        ),
        migrations.CreateModel(
            name='CampaignReport',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('state', models.CharField(choices=[('s', 'Sent'), ('r', 'Under review'), ('t', 'Took action'), ('f', 'Skipped')], default='s', max_length=1)),
                ('message', models.TextField(blank=True, null=True)),
                ('flagged_by_llm', models.BooleanField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('campaign', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reports', to='campaign.campaign')),
                ('client', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reports', to='client.client')),
            ],
            options={
                'unique_together': {('campaign', 'client')},
            },
        ),
    ]
