From be23b087f1ffee87406f8cb079ac82c3a81a461a Mon Sep 17 00:00:00 2001 From: Parsa Nazer Date: Tue, 18 Nov 2025 13:54:57 +0330 Subject: [PATCH] commition field added to shop model --- .../0033_shopmodel_commission_percent.py | 19 +++++++++++++++++++ backend/account/models.py | 1 + 2 files changed, 20 insertions(+) create mode 100644 backend/account/migrations/0033_shopmodel_commission_percent.py diff --git a/backend/account/migrations/0033_shopmodel_commission_percent.py b/backend/account/migrations/0033_shopmodel_commission_percent.py new file mode 100644 index 0000000..9fee60c --- /dev/null +++ b/backend/account/migrations/0033_shopmodel_commission_percent.py @@ -0,0 +1,19 @@ +# Generated by Django 5.1.2 on 2025-11-17 05:17 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('account', '0032_specialdiscountcode'), + ] + + operations = [ + migrations.AddField( + model_name='shopmodel', + name='commission_percent', + field=models.DecimalField(decimal_places=2, default=0, max_digits=5, verbose_name='درصد کمیسیون'), + preserve_default=False, + ), + ] diff --git a/backend/account/models.py b/backend/account/models.py index cadf452..34715e9 100644 --- a/backend/account/models.py +++ b/backend/account/models.py @@ -142,6 +142,7 @@ class ShopModel(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='shop', verbose_name='کاربر') shop_name = models.CharField(max_length=100, verbose_name='نام فروشگاه') shop_description = models.TextField(verbose_name='توضیحات فروشگاه') + commission_percent = models.DecimalField(max_digits=5, decimal_places=2, verbose_name='درصد کمیسیون') def __str__(self): return f"{self.user.phone} - {self.shop_name}"