# Generated by Django 4.2.27 on 2026-01-25 20:40

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


class Migration(migrations.Migration):

    dependencies = [
        ("rates", "0011_alter_rate_options"),
    ]

    operations = [
        migrations.AlterModelOptions(
            name="ratetype",
            options={"ordering": ["id"]},
        ),
        migrations.CreateModel(
            name="RateTier",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "quantity",
                    models.PositiveIntegerField(
                        validators=[django.core.validators.MinValueValidator(1)],
                        help_text="The quantity (in MINUTES or units) after which the amount changes",
                    ),
                ),
                (
                    "amount",
                    models.DecimalField(
                        decimal_places=2,
                        max_digits=8,
                        help_text="The amount charged (per HOUR or per unit) after the quantity threshold",
                    ),
                ),
                ("rate", models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="rates.rate")),
                (
                    "flat",
                    models.BooleanField(
                        default=False, help_text="Indicates if the rate is flat or hourly (if applicable)"
                    ),
                ),
            ],
            options={
                "ordering": ["rate", "quantity"],
            },
        ),
    ]
