# Generated by Django 5.2.12 on 2026-03-17 19:38

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


class Migration(migrations.Migration):

    dependencies = [
        ('inventory', '0007_alter_purchaseorder_options_and_more'),
        ('sales', '0009_customer'),
    ]

    operations = [
        migrations.CreateModel(
            name='CashReconciliation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(unique=True)),
                ('expected', models.DecimalField(decimal_places=2, default=0, help_text='Sum of cash orders for this day.', max_digits=12)),
                ('actual', models.DecimalField(decimal_places=2, default=0, help_text='Physical cash count entered by cashier.', max_digits=12)),
                ('variance', models.DecimalField(decimal_places=2, default=0, help_text='actual - expected (positive = surplus, negative = shortage).', max_digits=12)),
                ('cashier', models.CharField(blank=True, max_length=100)),
                ('notes', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Cash Reconciliation',
                'verbose_name_plural': 'Cash Reconciliations',
                'ordering': ['-date'],
            },
        ),
        migrations.DeleteModel(
            name='SaleSummary',
        ),
        migrations.AddField(
            model_name='dailysalessummary',
            name='total_cost',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=12),
        ),
        migrations.AddField(
            model_name='posorder',
            name='client_id',
            field=models.CharField(blank=True, db_index=True, help_text='UUID generated by the client to prevent duplicate offline orders.', max_length=64),
        ),
        migrations.AddField(
            model_name='posorder',
            name='customer',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='orders', to='sales.customer'),
        ),
        migrations.AddField(
            model_name='posorderitem',
            name='product_name',
            field=models.CharField(blank=True, help_text='Snapshot of product name at time of sale.', max_length=200),
        ),
        migrations.AlterField(
            model_name='dailysalessummary',
            name='credit_outstanding',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=12),
        ),
        migrations.AlterField(
            model_name='paymenttransaction',
            name='gateway_response',
            field=models.JSONField(blank=True, default=dict),
        ),
        migrations.AlterField(
            model_name='paymenttransaction',
            name='payment_method',
            field=models.CharField(choices=[('pos', 'POS/ATM Card'), ('transfer', 'Bank Transfer'), ('cash', 'Cash'), ('mobile_money', 'Mobile Money'), ('paystack', 'Paystack'), ('flutterwave', 'Flutterwave')], max_length=20),
        ),
        migrations.AlterField(
            model_name='paymenttransaction',
            name='reference_number',
            field=models.CharField(blank=True, max_length=100),
        ),
        migrations.AlterField(
            model_name='paymenttransaction',
            name='transaction_id',
            field=models.CharField(blank=True, max_length=100),
        ),
        migrations.AlterField(
            model_name='posorder',
            name='amount_paid',
            field=models.DecimalField(decimal_places=2, default=0, max_digits=10),
        ),
        migrations.AlterField(
            model_name='posorder',
            name='order_number',
            field=models.CharField(max_length=60, unique=True),
        ),
        migrations.AlterField(
            model_name='posorder',
            name='payment_method',
            field=models.CharField(choices=[('pos', 'POS/ATM Card'), ('transfer', 'Bank Transfer'), ('cash', 'Cash'), ('mobile_money', 'Mobile Money')], default='cash', max_length=20),
        ),
        migrations.AlterField(
            model_name='posorderitem',
            name='product',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='inventory.product'),
        ),
        migrations.AlterField(
            model_name='unusualtransaction',
            name='reason',
            field=models.CharField(max_length=200),
        ),
    ]
