Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

corporate: Add required_plan_tier field to Customer model.

Lauryn Menard7542a676c79b
diff --git a/corporate/migrations/0034_customer_discount_required_tier.py b/corporate/migrations/0034_customer_discount_required_tier.py
new file mode 100644
index 00000000000..e53da6b25be
--- /dev/null
+++ b/corporate/migrations/0034_customer_discount_required_tier.py
@@ -0,0 +1,17 @@
+# Generated by Django 4.2.8 on 2024-01-09 14:28
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("corporate", "0033_customerplan_invoice_overdue_email_sent"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="customer",
+ name="required_plan_tier",
+ field=models.SmallIntegerField(null=True),
+ ),
+ ]
diff --git a/corporate/models.py b/corporate/models.py
index d70bd616079..a0abb027b2c 100644
--- a/corporate/models.py
+++ b/corporate/models.py
@@ -29,6 +29,9 @@ class Customer(models.Model):
# A percentage, like 85.
default_discount = models.DecimalField(decimal_places=4, max_digits=7, null=True)
minimum_licenses = models.PositiveIntegerField(null=True)
+ # Used for limiting a default_discount or a fixed_price
+ # to be used only for a particular CustomerPlan tier.
+ required_plan_tier = models.SmallIntegerField(null=True)
# Some non-profit organizations on manual license management pay
# only for their paid employees. We don't prevent these
# organizations from adding more users than the number of licenses