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

@ -6,7 +6,6 @@ from django.contrib.postgres.fields import ArrayField
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
LEVEL_CHOICES = [
(1, 'Très Petite Section (TPS)'),
(2, 'Petite Section (PS)'),
@ -19,6 +18,23 @@ LEVEL_CHOICES = [
(9, 'Cours Moyen 2 (CM2)')
]
class StructureType(models.IntegerChoices):
MATERNELLE = 1, _('Maternelle')
PRIMAIRE = 2, _('Primaire')
SECONDAIRE = 3, _('Secondaire')
class Establishment(models.Model):
name = models.CharField(max_length=255, unique=True)
address = models.CharField(max_length=255)
total_capacity = models.IntegerField()
establishment_type = ArrayField(models.IntegerField(choices=StructureType.choices))
licence_code = models.CharField(max_length=100, blank=True)
is_active = models.BooleanField(default=True)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self):
return self.name
class Speciality(models.Model):
name = models.CharField(max_length=100)
updated_date = models.DateTimeField(auto_now=True)
@ -56,6 +72,7 @@ class SchoolClass(models.Model):
type = models.IntegerField(choices=PLANNING_TYPE_CHOICES, default=1)
time_range = models.JSONField(default=list)
opening_days = ArrayField(models.IntegerField(), default=list)
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='school_classes')
def __str__(self):
return self.atmosphere_name
@ -95,6 +112,7 @@ class Discount(models.Model):
discount_type = models.IntegerField(choices=DiscountType.choices, default=DiscountType.CURRENCY)
type = models.IntegerField(choices=FeeType.choices, default=FeeType.REGISTRATION_FEE)
updated_at = models.DateTimeField(auto_now=True)
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='discounts')
def __str__(self):
return self.name
@ -106,6 +124,7 @@ class Fee(models.Model):
is_active = models.BooleanField(default=True)
updated_at = models.DateTimeField(auto_now=True)
type = models.IntegerField(choices=FeeType.choices, default=FeeType.REGISTRATION_FEE)
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='fees')
def __str__(self):
return self.name
@ -115,6 +134,7 @@ class PaymentPlan(models.Model):
due_dates = ArrayField(models.DateField(), blank=True)
type = models.IntegerField(choices=FeeType.choices, default=FeeType.REGISTRATION_FEE)
is_active = models.BooleanField(default=False)
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='payment_plans')
def __str__(self):
return f"{self.get_frequency_display()} - {self.get_type_display()}"
@ -123,6 +143,7 @@ class PaymentMode(models.Model):
mode = models.IntegerField(choices=PaymentModeType.choices, default=PaymentModeType.SEPA)
type = models.IntegerField(choices=FeeType.choices, default=FeeType.REGISTRATION_FEE)
is_active = models.BooleanField(default=False)
establishment = models.ForeignKey(Establishment, on_delete=models.CASCADE, related_name='payment_modes')
def __str__(self):
return f"{self.get_mode_display()} - {self.get_type_display()}"