from django.db import migrations

def add_wallet_topup(apps, schema_editor):
    NotificationType = apps.get_model("notifications", "NotificationType")
    NotificationType.objects.get_or_create(
        key="wallet_topup_credit",
        defaults=dict(
            label="Wallet Top-Up Successful",
            enabled_inapp=True,
            enabled_email=True,
            enabled_sms=False,
            enabled_whatsapp=False,
            is_active=True,
            email_template="emails/wallet_topup.html",  # add this template below
            sms_template="wallet_topup_sms.txt",
            whatsapp_template=None,
        ),
    )

class Migration(migrations.Migration):
    dependencies = [("notifications", "0001_initial")]
    operations = [migrations.RunPython(add_wallet_topup)]
