From 9d3ef7aa5e3dc0b5cd41543b96beade834f132ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Fri, 10 Jun 2022 14:26:34 +0200
Subject: [PATCH] misc: remove completely pricing app (#65982)

---
 chrono/agendas/migrations/0126_pricing.py     |  13 +-
 .../migrations/0127_remove_pricing_models.py  |   4 -
 chrono/pricing/__init__.py                    |   0
 chrono/pricing/migrations/0001_initial.py     |  10 --
 chrono/pricing/migrations/0002_pricing.py     | 132 ------------------
 .../migrations/0003_extra_variables.py        |  17 ---
 .../migrations/0004_remove_pricing_models.py  |  55 --------
 chrono/pricing/migrations/__init__.py         |   0
 chrono/pricing/models.py                      |   0
 chrono/settings.py                            |   1 -
 10 files changed, 2 insertions(+), 230 deletions(-)
 delete mode 100644 chrono/pricing/__init__.py
 delete mode 100644 chrono/pricing/migrations/0001_initial.py
 delete mode 100644 chrono/pricing/migrations/0002_pricing.py
 delete mode 100644 chrono/pricing/migrations/0003_extra_variables.py
 delete mode 100644 chrono/pricing/migrations/0004_remove_pricing_models.py
 delete mode 100644 chrono/pricing/migrations/__init__.py
 delete mode 100644 chrono/pricing/models.py

diff --git a/chrono/agendas/migrations/0126_pricing.py b/chrono/agendas/migrations/0126_pricing.py
index 8f43c115..26ed40ad 100644
--- a/chrono/agendas/migrations/0126_pricing.py
+++ b/chrono/agendas/migrations/0126_pricing.py
@@ -1,19 +1,10 @@
-from django.db import migrations, models
+from django.db import migrations
 
 
 class Migration(migrations.Migration):
 
     dependencies = [
-        ('pricing', '0002_pricing'),
         ('agendas', '0125_auto_20220502_1134'),
     ]
 
-    operations = [
-        migrations.AddField(
-            model_name='agenda',
-            name='pricings',
-            field=models.ManyToManyField(
-                related_name='agendas', through='pricing.AgendaPricing', to='pricing.Pricing'
-            ),
-        ),
-    ]
+    operations = []
diff --git a/chrono/agendas/migrations/0127_remove_pricing_models.py b/chrono/agendas/migrations/0127_remove_pricing_models.py
index 65164596..c75ecf5b 100644
--- a/chrono/agendas/migrations/0127_remove_pricing_models.py
+++ b/chrono/agendas/migrations/0127_remove_pricing_models.py
@@ -8,10 +8,6 @@ class Migration(migrations.Migration):
     ]
 
     operations = [
-        migrations.RemoveField(
-            model_name='agenda',
-            name='pricings',
-        ),
         migrations.RemoveField(
             model_name='checktype',
             name='pricing',
diff --git a/chrono/pricing/__init__.py b/chrono/pricing/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/chrono/pricing/migrations/0001_initial.py b/chrono/pricing/migrations/0001_initial.py
deleted file mode 100644
index 729616f4..00000000
--- a/chrono/pricing/migrations/0001_initial.py
+++ /dev/null
@@ -1,10 +0,0 @@
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    initial = True
-
-    dependencies = []
-
-    operations = []
diff --git a/chrono/pricing/migrations/0002_pricing.py b/chrono/pricing/migrations/0002_pricing.py
deleted file mode 100644
index de0d2ce2..00000000
--- a/chrono/pricing/migrations/0002_pricing.py
+++ /dev/null
@@ -1,132 +0,0 @@
-import django.contrib.postgres.fields.jsonb
-import django.db.models.deletion
-from django.db import migrations, models
-
-
-class Migration(migrations.Migration):
-
-    initial = True
-
-    dependencies = [
-        ('agendas', '0124_check_type_disabled'),
-        ('pricing', '0001_initial'),
-    ]
-
-    operations = [
-        migrations.CreateModel(
-            name='Criteria',
-            fields=[
-                (
-                    'id',
-                    models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
-                ),
-                ('label', models.CharField(max_length=150, verbose_name='Label')),
-                ('slug', models.SlugField(max_length=160, verbose_name='Identifier')),
-                ('condition', models.CharField(max_length=1000, verbose_name='Condition')),
-                ('order', models.PositiveIntegerField()),
-            ],
-            options={
-                'ordering': ['order'],
-            },
-        ),
-        migrations.CreateModel(
-            name='CriteriaCategory',
-            fields=[
-                (
-                    'id',
-                    models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
-                ),
-                ('label', models.CharField(max_length=150, verbose_name='Label')),
-                ('slug', models.SlugField(max_length=160, unique=True, verbose_name='Identifier')),
-            ],
-            options={
-                'ordering': ['label'],
-            },
-        ),
-        migrations.CreateModel(
-            name='Pricing',
-            fields=[
-                (
-                    'id',
-                    models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
-                ),
-                ('label', models.CharField(max_length=150, verbose_name='Label')),
-                ('slug', models.SlugField(max_length=160, unique=True, verbose_name='Identifier')),
-            ],
-            options={
-                'ordering': ['label'],
-            },
-        ),
-        migrations.CreateModel(
-            name='PricingCriteriaCategory',
-            fields=[
-                (
-                    'id',
-                    models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
-                ),
-                ('order', models.PositiveIntegerField()),
-                (
-                    'category',
-                    models.ForeignKey(
-                        on_delete=django.db.models.deletion.CASCADE, to='pricing.CriteriaCategory'
-                    ),
-                ),
-                (
-                    'pricing',
-                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pricing.Pricing'),
-                ),
-            ],
-            options={
-                'ordering': ['order'],
-                'unique_together': {('pricing', 'category')},
-            },
-        ),
-        migrations.AddField(
-            model_name='pricing',
-            name='categories',
-            field=models.ManyToManyField(
-                related_name='pricings',
-                through='pricing.PricingCriteriaCategory',
-                to='pricing.CriteriaCategory',
-            ),
-        ),
-        migrations.AddField(
-            model_name='pricing',
-            name='criterias',
-            field=models.ManyToManyField(to='pricing.Criteria'),
-        ),
-        migrations.AddField(
-            model_name='criteria',
-            name='category',
-            field=models.ForeignKey(
-                on_delete=django.db.models.deletion.CASCADE,
-                related_name='criterias',
-                to='pricing.CriteriaCategory',
-                verbose_name='Category',
-            ),
-        ),
-        migrations.CreateModel(
-            name='AgendaPricing',
-            fields=[
-                (
-                    'id',
-                    models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
-                ),
-                ('date_start', models.DateField()),
-                ('date_end', models.DateField()),
-                ('pricing_data', django.contrib.postgres.fields.jsonb.JSONField(null=True)),
-                (
-                    'agenda',
-                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='agendas.Agenda'),
-                ),
-                (
-                    'pricing',
-                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pricing.Pricing'),
-                ),
-            ],
-        ),
-        migrations.AlterUniqueTogether(
-            name='criteria',
-            unique_together={('category', 'slug')},
-        ),
-    ]
diff --git a/chrono/pricing/migrations/0003_extra_variables.py b/chrono/pricing/migrations/0003_extra_variables.py
deleted file mode 100644
index cd169c4e..00000000
--- a/chrono/pricing/migrations/0003_extra_variables.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import django.contrib.postgres.fields.jsonb
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('pricing', '0002_pricing'),
-    ]
-
-    operations = [
-        migrations.AddField(
-            model_name='pricing',
-            name='extra_variables',
-            field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict),
-        ),
-    ]
diff --git a/chrono/pricing/migrations/0004_remove_pricing_models.py b/chrono/pricing/migrations/0004_remove_pricing_models.py
deleted file mode 100644
index 28f1cf08..00000000
--- a/chrono/pricing/migrations/0004_remove_pricing_models.py
+++ /dev/null
@@ -1,55 +0,0 @@
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ('agendas', '0127_remove_pricing_models'),
-        ('pricing', '0003_extra_variables'),
-    ]
-
-    operations = [
-        migrations.AlterUniqueTogether(
-            name='criteria',
-            unique_together=None,
-        ),
-        migrations.RemoveField(
-            model_name='criteria',
-            name='category',
-        ),
-        migrations.RemoveField(
-            model_name='pricing',
-            name='categories',
-        ),
-        migrations.RemoveField(
-            model_name='pricing',
-            name='criterias',
-        ),
-        migrations.AlterUniqueTogether(
-            name='pricingcriteriacategory',
-            unique_together=None,
-        ),
-        migrations.RemoveField(
-            model_name='pricingcriteriacategory',
-            name='category',
-        ),
-        migrations.RemoveField(
-            model_name='pricingcriteriacategory',
-            name='pricing',
-        ),
-        migrations.DeleteModel(
-            name='AgendaPricing',
-        ),
-        migrations.DeleteModel(
-            name='Criteria',
-        ),
-        migrations.DeleteModel(
-            name='CriteriaCategory',
-        ),
-        migrations.DeleteModel(
-            name='Pricing',
-        ),
-        migrations.DeleteModel(
-            name='PricingCriteriaCategory',
-        ),
-    ]
diff --git a/chrono/pricing/migrations/__init__.py b/chrono/pricing/migrations/__init__.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/chrono/pricing/models.py b/chrono/pricing/models.py
deleted file mode 100644
index e69de29b..00000000
diff --git a/chrono/settings.py b/chrono/settings.py
index 54e7190f..c7f82fa7 100644
--- a/chrono/settings.py
+++ b/chrono/settings.py
@@ -55,7 +55,6 @@ INSTALLED_APPS = (
     'django.contrib.humanize',
     'gadjo',
     'chrono.agendas',
-    'chrono.pricing',
     'chrono.api',
     'chrono.manager',
     'rest_framework',
-- 
2.35.1

