Align frontend API contracts
This commit is contained in:
@@ -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 "Настройки парсинга"
|
||||
|
||||
Reference in New Issue
Block a user