# Generated by Django 2.1.4 on 2018-12-15 11:57

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='InstamojoConfiguration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Create Date/Time')),
                ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date/Time Modified')),
                ('api_key', models.CharField(max_length=48, unique=True, verbose_name='Private API Key')),
                ('auth_token', models.CharField(max_length=48, unique=True, verbose_name='Private Auth Token')),
                ('salt', models.CharField(max_length=48, unique=True, verbose_name='Private Salt')),
                ('is_active', models.BooleanField(default=False, verbose_name='Is Active?')),
                ('base_url', models.URLField(default='https://www.instamojo.com/api/1.1/', verbose_name='API Based URL')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Instamojo Configuration',
                'verbose_name_plural': 'Instamojo Configurations',
            },
        ),
        migrations.CreateModel(
            name='Payment',
            fields=[
                ('id', models.CharField(max_length=254, primary_key=True, serialize=False, verbose_name='Payment ID')),
                ('instamojo_raw_response', models.TextField(blank=True, null=True, verbose_name='Payment Raw Response')),
                ('mac', models.CharField(blank=True, max_length=154, null=True, verbose_name='Message Authentication Code')),
                ('status', models.CharField(choices=[('Credit', 'CREDIT'), ('Failed', 'FAILED')], max_length=12, verbose_name='Status')),
                ('fees', models.DecimalField(blank=True, decimal_places=3, max_digits=10, null=True, verbose_name='Fees by Instamojo')),
                ('affiliate_commission', models.DecimalField(blank=True, decimal_places=3, max_digits=10, null=True, verbose_name='Affiliate Commission')),
                ('currency', models.CharField(blank=True, max_length=50, null=True, verbose_name='Currency')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Amount')),
                ('buyer_name', models.CharField(blank=True, max_length=254, null=True, verbose_name='Buyer Name')),
                ('buyer_email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='Buyer Email')),
                ('buyer_phone', models.CharField(blank=True, max_length=15, null=True, verbose_name='Buyer Mobile')),
                ('shipping_address', models.CharField(blank=True, max_length=255, null=True, verbose_name='Shipping Address')),
                ('shipping_city', models.CharField(blank=True, max_length=255, null=True, verbose_name='Shipping City')),
                ('shipping_state', models.CharField(blank=True, max_length=255, null=True, verbose_name='Shipping State')),
                ('shipping_country', models.CharField(blank=True, max_length=255, null=True, verbose_name='Shipping Country')),
                ('shipping_zip', models.CharField(blank=True, max_length=255, null=True, verbose_name='Shipping ZIP')),
                ('quantity', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='Quantity')),
                ('unit_price', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True, verbose_name='Unit Price')),
                ('instrument_type', models.CharField(blank=True, max_length=64, null=True, verbose_name='Instrument Type')),
                ('billing_instrument', models.CharField(blank=True, max_length=64, null=True, verbose_name='Billing Instrument')),
                ('tax_invoice_id', models.CharField(blank=True, max_length=64, null=True, verbose_name='Tax Invoice ID')),
                ('failure_message', models.CharField(blank=True, max_length=255, null=True, verbose_name='Failure Message')),
                ('failure_reason', models.CharField(blank=True, max_length=127, null=True, verbose_name='Failure Reason')),
                ('payout', models.CharField(blank=True, max_length=255, null=True, verbose_name='Payout')),
                ('webhook_verified', models.BooleanField(default=False, verbose_name='Verified via WebHook?')),
            ],
            options={
                'verbose_name': 'Instamojo Payment',
                'verbose_name_plural': 'Instamojo Payment',
            },
        ),
        migrations.CreateModel(
            name='PaymentRequest',
            fields=[
                ('create_date', models.DateTimeField(auto_now_add=True, verbose_name='Create Date/Time')),
                ('update_date', models.DateTimeField(auto_now=True, verbose_name='Date/Time Modified')),
                ('id', models.CharField(max_length=254, primary_key=True, serialize=False, verbose_name='Payment Request ID')),
                ('amount', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Amount')),
                ('purpose', models.CharField(max_length=254, verbose_name='Purpose')),
                ('buyer_name', models.CharField(blank=True, max_length=254, null=True, verbose_name='Buyer Name')),
                ('email', models.EmailField(blank=True, max_length=254, null=True, verbose_name='Buyer Email')),
                ('phone', models.CharField(blank=True, max_length=15, null=True, verbose_name='Buyer Mobile')),
                ('send_email', models.BooleanField(default=False, verbose_name='Send Mail?')),
                ('send_sms', models.BooleanField(default=False, verbose_name='Send SMS?')),
                ('email_status', models.CharField(blank=True, choices=[('Pending', 'PENDING'), ('Sent', 'SENT'), ('Failed', 'FAILED'), ('Null', 'NULL')], max_length=48, null=True, verbose_name='Email Sent Status')),
                ('sms_status', models.CharField(blank=True, choices=[('Pending', 'PENDING'), ('Sent', 'SENT'), ('Failed', 'FAILED'), ('Null', 'NULL')], max_length=48, null=True, verbose_name='SMS Sent Status')),
                ('redirect_url', models.URLField(verbose_name='Redirect URL')),
                ('webhook', models.URLField(blank=True, null=True, verbose_name='Webhook URL')),
                ('allow_repeated_payments', models.BooleanField(default=True, verbose_name='Allow Repeated Payment')),
                ('instamojo_raw_response', models.TextField(blank=True, null=True, verbose_name='Payment Request Raw Response')),
                ('longurl', models.URLField(verbose_name='Long URL')),
                ('shorturl', models.URLField(blank=True, null=True, verbose_name='Long URL')),
                ('expires_at', models.CharField(blank=True, max_length=30, null=True, verbose_name='Expires at')),
                ('status', models.CharField(choices=[('Pending', 'PENDING'), ('Sent', 'SENT'), ('Failed', 'FAILED'), ('Completed', 'COMPLETED')], default='Pending', max_length=10, verbose_name='Status')),
                ('is_enabled', models.BooleanField(default=True, verbose_name='Is Enabled?')),
                ('customer_id', models.CharField(blank=True, max_length=254, null=True, verbose_name='Customer ID')),
                ('created_at', models.DateTimeField(blank=True, null=True, verbose_name='Created At by Instamojo')),
                ('modified_at', models.DateTimeField(blank=True, null=True, verbose_name='Updated At by Instamojo')),
                ('configuration', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='drf_instamojo.InstamojoConfiguration', verbose_name='Instamojo Config')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Payment Request',
                'verbose_name_plural': 'Payment Request',
            },
        ),
        migrations.AddField(
            model_name='payment',
            name='payment_request',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='drf_instamojo.PaymentRequest', verbose_name='Payment Request'),
        ),
    ]
