# Generated by Django 5.2.8 on 2025-12-04 18:10

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


class Migration(migrations.Migration):

    dependencies = [
        ('schedule', '0024_resource_archived_by_quota_at_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='event',
            name='deposit_amount',
            field=models.DecimalField(blank=True, decimal_places=2, help_text='Deposit amount collected at booking', max_digits=10, null=True),
        ),
        migrations.AddField(
            model_name='event',
            name='deposit_transaction_id',
            field=models.CharField(blank=True, help_text='Stripe PaymentIntent ID for the deposit', max_length=255),
        ),
        migrations.AddField(
            model_name='event',
            name='final_charge_transaction_id',
            field=models.CharField(blank=True, help_text='Stripe PaymentIntent ID for the final charge', max_length=255),
        ),
        migrations.AddField(
            model_name='event',
            name='final_price',
            field=models.DecimalField(blank=True, decimal_places=2, help_text='Final price entered after service completion (for variable pricing)', max_digits=10, null=True),
        ),
        migrations.AddField(
            model_name='event',
            name='service',
            field=models.ForeignKey(blank=True, help_text='The service being provided in this appointment', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='events', to='schedule.service'),
        ),
        migrations.AddField(
            model_name='service',
            name='deposit_amount',
            field=models.DecimalField(blank=True, decimal_places=2, help_text='Fixed deposit amount to collect at booking (used if deposit_percent is not set)', max_digits=10, null=True),
        ),
        migrations.AddField(
            model_name='service',
            name='deposit_percent',
            field=models.DecimalField(blank=True, decimal_places=2, help_text='Deposit as percentage of estimated price (0-100)', max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))]),
        ),
        migrations.AddField(
            model_name='service',
            name='requires_saved_payment_method',
            field=models.BooleanField(default=False, help_text='If true, customer must have a saved payment method to book (auto-set for variable pricing)'),
        ),
        migrations.AddField(
            model_name='service',
            name='variable_pricing',
            field=models.BooleanField(default=False, help_text='If true, final price is determined after service completion'),
        ),
        migrations.AlterField(
            model_name='event',
            name='status',
            field=models.CharField(choices=[('SCHEDULED', 'Scheduled'), ('CANCELED', 'Canceled'), ('COMPLETED', 'Completed'), ('AWAITING_PAYMENT', 'Awaiting Payment'), ('PAID', 'Paid'), ('NOSHOW', 'No Show')], db_index=True, default='SCHEDULED', max_length=20),
        ),
    ]
