# Generated by Django 3.0.8 on 2020-09-17 09:52

from decimal import Decimal
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('customers', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('orders', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique Identifier', unique=True, verbose_name='UUID')),
                ('is_available', models.BooleanField(default=True, help_text='if False the record is not available')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('requestor_name', models.CharField(blank=True, help_text='Request Person name', max_length=255)),
                ('requestor_phone', models.CharField(blank=True, help_text='Request Person Phone', max_length=15)),
                ('requestor_address', models.CharField(help_text='Request Person pickup address', max_length=255)),
                ('pickup_date', models.DateTimeField(blank=True, null=True, verbose_name='Pickup date and time')),
                ('product_type', models.CharField(choices=[('books', 'Books'), ('beauty_accessories', 'Beauty Accessories'), ('clothing', 'Clothing'), ('crafts', 'Crafts'), ('documents', 'Documents'), ('electronics', 'Electronics'), ('food', 'Food'), ('fish', 'Fish'), ('fashion_accessories', 'Fashion Accessories'), ('grocery', 'Grocery'), ('home_decor', 'Home Decor'), ('jewellery', 'Jewellery'), ('fragile_item', 'Fragile Item'), ('others', 'Others')], max_length=120)),
                ('description', models.CharField(blank=True, max_length=255)),
                ('invoice_number', models.CharField(blank=True, max_length=150, null=True)),
                ('invoice_value', models.CharField(blank=True, max_length=150, null=True)),
                ('cash_amount', models.DecimalField(decimal_places=6, default=Decimal('0.00'), help_text='Cash Collection Amount', max_digits=12, verbose_name='Amount')),
                ('amount', models.DecimalField(decimal_places=6, default=Decimal('0.00'), help_text='Amount without delivery charge.', max_digits=12, verbose_name='Amount')),
                ('total_amount', models.DecimalField(decimal_places=6, default=Decimal('0.00'), help_text='Amount with delivery charge.', max_digits=12, verbose_name='Total Amount')),
                ('receiver_name', models.CharField(blank=True, help_text='Receiver name', max_length=255)),
                ('receiver_phone', models.CharField(blank=True, help_text='Receiver Phone', max_length=15)),
                ('receiver_address', models.CharField(help_text='Receiver address', max_length=255)),
                ('delivery_date', models.DateTimeField(blank=True, null=True, verbose_name='Delivery date and time')),
                ('delivery_note', models.CharField(blank=True, max_length=255)),
                ('reference', models.CharField(editable=False, help_text='Unique order number', max_length=20, unique=True, verbose_name='Order Reference')),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('rejected', 'Rejected'), ('picked', 'Picked'), ('in_hub', 'In Hub'), ('on_the_way', 'On the Way'), ('delivered', 'Delivered')], default='pending', max_length=80)),
                ('is_individual', models.BooleanField(default=False)),
                ('pickedup_at', models.DateTimeField(blank=True, null=True, verbose_name='Picked up time')),
                ('delivered_at', models.DateTimeField(blank=True, null=True, verbose_name='Delivered time')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_created_by', to=settings.AUTH_USER_MODEL)),
                ('deliverd_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='orders_deliverd_by', to='customers.Customer')),
                ('pickedup_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='orders_pickedup_by', to='customers.Customer')),
                ('receiver_zone', models.ForeignKey(help_text='Receiver Zone', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='orders', to='orders.PickupCoverageZone')),
                ('requestor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='customers.Customer')),
                ('requestor_zone', models.ForeignKey(help_text='Request Person pickup zone', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order', to='orders.PickupCoverageZone')),
                ('updated_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='order_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
