[refactor] cleaning up uncloud_net for Wireguardvpn

This commit is contained in:
Nico Schottelius 2020-12-13 11:38:41 +01:00
commit 10d5a72c5a
82 changed files with 403 additions and 2180 deletions

File diff suppressed because one or more lines are too long

View file

@ -1,18 +0,0 @@
# Generated by Django 3.0.8 on 2020-08-01 22:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='billingaddress',
name='organization',
field=models.CharField(blank=True, max_length=100, null=True),
),
]

View file

@ -1,33 +0,0 @@
# Generated by Django 3.0.8 on 2020-08-01 23:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0002_auto_20200801_2208'),
]
operations = [
migrations.RenameField(
model_name='vatrate',
old_name='stop_date',
new_name='ending_date',
),
migrations.RenameField(
model_name='vatrate',
old_name='start_date',
new_name='starting_date',
),
migrations.AlterField(
model_name='bill',
name='ending_date',
field=models.DateTimeField(),
),
migrations.AlterField(
model_name='billrecord',
name='quantity',
field=models.DecimalField(decimal_places=10, max_digits=19),
),
]

View file

@ -1,17 +0,0 @@
# Generated by Django 3.1 on 2020-08-08 19:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0003_auto_20200801_2332'),
]
operations = [
migrations.RemoveField(
model_name='order',
name='one_time_price',
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 3.1 on 2020-08-08 19:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0004_remove_order_one_time_price'),
]
operations = [
migrations.RenameField(
model_name='order',
old_name='recurring_price',
new_name='price',
),
]

View file

@ -1,17 +0,0 @@
# Generated by Django 3.1 on 2020-08-08 19:57
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0005_auto_20200808_1954'),
]
operations = [
migrations.RemoveField(
model_name='billrecord',
name='quantity',
),
]

View file

@ -1,17 +0,0 @@
# Generated by Django 3.1 on 2020-08-08 20:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0006_remove_billrecord_quantity'),
]
operations = [
migrations.RemoveField(
model_name='bill',
name='bill_records',
),
]

View file

@ -1,16 +0,0 @@
# Generated by Django 3.1 on 2020-08-08 20:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0007_remove_bill_bill_records'),
]
operations = [
migrations.DeleteModel(
name='OrderRecord',
),
]

View file

@ -1,22 +0,0 @@
# Generated by Django 3.1 on 2020-08-08 21:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0008_delete_orderrecord'),
]
operations = [
migrations.RemoveField(
model_name='bill',
name='valid',
),
migrations.AddField(
model_name='bill',
name='is_final',
field=models.BooleanField(default=False),
),
]

View file

@ -1,65 +0,0 @@
# Generated by Django 3.1 on 2020-08-09 08:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('uncloud_pay', '0009_auto_20200808_2113'),
]
operations = [
migrations.AlterField(
model_name='order',
name='depends_on',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='parent_of', to='uncloud_pay.order'),
),
migrations.AlterField(
model_name='order',
name='replaces',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='replaced_by', to='uncloud_pay.order'),
),
migrations.CreateModel(
name='SampleRecurringProductOneTimeFee',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('extra_data', models.JSONField(blank=True, editable=False, null=True)),
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='AWAITING_PAYMENT', max_length=32)),
('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.order')),
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='SampleRecurringProduct',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('extra_data', models.JSONField(blank=True, editable=False, null=True)),
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='AWAITING_PAYMENT', max_length=32)),
('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.order')),
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='SampleOneTimeProduct',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('extra_data', models.JSONField(blank=True, editable=False, null=True)),
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='AWAITING_PAYMENT', max_length=32)),
('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.order')),
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
]

View file

@ -1,19 +0,0 @@
# Generated by Django 3.1 on 2020-08-09 10:24
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0010_auto_20200809_0856'),
]
operations = [
migrations.AddField(
model_name='bill',
name='billing_address',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.billingaddress'),
),
]

View file

@ -1,19 +0,0 @@
# Generated by Django 3.1 on 2020-08-09 10:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0011_bill_billing_address'),
]
operations = [
migrations.AlterField(
model_name='bill',
name='billing_address',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.billingaddress'),
),
]

View file

@ -1,40 +0,0 @@
# Generated by Django 3.1 on 2020-08-09 12:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0012_auto_20200809_1026'),
]
operations = [
migrations.RemoveField(
model_name='sampleonetimeproduct',
name='order',
),
migrations.RemoveField(
model_name='samplerecurringproduct',
name='order',
),
migrations.RemoveField(
model_name='samplerecurringproductonetimefee',
name='order',
),
migrations.AddField(
model_name='sampleonetimeproduct',
name='orders',
field=models.ManyToManyField(to='uncloud_pay.Order'),
),
migrations.AddField(
model_name='samplerecurringproduct',
name='orders',
field=models.ManyToManyField(to='uncloud_pay.Order'),
),
migrations.AddField(
model_name='samplerecurringproductonetimefee',
name='orders',
field=models.ManyToManyField(to='uncloud_pay.Order'),
),
]

