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

from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
import uuid


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ApprovalNotes',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('message', models.TextField(null=True)),
                ('status', models.BooleanField(default=False)),
                ('application_id', models.IntegerField()),
                ('type_id', models.IntegerField()),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'db_table': 'reg_approval_notes',
                'verbose_name': 'Applications Approval',
                'verbose_name_plural': 'Applications Approvals',
            },
        ),
        migrations.CreateModel(
            name='BondsApplication',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('amount', models.DecimalField(max_digits=30, decimal_places=5)),
                ('is_active', models.BooleanField(default=True)),
                ('is_validated', models.BooleanField(default=True)),
                ('is_approved', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'db_table': 'reg_bond_application',
                'verbose_name': 'Bonds Application',
                'verbose_name_plural': 'Bonds Applications',
            },
        ),
        migrations.CreateModel(
            name='BondsType',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('class_name', models.CharField(max_length=30)),
                ('description', models.TextField()),
                ('requirements', models.CharField(max_length=200)),
                ('validity_days', models.IntegerField()),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'db_table': 'list_bond_types',
                'verbose_name': 'Bonds Class',
                'verbose_name_plural': 'Bonds Classes',
            },
        ),
        migrations.CreateModel(
            name='CurrencyExchange',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('currency_name', models.CharField(max_length=4)),
                ('currency_full_name', models.CharField(max_length=50)),
                ('exchange_rate', models.DecimalField(max_digits=20, decimal_places=4)),
                ('updated_at', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'db_table': 'reg_currency',
                'verbose_name': 'Currency Exchange',
                'verbose_name_plural': 'Currency Exchanges',
            },
        ),
        migrations.CreateModel(
            name='CustomerGoods',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('package_type', models.IntegerField()),
                ('amount', models.IntegerField()),
                ('price', models.DecimalField(max_digits=30, decimal_places=5)),
                ('freight_cost', models.DecimalField(default=0, max_digits=30, decimal_places=5)),
                ('cargo_rate', models.DecimalField(max_digits=30, decimal_places=5)),
                ('import_duty', models.DecimalField(max_digits=30, decimal_places=5)),
                ('excise_duty', models.DecimalField(max_digits=30, decimal_places=5)),
                ('sugardev_levy', models.DecimalField(max_digits=30, decimal_places=5)),
                ('raildev_levy', models.DecimalField(max_digits=30, decimal_places=5)),
                ('created_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'reg_order_goods',
                'verbose_name': 'Forms',
                'verbose_name_plural': 'Forms',
            },
        ),
        migrations.CreateModel(
            name='CustomerInvoice',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('invoice_id', models.UUIDField(default=uuid.uuid4, unique=True, editable=False)),
                ('invoice_no', models.CharField(max_length=12, null=True)),
                ('policy_no', models.CharField(max_length=50, null=True)),
                ('payable_amount', models.DecimalField(max_digits=30, decimal_places=5)),
                ('sum_assured', models.DecimalField(max_digits=30, decimal_places=5)),
                ('total_premium', models.DecimalField(max_digits=30, decimal_places=5)),
                ('stamp_duty', models.DecimalField(max_digits=30, decimal_places=5)),
                ('pcf_amount', models.DecimalField(max_digits=30, decimal_places=5)),
                ('itl_amount', models.DecimalField(max_digits=30, decimal_places=5)),
                ('paid_amount', models.DecimalField(max_digits=30, decimal_places=5)),
                ('discount', models.DecimalField(max_digits=5, decimal_places=2)),
                ('war_strike', models.DecimalField(max_digits=30, decimal_places=5)),
                ('trans_ship', models.DecimalField(max_digits=30, decimal_places=5)),
                ('storage_ext', models.DecimalField(max_digits=30, decimal_places=5)),
                ('over_age', models.DecimalField(max_digits=30, decimal_places=5)),
                ('short_landing', models.DecimalField(max_digits=30, decimal_places=5)),
                ('pay_status', models.BooleanField(default=False)),
                ('approve_status', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField()),
                ('paid_at', models.DateTimeField(null=True)),
            ],
            options={
                'db_table': 'reg_invoice',
                'verbose_name': 'Customer Invoice',
                'verbose_name_plural': 'Customer Invoices',
            },
        ),
        migrations.CreateModel(
            name='CustomerOrders',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('transaction_type', models.IntegerField()),
                ('inland_warehouse', models.CharField(max_length=100)),
                ('voyage_start', models.DateField()),
                ('voyage_end', models.DateField()),
                ('transport_mode', models.IntegerField()),
                ('logistics_type', models.IntegerField()),
                ('handler', models.IntegerField()),
                ('war_strike', models.IntegerField()),
                ('storage_ext', models.IntegerField()),
                ('trans_ship', models.IntegerField()),
                ('over_age', models.IntegerField()),
                ('short_land', models.IntegerField()),
                ('pay_method', models.IntegerField()),
                ('is_paid', models.BooleanField()),
                ('total_freight', models.DecimalField(max_digits=30, decimal_places=5)),
                ('total_tax', models.DecimalField(max_digits=30, decimal_places=5)),
                ('total_cost', models.DecimalField(max_digits=30, decimal_places=5)),
                ('sum_assured', models.DecimalField(max_digits=30, decimal_places=5)),
                ('total_premium', models.DecimalField(max_digits=30, decimal_places=5)),
                ('created_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'reg_orders',
                'verbose_name': 'Customer Order',
                'verbose_name_plural': 'Customer Orders',
            },
        ),
        migrations.CreateModel(
            name='CustomerPayments',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('invoice_no', models.CharField(max_length=12, null=True)),
                ('paid_amount', models.DecimalField(max_digits=30, decimal_places=5)),
                ('payment_details', models.TextField()),
                ('payment_type', models.IntegerField(default=1)),
                ('created_at', models.DateTimeField()),
            ],
            options={
                'db_table': 'reg_payments',
                'verbose_name': 'Forms',
                'verbose_name_plural': 'Forms',
            },
        ),
        migrations.CreateModel(
            name='HSCategory',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('category_name', models.TextField()),
            ],
            options={
                'db_table': 'reg_hs_category',
                'verbose_name': 'HS Category',
                'verbose_name_plural': 'HS Categories',
            },
        ),
        migrations.CreateModel(
            name='HSCodes',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('heading', models.CharField(max_length=10, null=True)),
                ('hs_code', models.CharField(max_length=20, null=True)),
                ('goods_details', models.TextField()),
                ('units', models.CharField(max_length=10, null=True)),
                ('excise_duty', models.DecimalField(default=0, null=True, max_digits=30, decimal_places=5)),
                ('import_duty', models.DecimalField(default=0, null=True, max_digits=30, decimal_places=5)),
                ('raildev_levy', models.DecimalField(default=0, null=True, max_digits=30, decimal_places=5)),
                ('sugardev_levy', models.DecimalField(default=0, null=True, max_digits=30, decimal_places=5)),
                ('is_void', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'reg_hs_codes',
                'verbose_name': 'HS Code',
                'verbose_name_plural': 'HS Codes',
            },
        ),
        migrations.CreateModel(
            name='HSSchedule',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('sea_rate_ca', models.DecimalField(max_digits=10, decimal_places=5)),
                ('sea_rate_cb', models.DecimalField(max_digits=10, decimal_places=5)),
                ('sea_rate_cc', models.DecimalField(max_digits=10, decimal_places=5)),
                ('sea_rate_nca', models.DecimalField(max_digits=10, decimal_places=5)),
                ('sea_rate_ncb', models.DecimalField(max_digits=10, decimal_places=5)),
                ('sea_rate_ncc', models.DecimalField(max_digits=10, decimal_places=5)),
                ('air_rate', models.DecimalField(max_digits=10, decimal_places=5)),
                ('road_rate', models.DecimalField(max_digits=10, decimal_places=5)),
                ('rail_rate', models.DecimalField(max_digits=10, decimal_places=5)),
                ('war_strike', models.DecimalField(max_digits=10, decimal_places=5)),
                ('trans_ship', models.DecimalField(max_digits=10, decimal_places=5)),
                ('storage_ext', models.DecimalField(max_digits=10, decimal_places=5)),
                ('over_age', models.DecimalField(max_digits=10, decimal_places=5)),
                ('short_landing', models.DecimalField(max_digits=10, decimal_places=5)),
                ('extras_detail', models.TextField(null=True)),
            ],
            options={
                'db_table': 'reg_hs_schedule',
                'verbose_name': 'Insurance Schedule',
                'verbose_name_plural': 'Insurance Schedules',
            },
        ),
        migrations.CreateModel(
            name='HSSection',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('section_name', models.TextField()),
                ('sea_rate', models.DecimalField(max_digits=10, decimal_places=5)),
                ('air_rate', models.DecimalField(max_digits=10, decimal_places=5)),
                ('road_rate', models.DecimalField(max_digits=10, decimal_places=5)),
                ('war_strike', models.DecimalField(max_digits=10, decimal_places=5)),
                ('trans_ship', models.DecimalField(max_digits=10, decimal_places=5)),
                ('storage_ext', models.DecimalField(max_digits=10, decimal_places=5)),
                ('over_age', models.DecimalField(max_digits=10, decimal_places=5)),
                ('short_landing', models.DecimalField(max_digits=10, decimal_places=5)),
            ],
            options={
                'db_table': 'reg_hs_section',
                'verbose_name': 'HS Section',
                'verbose_name_plural': 'HS Sections',
            },
        ),
        migrations.CreateModel(
            name='ISettings',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('setting_name', models.CharField(max_length=5)),
                ('setting_value', models.BigIntegerField()),
                ('is_void', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'reg_isettings',
                'verbose_name': 'Insurance Set Up',
                'verbose_name_plural': 'Insurance Set Ups',
            },
        ),
        migrations.CreateModel(
            name='MpesaPayments',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('trans_amount', models.DecimalField(max_digits=30, decimal_places=5)),
                ('first_name', models.CharField(max_length=50)),
                ('last_name', models.CharField(max_length=50)),
                ('trans_time', models.CharField(max_length=15)),
                ('trans_type', models.CharField(max_length=15)),
                ('trans_id', models.CharField(max_length=10)),
                ('response_id', models.IntegerField()),
                ('msisdn', models.CharField(max_length=12)),
                ('bill_ref_no', models.CharField(max_length=15)),
                ('created_at', models.DateTimeField(verbose_name=django.utils.timezone.now)),
            ],
            options={
                'db_table': 'reg_mpesa_payment',
                'verbose_name': 'Mpesa Payment',
                'verbose_name_plural': 'Mpesa Payments',
            },
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('is_read', models.BooleanField(default=False)),
                ('account', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'reg_notification',
                'verbose_name': 'System Notification',
                'verbose_name_plural': 'System Notifications',
            },
        ),
        migrations.CreateModel(
            name='NotificationChange',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('action_type_id', models.IntegerField()),
                ('actor', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'reg_notification_change',
                'verbose_name': 'System Notification Change',
                'verbose_name_plural': 'System Notification Changes',
            },
        ),
        migrations.CreateModel(
            name='NotificationDetail',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('event_type_id', models.IntegerField()),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('notification', models.ForeignKey(to='forms.Notification')),
            ],
            options={
                'db_table': 'reg_notification_detail',
                'verbose_name': 'System Notification Detail',
                'verbose_name_plural': 'System Notification Details',
            },
        ),
        migrations.CreateModel(
            name='RegCargo',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('insurance_id', models.IntegerField()),
                ('package_type', models.IntegerField()),
                ('quantity', models.IntegerField()),
                ('price', models.DecimalField(max_digits=30, decimal_places=5)),
                ('freight_cost', models.DecimalField(max_digits=30, decimal_places=5)),
                ('ship_type', models.IntegerField()),
                ('cover_type', models.IntegerField()),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('is_void', models.BooleanField(default=False)),
                ('account', models.ForeignKey(related_name='creator', to=settings.AUTH_USER_MODEL)),
                ('category', models.ForeignKey(to='forms.HSCategory')),
                ('goods', models.ForeignKey(to='forms.HSCodes')),
                ('person', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'tmp_reg_cargo',
                'verbose_name': 'Forms',
                'verbose_name_plural': 'Forms',
            },
        ),
        migrations.CreateModel(
            name='RegCompany',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('company_name', models.CharField(max_length=100)),
                ('pin_number', models.CharField(max_length=20)),
                ('reg_number', models.CharField(max_length=15)),
                ('etr_number', models.CharField(max_length=15)),
                ('mobile_number', models.CharField(max_length=100)),
                ('postal_address', models.TextField()),
                ('physical_address', models.TextField()),
                ('email_address', models.TextField(null=True)),
                ('is_void', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('account', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'reg_company',
                'verbose_name': 'Company',
                'verbose_name_plural': 'Companies',
            },
        ),
        migrations.CreateModel(
            name='RegPerson',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('first_name', models.CharField(max_length=100)),
                ('middle_name', models.CharField(default=None, max_length=100)),
                ('surname', models.CharField(max_length=100)),
                ('pin_number', models.CharField(max_length=20, null=True)),
                ('staff_number', models.CharField(max_length=20, null=True)),
                ('idpass_number', models.CharField(max_length=15)),
                ('mobile_number', models.CharField(max_length=20)),
                ('postal_address', models.TextField()),
                ('is_void', models.BooleanField(default=False)),
                ('tax_status', models.IntegerField(null=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('account', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'reg_person',
                'verbose_name': 'Person',
                'verbose_name_plural': 'Persons',
            },
        ),
        migrations.CreateModel(
            name='UserCompany',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('company_id', models.IntegerField()),
                ('company_type', models.IntegerField()),
                ('validated', models.BooleanField(default=False)),
                ('validated_at', models.DateTimeField(null=True)),
                ('is_void', models.BooleanField(default=False)),
                ('account', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
                ('validated_by', models.ForeignKey(related_name='validator', to=settings.AUTH_USER_MODEL, null=True)),
            ],
            options={
                'db_table': 'reg_user_company',
                'verbose_name': 'User Company',
                'verbose_name_plural': 'User Companies',
            },
        ),
        migrations.AddField(
            model_name='notificationchange',
            name='notification_change',
            field=models.ForeignKey(to='forms.NotificationDetail'),
        ),
    ]
