# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-06-21 09:47
from __future__ import unicode_literals

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='Branch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True, verbose_name='\u6821\u533a\u540d')),
                ('addr', models.CharField(blank=True, max_length=128, null=True, verbose_name='\u5730\u5740')),
            ],
        ),
        migrations.CreateModel(
            name='ClassList',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('class_type', models.SmallIntegerField(choices=[(0, '\u8131\u4ea7'), (1, '\u5468\u672b'), (2, '\u7f51\u7edc\u73ed')], default=0, verbose_name='\u73ed\u7ea7\u7c7b\u578b')),
                ('semester', models.SmallIntegerField(verbose_name='\u5b66\u671f')),
                ('start_date', models.DateField(verbose_name='\u5f00\u73ed\u65e5\u671f')),
                ('graduate_date', models.DateField(blank=True, null=True, verbose_name='\u6bd5\u4e1a\u65e5\u671f')),
                ('branch', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.Branch', verbose_name='\u6821\u533a')),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True, verbose_name='\u8bfe\u7a0b\u540d\u79f0')),
                ('price', models.PositiveSmallIntegerField(verbose_name='\u4ef7\u683c')),
                ('period', models.PositiveSmallIntegerField(default=5, verbose_name='\u8bfe\u7a0b\u5468\u671f\uff08\u6708\uff09')),
                ('outline', models.TextField(verbose_name='\u5927\u7eb2')),
            ],
        ),
        migrations.CreateModel(
            name='CourseRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('day_num', models.PositiveSmallIntegerField(verbose_name='\u8bfe\u7a0b\u8282\u6b21')),
                ('title', models.CharField(max_length=64, verbose_name='\u672c\u8282\u4e3b\u9898')),
                ('content', models.TextField(verbose_name='\u672c\u8282\u5185\u5bb9')),
                ('has_homework', models.BooleanField(default=True, verbose_name='\u672c\u8282\u6709\u4f5c\u4e1a')),
                ('homework', models.TextField(blank=True, null=True, verbose_name='\u4f5c\u4e1a\u9700\u6c42')),
                ('date', models.DateField(auto_now_add=True, verbose_name='\u521b\u5efa\u7684\u65f6\u95f4')),
                ('class_grade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.ClassList', verbose_name='\u4e0a\u8bfe\u73ed\u7ea7')),
            ],
        ),
        migrations.CreateModel(
            name='CustomerFollowUp',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField(verbose_name='\u8ddf\u8e2a\u5185\u5bb9')),
                ('status', models.SmallIntegerField(choices=[(0, '\u8fd1\u671f\u65e0\u62a5\u540d\u8ba1\u5212'), (1, '\u4e00\u4e2a\u6708\u5185\u62a5\u540d'), (2, '\u534a\u4e2a\u6708\u62a5\u540d'), (3, '\u5df2\u62a5\u540d')], verbose_name='\u5ba2\u6237\u72b6\u6001')),
                ('date', models.DateField(auto_now_add=True, verbose_name='\u521b\u5efa\u7684\u65f6\u95f4')),
            ],
        ),
        migrations.CreateModel(
            name='CustomerInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default=None, max_length=64, verbose_name='\u59d3\u540d')),
                ('contact_type', models.SmallIntegerField(choices=[(0, 'qq'), (1, '\u5fae\u4fe1'), (2, '\u624b\u673a')], default=0)),
                ('contact', models.CharField(max_length=64, unique=True, verbose_name='\u8054\u7cfb\u65b9\u5f0f')),
                ('source', models.SmallIntegerField(choices=[(0, 'qq\u7fa4'), (1, '51CTO'), (2, '\u767e\u5ea6\u63a8\u5e7f'), (3, '\u77e5\u4e4e'), (4, '\u8f6c\u4ecb\u7ecd'), (5, '\u5176\u5b83')], verbose_name='\u5ba2\u6237\u6765\u6e90')),
                ('consult_content', models.TextField(verbose_name='\u54a8\u8be2\u5185\u5bb9')),
                ('status', models.SmallIntegerField(choices=[(0, '\u672a\u62a5\u540d'), (1, '\u5df2\u62a5\u540d'), (2, '\u5df2\u7ecf\u9000\u5b66')], verbose_name='\u5ba2\u6237\u72b6\u6001')),
                ('date', models.DateField(auto_now_add=True, verbose_name='\u521b\u5efa\u7684\u65f6\u95f4')),
                ('consult_courses', models.ManyToManyField(to='crm.Course', verbose_name='\u54a8\u8be2\u8bfe\u7a0b')),
            ],
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('class_grades', models.ManyToManyField(to='crm.ClassList', verbose_name='\u73ed\u7ea7')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.CustomerInfo', verbose_name='\u5ba2\u6237')),
            ],
        ),
        migrations.CreateModel(
            name='StudyRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('score', models.SmallIntegerField(choices=[(100, 'A+'), (90, 'A'), (85, 'B+'), (80, 'B'), (75, 'B-'), (70, 'C+'), (60, 'C'), (40, 'C-'), (-50, 'D'), (0, 'N/A'), (-100, 'COPY')], default=0, verbose_name='\u5f97\u5206')),
                ('show_status', models.SmallIntegerField(choices=[(0, '\u7f3a\u52e4'), (1, '\u5df2\u7b7e\u5230'), (2, '\u8fdf\u5230'), (3, '\u65e9\u9000')], default=1, verbose_name='\u51fa\u52e4')),
                ('note', models.TextField(blank=True, null=True, verbose_name='\u6210\u7ee9\u5907\u6ce8')),
                ('date', models.DateField(auto_now_add=True, verbose_name='\u521b\u5efa\u7684\u65f6\u95f4')),
                ('course_record', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.CourseRecord', verbose_name='\u8bfe\u7a0b')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.Student', verbose_name='\u5b66\u751f')),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, verbose_name='\u59d3\u540d')),
                ('role', models.ManyToManyField(blank=True, null=True, to='crm.Role')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='customerinfo',
            name='consultant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.UserProfile', verbose_name='\u8bfe\u7a0b\u987e\u95ee'),
        ),
        migrations.AddField(
            model_name='customerinfo',
            name='referral_from',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='crm.CustomerInfo', verbose_name='\u8f6c\u4ecb\u7ecd'),
        ),
        migrations.AddField(
            model_name='customerfollowup',
            name='customer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.CustomerInfo'),
        ),
        migrations.AddField(
            model_name='customerfollowup',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.UserProfile', verbose_name='\u8ddf\u8fdb\u4eba'),
        ),
        migrations.AddField(
            model_name='courserecord',
            name='teacher',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.UserProfile', verbose_name='\u8bb2\u5e08'),
        ),
        migrations.AddField(
            model_name='classlist',
            name='course',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='crm.Course', verbose_name='\u8bfe\u7a0b'),
        ),
        migrations.AddField(
            model_name='classlist',
            name='teachers',
            field=models.ManyToManyField(to='crm.UserProfile', verbose_name='\u8bb2\u5e08'),
        ),
        migrations.AlterUniqueTogether(
            name='courserecord',
            unique_together=set([('class_grade', 'day_num')]),
        ),
        migrations.AlterUniqueTogether(
            name='classlist',
            unique_together=set([('branch', 'class_type', 'course', 'semester')]),
        ),
    ]
