Align frontend API contracts

This commit is contained in:
2026-03-22 13:21:02 +01:00
parent 0da5b4abe2
commit e639b3c792
35 changed files with 1362 additions and 205 deletions

View File

@@ -846,3 +846,70 @@ class FinancialReportLine(models.Model):
def __str__(self) -> str:
return f"{self.line_code} ({self.line_name[:30]}) - {self.year}"
class ParsingSettings(TimestampMixin, models.Model):
"""Singleton-настройки периодичности обновления источников парсинга."""
class Frequency(models.TextChoices):
DAILY = "daily", _("Ежедневно")
WEEKLY = "weekly", _("Еженедельно")
MONTHLY = "monthly", _("Ежемесячно")
YEARLY = "yearly", _("Ежегодно")
singleton_key = models.PositiveSmallIntegerField(
_("ключ singleton-записи"),
default=1,
unique=True,
editable=False,
)
manufacturers_and_products = models.CharField(
_("производители и продукция"),
max_length=20,
choices=Frequency.choices,
default=Frequency.DAILY,
)
public_procurements = models.CharField(
_("госзакупки"),
max_length=20,
choices=Frequency.choices,
default=Frequency.DAILY,
)
defense_unreliable_suppliers = models.CharField(
_("недобросовестные поставщики ОПК"),
max_length=20,
choices=Frequency.choices,
default=Frequency.WEEKLY,
)
planned_inspections = models.CharField(
_("плановые проверки"),
max_length=20,
choices=Frequency.choices,
default=Frequency.MONTHLY,
)
arbitration_cases = models.CharField(
_("арбитражные дела"),
max_length=20,
choices=Frequency.choices,
default=Frequency.DAILY,
)
bankruptcy_procedures = models.CharField(
_("банкротные процедуры"),
max_length=20,
choices=Frequency.choices,
default=Frequency.DAILY,
)
information_security_registries = models.CharField(
_("реестры информационной безопасности"),
max_length=20,
choices=Frequency.choices,
default=Frequency.YEARLY,
)
class Meta:
db_table = "parsers_parsing_settings"
verbose_name = _("настройки парсинга")
verbose_name_plural = _("настройки парсинга")
def __str__(self) -> str:
return "Настройки парсинга"