# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-03 02:27
from __future__ import absolute_import, division, print_function, unicode_literals

import datetime
import sys
import uuid

from django.conf import settings
from django.core import serializers
import django.core.validators
from django.db import migrations, models
from django.db.models.deletion import SET_NULL
import django.db.models.deletion
from django.db.utils import IntegrityError
from django.utils import six
from django.utils.timezone import utc
import django.utils.timezone
from stripe.error import InvalidRequestError
from tqdm import tqdm

import djstripe.fields


DJSTRIPE_SUBSCRIBER_MODEL = getattr(settings, "DJSTRIPE_SUBSCRIBER_MODEL", settings.AUTH_USER_MODEL)


def resync_subscriptions(apps, schema_editor):
    """
    Since subscription IDs were not previously stored, a direct migration will leave us
    with a bunch of orphaned objects. It was decided [here](https://github.com/kavdev/dj-stripe/issues/162)
    that a purge and re-sync would be the best option. No data that is currently available on stripe will
    be deleted. Anything stored locally will be purged.
    """

    # This is okay, since we're only doing a forward migration.
    from djstripe.models import Subscription

    import stripe
    stripe.api_version = "2016-03-07"

    if Subscription.objects.count():
        print("Purging subscriptions. Don't worry, all active subscriptions will be re-synced from stripe. Just in \
        case you didn't get the memo, we'll print out a json representation of each object for your records:")
        print(serializers.serialize("json", Subscription.objects.all()))
        Subscription.objects.all().delete()

        print("Re-syncing subscriptions. This may take a while.")

        for stripe_subscription in tqdm(iterable=Subscription.api_list(), desc="Sync", unit=" subscriptions"):
            subscription = Subscription.sync_from_stripe_data(stripe_subscription)

            if not subscription.customer:
                tqdm.write("The customer for this subscription ({subscription_id}) does not exist locally (so we \
                won't sync the subscription). You'll want to figure out how that \
                happened.".format(subscription_id=stripe_subscription['id']))

        print("Subscription re-sync complete.")


def resync_invoiceitems(apps, schema_editor):
    """
    Since invoiceitem IDs were not previously stored (the ``stripe_id`` field held the id of the linked subsription),
    a direct migration will leave us with a bunch of orphaned objects. It was decided
    [here](https://github.com/kavdev/dj-stripe/issues/162) that a purge and re-sync would be the best option for
    subscriptions. That's being extended to InvoiceItems. No data that is currently available on stripe will be
    deleted. Anything stored locally will be purged.
    """

    # This is okay, since we're only doing a forward migration.
    from djstripe.models import InvoiceItem

    import stripe
    stripe.api_version = "2016-03-07"

    if InvoiceItem.objects.count():
        print("Purging invoiceitems. Don't worry, all invoiceitems will be re-synced from stripe. Just in case you \
        didn't get the memo, we'll print out a json representation of each object for your records:")
        print(serializers.serialize("json", InvoiceItem.objects.all()))
        InvoiceItem.objects.all().delete()

        print("Re-syncing invoiceitems. This may take a while.")

        for stripe_invoiceitem in tqdm(iterable=InvoiceItem.api_list(), desc="Sync", unit=" invoiceitems"):
            invoice = InvoiceItem.sync_from_stripe_data(stripe_invoiceitem)

            if not invoice.customer:
                tqdm.write("The customer for this invoiceitem ({invoiceitem_id}) does not exist \
                locally (so we won't sync the invoiceitem). You'll want to figure out how that \
                happened.".format(invoiceitem_id=stripe_invoiceitem['id']))

        print("InvoiceItem re-sync complete.")


def sync_charges(apps, schema_editor):
    # This is okay, since we're only doing a forward migration.
    from djstripe.models import Charge

    import stripe
    stripe.api_version = "2016-03-07"

    if Charge.objects.count():
        print("syncing charges. This may take a while.")

        for charge in tqdm(Charge.objects.all(), desc="Sync", unit=" charges"):
            try:
                Charge.sync_from_stripe_data(charge.api_retrieve())
            except InvalidRequestError:
                tqdm.write("There was an error while syncing charge ({charge_id}).".format(charge_id=charge.stripe_id))

        print("Charge sync complete.")


def sync_invoices(apps, schema_editor):
    # This is okay, since we're only doing a forward migration.
    from djstripe.models import Invoice

    import stripe
    stripe.api_version = "2016-03-07"

    if Invoice.objects.count():
        print("syncing invoices. This may take a while.")

        for invoice in tqdm(iterable=Invoice.objects.all(), desc="Sync", unit=" invoices"):
            try:
                Invoice.sync_from_stripe_data(invoice.api_retrieve())
            except InvalidRequestError:
                tqdm.write("There was an error while syncing invoice \
                ({invoice_id}).".format(invoice_id=invoice.stripe_id))

        print("Invoice sync complete.")


def sync_transfers(apps, schema_editor):
    # This is okay, since we're only doing a forward migration.
    from djstripe.models import Transfer

    import stripe
    stripe.api_version = "2016-03-07"

    if Transfer.objects.count():
        print("syncing transfers. This may take a while.")

        for transfer in tqdm(iterable=Transfer.objects.all(), desc="Sync", unit=" transfers"):
            try:
                Transfer.sync_from_stripe_data(transfer)
            except InvalidRequestError:
                tqdm.write("There was an error while syncing transfer \
                ({transfer_id}).".format(transfer_id=transfer.stripe_id))

        print("Transfer sync complete.")


def sync_plans(apps, schema_editor):
    # This is okay, since we're only doing a forward migration.
    from djstripe.models import Plan

    import stripe
    stripe.api_version = "2016-03-07"

    if Plan.objects.count():
        print("syncing plans. This may take a while.")

        for plan in tqdm(iterable=Plan.objects.all(), desc="Sync", unit=" plans"):
            try:
                Plan.sync_from_stripe_data(plan)
            except InvalidRequestError:
                tqdm.write("There was an error while syncing plan ({plan_id}).".format(transfer_id=plan.stripe_id))

        print("Transfer sync complete.")


def sync_customers(apps, schema_editor):
    # This is okay, since we're only doing a forward migration.
    from djstripe.models import Customer

    import stripe
    stripe.api_version = "2016-03-07"

    if Customer.objects.count():
        print("syncing customers. This may take a while.")

        for customer in tqdm(Customer.objects.all(), desc="Sync", unit=" customers"):
            try:
                Customer.sync_from_stripe_data(customer.api_retrieve())
            except InvalidRequestError:
                tqdm.write("There was an error while syncing customer \
                ({customer_id}).".format(customer_id=customer.stripe_id))
            except IntegrityError:
                print(customer.api_retrieve())
                six.reraise(*sys.exc_info())

        print("Customer sync complete.")


def on_subscriber_delete_purge_customers(collector, field, sub_objs, using):
    """ Ensure that all customers attached to subscriber are purged on deletion. """
    for obj in sub_objs:
        obj.purge()

    SET_NULL(collector, field, sub_objs, using)


