# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-02 22:18
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import payment.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Card',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('digits', models.CharField(default=payment.models.card_digit_gen, max_length=8, unique=True)),
                ('balance', models.PositiveSmallIntegerField(default=0)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='card', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Movement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('movement_desc', models.CharField(max_length=100)),
                ('movement_type', models.BooleanField()),
                ('movement_amount', models.SmallIntegerField()),
                ('movement_date', models.DateTimeField(default=datetime.datetime.now)),
                ('movement_card', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='payment.Card')),
                ('movement_user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='movements', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'get_latest_by': 'm_date',
            },
        ),
        migrations.CreateModel(
            name='PaymentCard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('digits', models.CharField(default=payment.models.paymentcard_digit_gen, max_length=10, unique=True)),
                ('balance', models.PositiveSmallIntegerField(default=10)),
                ('used', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('desc', models.TextField()),
                ('price', models.PositiveSmallIntegerField(default=0)),
                ('brand', models.CharField(default='Unknown', max_length=100)),
                ('image', models.URLField(default='http://lorempixel.com/240/240/technics/')),
            ],
        ),
    ]
