# Generated by Django 5.1.3 on 2024-12-28 20:35

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


class Migration(migrations.Migration):

    dependencies = [
        ('products', '0007_alter_product_name'),
        ('sales', '0012_alter_paymentmethod_value_alter_saleitem_total_price'),
    ]

    operations = [
        migrations.CreateModel(
            name='SaleReturn',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField(default=1, validators=[django.core.validators.MinValueValidator(1, message='A quantidade deve ser maior que zero')])),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='returns', to='products.product')),
                ('sale', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='sale_returns', to='sales.sale')),
            ],
        ),
    ]
