Updating stats.
[wolnelektury.git] / src / wolnelektury / migrations / getpaid / 0001_initial.py
1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 from django.db import models, migrations
5 import django.db.models.deletion
6 import getpaid.abstract_mixin
7
8
9 class Migration(migrations.Migration):
10
11     dependencies = [
12         ('funding', '0001_initial'),
13     ]
14
15     operations = [
16         migrations.CreateModel(
17             name='Payment',
18             fields=[
19                 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
20                 ('amount', models.DecimalField(verbose_name='amount', max_digits=20, decimal_places=4)),
21                 ('currency', models.CharField(max_length=3, verbose_name='currency')),
22                 ('status', models.CharField(default='new', max_length=20, verbose_name='status', db_index=True, choices=[('new', 'new'), ('in_progress', 'in progress'), ('partially_paid', 'partially paid'), ('paid', 'paid'), ('failed', 'failed')])),
23                 ('backend', models.CharField(max_length=50, verbose_name='backend')),
24                 ('created_on', models.DateTimeField(auto_now_add=True, verbose_name='created on', db_index=True)),
25                 ('paid_on', models.DateTimeField(default=None, null=True, verbose_name='paid on', db_index=True, blank=True)),
26                 ('amount_paid', models.DecimalField(default=0, verbose_name='amount paid', max_digits=20, decimal_places=4)),
27                 ('external_id', models.CharField(max_length=64, null=True, verbose_name='external id', blank=True)),
28                 ('description', models.CharField(max_length=128, null=True, verbose_name='Description', blank=True)),
29                 ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='payment', to='funding.Funding')),
30             ],
31             options={
32                 'ordering': ('-created_on',),
33                 'verbose_name': 'Payment',
34                 'verbose_name_plural': 'Payments',
35             },
36             bases=(models.Model, getpaid.abstract_mixin.AbstractMixin),
37         ),
38     ]