# Generated by Django 5.2.8 on 2025-11-25 02:59

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('inventory', '0002_stockadjustment'),
    ]

    operations = [
        migrations.CreateModel(
            name='POSOrder',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_number', models.CharField(max_length=50, unique=True)),
                ('total_amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('discount_amount', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('tax_amount', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('final_amount', models.DecimalField(decimal_places=2, max_digits=10)),
                ('payment_method', models.CharField(choices=[('cash', 'Cash'), ('transfer', 'Bank Transfer'), ('pos', 'POS/ATM Card'), ('mobile_money', 'Mobile Money'), ('credit', 'Credit')], max_length=20)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('completed', 'Completed'), ('cancelled', 'Cancelled')], default='pending', max_length=15)),
                ('customer_name', models.CharField(blank=True, max_length=100)),
                ('customer_phone', models.CharField(blank=True, max_length=15)),
                ('cashier', models.CharField(max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'POS Order',
                'verbose_name_plural': 'POS Orders',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='POSOrderItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveIntegerField()),
                ('unit_price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('total_price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='sales.posorder')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.product')),
            ],
            options={
                'verbose_name': 'POS Order Item',
                'verbose_name_plural': 'POS Order Items',
            },
        ),
        migrations.CreateModel(
            name='POSReceiptSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('show_product_details', models.BooleanField(default=True)),
                ('show_customer_info', models.BooleanField(default=True)),
                ('show_payment_info', models.BooleanField(default=True)),
                ('custom_message', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('order', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='receipt_settings', to='sales.posorder')),
            ],
        ),
    ]
