# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-09-10 23:43
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.IntegerField()),
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('schema_name', models.CharField(blank=True, default=core.django.db.get_schema_name, max_length=32)),
                ('uid', models.CharField(blank=True, max_length=12, null=True, unique=True)),
                ('address_text', models.CharField(blank=True, max_length=255, null=True, verbose_name='地址')),
                ('is_paid', models.BooleanField(default=False, verbose_name='已支付')),
                ('paid_time', models.DateTimeField(blank=True, null=True, verbose_name='支付时间')),
                ('status', models.CharField(choices=[('CREATED', '创建'), ('SHIPPING', '在途'), ('DELIVERED', '寄达'), ('FINISHED', '完成'), ('CLOSED', '关闭')], default='CREATED', max_length=20, verbose_name='状态')),
                ('total_amount', models.IntegerField(default=0, verbose_name='数量')),
                ('product_cost_aud', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='货物成本')),
                ('product_cost_rmb', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='货物成本')),
                ('shipping_fee', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='快递费用')),
                ('ship_time', models.DateTimeField(blank=True, null=True, verbose_name='寄出时间')),
                ('currency', models.CharField(blank=True, choices=[('AUDCNH', '澳元'), ('USDCNH', '美元'), ('NZDCNH', '纽元'), ('EURCNH', '欧元'), ('GBPCNH', '英镑'), ('CADCNH', '加元'), ('JPYCNH', '日元')], max_length=128, verbose_name='货币')),
                ('total_cost_aud', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='总成本')),
                ('total_cost_rmb', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='总承包')),
                ('origin_sell_rmb', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='原价')),
                ('sell_price_rmb', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='售价')),
                ('payment_price', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='Payment Price')),
                ('remark', models.CharField(blank=True, max_length=512, null=True, verbose_name='remark')),
                ('profit_rmb', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='利润')),
                ('aud_rmb_rate', models.DecimalField(blank=True, decimal_places=4, max_digits=8, null=True, verbose_name='下单汇率')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='创建时间')),
                ('finish_time', models.DateTimeField(blank=True, null=True, verbose_name='完成时间')),
                ('coupon', models.CharField(blank=True, max_length=30, null=True, verbose_name='Coupon')),
                ('app_id', models.CharField(blank=True, max_length=128, null=True, verbose_name='App ID')),
                ('shipping_msg_sent', models.BooleanField(default=False, verbose_name='send msg')),
                ('delivery_msg_sent', models.BooleanField(default=False, verbose_name='delivery msg')),
            ],
            options={
                'get_latest_by': 'finish_time',
            },
        ),
        migrations.CreateModel(
            name='OrderProduct',
            fields=[
                ('id', models.IntegerField()),
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('schema_name', models.CharField(blank=True, default=core.django.db.get_schema_name, max_length=32)),
                ('name', models.CharField(blank=True, help_text='产品名称', max_length=128, null=True, verbose_name='Name')),
                ('description', models.CharField(blank=True, help_text='备注', max_length=128, null=True, verbose_name='Description')),
                ('amount', models.IntegerField(default=1, help_text='数量', verbose_name='Amount')),
                ('sell_price_rmb', models.DecimalField(decimal_places=2, default=0, help_text='单价', max_digits=8, verbose_name='Sell Price RMB')),
                ('total_price_rmb', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='Total RMB')),
                ('cost_price_aud', models.DecimalField(decimal_places=2, default=0, help_text='成本', max_digits=8, verbose_name='Cost Price AUD')),
                ('total_price_aud', models.DecimalField(blank=True, decimal_places=2, max_digits=8, null=True, verbose_name='Total AUD')),
                ('is_purchased', models.BooleanField(default=False)),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='Create Time')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='order.Order', verbose_name='Order')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
