# Generated by Django 4.2.23 on 2025-08-31 15:01

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('api', '0002_profile_tags'),
    ]

    operations = [
        migrations.CreateModel(
            name='BenefitEvent',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('points', models.IntegerField()),
                ('kind', models.CharField(choices=[('accepted_answer', 'Accepted Answer'), ('review_helpful', 'Review Marked Helpful'), ('referral', 'Referral'), ('recommendation', 'Recommendation')], max_length=32)),
                ('meta', models.JSONField(blank=True, default=dict)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('benefactor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='benefit_given', to=settings.AUTH_USER_MODEL)),
                ('beneficiary', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='benefit_received', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_at', '-id'),
                'indexes': [models.Index(fields=['benefactor', 'created_at'], name='api_benefit_benefac_a07d7f_idx'), models.Index(fields=['beneficiary', 'created_at'], name='api_benefit_benefic_2819d8_idx'), models.Index(fields=['kind', 'created_at'], name='api_benefit_kind_bdc89b_idx')],
            },
        ),
    ]
