# Generated by Django 3.2.3 on 2021-08-15 14:44

from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('utils', '0001_initial'),
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Banco',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=120, unique=True)),
                ('status', models.BooleanField(default=True, help_text='Para desactivar este banco, deshabilite esta casilla.')),
                ('created_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Civil',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=120, unique=True)),
                ('status', models.BooleanField(default=True, help_text='Para desactivar este estado civil, deshabilite esta casilla.')),
                ('created_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Nacionalidad',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=120, unique=True)),
                ('status', models.BooleanField(default=True, help_text='Para desactivar esta nacionalidad, deshabilite esta casilla.')),
                ('created_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Sexo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=120, unique=True)),
                ('status', models.BooleanField(default=True, help_text='Para desactivar este sexo, deshabilite esta casilla.')),
                ('created_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='SistemaPrevision',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=120, unique=True)),
                ('status', models.BooleanField(default=True, help_text='Para desactivar este estado Sistema de Prevision, deshabilite esta casilla.')),
                ('created_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='SistemaSalud',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=120, unique=True)),
                ('status', models.BooleanField(default=True, help_text='Para desactivar este Sistema de Salud, deshabilite esta casilla.')),
                ('created_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TipoCta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=120, unique=True)),
                ('status', models.BooleanField(default=True, help_text='Para desactivar este tipo de cuenta, deshabilite esta casilla.')),
                ('created_date', models.DateTimeField(blank=True, default=django.utils.timezone.now, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('created', models.DateTimeField(auto_now_add=True, help_text='Date time on  which the object was created.', verbose_name='created at')),
                ('modified', models.DateTimeField(auto_now=True, help_text='Date time on  which the object was last modified.', verbose_name='modified at')),
                ('atributos', models.JSONField(blank=True, null=True)),
                ('cambiar_clave', models.BooleanField(default=True, help_text='Marque esta casilla para que el usuario cambie su clave después de ingresar.', verbose_name='Cambiar Clave')),
                ('codigo', models.CharField(blank=True, help_text='Identificador único del sistema de gestión.', max_length=6, null=True, unique=True, verbose_name='código')),
                ('email', models.EmailField(error_messages={'unique': 'Ya existe un usuario con este email registrado.'}, max_length=254, unique=True, verbose_name='email address')),
                ('rut', models.CharField(error_messages={'unique': 'Ya existe un usuario con este RUT registrado.'}, max_length=12, unique=True, validators=[django.core.validators.RegexValidator(message='El RUT debe ser valido. Ingresalo sin puntos ni guiones.', regex='^[0-9]{7,9}[0-9kK]{1}$')])),
                ('fecha_nacimiento', models.DateField(blank=True, null=True)),
                ('telefono', models.CharField(blank=True, max_length=15, null=True, validators=[django.core.validators.RegexValidator(message='El numero de telefono debe ser ingresado en el siguiente formato +999999999. Solo puede ingresar hasta 15 digitos.', regex='\\+?1?\\d{9,15}$')], verbose_name='Teléfono')),
                ('domicilio', models.CharField(blank=True, max_length=200, null=True)),
                ('cuenta', models.CharField(blank=True, max_length=30, null=True, unique=True, verbose_name='Número de cuenta')),
                ('banco', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.banco')),
                ('ciudad', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='utils.ciudad')),
                ('cliente', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='utils.cliente')),
                ('created_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='users_user_created_by', to=settings.AUTH_USER_MODEL)),
                ('estado_civil', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.civil')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('modified_by', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='users_user_modified_by', to=settings.AUTH_USER_MODEL)),
                ('nacionalidad', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.nacionalidad')),
                ('planta', models.ManyToManyField(help_text='Seleccione una o mas plantas a las que pertenecerá el usuario.', to='utils.Planta')),
                ('provincia', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='utils.provincia')),
                ('region', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='utils.region')),
                ('sexo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.sexo')),
                ('sistema_prevision', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.sistemaprevision')),
                ('sistema_salud', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.sistemasalud')),
                ('tipo_cta', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='users.tipocta')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'ordering': ['-created', '-modified'],
                'get_latest_by': 'created',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
