# Generated by Django 3.1 on 2020-09-10 23:32

import uuid

import django.core.validators
import django.db.models.deletion
from django.db import migrations, models

import transactions.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("companies", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Transaction",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "client",
                    models.CharField(
                        max_length=14,
                        validators=[
                            django.core.validators.MinLengthValidator(14),
                            transactions.validators.cpf_validator,
                        ],
                    ),
                ),
                ("value", models.FloatField()),
                ("description", models.TextField(max_length=1000)),
                (
                    "company",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="transactions",
                        to="companies.company",
                    ),
                ),
            ],
        ),
    ]
