# Generated by Django 5.1.5 on 2025-08-05 12:12

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


class Migration(migrations.Migration):

    dependencies = [
        ('sales', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='SalePayment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_method', models.CharField(choices=[('cash', 'Cash'), ('mpesa', 'M-Pesa'), ('credit', 'Credit'), ('cheque', 'Cheque')], max_length=10)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('mpesa_reference', models.CharField(blank=True, max_length=255, null=True)),
                ('cheque_number', models.CharField(blank=True, max_length=50, null=True)),
                ('cheque_date', models.DateField(blank=True, null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('sale', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payments', to='sales.sale')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
    ]
