feat: extend char field lengths across billing and user models to support longer identifiers and descriptions
This commit is contained in:
+13
-13
@@ -25,10 +25,10 @@ class UserSubscription(models.Model):
|
||||
plan = fields.ForeignKeyField(
|
||||
"billing.SubscriptionPlan", related_name="subscriptions", null=True
|
||||
)
|
||||
billing_type = fields.CharField(max_length=20, default="pay_as_you_go")
|
||||
billing_type = fields.CharField(max_length=100, default="pay_as_you_go")
|
||||
stripe_customer_id = fields.CharField(max_length=255, unique=True, null=True)
|
||||
stripe_subscription_id = fields.CharField(max_length=255, unique=True, null=True)
|
||||
status = fields.CharField(max_length=50, default="active")
|
||||
status = fields.CharField(max_length=100, default="active")
|
||||
current_period_start = fields.DatetimeField(null=True)
|
||||
current_period_end = fields.DatetimeField(null=True)
|
||||
created_at = fields.DatetimeField(auto_now_add=True)
|
||||
@@ -42,9 +42,9 @@ class UserSubscription(models.Model):
|
||||
class UsageRecord(models.Model):
|
||||
id = fields.BigIntField(primary_key=True)
|
||||
user = fields.ForeignKeyField("models.User", related_name="usage_records")
|
||||
record_type = fields.CharField(max_length=50, db_index=True)
|
||||
record_type = fields.CharField(max_length=100, db_index=True)
|
||||
amount_bytes = fields.BigIntField()
|
||||
resource_type = fields.CharField(max_length=50, null=True)
|
||||
resource_type = fields.CharField(max_length=100, null=True)
|
||||
resource_id = fields.IntField(null=True)
|
||||
timestamp = fields.DatetimeField(auto_now_add=True, db_index=True)
|
||||
idempotency_key = fields.CharField(max_length=255, unique=True, null=True)
|
||||
@@ -73,15 +73,15 @@ class UsageAggregate(models.Model):
|
||||
class Invoice(models.Model):
|
||||
id = fields.IntField(primary_key=True)
|
||||
user = fields.ForeignKeyField("models.User", related_name="invoices")
|
||||
invoice_number = fields.CharField(max_length=50, unique=True)
|
||||
invoice_number = fields.CharField(max_length=100, unique=True)
|
||||
stripe_invoice_id = fields.CharField(max_length=255, unique=True, null=True)
|
||||
period_start = fields.DateField(db_index=True)
|
||||
period_end = fields.DateField()
|
||||
subtotal = fields.DecimalField(max_digits=10, decimal_places=4)
|
||||
tax = fields.DecimalField(max_digits=10, decimal_places=4, default=0)
|
||||
total = fields.DecimalField(max_digits=10, decimal_places=4)
|
||||
currency = fields.CharField(max_length=3, default="USD")
|
||||
status = fields.CharField(max_length=50, default="draft", db_index=True)
|
||||
currency = fields.CharField(max_length=100, default="USD")
|
||||
status = fields.CharField(max_length=100, default="draft", db_index=True)
|
||||
due_date = fields.DateField(null=True)
|
||||
paid_at = fields.DatetimeField(null=True)
|
||||
created_at = fields.DatetimeField(auto_now_add=True, db_index=True)
|
||||
@@ -100,7 +100,7 @@ class InvoiceLineItem(models.Model):
|
||||
quantity = fields.DecimalField(max_digits=15, decimal_places=6)
|
||||
unit_price = fields.DecimalField(max_digits=10, decimal_places=6)
|
||||
amount = fields.DecimalField(max_digits=10, decimal_places=4)
|
||||
item_type = fields.CharField(max_length=50, null=True)
|
||||
item_type = fields.CharField(max_length=100, null=True)
|
||||
metadata = fields.JSONField(null=True)
|
||||
created_at = fields.DatetimeField(auto_now_add=True)
|
||||
|
||||
@@ -110,10 +110,10 @@ class InvoiceLineItem(models.Model):
|
||||
|
||||
class PricingConfig(models.Model):
|
||||
id = fields.IntField(primary_key=True)
|
||||
config_key = fields.CharField(max_length=100, unique=True)
|
||||
config_key = fields.CharField(max_length=255, unique=True)
|
||||
config_value = fields.DecimalField(max_digits=10, decimal_places=6)
|
||||
description = fields.TextField(null=True)
|
||||
unit = fields.CharField(max_length=50, null=True)
|
||||
unit = fields.CharField(max_length=100, null=True)
|
||||
updated_by = fields.ForeignKeyField(
|
||||
"models.User", related_name="pricing_updates", null=True
|
||||
)
|
||||
@@ -127,10 +127,10 @@ class PaymentMethod(models.Model):
|
||||
id = fields.IntField(primary_key=True)
|
||||
user = fields.ForeignKeyField("models.User", related_name="payment_methods")
|
||||
stripe_payment_method_id = fields.CharField(max_length=255)
|
||||
type = fields.CharField(max_length=50)
|
||||
type = fields.CharField(max_length=100)
|
||||
is_default = fields.BooleanField(default=False)
|
||||
last4 = fields.CharField(max_length=4, null=True)
|
||||
brand = fields.CharField(max_length=50, null=True)
|
||||
last4 = fields.CharField(max_length=100, null=True)
|
||||
brand = fields.CharField(max_length=100, null=True)
|
||||
exp_month = fields.IntField(null=True)
|
||||
exp_year = fields.IntField(null=True)
|
||||
created_at = fields.DatetimeField(auto_now_add=True)
|
||||
|
||||
Reference in New Issue
Block a user