# Generated by Django 5.1.4 on 2024-12-11 15:50

import django.db.models.deletion
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('inventory', '0013_merge_20241211_1847'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='carfinance',
            options={'verbose_name': 'Car Financial Details', 'verbose_name_plural': 'Car Financial Details'},
        ),
        migrations.AlterModelOptions(
            name='carreservation',
            options={'ordering': ['-reserved_at'], 'verbose_name': 'Car Reservation', 'verbose_name_plural': 'Car Reservations'},
        ),
        migrations.RemoveField(
            model_name='carfinance',
            name='vat_rate',
        ),
        migrations.AddField(
            model_name='carfinance',
            name='total',
            field=models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=14, null=True),
        ),
        migrations.AlterField(
            model_name='carreservation',
            name='car',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to='inventory.car', verbose_name='Car'),
        ),
        migrations.AlterField(
            model_name='carreservation',
            name='reserved_at',
            field=models.DateTimeField(auto_now_add=True, verbose_name='Reserved At'),
        ),
        migrations.AlterField(
            model_name='carreservation',
            name='reserved_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reservations', to=settings.AUTH_USER_MODEL, verbose_name='Reserved By'),
        ),
        migrations.AlterField(
            model_name='carreservation',
            name='reserved_until',
            field=models.DateTimeField(verbose_name='Reserved Until'),
        ),
        migrations.CreateModel(
            name='CarShowroom',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Description')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last Updated')),
                ('car', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='showroom', to='inventory.car', verbose_name='Car')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owned_cars', to='inventory.dealer', verbose_name='Owner')),
                ('showroom', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='showroom_cars', to='inventory.dealer', verbose_name='Showroom')),
            ],
            options={
                'verbose_name': 'Car Showroom',
                'verbose_name_plural': 'Car Showrooms',
            },
        ),
    ]
