corporate: Add required_plan_tier field to Customer model.

This will be used to set a required plan tier value to be used with
the default discount that is set on the Customer object or with a
fixed price set on a CustomerPlan object.
This commit is contained in:
Lauryn Menard 2024-01-09 15:33:55 +01:00 committed by Tim Abbott
parent f27b6d896a
commit 7542a676c7
2 changed files with 20 additions and 0 deletions

View File

@ -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),
),
]

View File

@ -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