class Migration(migrations.Migration):

    replaces = [
        ('djstripe', '0008_auto_20150806_1641'),
        ('djstripe', '0009_auto_20160501_1838'),
        ('djstripe', '0010_splitting_up_adds_from_alters'),
        ('djstripe', '0011_charge_captured_update'),
        ('djstripe', '0012_model_sync'),
        ('djstripe', '0013_sync_cleanup'),
        ('djstripe', '0014_auto_20160625_1851'),
        ('djstripe', '0015_upcoming_invoices'),
        ('djstripe', '0016_stripe_id_255_length'),
        ('djstripe', '0017_set_null_on_delete'),
        ('djstripe', '0018_field_docs'),
        ('djstripe', '0019_purge_on_subscriber_delete'),
        ('djstripe', '0020_auto_20161229_0041'),
        ('djstripe', '0021_auto_20170107_0813'),
        ('djstripe', '0022_fix_subscriber_delete'),
        ('djstripe', '0023_auto_20170307_0937'),
        ('djstripe', '0024_auto_20170308_0757'),
        ('djstripe', '0025_auto_20170322_0428'),
        ('djstripe', '0026_idempotencykey'),
        ('djstripe', '0027_auto_20170308_0620'),
        ('djstripe', '0028_auto_20170313_2316'),
        ('djstripe', '0029_coupon'),
        ('djstripe', '0030_auto_20170323_0535'),
        ('djstripe', '0031_auto_20170606_1708')
    ]

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

    operations = [
        migrations.RenameField(
            model_name='charge',
            old_name='charge_created',
            new_name='stripe_timestamp',
        ),
        migrations.RenameField(
            model_name='event',
            old_name='kind',
            new_name='type',
        ),
        migrations.RenameField(
            model_name='invoice',
            old_name='attempts',
            new_name='attempt_count',
        ),
        migrations.RenameModel(
            old_name='CurrentSubscription',
            new_name='Subscription',
        ),
        migrations.CreateModel(
            name='Account',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False,
                                                 verbose_name='created')),
                ('modified', models.DateTimeField(default=django.utils.timezone.now, editable=False,
                                                  verbose_name='modified')),
                ('stripe_id', djstripe.fields.StripeIdField(max_length=50, unique=True)),
                ('livemode', djstripe.fields.StripeNullBooleanField(
                    default=False,
                    help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.')),
                ('stripe_timestamp', djstripe.fields.StripeDateTimeField(
                    help_text='The datetime this object was created in stripe.', null=True)),
                ('metadata', djstripe.fields.StripeJSONField(
                    blank=True,
                    help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True)),
                ('description', djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='StripeSource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('stripe_id', djstripe.fields.StripeIdField(max_length=50, unique=True)),
                ('livemode', djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.')),
                ('stripe_timestamp', djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True)),
                ('metadata', djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True)),
                ('description', djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Card',
            fields=[
                ('stripesource_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='djstripe.StripeSource')),
                ('address_city', djstripe.fields.StripeTextField(help_text='Billing address city.', null=True)),
                ('address_country', djstripe.fields.StripeTextField(help_text='Billing address country.', null=True)),
                ('address_line1', djstripe.fields.StripeTextField(help_text='Billing address (Line 1).', null=True)),
                ('address_line1_check', djstripe.fields.StripeCharField(choices=[('pass', 'Pass'), ('fail', 'Fail'), ('unavailable', 'Unavailable'), ('unknown', 'Unknown')], help_text='If ``address_line1`` was provided, results of the check.', max_length=11, null=True)),
                ('address_line2', djstripe.fields.StripeTextField(help_text='Billing address (Line 2).', null=True)),
                ('address_state', djstripe.fields.StripeTextField(help_text='Billing address state.', null=True)),
                ('address_zip', djstripe.fields.StripeTextField(help_text='Billing address zip code.', null=True)),
                ('address_zip_check', djstripe.fields.StripeCharField(choices=[('pass', 'Pass'), ('fail', 'Fail'), ('unavailable', 'Unavailable'), ('unknown', 'Unknown')], help_text='If ``address_zip`` was provided, results of the check.', max_length=11, null=True)),
                ('brand', djstripe.fields.StripeCharField(choices=[('American Express', 'American Express'), ('Diners Club', 'Diners Club'), ('Discover', 'Discover'), ('JCB', 'JCB'), ('MasterCard', 'MasterCard'), ('Unknown', 'Unknown'), ('Visa', 'Visa')], help_text='Card brand.', max_length=16)),
                ('country', djstripe.fields.StripeCharField(help_text='Two-letter ISO code representing the country of the card.', max_length=2)),
                ('cvc_check', djstripe.fields.StripeCharField(choices=[('pass', 'Pass'), ('fail', 'Fail'), ('unavailable', 'Unavailable'), ('unknown', 'Unknown')], help_text='If a CVC was provided, results of the check.', max_length=11, null=True)),
                ('dynamic_last4', djstripe.fields.StripeCharField(help_text='(For tokenized numbers only.) The last four digits of the device account number.', max_length=4, null=True)),
                ('exp_month', djstripe.fields.StripeIntegerField(help_text='Card expiration month.')),
                ('exp_year', djstripe.fields.StripeIntegerField(help_text='Card expiration year.')),
                ('fingerprint', djstripe.fields.StripeTextField(help_text='Uniquely identifies this particular card number.', null=True)),
                ('funding', djstripe.fields.StripeCharField(choices=[('credit', 'Credit'), ('debit', 'Debit'), ('prepaid', 'Prepaid'), ('unknown', 'Unknown')], help_text='Card funding type.', max_length=7)),
                ('last4', djstripe.fields.StripeCharField(help_text='Last four digits of Card number.', max_length=4)),
                ('name', djstripe.fields.StripeTextField(help_text='Cardholder name.', null=True)),
                ('tokenization_method', djstripe.fields.StripeCharField(choices=[('android_pay', 'Android Pay'), ('apple_pay', 'Apple Pay')], help_text='If the card number is tokenized, this is the method that was used.', max_length=11, null=True)),
            ],
            options={
                'abstract': False,
            },
            bases=('djstripe.stripesource',),
        ),
        migrations.RemoveField(
            model_name='transferchargefee',
            name='transfer',
        ),
        migrations.RemoveField(
            model_name='charge',
            name='card_kind',
        ),
        migrations.RemoveField(
            model_name='charge',
            name='card_last_4',
        ),
        migrations.RemoveField(
            model_name='charge',
            name='invoice',
        ),
        migrations.RemoveField(
            model_name='customer',
            name='card_exp_month',
        ),
        migrations.RemoveField(
            model_name='customer',
            name='card_exp_year',
        ),
        migrations.RemoveField(
            model_name='customer',
            name='card_fingerprint',
        ),
        migrations.RemoveField(
            model_name='customer',
            name='card_kind',
        ),
        migrations.RemoveField(
            model_name='customer',
            name='card_last_4',
        ),
        migrations.RemoveField(
            model_name='event',
            name='validated_message',
        ),
        migrations.RemoveField(
            model_name='invoiceitem',
            name='line_type',
        ),
        migrations.RemoveField(
            model_name='subscription',
            name='amount',
        ),
        migrations.RemoveField(
            model_name='transfer',
            name='event',
        ),
        migrations.AddField(
            model_name='charge',
            name='account',
            field=models.ForeignKey(help_text='The account the charge was made on behalf of. Null here indicates that this value was never set.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='charges', to='djstripe.Account'),
        ),
        migrations.AddField(
            model_name='charge',
            name='source',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='charges', to='djstripe.StripeSource'),
        ),
        migrations.AddField(
            model_name='charge',
            name='currency',
            field=djstripe.fields.StripeCharField(default='', help_text='Three-letter ISO currency code representing the currency in which the charge was made.', max_length=3),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='charge',
            name='failure_code',
            field=djstripe.fields.StripeCharField(choices=[('card_declined', 'Card was declined'), ('expired_card', 'Expired card'), ('incorrect_cvc', 'Incorrect security code'), ('incorrect_number', 'Incorrect number'), ('incorrect_zip', 'ZIP code failed validation'), ('invalid_cvc', 'Invalid security code'), ('invalid_expiry_month', 'Invalid expiration month'), ('invalid_expiry_year', 'Invalid expiration year'), ('invalid_number', 'Invalid number'), ('invalid_swipe_data', 'Invalid swipe data'), ('missing', 'No card being charged'), ('processing_error', 'Processing error')], help_text='Error code explaining reason for charge failure if available.', max_length=30, null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='failure_message',
            field=djstripe.fields.StripeTextField(help_text='Message to user further explaining reason for charge failure if available.', null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='fee_details',
            field=djstripe.fields.StripeJSONField(null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='fraudulent',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not this charge was marked as fraudulent.'),
        ),
        migrations.AddField(
            model_name='charge',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AddField(
            model_name='charge',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='shipping',
            field=djstripe.fields.StripeJSONField(help_text='Shipping information for the charge', null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='source_stripe_id',
            field=djstripe.fields.StripeIdField(help_text='The payment source id.', max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='source_type',
            field=djstripe.fields.StripeCharField(choices=[('alipay_account', 'Alipay account'), ('bank_account', 'Bank account'), ('bitcoin_receiver', 'Bitcoin receiver'), ('card', 'Card')], help_text='The payment source type. If the payment source is supported by dj-stripe, a corresponding model is attached to this Charge via a foreign key matching this field.', max_length=20, null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AddField(
            model_name='charge',
            name='status',
            field=djstripe.fields.StripeCharField(choices=[('succeeded', 'Succeeded'), ('failed', 'Failed')], default='unknown', help_text='The status of the payment.', max_length=10),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='charge',
            name='transfer',
            field=models.ForeignKey(help_text='The transfer to the destination account (only applicable if the charge was created using the destination parameter).', null=True, on_delete=django.db.models.deletion.CASCADE, to='djstripe.Transfer'),
        ),
        migrations.AddField(
            model_name='customer',
            name='account_balance',
            field=djstripe.fields.StripeIntegerField(help_text="Current balance, if any, being stored on the customer's account. If negative, the customer has credit to apply to the next invoice. If positive, the customer has an amount owed that will be added to the next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account for recurring charges.", null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='business_vat_id',
            field=djstripe.fields.StripeCharField(help_text="The customer's VAT identification number.", max_length=20, null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='currency',
            field=djstripe.fields.StripeCharField(help_text='The currency the customer can be charged in for recurring billing purposes (subscriptions, invoices, invoice items).', max_length=3, null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='delinquent',
            field=djstripe.fields.StripeBooleanField(default=False, help_text="Whether or not the latest charge for the customer's latest invoice has failed."),
        ),
        migrations.AddField(
            model_name='customer',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AddField(
            model_name='customer',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='shipping',
            field=djstripe.fields.StripeJSONField(help_text='Shipping information associated with the customer.', null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AddField(
            model_name='event',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AddField(
            model_name='event',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='event',
            name='received_api_version',
            field=djstripe.fields.StripeCharField(blank=True, help_text='the API version at which the event data was rendered. Blank for old entries only, all new entries will have this value', max_length=15),
        ),
        migrations.AddField(
            model_name='event',
            name='request_id',
            field=djstripe.fields.StripeCharField(blank=True, help_text="Information about the request that triggered this event, for traceability purposes. If empty string then this is an old entry without that data. If Null then this is not an old entry, but a Stripe 'automated' event with no associated request.", max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='event',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='amount_due',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=0, help_text="Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due.", max_digits=7),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='invoice',
            name='application_fee',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text="The fee in cents that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.", max_digits=7, null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='currency',
            field=djstripe.fields.StripeCharField(default='', help_text='Three-letter ISO currency code.', max_length=3),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='invoice',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='ending_balance',
            field=djstripe.fields.StripeIntegerField(help_text='Ending customer balance after attempting to pay invoice. If the invoice has not been attempted yet, this will be null.', null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='forgiven',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the invoice has been forgiven. Forgiving an invoice instructs us to update the subscription status as if the invoice were successfully paid. Once an invoice has been forgiven, it cannot be unforgiven or reopened.'),
        ),
        migrations.AddField(
            model_name='invoice',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AddField(
            model_name='invoice',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='next_payment_attempt',
            field=djstripe.fields.StripeDateTimeField(help_text='The time at which payment will next be attempted.', null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='starting_balance',
            field=djstripe.fields.StripeIntegerField(default=0, help_text='Starting customer balance before attempting to pay invoice. If the invoice has not been attempted yet, this will be the current customer balance.'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='invoice',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='subscription',
            field=models.ForeignKey(help_text='The subscription that this invoice was prepared for, if any.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='invoices', to='djstripe.Subscription'),
        ),
        migrations.AddField(
            model_name='invoice',
            name='subscription_proration_date',
            field=djstripe.fields.StripeDateTimeField(help_text='Only set for upcoming invoices that preview prorations. The time used to calculate prorations.', null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='tax',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount of tax included in the total, calculated from ``tax_percent`` and the subtotal. If no ``tax_percent`` is defined, this value will be null.', max_digits=7, null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='tax_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text="This percentage of the subtotal has been added to the total amount of the invoice, including invoice line items and discounts. This field is inherited from the subscription's ``tax_percent`` field, but can be changed before the invoice is paid. This field defaults to null.", max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='customer',
            field=models.ForeignKey(default=1, help_text='The customer associated with this invoiceitem.', on_delete=django.db.models.deletion.CASCADE, related_name='invoiceitems', to='djstripe.Customer'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='date',
            field=djstripe.fields.StripeDateTimeField(default=datetime.datetime(2100, 1, 1, 0, 0, tzinfo=utc), help_text='The date on the invoiceitem.'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='discountable',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='If True, discounts will apply to this invoice item. Always False for prorations.'),
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='subscription',
            field=models.ForeignKey(help_text='The subscription that this invoice item has been created for, if any.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='invoiceitems', to='djstripe.Subscription'),
        ),
        migrations.AddField(
            model_name='plan',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AddField(
            model_name='plan',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AddField(
            model_name='plan',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='plan',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AddField(
            model_name='plan',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AlterModelOptions(
            name='plan',
            options={'ordering': ['amount']},
        ),
        migrations.AddField(
            model_name='subscription',
            name='application_fee_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text='A positive decimal that represents the fee percentage of the subscription invoice amount that will be transferred to the application owner’s Stripe account each billing period.', max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AddField(
            model_name='subscription',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AddField(
            model_name='subscription',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AddField(
            model_name='subscription',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='subscription',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(default='unknown', max_length=50),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='subscription',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AddField(
            model_name='subscription',
            name='tax_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text='A positive decimal (with at most two decimal places) between 1 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period.', max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AddField(
            model_name='transfer',
            name='amount_reversed',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount reversed (can be less than the amount attribute on the transfer if a partial reversal was issued).', max_digits=7, null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='currency',
            field=djstripe.fields.StripeCharField(default='', help_text='Three-letter ISO currency code.', max_length=3),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='transfer',
            name='destination',
            field=djstripe.fields.StripeIdField(default='unknown', help_text='ID of the bank account, card, or Stripe account the transfer was sent to.', max_length=50),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='transfer',
            name='destination_payment',
            field=djstripe.fields.StripeIdField(help_text='If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer.', max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='destination_type',
            field=djstripe.fields.StripeCharField(choices=[('card', 'Card'), ('bank_account', 'Bank Account'), ('stripe_account', 'Stripe Account')], default='unknown', help_text='The type of the transfer destination.', max_length=14),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='transfer',
            name='failure_code',
            field=djstripe.fields.StripeCharField(choices=[('insufficient_funds', 'Insufficient Funds'), ('account_closed', 'Account Closed'), ('no_account', 'No Account'), ('invalid_account_number', 'Invalid Account Number'), ('debit_not_authorized', 'Debit Not Authorized'), ('bank_ownership_changed', 'Bank Ownership Changed'), ('account_frozen', 'Account Frozen'), ('could_not_process', 'Could Not Process'), ('bank_account_restricted', 'Bank Account Restricted'), ('invalid_currency', 'Invalid Currency')], help_text='Error code explaining reason for transfer failure if available. See                 https://stripe.com/docs/api/python#transfer_failures.', max_length=23, null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='failure_message',
            field=djstripe.fields.StripeTextField(help_text='Message to user further explaining reason for transfer failure if available.', null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='fee',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, max_digits=7, null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='fee_details',
            field=djstripe.fields.StripeJSONField(null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AddField(
            model_name='transfer',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='reversed',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false.'),
        ),
        migrations.AddField(
            model_name='transfer',
            name='source_transaction',
            field=djstripe.fields.StripeIdField(help_text='ID of the charge (or other transaction) that was used to fund the transfer. If null, the transfer was funded from the available balance.', max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='source_type',
            field=djstripe.fields.StripeCharField(choices=[('alipay_account', 'Alipay account'), ('bank_account', 'Bank account'), ('bitcoin_receiver', 'Bitcoin receiver'), ('card', 'Card')], default='unknown', help_text='The source balance from which this transfer came.', max_length=16),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='transfer',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AddField(
            model_name='transfer',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AddField(
            model_name='stripesource',
            name='customer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sources', to='djstripe.Customer'),
        ),
        migrations.AddField(
            model_name='stripesource',
            name='polymorphic_ctype',
            field=models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_djstripe.stripesource_set+', to='contenttypes.ContentType'),
        ),
        migrations.AddField(
            model_name='customer',
            name='default_source',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='customers', to='djstripe.StripeSource'),
        ),
        migrations.DeleteModel(
            name='TransferChargeFee',
        ),
        migrations.AlterField(
            model_name='customer',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='customer',
            field=models.ForeignKey(help_text='In the event that there is a related customer, this will point to that Customer record', null=True, on_delete=django.db.models.deletion.CASCADE, to='djstripe.Customer'),
        ),
        migrations.AlterField(
            model_name='event',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='event',
            name='processed',
            field=models.BooleanField(default=False, help_text='If validity is performed, webhook event processor(s) may run to take further action on the event. Once these have run, this is set to True.'),
        ),
        migrations.AlterField(
            model_name='event',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='type',
            field=djstripe.fields.StripeCharField(help_text="Stripe's event description code", max_length=250),
        ),
        migrations.AlterField(
            model_name='event',
            name='valid',
            field=models.NullBooleanField(help_text='Tri-state bool. Null == validity not yet confirmed. Otherwise, this field indicates that this event was checked via stripe api and found to be either authentic (valid=True) or in-authentic (possibly malicious)'),
        ),
        migrations.AlterField(
            model_name='event',
            name='webhook_message',
            field=djstripe.fields.StripeJSONField(help_text='data received at webhook. data should be considered to be garbage until validity check is run and valid flag is set'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='attempt_count',
            field=djstripe.fields.StripeIntegerField(default=0, help_text='Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='invoice',
            name='attempted',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the ``invoice.created`` webhook, for example, so you might not want to display that invoice as unpaid to your users.'),
        ),
        migrations.RenameField(
            model_name='invoice',
            old_name='charge',
            new_name='charge_stripe_id',
        ),
        migrations.AlterField(
            model_name='invoice',
            name='charge_stripe_id',
            field=models.CharField(blank=True, max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='invoice',
            name='charge',
            field=models.OneToOneField(help_text='The latest charge generated for this invoice, if any.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='invoice', to='djstripe.Charge'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='closed',
            field=djstripe.fields.StripeBooleanField(default=False, help_text="Whether or not the invoice is still trying to collect payment. An invoice is closed if it's either paid or it has been marked closed. A closed invoice will no longer attempt to collect payment."),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='customer',
            field=models.ForeignKey(help_text='The customer associated with this invoice.', on_delete=django.db.models.deletion.CASCADE, related_name='invoices', to='djstripe.Customer'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='date',
            field=djstripe.fields.StripeDateTimeField(help_text='The date on the invoice.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='paid',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='The time at which payment will next be attempted.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='period_end',
            field=djstripe.fields.StripeDateTimeField(help_text='End of the usage period during which invoice items were added to this invoice.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='period_start',
            field=djstripe.fields.StripeDateTimeField(help_text='Start of the usage period during which invoice items were added to this invoice.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='subtotal',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Only set for upcoming invoices that preview prorations. The time used to calculate prorations.', max_digits=7),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='total',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, max_digits=7, verbose_name='Total after discount.'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Amount invoiced.', max_digits=7),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='currency',
            field=djstripe.fields.StripeCharField(help_text='Three-letter ISO currency code.', max_length=3),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='invoice',
            field=models.ForeignKey(help_text='The invoice to which this invoiceitem is attached.', on_delete=django.db.models.deletion.CASCADE, related_name='invoiceitems', to='djstripe.Invoice'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='period_end',
            field=djstripe.fields.StripeDateTimeField(help_text="Might be the date when this invoiceitem's invoice was sent."),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='period_start',
            field=djstripe.fields.StripeDateTimeField(help_text='Might be the date when this invoiceitem was added to the invoice'),
        ),
        migrations.RenameField(
            model_name='invoiceitem',
            old_name='plan',
            new_name='plan_stripe_id',
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='plan_stripe_id',
            field=models.CharField(blank=True, max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='plan',
            field=models.ForeignKey(help_text='If the invoice item is a proration, the plan of the subscription for which the proration was computed.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='invoiceitems', to='djstripe.Plan'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='proration',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the invoice item was created automatically as a proration adjustment when the customer switched plans.'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='quantity',
            field=djstripe.fields.StripeIntegerField(help_text='If the invoice item is a proration, the quantity of the subscription for which the proration was computed.', null=True),
        ),
        migrations.RenameField(
            model_name='invoiceitem',
            old_name='stripe_id',
            new_name='subscription_stripe_id',
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='subscription_stripe_id',
            field=models.CharField(blank=True, max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='invoiceitem',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(default='unknown', max_length=50),
        ),
        migrations.AlterField(
            model_name='plan',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Amount to be charged on the interval specified.', max_digits=7),
        ),
        migrations.AlterField(
            model_name='plan',
            name='currency',
            field=djstripe.fields.StripeCharField(help_text='Three-letter ISO currency code', max_length=3),
        ),
        migrations.AlterField(
            model_name='plan',
            name='interval',
            field=djstripe.fields.StripeCharField(choices=[('day', 'Day'), ('month', 'Month'), ('week', 'Week'), ('year', 'Year')], help_text='The frequency with which a subscription should be billed.', max_length=5),
        ),
        migrations.AlterField(
            model_name='plan',
            name='interval_count',
            field=djstripe.fields.StripeIntegerField(help_text='The number of intervals (specified in the interval property) between each subscription billing.', null=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='name',
            field=djstripe.fields.StripeTextField(help_text='Name of the plan, to be displayed on invoices and in the web interface.'),
        ),
        migrations.AlterField(
            model_name='plan',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='trial_period_days',
            field=djstripe.fields.StripeIntegerField(help_text='Number of trial period days granted when subscribing a customer to this plan. Null if the plan has no trial period.', null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='cancel_at_period_end',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='If the subscription has been canceled with the ``at_period_end`` flag set to true, ``cancel_at_period_end`` on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='canceled_at',
            field=djstripe.fields.StripeDateTimeField(help_text='If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with ``cancel_at_period_end``, canceled_at will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state.', null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='current_period_end',
            field=djstripe.fields.StripeDateTimeField(default=datetime.datetime(2100, 1, 1, 0, 0, tzinfo=utc), help_text='End of the current period for which the subscription has been invoiced. At the end of this period, a new invoice will be created.'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='subscription',
            name='current_period_start',
            field=djstripe.fields.StripeDateTimeField(default=datetime.datetime(2100, 1, 1, 0, 0, tzinfo=utc), help_text='Start of the current period for which the subscription has been invoiced.'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='subscription',
            name='customer',
            field=models.ForeignKey(default=1, help_text='The customer associated with this subscription.', on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to='djstripe.Customer'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='subscription',
            name='ended_at',
            field=djstripe.fields.StripeDateTimeField(help_text='If the subscription has ended (either because it was canceled or because the customer was switched to a subscription to a new plan), the date the subscription ended.', null=True),
        ),
        migrations.RenameField(
            model_name='subscription',
            old_name='plan',
            new_name='plan_stripe_id',
        ),
        migrations.AlterField(
            model_name='subscription',
            name='plan_stripe_id',
            field=models.CharField(blank=True, max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='subscription',
            name='plan',
            field=models.ForeignKey(default=1, help_text='The plan associated with this subscription.', on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to='djstripe.Plan'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='subscription',
            name='quantity',
            field=djstripe.fields.StripeIntegerField(help_text='The quantity applied to this subscription.'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='start',
            field=djstripe.fields.StripeDateTimeField(help_text='Date the subscription started.'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='status',
            field=djstripe.fields.StripeCharField(choices=[('trialing', 'Trialing'), ('active', 'Active'), ('past_due', 'Past Due'), ('canceled', 'Canceled'), ('unpaid', 'Unpaid')], help_text='The status of this subscription.', max_length=8),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='trial_end',
            field=djstripe.fields.StripeDateTimeField(help_text='If the subscription has a trial, the end of that trial.', null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='trial_start',
            field=djstripe.fields.StripeDateTimeField(help_text='If the subscription has a trial, the beginning of that trial.', null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='adjustment_count',
            field=djstripe.fields.StripeIntegerField(default=None, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='adjustment_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='adjustment_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount transferred', max_digits=7),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='charge_count',
            field=djstripe.fields.StripeIntegerField(default=None, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='charge_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='charge_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='collected_fee_count',
            field=djstripe.fields.StripeIntegerField(default=None, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='collected_fee_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='date',
            field=djstripe.fields.StripeDateTimeField(help_text="Date the transfer is scheduled to arrive in the bank. This doesn't factor in delays like weekends or bank holidays."),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='net',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='refund_count',
            field=djstripe.fields.StripeIntegerField(default=None, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='refund_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='refund_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='status',
            field=djstripe.fields.StripeCharField(choices=[('paid', 'Paid'), ('pending', 'Pending'), ('in_transit', 'In Transit'), ('canceled', 'Canceled'), ('failed', 'Failed')], help_text='The current status of the transfer. A transfer will be pending until it is submitted to the bank, at which point it becomes in_transit. It will then change to paid if the transaction goes through. If it does not go through successfully, its status will change to failed or canceled.', max_length=10),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='validation_count',
            field=djstripe.fields.StripeIntegerField(default=None, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='validation_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=0, help_text='Amount charged.', max_digits=7),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='charge',
            name='amount_refunded',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=0, help_text='Amount refunded (can be less than the amount attribute on the charge if a partial refund was issued).', max_digits=7),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='charge',
            name='customer',
            field=models.ForeignKey(help_text='The customer associated with this charge.', on_delete=django.db.models.deletion.CASCADE, related_name='charges', to='djstripe.Customer'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='description',
            field=djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='disputed',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not this charge is disputed.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='fee',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='paid',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='True if the charge succeeded, or was successfully authorized for later capture, False otherwise.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='refunded',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='stripe_timestamp',
            field=djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='captured',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='If the charge was created without capturing, this boolean represents whether or not it is still uncaptured or has since been captured.'),
        ),
        migrations.RunPython(
            code=resync_subscriptions,
        ),
        migrations.RunPython(
            code=resync_invoiceitems,
        ),
        migrations.RunPython(
            code=sync_charges,
        ),
        migrations.RunPython(
            code=sync_invoices,
        ),
        migrations.RunPython(
            code=sync_transfers,
        ),
        migrations.RunPython(
            code=sync_customers,
        ),
        migrations.AlterField(
            model_name='subscription',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=50, unique=True),
        ),
        migrations.RemoveField(
            model_name='subscription',
            name='plan_stripe_id',
        ),
        migrations.RemoveField(
            model_name='invoice',
            name='charge_stripe_id',
        ),
        migrations.RemoveField(
            model_name='invoiceitem',
            name='plan_stripe_id',
        ),
        migrations.RemoveField(
            model_name='invoiceitem',
            name='subscription_stripe_id',
        ),
        migrations.AlterField(
            model_name='charge',
            name='receipt_sent',
            field=models.BooleanField(default=False, help_text='Whether or not a receipt was sent for this charge.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='source',
            field=models.ForeignKey(help_text='The source used for this charge.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='charges', to='djstripe.StripeSource'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='application_fee_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text='A positive decimal that represents the fee percentage of the subscription invoice amount that will be transferred to the application owner\'s Stripe account each billing period.', max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.CreateModel(
            name='UpcomingInvoice',
            fields=[
                ('invoice_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='djstripe.Invoice')),
            ],
            options={
                'abstract': False,
            },
            bases=('djstripe.invoice',),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='invoice',
            field=models.ForeignKey(help_text='The invoice to which this invoiceitem is attached.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='invoiceitems', to='djstripe.Invoice'),
        ),
        migrations.AlterField(
            model_name='account',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='source_stripe_id',
            field=djstripe.fields.StripeIdField(help_text='The payment source id.', max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='customer',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='stripesource',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='destination',
            field=djstripe.fields.StripeIdField(help_text='ID of the bank account, card, or Stripe account the transfer was sent to.', max_length=255),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='destination_payment',
            field=djstripe.fields.StripeIdField(help_text='If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer.', max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='source_transaction',
            field=djstripe.fields.StripeIdField(help_text='ID of the charge (or other transaction) that was used to fund the transfer. If null, the transfer was funded from the available balance.', max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='stripe_id',
            field=djstripe.fields.StripeIdField(max_length=255, unique=True),
        ),
        migrations.AlterField(
            model_name='customer',
            name='default_source',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='customers', to='djstripe.StripeSource'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='source',
            field=models.ForeignKey(help_text='The source used for this charge.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='charges', to='djstripe.StripeSource'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='subscription',
            field=models.ForeignKey(help_text='The subscription that this invoice was prepared for, if any.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='invoices', to='djstripe.Subscription'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='plan',
            field=models.ForeignKey(help_text='If the invoice item is a proration, the plan of the subscription for which the proration was computed.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='invoiceitems', to='djstripe.Plan'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='subscription',
            field=models.ForeignKey(help_text='The subscription that this invoice item has been created for,Z if any.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='invoiceitems', to='djstripe.Subscription'),
        ),
        migrations.AlterField(
            model_name='account',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='account',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='account',
            field=models.ForeignKey(help_text='The account the charge was made on behalf of. Null here indicates that this value was never set.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='charges', to='djstripe.Account'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='amount_refunded',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Amount refunded (can be less than the amount attribute on the charge if a partial refund was issued).', max_digits=7),
        ),
        migrations.AlterField(
            model_name='charge',
            name='captured',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='If the charge was created without capturing, this boolean represents whether or not it is still uncaptured or has since been captured.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='currency',
            field=djstripe.fields.StripeCharField(help_text='Three-letter ISO currency code representing the currency in which the charge was made.', max_length=3),
        ),
        migrations.AlterField(
            model_name='charge',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='paid',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='True if the charge succeeded, or was successfully authorized for later capture, False otherwise.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='refunded',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='source_type',
            field=djstripe.fields.StripeCharField(help_text='The payment source type. If the payment source is supported by dj-stripe, a corresponding model is attached to this Charge via a foreign key matching this field.', max_length=20, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='transfer',
            field=models.ForeignKey(help_text='The transfer to the destination account (only applicable if the charge was created using the destination parameter).', null=True, on_delete=django.db.models.deletion.CASCADE, to='djstripe.Transfer'),
        ),
        migrations.AlterField(
            model_name='customer',
            name='account_balance',
            field=djstripe.fields.StripeIntegerField(help_text="Current balance, if any, being stored on the customer's account. If negative, the customer has credit to apply to the next invoice. If positive, the customer has an amount owed that will be added to the next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account for recurring charges.", null=True),
        ),
        migrations.AlterField(
            model_name='customer',
            name='currency',
            field=djstripe.fields.StripeCharField(help_text='The currency the customer can be charged in for recurring billing purposes (subscriptions, invoices, invoice items).', max_length=3, null=True),
        ),
        migrations.AlterField(
            model_name='customer',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='customer',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='event',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='processed',
            field=models.BooleanField(default=False, help_text='If validity is performed, webhook event processor(s) may run to take further action on the event. Once these have run, this is set to True.'),
        ),
        migrations.AlterField(
            model_name='event',
            name='received_api_version',
            field=djstripe.fields.StripeCharField(blank=True, help_text='the API version at which the event data was rendered. Blank for old entries only, all new entries will have this value', max_length=15),
        ),
        migrations.AlterField(
            model_name='event',
            name='request_id',
            field=djstripe.fields.StripeCharField(blank=True, help_text="Information about the request that triggered this event, for traceability purposes. If empty string then this is an old entry without that data. If Null then this is not an old entry, but a Stripe 'automated' event with no associated request.", max_length=50, null=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='valid',
            field=models.NullBooleanField(help_text='Tri-state bool. Null == validity not yet confirmed. Otherwise, this field indicates that this event was checked via stripe api and found to be either authentic (valid=True) or in-authentic (possibly malicious)'),
        ),
        migrations.AlterField(
            model_name='event',
            name='webhook_message',
            field=djstripe.fields.StripeJSONField(default=dict, help_text='data received at webhook. data should be considered to be garbage until validity check is run and valid flag is set'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='amount_due',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text="Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due.", max_digits=7),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='application_fee',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text="The fee in cents that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.", max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='attempt_count',
            field=djstripe.fields.StripeIntegerField(help_text='Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='attempted',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the ``invoice.created`` webhook, for example, so you might not want to display that invoice as unpaid to your users.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='closed',
            field=djstripe.fields.StripeBooleanField(default=False, help_text="Whether or not the invoice is still trying to collect payment. An invoice is closed if it's either paid or it has been marked closed. A closed invoice will no longer attempt to collect payment."),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='ending_balance',
            field=djstripe.fields.StripeIntegerField(help_text='Ending customer balance after attempting to pay invoice. If the invoice has not been attempted yet, this will be null.', null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='forgiven',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the invoice has been forgiven. Forgiving an invoice instructs us to update the subscription status as if the invoice were successfully paid. Once an invoice has been forgiven, it cannot be unforgiven or reopened.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='starting_balance',
            field=djstripe.fields.StripeIntegerField(help_text='Starting customer balance before attempting to pay invoice. If the invoice has not been attempted yet, this will be the current customer balance.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='subscription_proration_date',
            field=djstripe.fields.StripeDateTimeField(help_text='Only set for upcoming invoices that preview prorations. The time used to calculate prorations.', null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='subtotal',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Only set for upcoming invoices that preview prorations. The time used to calculate prorations.', max_digits=7),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='tax',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount of tax included in the total, calculated from ``tax_percent`` and the subtotal. If no ``tax_percent`` is defined, this value will be null.', max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='tax_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text="This percentage of the subtotal has been added to the total amount of the invoice, including invoice line items and discounts. This field is inherited from the subscription's ``tax_percent`` field, but can be changed before the invoice is paid. This field defaults to null.", max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='discountable',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='If True, discounts will apply to this invoice item. Always False for prorations.'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='plan',
            field=models.ForeignKey(help_text='If the invoice item is a proration, the plan of the subscription for which the proration was computed.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='invoiceitems', to='djstripe.Plan'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='proration',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the invoice item was created automatically as a proration adjustment when the customer switched plans.'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='quantity',
            field=djstripe.fields.StripeIntegerField(help_text='If the invoice item is a proration, the quantity of the subscription for which the proration was computed.', null=True),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='subscription',
            field=models.ForeignKey(help_text='The subscription that this invoice item has been created for, if any.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='invoiceitems', to='djstripe.Subscription'),
        ),
        migrations.AlterField(
            model_name='plan',
            name='interval_count',
            field=djstripe.fields.StripeIntegerField(help_text='The number of intervals (specified in the interval property) between each subscription billing.', null=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='plan',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='trial_period_days',
            field=djstripe.fields.StripeIntegerField(help_text='Number of trial period days granted when subscribing a customer to this plan. Null if the plan has no trial period.', null=True),
        ),
        migrations.AlterField(
            model_name='stripesource',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='stripesource',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='application_fee_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text='A positive decimal that represents the fee percentage of the subscription invoice amount that will be transferred to the application ownerâ\x80\x99s Stripe account each billing period.', max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='cancel_at_period_end',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='If the subscription has been canceled with the ``at_period_end`` flag set to true, ``cancel_at_period_end`` on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='canceled_at',
            field=djstripe.fields.StripeDateTimeField(help_text='If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with ``cancel_at_period_end``, canceled_at will still reflect the date of the initial cancellation request, not the end of the subscription period when the subscription is automatically moved to a canceled state.', null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='current_period_end',
            field=djstripe.fields.StripeDateTimeField(help_text='End of the current period for which the subscription has been invoiced. At the end of this period, a new invoice will be created.'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='ended_at',
            field=djstripe.fields.StripeDateTimeField(help_text='If the subscription has ended (either because it was canceled or because the customer was switched to a subscription to a new plan), the date the subscription ended.', null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='tax_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text='A positive decimal (with at most two decimal places) between 1 and 100. This represents the percentage of the subscription invoice subtotal that will be calculated and added as tax to the final amount each billing period.', max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='amount_reversed',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount reversed (can be less than the amount attribute on the transfer if a partial reversal was issued).', max_digits=7, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='date',
            field=djstripe.fields.StripeDateTimeField(help_text="Date the transfer is scheduled to arrive in the bank. This doesn't factor in delays like weekends or bank holidays."),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='destination',
            field=djstripe.fields.StripeIdField(help_text='ID of the bank account, card, or Stripe account the transfer was sent to.', max_length=255),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='destination_payment',
            field=djstripe.fields.StripeIdField(help_text='If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer.', max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='failure_code',
            field=djstripe.fields.StripeCharField(choices=[('insufficient_funds', 'Insufficient Funds'), ('account_closed', 'Account Closed'), ('no_account', 'No Account'), ('invalid_account_number', 'Invalid Account Number'), ('debit_not_authorized', 'Debit Not Authorized'), ('bank_ownership_changed', 'Bank Ownership Changed'), ('account_frozen', 'Account Frozen'), ('could_not_process', 'Could Not Process'), ('bank_account_restricted', 'Bank Account Restricted'), ('invalid_currency', 'Invalid Currency')], help_text='Error code explaining reason for transfer failure if available. See https://stripe.com/docs/api/python#transfer_failures.', max_length=23, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='metadata',
            field=djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='reversed',
            field=djstripe.fields.StripeBooleanField(default=False, help_text='Whether or not the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false.'),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='source_transaction',
            field=djstripe.fields.StripeIdField(help_text='ID of the charge (or other transaction) that was used to fund the transfer. If null, the transfer was funded from the available balance.', max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='statement_descriptor',
            field=djstripe.fields.StripeCharField(help_text='An arbitrary string to be displayed on your customer\'s credit card statement. The statement description may not include <>"\' characters, and will appear on your customer\'s statement in capital letters. Non-ASCII characters are automatically stripped. While most banks display this information consistently, some may display it incorrectly or not at all.', max_length=22, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='status',
            field=djstripe.fields.StripeCharField(choices=[('paid', 'Paid'), ('pending', 'Pending'), ('in_transit', 'In Transit'), ('canceled', 'Canceled'), ('failed', 'Failed')], help_text='The current status of the transfer. A transfer will be pending until it is submitted to the bank, at which point it becomes in_transit. It will then change to paid if the transaction goes through. If it does not go through successfully, its status will change to failed or canceled.', max_length=10),
        ),
        migrations.AlterField(
            model_name='customer',
            name='subscriber',
            field=models.OneToOneField(null=True, on_delete=on_subscriber_delete_purge_customers, to=DJSTRIPE_SUBSCRIBER_MODEL),
        ),
        migrations.AlterField(
            model_name='event',
            name='webhook_message',
            field=djstripe.fields.StripeJSONField(help_text='data received at webhook. data should be considered to be garbage until validity check is run and valid flag is set'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='application_fee_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text='A positive decimal that represents the fee percentage of the subscription invoice amount that will be transferred to the application owner’s Stripe account each billing period.', max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='application_fee_percent',
            field=djstripe.fields.StripePercentField(decimal_places=2, help_text="A positive decimal that represents the fee percentage of the subscription invoice amount that will be transferred to the application owner's Stripe account each billing period.", max_digits=5, null=True, validators=[django.core.validators.MinValueValidator(1.0), django.core.validators.MaxValueValidator(100.0)]),
        ),
        migrations.AlterField(
            model_name='customer',
            name='subscriber',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='customer', to=DJSTRIPE_SUBSCRIBER_MODEL),
        ),
        migrations.AlterField(
            model_name='customer',
            name='subscriber',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='djstripe_customers', to=DJSTRIPE_SUBSCRIBER_MODEL),
        ),
        migrations.AlterField(
            model_name='customer',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='customer',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterUniqueTogether(
            name='customer',
            unique_together=set([('subscriber', 'livemode')]),
        ),
        migrations.AlterField(
            model_name='charge',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Amount charged.', max_digits=8),
        ),
        migrations.AlterField(
            model_name='charge',
            name='amount_refunded',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Amount refunded (can be less than the amount attribute on the charge if a partial refund was issued).', max_digits=8),
        ),
        migrations.AlterField(
            model_name='charge',
            name='fee',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='amount_due',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text="Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due.", max_digits=8),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='application_fee',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text="The fee in cents that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid.", max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='subtotal',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Only set for upcoming invoices that preview prorations. The time used to calculate prorations.', max_digits=8),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='tax',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount of tax included in the total, calculated from ``tax_percent`` and the subtotal. If no ``tax_percent`` is defined, this value will be null.', max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='total',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, max_digits=8, verbose_name='Total after discount.'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Amount invoiced.', max_digits=8),
        ),
        migrations.AlterField(
            model_name='plan',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='Amount to be charged on the interval specified.', max_digits=8),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='adjustment_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='adjustment_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='amount',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount transferred', max_digits=8),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='amount_reversed',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, help_text='The amount reversed (can be less than the amount attribute on the transfer if a partial reversal was issued).', max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='charge_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='charge_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='collected_fee_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='fee',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='net',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='refund_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='refund_gross',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='validation_fees',
            field=djstripe.fields.StripeCurrencyField(decimal_places=2, default=None, max_digits=8, null=True),
        ),
        migrations.AlterField(
            model_name='account',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='account',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='event',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='eventprocessingexception',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='eventprocessingexception',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='plan',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='stripesource',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='stripesource',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='created',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='modified',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.CreateModel(
            name='IdempotencyKey',
            fields=[
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('action', models.CharField(max_length=100)),
                ('livemode', models.BooleanField(help_text='Whether the key was used in live or test mode.')),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='idempotencykey',
            unique_together=set([('action', 'livemode')]),
        ),
        migrations.AlterField(
            model_name='charge',
            name='customer',
            field=models.ForeignKey(help_text='The customer associated with this charge.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='charges', to='djstripe.Customer'),
        ),
        migrations.AlterField(
            model_name='account',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='charge',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='customer',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='event',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='invoice',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='invoiceitem',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='plan',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='stripesource',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.CreateModel(
            name='Coupon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('livemode', djstripe.fields.StripeNullBooleanField(default=False, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.')),
                ('stripe_timestamp', djstripe.fields.StripeDateTimeField(help_text='The datetime this object was created in stripe.', null=True)),
                ('metadata', djstripe.fields.StripeJSONField(blank=True, help_text='A set of key/value pairs that you can attach to an object. It can be useful for storing additional information about an object in a structured format.', null=True)),
                ('description', djstripe.fields.StripeTextField(blank=True, help_text='A description of this object.', null=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('stripe_id', djstripe.fields.StripeIdField(max_length=500)),
                ('amount_off', djstripe.fields.StripeCurrencyField(blank=True, decimal_places=2, help_text='Amount that will be taken off the subtotal of any invoices for this customer.', max_digits=8, null=True)),
                ('currency', djstripe.fields.StripeCharField(blank=True, help_text='Three-letter ISO currency code', max_length=3, null=True)),
                ('duration', djstripe.fields.StripeCharField(choices=[('forever', 'Forever'), ('once', 'Once'), ('repeating', 'Repeating')], help_text='Describes how long a customer who applies this coupon will get the discount.', max_length=9)),
                ('duration_in_months', djstripe.fields.StripePositiveIntegerField(blank=True, help_text='If `duration` is `repeating`, the number of months the coupon applies.', null=True)),
                ('max_redemptions', djstripe.fields.StripePositiveIntegerField(blank=True, help_text='Maximum number of times this coupon can be redeemed, in total, before it is no longer valid.', null=True)),
                ('percent_off', djstripe.fields.StripePositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(100)])),
                ('redeem_by', djstripe.fields.StripeDateTimeField(blank=True, help_text='Date after which the coupon can no longer be redeemed. Max 5 years in the future.', null=True)),
                ('times_redeemed', djstripe.fields.StripePositiveIntegerField(default=0, editable=False, help_text='Number of times this coupon has been applied to a customer.')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AlterUniqueTogether(
            name='coupon',
            unique_together=set([('stripe_id', 'livemode')]),
        ),
        migrations.AddField(
            model_name='customer',
            name='coupon',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='djstripe.Coupon'),
        ),
        migrations.AddField(
            model_name='customer',
            name='coupon_end',
            field=djstripe.fields.StripeDateTimeField(editable=False, help_text='If a coupon is present and has a limited duration, the date that the discount will end.', null=True),
        ),
        migrations.AddField(
            model_name='customer',
            name='coupon_start',
            field=djstripe.fields.StripeDateTimeField(editable=False, help_text='If a coupon is present, the date at which it was applied.', null=True),
        ),
        migrations.AlterField(
            model_name='coupon',
            name='livemode',
            field=djstripe.fields.StripeNullBooleanField(default=None, help_text='Null here indicates that the livemode status is unknown or was previously unrecorded. Otherwise, this field indicates whether this record comes from Stripe test mode or live mode operation.'),
        ),
        migrations.AlterField(
            model_name='card',
            name='address_line1_check',
            field=djstripe.fields.StripeCharField(choices=[('fail', 'Fail'), ('pass', 'Pass'), ('unavailable', 'Unavailable'), ('unchecked', 'Unchecked')], help_text='If ``address_line1`` was provided, results of the check.', max_length=11, null=True),
        ),
        migrations.AlterField(
            model_name='card',
            name='address_zip_check',
            field=djstripe.fields.StripeCharField(choices=[('fail', 'Fail'), ('pass', 'Pass'), ('unavailable', 'Unavailable'), ('unchecked', 'Unchecked')], help_text='If ``address_zip`` was provided, results of the check.', max_length=11, null=True),
        ),
        migrations.AlterField(
            model_name='card',
            name='cvc_check',
            field=djstripe.fields.StripeCharField(choices=[('fail', 'Fail'), ('pass', 'Pass'), ('unavailable', 'Unavailable'), ('unchecked', 'Unchecked')], help_text='If a CVC was provided, results of the check.', max_length=11, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='failure_code',
            field=djstripe.fields.StripeCharField(choices=[('card_declined', 'Card was declined'), ('expired_card', 'Expired card'), ('incorrect_cvc', 'Incorrect security code'), ('incorrect_number', 'Incorrect number'), ('incorrect_zip', 'ZIP code failed validation'), ('invalid_cvc', 'Invalid security code'), ('invalid_expiry_month', 'Invalid expiration month'), ('invalid_expiry_year', 'Invalid expiration year'), ('invalid_number', 'Invalid number'), ('invalid_swipe_data', 'Invalid swipe data'), ('missing', 'No card being charged'), ('processing_error', 'Processing error')], help_text='Error code explaining reason for charge failure if available.', max_length=30, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='source_type',
            field=djstripe.fields.StripeCharField(choices=[('alipay_account', 'Alipay account'), ('bank_account', 'Bank account'), ('bitcoin_receiver', 'Bitcoin receiver'), ('card', 'Card')], help_text='The payment source type. If the payment source is supported by dj-stripe, a corresponding model is attached to this Charge via a foreign key matching this field.', max_length=20, null=True),
        ),
        migrations.AlterField(
            model_name='charge',
            name='status',
            field=djstripe.fields.StripeCharField(choices=[('failed', 'Failed'), ('pending', 'Pending'), ('succeeded', 'Succeeded')], help_text='The status of the payment.', max_length=10),
        ),
        migrations.AlterField(
            model_name='coupon',
            name='duration',
            field=djstripe.fields.StripeCharField(choices=[('forever', 'Forever'), ('once', 'Once'), ('repeating', 'Multi-month')], help_text='Describes how long a customer who applies this coupon will get the discount.', max_length=9),
        ),
        migrations.AlterField(
            model_name='subscription',
            name='status',
            field=djstripe.fields.StripeCharField(choices=[('active', 'Active'), ('canceled', 'Canceled'), ('past_due', 'Past due'), ('trialing', 'Trialing'), ('unpaid', 'Unpaid')], help_text='The status of this subscription.', max_length=8),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='failure_code',
            field=djstripe.fields.StripeCharField(choices=[('account_closed', 'Bank account has been closed.'), ('account_frozen', 'Bank account has been frozen.'), ('bank_account_restricted', 'Bank account has restrictions on payouts allowed.'), ('bank_ownership_changed', 'Destination bank account has changed ownership.'), ('could_not_process', 'Bank could not process payout.'), ('debit_not_authorized', 'Debit transactions not approved on the bank account.'), ('insufficient_funds', 'Stripe account has insufficient funds.'), ('invalid_account_number', 'Invalid account number'), ('invalid_currency', 'Bank account does not support currency.'), ('no_account', 'Bank account could not be located.'), ('unsupported_card', 'Card no longer supported.')], help_text='Error code explaining reason for transfer failure if available. See https://stripe.com/docs/api/python#transfer_failures.', max_length=23, null=True),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='source_type',
            field=djstripe.fields.StripeCharField(choices=[('alipay_account', 'Alipay account'), ('bank_account', 'Bank account'), ('bitcoin_receiver', 'Bitcoin receiver'), ('card', 'Card')], help_text='The source balance from which this transfer came.', max_length=16),
        ),
        migrations.AlterField(
            model_name='transfer',
            name='status',
            field=djstripe.fields.StripeCharField(choices=[('canceled', 'Canceled'), ('failed', 'Failed'), ('in_transit', 'In transit'), ('paid', 'Paid'), ('pending', 'Pending')], help_text='The current status of the transfer. A transfer will be pending until it is submitted to the bank, at which point it becomes in_transit. It will then change to paid if the transaction goes through. If it does not go through successfully, its status will change to failed or canceled.', max_length=10),
        ),
    ]