View file

@ -1,33 +0,0 @@
# Generated by Django 3.1 on 2020-08-25 19:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0013_auto_20200809_1237'),
]
operations = [
migrations.AddField(
model_name='sampleonetimeproduct',
name='ot_price',
field=models.IntegerField(default=5),
),
migrations.AddField(
model_name='samplerecurringproduct',
name='rc_price',
field=models.IntegerField(default=10),
),
migrations.AddField(
model_name='samplerecurringproductonetimefee',
name='ot_price',
field=models.IntegerField(default=5),
),
migrations.AddField(
model_name='samplerecurringproductonetimefee',
name='rc_price',
field=models.IntegerField(default=10),
),
]

View file

@ -1,25 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 18:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0014_auto_20200825_1915'),
]
operations = [
migrations.RemoveField(
model_name='sampleonetimeproduct',
name='orders',
),
migrations.RemoveField(
model_name='samplerecurringproduct',
name='orders',
),
migrations.RemoveField(
model_name='samplerecurringproductonetimefee',
name='orders',
),
]

View file

@ -1,65 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 18:58
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('uncloud_pay', '0015_auto_20200928_1844'),
]
operations = [
migrations.RemoveField(
model_name='sampleonetimeproduct',
name='extra_data',
),
migrations.RemoveField(
model_name='sampleonetimeproduct',
name='owner',
),
migrations.RemoveField(
model_name='sampleonetimeproduct',
name='status',
),
migrations.RemoveField(
model_name='samplerecurringproduct',
name='extra_data',
),
migrations.RemoveField(
model_name='samplerecurringproduct',
name='owner',
),
migrations.RemoveField(
model_name='samplerecurringproduct',
name='status',
),
migrations.RemoveField(
model_name='samplerecurringproductonetimefee',
name='extra_data',
),
migrations.RemoveField(
model_name='samplerecurringproductonetimefee',
name='owner',
),
migrations.RemoveField(
model_name='samplerecurringproductonetimefee',
name='status',
),
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('extra_data', models.JSONField(blank=True, editable=False, null=True)),
('status', models.CharField(choices=[('PENDING', 'Pending'), ('AWAITING_PAYMENT', 'Awaiting payment'), ('BEING_CREATED', 'Being created'), ('SCHEDULED', 'Scheduled'), ('ACTIVE', 'Active'), ('MODIFYING', 'Modifying'), ('DELETED', 'Deleted'), ('DISABLED', 'Disabled'), ('UNUSABLE', 'Unusable')], default='AWAITING_PAYMENT', max_length=32)),
('config', models.JSONField()),
('owner', models.ForeignKey(editable=False, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
]

View file

@ -1,19 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0016_auto_20200928_1858'),
]
operations = [
migrations.AddField(
model_name='order',
name='config',
field=models.JSONField(default={}),
preserve_default=False,
),
]

View file

@ -1,20 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0017_order_config'),
]
operations = [
migrations.AddField(
model_name='order',
name='product',
field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.product'),
preserve_default=False,
),
]

View file

@ -1,17 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:14
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0018_order_product'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='owner',
),
]

View file

@ -1,29 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0019_remove_product_owner'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='status',
),
migrations.AddField(
model_name='product',
name='description',
field=models.CharField(default='', max_length=1024),
preserve_default=False,
),
migrations.AddField(
model_name='product',
name='name',
field=models.CharField(default='', max_length=256),
preserve_default=False,
),
]

View file

@ -1,23 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0020_auto_20200928_1915'),
]
operations = [
migrations.AddField(
model_name='product',
name='default_currency',
field=models.CharField(choices=[('CHF', 'Swiss Franc'), ('EUR', 'Euro'), ('USD', 'US Dollar')], default='CHF', max_length=32),
),
migrations.AddField(
model_name='product',
name='default_recurring_period',
field=models.IntegerField(choices=[(31536000, 'Per 365 days'), (2592000, 'Per 30 days'), (604800, 'Per Week'), (86400, 'Per Day'), (3600, 'Per Hour'), (60, 'Per Minute'), (1, 'Per Second'), (0, 'Onetime')], default=2592000),
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0021_auto_20200928_1932'),
]
operations = [
migrations.RenameField(
model_name='product',
old_name='default_currency',
new_name='currency',
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0022_auto_20200928_1932'),
]
operations = [
migrations.RenameField(
model_name='order',
old_name='price',
new_name='one_time_price',
),
]

View file

@ -1,24 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 19:45
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0023_auto_20200928_1944'),
]
operations = [
migrations.AddField(
model_name='order',
name='currency',
field=models.CharField(choices=[('CHF', 'Swiss Franc'), ('EUR', 'Euro'), ('USD', 'US Dollar')], default='CHF', max_length=32),
),
migrations.AddField(
model_name='order',
name='recurring_price',
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=10, validators=[django.core.validators.MinValueValidator(0)]),
),
]

