feat(external-data): add information security registry entries endpoint
This commit is contained in:
@@ -110,3 +110,41 @@ class ArbitrationCase(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.case_number} ({self.organization_id})"
|
||||
|
||||
|
||||
class InformationSecurityRegistryEntry(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
class PresenceStatus(models.TextChoices):
|
||||
PRESENT = "present", _("В реестре")
|
||||
ABSENT = "absent", _("Не в реестре")
|
||||
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="information_security_registry_entries",
|
||||
verbose_name=_("организация"),
|
||||
)
|
||||
registry_name = models.CharField(
|
||||
_("название реестра"), max_length=255, db_index=True
|
||||
)
|
||||
presence_status = models.CharField(
|
||||
_("статус присутствия"),
|
||||
max_length=16,
|
||||
choices=PresenceStatus.choices,
|
||||
db_index=True,
|
||||
)
|
||||
entry_number = models.CharField(
|
||||
_("регистрационный номер"),
|
||||
max_length=64,
|
||||
blank=True,
|
||||
default="",
|
||||
)
|
||||
issued_at = models.DateField(_("дата выдачи"), null=True, blank=True)
|
||||
expires_at = models.DateField(_("дата окончания"), null=True, blank=True)
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("запись реестра безопасности")
|
||||
verbose_name_plural = _("записи реестра безопасности")
|
||||
ordering = ["registry_name", "-issued_at"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.registry_name} ({self.organization_id})"
|
||||
|
||||
Reference in New Issue
Block a user