chore: commit qui sert à rien

This commit is contained in:
N3WT DE COMPET
2025-02-13 17:13:31 +01:00
parent 9bf9c5f62d
commit cce78355a3
17 changed files with 210 additions and 143 deletions

View File

@ -1,6 +1,6 @@
from django.core.management.base import BaseCommand
from Auth.models import Profile
from School.models import Fee, Discount, FeeType, DiscountType
from School.models import Fee, Discount, FeeType, DiscountType, Establishment
class Command(BaseCommand):
help = 'Initialize or update Fees and Discounts'
@ -10,41 +10,47 @@ class Command(BaseCommand):
self.create_or_update_discounts()
def create_or_update_fees(self):
establishment = Establishment.objects.get(name="N3WT")
fees_data = [
{
"name": "Frais d'inscription",
"base_amount": "150.00",
"description": "Montant de base",
"is_active": True,
"type": FeeType.REGISTRATION_FEE
"type": FeeType.REGISTRATION_FEE,
"establishment": establishment
},
{
"name": "Matériel",
"base_amount": "85.00",
"description": "Livres / jouets",
"is_active": True,
"type": FeeType.REGISTRATION_FEE
"type": FeeType.REGISTRATION_FEE,
"establishment": establishment
},
{
"name": "Sorties périscolaires",
"base_amount": "120.00",
"description": "Sorties",
"is_active": True,
"type": FeeType.REGISTRATION_FEE
"type": FeeType.REGISTRATION_FEE,
"establishment": establishment
},
{
"name": "Les colibris",
"base_amount": "4500.00",
"description": "TPS / PS / MS / GS",
"is_active": True,
"type": FeeType.TUITION_FEE
"type": FeeType.TUITION_FEE,
"establishment": establishment
},
{
"name": "Les butterflies",
"base_amount": "5000.00",
"description": "CP / CE1 / CE2 / CM1 / CM2",
"is_active": True,
"type": FeeType.TUITION_FEE
"type": FeeType.TUITION_FEE,
"establishment": establishment
}
]
@ -58,20 +64,23 @@ class Command(BaseCommand):
self.stdout.write(self.style.SUCCESS('Fees initialized or updated successfully'))
def create_or_update_discounts(self):
establishment = Establishment.objects.get(name="N3WT")
discounts_data = [
{
"name": "Parrainage",
"amount": "10.00",
"description": "Réduction pour parrainage",
"discount_type": DiscountType.PERCENT,
"type": FeeType.TUITION_FEE
"type": FeeType.TUITION_FEE,
"establishment": establishment
},
{
"name": "Réinscription",
"amount": "100.00",
"description": "Réduction pour Réinscription",
"discount_type": DiscountType.PERCENT,
"type": FeeType.REGISTRATION_FEE
"type": FeeType.REGISTRATION_FEE,
"establishment": establishment
}
]