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


class Migration(migrations.Migration):

    dependencies = [
        ('ecommerce', '0006_expense'),
        ('accounts', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='DealAgreement',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.UUIDField(default=uuid.uuid4, unique=True, editable=False)),
                ('terms_type', models.CharField(
                    choices=[
                        ('service',      'Service / Project'),
                        ('subscription', 'Subscription / Retainer'),
                        ('instalment',   'Instalment Plan'),
                        ('domain',       'Domain Registration'),
                        ('general',      'General'),
                    ],
                    default='general',
                    max_length=20,
                )),
                ('sent_to_email', models.EmailField()),
                ('sent_to_name',  models.CharField(max_length=150)),
                ('sent_at',       models.DateTimeField(null=True, blank=True)),
                ('signed_name',   models.CharField(blank=True, max_length=150)),
                ('accepted_at',   models.DateTimeField(null=True, blank=True)),
                ('accepted_ip',   models.GenericIPAddressField(null=True, blank=True)),
                ('user_agent',    models.TextField(blank=True)),
                ('stripe_session_id', models.CharField(blank=True, max_length=200)),
                ('created_at',    models.DateTimeField(auto_now_add=True)),
                ('order', models.ForeignKey(
                    on_delete=django.db.models.deletion.CASCADE,
                    related_name='agreements',
                    to='ecommerce.order',
                )),
                ('created_by', models.ForeignKey(
                    null=True, blank=True,
                    on_delete=django.db.models.deletion.SET_NULL,
                    related_name='deals_sent',
                    to='accounts.user',
                )),
            ],
            options={
                'verbose_name': 'Deal Agreement',
                'verbose_name_plural': 'Deal Agreements',
                'ordering': ['-created_at'],
            },
        ),
    ]
