# Generated by Django 5.2.8 on 2025-11-25 05:12

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


class Migration(migrations.Migration):

    dependencies = [
        ('sales', '0002_paymenttransaction_salesummary'),
    ]

    operations = [
        migrations.CreateModel(
            name='DailySalesSummary',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(unique=True)),
                ('total_revenue', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('total_transactions', models.PositiveIntegerField(default=0)),
                ('cash_revenue', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('cash_transactions', models.PositiveIntegerField(default=0)),
                ('transfer_revenue', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('transfer_transactions', models.PositiveIntegerField(default=0)),
                ('pos_revenue', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('pos_transactions', models.PositiveIntegerField(default=0)),
                ('mobile_money_revenue', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('mobile_money_transactions', models.PositiveIntegerField(default=0)),
                ('top_selling_items', models.JSONField(blank=True, default=list)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Daily Sales Summary',
                'verbose_name_plural': 'Daily Sales Summaries',
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='UnusualTransaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reason', models.CharField(help_text='Reason for marking as unusual', max_length=200)),
                ('flagged_by', models.CharField(max_length=100)),
                ('flagged_at', models.DateTimeField(auto_now_add=True)),
                ('resolved', models.BooleanField(default=False)),
                ('resolved_by', models.CharField(blank=True, max_length=100)),
                ('resolved_at', models.DateTimeField(blank=True, null=True)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='sales.posorder')),
            ],
            options={
                'verbose_name': 'Unusual Transaction',
                'verbose_name_plural': 'Unusual Transactions',
                'ordering': ['-flagged_at'],
            },
        ),
    ]
