# Generated by Django 3.2.23 on 2025-12-09 04:07

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


class Migration(migrations.Migration):

    dependencies = [
        ('crm', '0029_auto_20251209_1134'),
    ]

    operations = [
        migrations.CreateModel(
            name='NotificationBatch',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='标题')),
                ('content', models.TextField(verbose_name='内容')),
                ('notification_type', models.CharField(choices=[('system', '系统通知'), ('activity', '活动提醒'), ('course', '课程通知')], default='system', max_length=20, verbose_name='通知类型')),
                ('send_mode', models.CharField(choices=[('custom', '自定义发送'), ('project', '按项目发送'), ('coupon', '按优惠券发送')], default='custom', max_length=20, verbose_name='发送方式')),
                ('target_criteria', models.TextField(default='{}', verbose_name='发送条件')),
                ('recipient_count', models.IntegerField(default=0, verbose_name='接收人数')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='发送时间')),
            ],
            options={
                'verbose_name': '通知发送记录',
                'verbose_name_plural': '通知发送记录',
                'ordering': ['-created_at'],
            },
        ),
        migrations.AddField(
            model_name='notification',
            name='batch',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='crm.notificationbatch', verbose_name='关联批次'),
        ),
    ]