View file

@ -1,19 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 20:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0024_auto_20200928_1945'),
]
operations = [
migrations.AddField(
model_name='billrecord',
name='is_recurring_record',
field=models.BooleanField(default=False),
preserve_default=False,
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 3.1 on 2020-09-28 20:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0025_billrecord_is_recurring_record'),
]
operations = [
migrations.AddField(
model_name='order',
name='should_be_billed',
field=models.BooleanField(default=True),
),
]

View file

@ -1,41 +0,0 @@
# Generated by Django 3.1 on 2020-10-06 13:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0026_order_should_be_billed'),
]
operations = [
migrations.CreateModel(
name='RecurringPeriod',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100, unique=True)),
('duration_seconds', models.IntegerField(unique=True)),
],
),
migrations.DeleteModel(
name='SampleOneTimeProduct',
),
migrations.DeleteModel(
name='SampleRecurringProduct',
),
migrations.DeleteModel(
name='SampleRecurringProductOneTimeFee',
),
migrations.AlterField(
model_name='order',
name='recurring_period',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.recurringperiod'),
),
migrations.AlterField(
model_name='product',
name='default_recurring_period',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.recurringperiod'),
),
]

View file

@ -1,36 +0,0 @@
# Generated by Django 3.1 on 2020-10-06 15:29
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0027_auto_20201006_1319'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='default_recurring_period',
),
migrations.CreateModel(
name='ProductToRecurringPeriod',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('is_default', models.BooleanField(default=False)),
('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.product')),
('recurring_period', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.recurringperiod')),
],
),
migrations.AddField(
model_name='product',
name='recurring_periods',
field=models.ManyToManyField(through='uncloud_pay.ProductToRecurringPeriod', to='uncloud_pay.RecurringPeriod'),
),
migrations.AddConstraint(
model_name='producttorecurringperiod',
constraint=models.UniqueConstraint(condition=models.Q(is_default=True), fields=('recurring_period', 'product'), name='one_default_recurring_period_per_product'),
),
]

View file

@ -1,18 +0,0 @@
# Generated by Django 3.1 on 2020-10-06 15:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0028_auto_20201006_1529'),
]
operations = [
migrations.AlterField(
model_name='product',
name='name',
field=models.CharField(max_length=256, unique=True),
),
]

View file

@ -1,21 +0,0 @@
# Generated by Django 3.1 on 2020-10-06 16:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0029_auto_20201006_1540'),
]
operations = [
migrations.RemoveConstraint(
model_name='producttorecurringperiod',
name='one_default_recurring_period_per_product',
),
migrations.AddConstraint(
model_name='producttorecurringperiod',
constraint=models.UniqueConstraint(condition=models.Q(is_default=True), fields=('product',), name='one_default_recurring_period_per_product'),
),
]

View file

@ -1,17 +0,0 @@
# Generated by Django 3.1 on 2020-10-06 16:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0030_auto_20201006_1640'),
]
operations = [
migrations.AddConstraint(
model_name='producttorecurringperiod',
constraint=models.UniqueConstraint(fields=('product', 'recurring_period'), name='recurring_period_once_per_product'),
),
]

View file

@ -1,23 +0,0 @@
# Generated by Django 3.1 on 2020-10-11 15:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0031_auto_20201006_1655'),
]
operations = [
migrations.CreateModel(
name='UncloudProvider',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('valid_from', models.DateField()),
('valid_to', models.DateField(blank=True)),
('billing_address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='uncloud_pay.billingaddress')),
],
),
]

View file

@ -1,20 +0,0 @@
# Generated by Django 3.1 on 2020-10-11 20:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0032_uncloudprovider'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='extra_data',
),
migrations.DeleteModel(
name='UncloudProvider',
),
]

View file

@ -1,37 +0,0 @@
# Generated by Django 3.1 on 2020-10-11 20:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('uncloud_pay', '0033_auto_20201011_2003'),
]
operations = [
migrations.RemoveField(
model_name='billingaddress',
name='city',
),
migrations.RemoveField(
model_name='billingaddress',
name='country',
),
migrations.RemoveField(
model_name='billingaddress',
name='name',
),
migrations.RemoveField(
model_name='billingaddress',
name='organization',
),
migrations.RemoveField(
model_name='billingaddress',
name='postal_code',
),
migrations.RemoveField(
model_name='billingaddress',
name='street',
),
]

File diff suppressed because one or more lines are too long