# Generated by Django 3.2.1 on 2021-05-06 16:18

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cpf', models.CharField(max_length=13, unique=True, verbose_name='CPF')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='E-mail')),
                ('telefone', models.CharField(blank=True, max_length=15, null=True, verbose_name='Telefone')),
                ('primeiro_nome', models.CharField(max_length=20, verbose_name='Primeiro nome')),
                ('segundo_nome', models.CharField(max_length=20, verbose_name='Segundo nome')),
                ('data_cadastro', models.DateTimeField(editable=False)),
                ('data_edicao', models.DateTimeField()),
                ('criado_por', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Imovel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('endereco', models.CharField(max_length=100, verbose_name='Endereço')),
                ('numero', models.IntegerField(verbose_name='Numero')),
                ('bairro', models.CharField(max_length=100, verbose_name='Bairro')),
                ('complemento', models.CharField(blank=True, max_length=100, null=True, verbose_name='Complemento')),
                ('cidade', models.CharField(max_length=100, verbose_name='Cidade')),
                ('estado', models.CharField(max_length=50, verbose_name='Estado')),
                ('cep', models.CharField(max_length=10, verbose_name='CEP')),
                ('valor', models.DecimalField(decimal_places=2, max_digits=7)),
            ],
        ),
        migrations.CreateModel(
            name='Venda',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('valor_imovel', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='Valor da venda')),
                ('pagamento', models.CharField(max_length=255, verbose_name='Forma de pagamento')),
                ('cliente_cliente', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='cliente_cliente', to='core.cliente', verbose_name='Cliente')),
                ('imovel_imovel', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='imovel_vendido', to='core.imovel', verbose_name='Imóvel')),
                ('vendedor_user', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='vendedor_user', to=settings.AUTH_USER_MODEL, verbose_name='Vendedor')),
            ],
        ),
    ]
