# Generated by Django 6.0.6 on 2026-08-09 18:21

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


class Migration(migrations.Migration):

    dependencies = [
        ('events', '0020_event_max_referees_eventreferee'),
        ('members', '0004_group_groupmembership_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='eventreferee',
            name='external_name',
            field=models.CharField(blank=True, help_text="For a referee who isn't a club member (e.g. federation-appointed) -- logged by name only.", max_length=255, verbose_name='external referee name'),
        ),
        migrations.AddField(
            model_name='eventreferee',
            name='fee',
            field=models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=8, verbose_name='fee'),
        ),
        migrations.AddField(
            model_name='eventreferee',
            name='km',
            field=models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True, verbose_name='kilometers'),
        ),
        migrations.AddField(
            model_name='eventreferee',
            name='km_rate',
            field=models.DecimalField(blank=True, decimal_places=4, help_text='Reimbursement rate per kilometer, e.g. 0.4230.', max_digits=6, null=True, verbose_name='rate per km'),
        ),
        migrations.AlterField(
            model_name='eventreferee',
            name='member',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='referee_assignments', to='members.member', verbose_name='member'),
        ),
        migrations.AddConstraint(
            model_name='eventreferee',
            constraint=models.CheckConstraint(condition=models.Q(models.Q(('member__isnull', False), ('external_name', '')), models.Q(('member__isnull', True), models.Q(('external_name', ''), _negated=True)), _connector='OR'), name='event_referee_member_xor_external_name'),
        ),
    ]
