# Generated by Django 5.2.4 on 2026-01-20 14:05

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


class Migration(migrations.Migration):

    dependencies = [
        ("companies", "0027_company_is_dealership"),
    ]

    operations = [
        migrations.CreateModel(
            name="Service",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "booking_type",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (1, "Oil Change"),
                            (2, "Dealership Visit"),
                            (3, "Engine Repair & Replacement"),
                            (4, "Transmission Repair & Replacement"),
                            (5, "Heavy warranty work"),
                            (6, "Non-drivable vehicle recovery & repair"),
                            (7, "Electrical system overhaul"),
                            (8, "Suspension & steering system replacement"),
                            (9, "Cooling system rebuild"),
                            (10, "Fuel system repair"),
                            (
                                11,
                                "Hybrid/EV battery replacement or high-voltage system repair",
                            ),
                            (12, "Route add-ons (custom service requests)"),
                            (13, "Brake service (pads, rotors, calipers)"),
                            (14, "Noise check & diagnostics"),
                            (15, "Tire rotations & balancing"),
                            (
                                16,
                                "Fluid top-offs (coolant, transmission, brake, power steering)",
                            ),
                            (17, "Battery testing & replacement"),
                            (
                                18,
                                "Light bulb replacement (headlights, taillights, interior)",
                            ),
                            (19, "Wiper blade replacement"),
                            (20, "Air filter & cabin filter replacement"),
                            (21, "Alignment checks & adjustments"),
                            (
                                22,
                                "Small accessory installs (phone mounts, dash cams, etc.)",
                            ),
                        ],
                        db_index=True,
                        unique=True,
                    ),
                ),
                ("code", models.CharField(max_length=50, unique=True)),
                ("is_active", models.BooleanField(default=True)),
                (
                    "category",
                    models.CharField(
                        choices=[("major", "Major"), ("minor", "Minor")], max_length=20
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="ServicePrice",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("base_price", models.DecimalField(decimal_places=2, max_digits=10)),
                (
                    "labor_rate_per_hour",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=10, null=True
                    ),
                ),
                (
                    "estimated_hours",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=5, null=True
                    ),
                ),
                ("starting_at", models.BooleanField(default=True)),
                ("currency", models.CharField(default="USD", max_length=10)),
                ("is_active", models.BooleanField(default=True)),
                ("effective_from", models.DateField(blank=True, null=True)),
                ("effective_to", models.DateField(blank=True, null=True)),
                (
                    "company",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="companies.company",
                    ),
                ),
                (
                    "service",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="prices",
                        to="companies.service",
                    ),
                ),
            ],
            options={
                "unique_together": {("service", "company")},
            },
        ),
    ]
