# Generated by Django 3.1 on 2020-09-06 23:23

import uuid

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

import companies.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Company",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                (
                    "cnpj",
                    models.CharField(
                        max_length=18,
                        unique=True,
                        validators=[
                            django.core.validators.MinLengthValidator(18),
                            companies.validators.cnpj_validator,
                        ],
                    ),
                ),
                ("owner", models.CharField(max_length=40)),
                (
                    "ddd",
                    models.PositiveIntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(11),
                            django.core.validators.MaxValueValidator(99),
                        ]
                    ),
                ),
                (
                    "phone",
                    models.PositiveIntegerField(
                        validators=[
                            companies.validators.IntegerLengthValidator(9, 9)
                        ]
                    ),
                ),
            ],
        ),
    ]
