"""
Restore inventory and margin fields that were accidentally removed in 0026.

Author additions:
  default_my_keep_percent – default Tai AfroPress margin % for this author's books

Book additions:
  selling_price_kes – KES price for physical-book sales
  my_keep_percent   – per-book margin override (nullable; falls back to author default)
  reorder_level     – low-stock alert threshold
  track_inventory   – opt books in/out of inventory tracking
"""

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('catalog_app', '0026_remove_author_default_author_pay_percent_and_more'),
    ]

    operations = [
        migrations.AddField(
            model_name='author',
            name='default_my_keep_percent',
            field=models.DecimalField(
                max_digits=5, decimal_places=2, default=25.00,
                help_text='Default Tai AfroPress margin % applied to all books by this author.',
            ),
        ),
        migrations.AddField(
            model_name='book',
            name='selling_price_kes',
            field=models.DecimalField(
                max_digits=10, decimal_places=2, null=True, blank=True,
                help_text='KES retail price for physical book sales. Leave blank to use the main price.',
            ),
        ),
        migrations.AddField(
            model_name='book',
            name='my_keep_percent',
            field=models.DecimalField(
                max_digits=5, decimal_places=2, null=True, blank=True,
                help_text="Tai AfroPress margin % for this book. Leave blank to use the author's default.",
            ),
        ),
        migrations.AddField(
            model_name='book',
            name='reorder_level',
            field=models.PositiveIntegerField(
                default=5,
                help_text='Raise a low-stock alert when on-hand quantity reaches this level.',
            ),
        ),
        migrations.AddField(
            model_name='book',
            name='track_inventory',
            field=models.BooleanField(
                default=True,
                help_text='Include this book in inventory tracking and reporting.',
            ),
        ),
    ]
