# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2020-03-18 14:04
from __future__ import unicode_literals

from django.db import migrations
from bluebottle.funding_stripe.models import get_specs


def set_eventually_due(apps, schema_editor):
    Account = apps.get_model('funding_stripe', 'StripePayoutAccount')

    for account in Account.objects.all():
        spec = get_specs(account.country)
        account.eventually_due = (
            spec['verification_fields']['individual']['minimum'] +
            spec['verification_fields']['individual']['additional']
        )
        account.save()


class Migration(migrations.Migration):

    dependencies = [
        ('funding_stripe', '0003_auto_20200317_1601'),
    ]

    operations = [
        migrations.RunPython(set_eventually_due)
    ]

Add eventually_due fields in migration
Add eventually_due fields in migration
