# Generated by Django 3.2.13 on 2022-05-20 02:06

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('django_omise', '0005_metadata_fields'),
    ]

    operations = [
        migrations.CreateModel(
            name='ChargeSchedule',
            fields=[
                ('metadata', models.JSONField(blank=True, default=dict, help_text='Custom metadata for this object.')),
                ('id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('livemode', models.BooleanField()),
                ('data', models.JSONField(blank=True, default=dict)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('uid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('amount', models.IntegerField(help_text='Refund amount in smallest unit of charge currency.')),
                ('currency', models.CharField(choices=[('USD', 'United States Dollar'), ('THB', 'Thai Baht'), ('SGD', 'Singapore Dollar'), ('JPY', 'Japanese Yen'), ('GBP', 'Pound Sterling'), ('EUR', 'Euro'), ('CNY', 'Chinese Yuan'), ('AUD', 'Australian Dollar')], max_length=3)),
                ('default_card', models.BooleanField()),
                ('description', models.TextField(blank=True)),
                ('card', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='charge_schedules', to='django_omise.card')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='charge_schedules', to='django_omise.customer')),
            ],
            options={
                'ordering': ['-date_created'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('livemode', models.BooleanField()),
                ('data', models.JSONField(blank=True, default=dict)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('uid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('deleted', models.BooleanField(default=False, help_text="Whether this object is marked as deleted on Omise's server")),
                ('active', models.BooleanField(help_text='Whether schedule is status running or expiring.')),
                ('end_on', models.CharField(blank=True, help_text='End date of schedule in ISO 8601 format.', max_length=255)),
                ('ended_at', models.CharField(blank=True, help_text='Actual end date of schedule in ISO 8601 format.', max_length=255)),
                ('every', models.PositiveIntegerField(blank=True, help_text='How often schedule should run when applied to period. For example, if set to 3 and period is set to week, schedule should run every 3 weeks.', null=True)),
                ('in_words', models.TextField(blank=True)),
                ('next_occurrences_on', models.JSONField(blank=True, default=list)),
                ('period', models.CharField(blank=True, choices=[('day', 'Day'), ('week', 'Week'), ('month', 'Month')], max_length=5)),
                ('start_on', models.CharField(help_text='Start date of schedule in ISO 8601 format.', max_length=255)),
                ('status', models.CharField(choices=[('running', 'Running'), ('expiring', 'Expiring'), ('expired', 'Expired'), ('deleted', 'Deleted'), ('suspended', 'Suspended')], max_length=50)),
                ('charge', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='django_omise.chargeschedule')),
            ],
            options={
                'ordering': ['-date_created'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Occurrence',
            fields=[
                ('id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('livemode', models.BooleanField()),
                ('data', models.JSONField(blank=True, default=dict)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('date_updated', models.DateTimeField(auto_now=True)),
                ('uid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('message', models.CharField(blank=True, max_length=255)),
                ('processed_at', models.DateTimeField(blank=True, null=True)),
                ('retry_on', models.DateField(blank=True, null=True)),
                ('schduled_on', models.DateField(blank=True, null=True)),
                ('status', models.CharField(choices=[('skipped', 'Skipped'), ('failed', 'Failed'), ('successful', 'Successful')], max_length=30)),
                ('schedule', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='occurrences', to='django_omise.schedule')),
            ],
            options={
                'ordering': ['-date_created'],
                'abstract': False,
            },
        ),
    ]
