# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-11-14 19:06
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import payment.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Coupon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=128, unique=True)),
                ('expires_at', models.DateTimeField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('discount', models.DecimalField(decimal_places=2, default=0.0, max_digits=6, validators=[django.core.validators.MaxValueValidator(1.0), django.core.validators.MinValueValidator(0.0)])),
                ('store', models.CharField(blank=True, max_length=128, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('shipping', models.DecimalField(decimal_places=2, default=0.0, max_digits=6)),
                ('description', models.TextField(blank=True, max_length=256, null=True)),
                ('path_name', models.CharField(max_length=128, unique=True)),
                ('price', models.DecimalField(decimal_places=2, max_digits=6)),
                ('discount', models.DecimalField(decimal_places=2, default=0.0, max_digits=6)),
                ('active', models.BooleanField(default=True)),
                ('hours', models.IntegerField(choices=[(2, '2H'), (5, '5H'), (10, '10H')], default=2)),
            ],
        ),
        migrations.CreateModel(
            name='Purchase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=128, null=True)),
                ('last_name', models.CharField(blank=True, max_length=128, null=True)),
                ('id_cpf', models.CharField(blank=True, max_length=11, null=True)),
                ('email', models.EmailField(blank=True, max_length=256, null=True)),
                ('phone', models.CharField(blank=True, max_length=15, null=True)),
                ('purchased_at', models.DateTimeField(auto_now_add=True)),
                ('payment_id', models.CharField(blank=True, max_length=528, null=True)),
                ('hash_session', models.CharField(blank=True, max_length=256, null=True)),
                ('expires_session', models.DateTimeField()),
                ('completed', models.BooleanField(default=False)),
                ('log_request', models.TextField(blank=True, null=True)),
                ('log_response', models.TextField(blank=True, null=True)),
                ('log_execute', models.TextField(blank=True, null=True)),
                ('invoice_number', models.CharField(default=payment.models.create_uuid, max_length=10, unique=True)),
                ('code', models.CharField(default=payment.models.create_uuid, max_length=28, unique=True)),
                ('coupon_used', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='payment.Coupon')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='payment.Product')),
            ],
        ),
        migrations.AddField(
            model_name='coupon',
            name='product',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='payment.Product'),
        ),
    ]
