# Generated by Django 5.2.11 on 2026-04-06 20:51

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


class Migration(migrations.Migration):

    dependencies = [
        ('companies', '0004_companysettings_enable_unlimited_stock'),
        ('sales', '0013_add_company_fk'),
    ]

    operations = [
        migrations.CreateModel(
            name='Refund',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('refunded_by', models.CharField(max_length=150)),
                ('reason', models.TextField(blank=True)),
                ('refund_amount', models.DecimalField(decimal_places=2, default=0, max_digits=12)),
                ('stock_restored', models.BooleanField(default=False)),
                ('credit_adjusted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='refunds', to='companies.company')),
                ('original_order', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='refund', to='sales.posorder')),
            ],
            options={
                'verbose_name': 'Refund',
                'verbose_name_plural': 'Refunds',
                'ordering': ['-created_at'],
            },
        ),
    ]
