# Generated by Django 4.2.21 on 2025-06-14 15:39

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


class Migration(migrations.Migration):

    dependencies = [
        ("gestion", "0010_graphe"),
    ]

    operations = [
        migrations.CreateModel(
            name="Rachat",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "date",
                    models.DateField(
                        default=datetime.date(1, 1, 1), verbose_name="Payé, le"
                    ),
                ),
                ("prix", models.FloatField(default=0.0, verbose_name="Prix")),
                (
                    "mode",
                    models.IntegerField(
                        choices=[
                            (1, "par chèque"),
                            (2, "en espèces"),
                            (3, "par carte"),
                            (4, "par carte du Conseil Régional"),
                        ],
                        default=1,
                        verbose_name="Mode de paiement",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="materiel",
            name="declasse",
            field=models.DateField(
                default=datetime.date(1, 1, 1), verbose_name="Déclassé, le"
            ),
        ),
        migrations.AddField(
            model_name="inventaire",
            name="paye",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to="gestion.rachat",
            ),
        ),
    ]
