# Generated by Django 2.1.2 on 2018-10-07 08:15

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Client',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('is_trade', models.BooleanField(default=False)),
                ('nif', models.CharField(db_index=True, max_length=10, unique=True)),
                ('is_client', models.BooleanField(default=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ClientWalletAccount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('money', models.FloatField(null=True)),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='client_wallet', to='wallet.Client')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='HistoryOperations',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('successful_charge', models.BooleanField()),
                ('successful_recharge', models.BooleanField()),
                ('summary', models.TextField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='Last modification date')),
            ],
        ),
        migrations.CreateModel(
            name='Trade',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('is_client', models.BooleanField(default=False)),
                ('company', models.CharField(max_length=64)),
                ('cif', models.CharField(db_index=True, max_length=32, unique=True)),
                ('is_trade', models.BooleanField(default=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TradeWalletAccount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('money', models.FloatField(null=True)),
                ('operations', models.ManyToManyField(related_name='tradewalletaccount_operations', to='wallet.HistoryOperations')),
                ('trade', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='trade_wallet', to='wallet.Trade')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='clientwalletaccount',
            name='operations',
            field=models.ManyToManyField(related_name='clientwalletaccount_operations', to='wallet.HistoryOperations'),
        ),
    ]
