# -*- coding: utf-8 -*-
from __future__ import unicode_literals

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


class Migration(migrations.Migration):
    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(editable=False, default=True)),
                ('address', models.CharField(max_length=127, verbose_name='address')),
                ('zip', models.CharField(max_length=63, verbose_name='postal code')),
                ('city', models.CharField(max_length=63, verbose_name='city')),
                ('country', models.CharField(max_length=63, verbose_name='country')),
                ('state', models.CharField(max_length=63, blank=True, verbose_name='state/district')),
                ('address2', models.CharField(max_length=127, blank=True, verbose_name='address supplements')),
                ('name', models.CharField(unique=True, max_length=127, verbose_name='name')),
                ('reference', models.CharField(max_length=127, blank=True, verbose_name='internal reference')),
            ],
            options={
                'verbose_name_plural': 'clients',
                'ordering': ['name'],
                'verbose_name': 'client',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ClientCategory',
            fields=[
                ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(editable=False, default=True)),
                ('name', models.CharField(max_length=63, verbose_name='industry sector')),
            ],
            options={
                'verbose_name_plural': 'client categories',
                'ordering': ['name'],
                'verbose_name': 'client category',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ClientOffice',
            fields=[
                ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(editable=False, default=True)),
                ('email', models.EmailField(max_length=127, blank=True, verbose_name='E-mail')),
                ('phone', models.CharField(max_length=63, blank=True, verbose_name='Phone')),
                ('mobile', models.CharField(max_length=63, blank=True, verbose_name='Mobile')),
                ('address', models.CharField(max_length=127, verbose_name='address')),
                ('zip', models.CharField(max_length=63, verbose_name='postal code')),
                ('city', models.CharField(max_length=63, verbose_name='city')),
                ('country', models.CharField(max_length=63, verbose_name='country')),
                ('state', models.CharField(max_length=63, blank=True, verbose_name='state/district')),
                ('address2', models.CharField(max_length=127, blank=True, verbose_name='address supplements')),
                ('department', models.CharField(max_length=63, blank=True, verbose_name='department')),
                ('reference', models.CharField(max_length=127, blank=True, verbose_name='internal reference')),
                ('client', models.ForeignKey(to='clients.Client', related_name='offices')),
            ],
            options={
                'verbose_name_plural': 'offices',
                'verbose_name': 'office',
            },
            bases=(models.Model,),
        ),
        migrations.CreateModel(
            name='ContactPerson',
            fields=[
                ('id', models.AutoField(primary_key=True, auto_created=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(editable=False, default=True)),
                ('email', models.EmailField(max_length=127, blank=True, verbose_name='E-mail')),
                ('phone', models.CharField(max_length=63, blank=True, verbose_name='Phone')),
                ('mobile', models.CharField(max_length=63, blank=True, verbose_name='Mobile')),
                ('first_name',
                 models.CharField(max_length=127, validators=[django.core.validators.MinLengthValidator(2)],
                                  verbose_name='first name')),
                ('last_name', models.CharField(max_length=63, validators=[django.core.validators.MinLengthValidator(2)],
                                               verbose_name='last name')),
                ('gender', models.CharField(default='U', max_length=1,
                                            choices=[('U', 'unknown'), ('M', 'male'), ('F', 'female'),
                                                     ('N', 'not applicable')])),
                ('title', models.CharField(max_length=63, blank=True, verbose_name='position')),
            ],
            options={
                'verbose_name_plural': 'contact persons',
                'verbose_name': 'contact person',
            },
            bases=(models.Model,),
        ),
        migrations.AddField(
            model_name='clientoffice',
            name='contact',
            field=models.ForeignKey(null=True, related_name='offices', to='clients.ContactPerson', blank=True),
            preserve_default=True,
        ),
        migrations.AddField(
            model_name='client',
            name='category',
            field=models.ForeignKey(to='clients.ClientCategory', related_name='clients'),
            preserve_default=True,
        ),
    ]
