# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-13 14:15
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(blank=True, max_length=256, verbose_name='Identifier')),
                ('name', models.CharField(max_length=2048, verbose_name='Name')),
                ('description', models.CharField(max_length=4000, verbose_name='Description')),
                ('value', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Value')),
                ('currency', models.CharField(default=b'USD', max_length=16)),
            ],
        ),
        migrations.CreateModel(
            name='PaymentTransaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('creation_date', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Creation time')),
                ('date', models.DateTimeField(auto_now=True, verbose_name='Time')),
                ('transaction_id', models.CharField(max_length=32, verbose_name='Transaction ID')),
                ('value', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='Transaction value')),
                ('status', models.CharField(choices=[(b'Checkout', b'Checkout'), (b'Pending', b'Pending'), (b'Canceled', b'Canceled'), (b'Completed', b'Completed'), (b'Canceled_Reversal', b'Canceled_Reversal'), (b'Created', b'Created'), (b'Denied', b'Denied'), (b'Expired', b'Expired'), (b'Failed', b'Failed'), (b'Refunded', b'Refunded'), (b'Reversed', b'Reversed'), (b'Processed', b'Processed'), (b'Voided', b'Voided')], max_length=16, verbose_name='Payment status')),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'ordering': ['-creation_date', 'transaction_id'],
            },
        ),
        migrations.CreateModel(
            name='PaymentTransactionError',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='Time')),
                ('paypal_api_url', models.CharField(blank=True, max_length=4000, verbose_name='Paypal API URL')),
                ('request_data', models.TextField(blank=True, verbose_name='Request data')),
                ('response', models.TextField(blank=True, verbose_name='Response String')),
                ('transaction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='paypal_express_checkout.PaymentTransaction', verbose_name='Payment transaction')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
        ),
        migrations.CreateModel(
            name='PurchasedItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(blank=True, max_length=256, verbose_name='Identifier')),
                ('object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('price', models.FloatField(blank=True, null=True, verbose_name='Price')),
                ('quantity', models.PositiveIntegerField(verbose_name='Quantity')),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('item', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='paypal_express_checkout.Item', verbose_name='Item')),
                ('transaction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='paypal_express_checkout.PaymentTransaction', verbose_name='Transaction')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='User')),
            ],
            options={
                'ordering': ['-transaction__date', 'transaction__transaction_id'],
            },
        ),
    ]
