# Generated by Django 3.0.5 on 2020-08-08 13:58

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import main.core.utils.json_serializer


class Migration(migrations.Migration):

    dependencies = [
        ('order', '0004_remove_orderline_review'),
        ('account', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='StaffNotificationRecipient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('staff_email', models.EmailField(blank=True, max_length=254, null=True, unique=True)),
                ('active', models.BooleanField(default=True)),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='staff_notification', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('staff_email',),
            },
        ),
        migrations.CreateModel(
            name='CustomerNote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('content', models.TextField()),
                ('is_public', models.BooleanField(default=True)),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notes', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('date',),
            },
        ),
        migrations.CreateModel(
            name='CustomerEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('type', models.CharField(choices=[('ACCOUNT_CREATED', 'account_created'), ('PASSWORD_RESET_LINK_SENT', 'password_reset_link_sent'), ('PASSWORD_RESET', 'password_reset'), ('EMAIL_CHANGED_REQUEST', 'email_changed_request'), ('PASSWORD_CHANGED', 'password_changed'), ('EMAIL_CHANGED', 'email_changed'), ('PLACED_ORDER', 'placed_order'), ('NOTE_ADDED_TO_ORDER', 'note_added_to_order'), ('DIGITAL_LINK_DOWNLOADED', 'digital_link_downloaded'), ('CUSTOMER_DELETED', 'customer_deleted'), ('NAME_ASSIGNED', 'name_assigned'), ('EMAIL_ASSIGNED', 'email_assigned'), ('NOTE_ADDED', 'note_added')], max_length=255)),
                ('parameters', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, encoder=main.core.utils.json_serializer.CustomJsonEncoder)),
                ('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='order.Order')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('date',),
            },
        ),
    ]

# Generated by Django 3.0.5 on 2020-08-08 13:58

from django.conf import settings
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import main.core.utils.json_serializer


class Migration(migrations.Migration):

    dependencies = [
        ('order', '0004_remove_orderline_review'),
        ('account', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='StaffNotificationRecipient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('staff_email', models.EmailField(blank=True, max_length=254, null=True, unique=True)),
                ('active', models.BooleanField(default=True)),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='staff_notification', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('staff_email',),
            },
        ),
        migrations.CreateModel(
            name='CustomerNote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('content', models.TextField()),
                ('is_public', models.BooleanField(default=True)),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notes', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('date',),
            },
        ),
        migrations.CreateModel(
            name='CustomerEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('type', models.CharField(choices=[('ACCOUNT_CREATED', 'account_created'), ('PASSWORD_RESET_LINK_SENT', 'password_reset_link_sent'), ('PASSWORD_RESET', 'password_reset'), ('EMAIL_CHANGED_REQUEST', 'email_changed_request'), ('PASSWORD_CHANGED', 'password_changed'), ('EMAIL_CHANGED', 'email_changed'), ('PLACED_ORDER', 'placed_order'), ('NOTE_ADDED_TO_ORDER', 'note_added_to_order'), ('DIGITAL_LINK_DOWNLOADED', 'digital_link_downloaded'), ('CUSTOMER_DELETED', 'customer_deleted'), ('NAME_ASSIGNED', 'name_assigned'), ('EMAIL_ASSIGNED', 'email_assigned'), ('NOTE_ADDED', 'note_added')], max_length=255)),
                ('parameters', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, encoder=main.core.utils.json_serializer.CustomJsonEncoder)),
                ('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='order.Order')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('date',),
            },
        ),
    ]

# Generated by Django 3.0.5 on 2020-08-08 13:58