feat: expand platform APIs, sources, and test coverage
Some checks failed
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m54s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
Some checks failed
CI/CD Pipeline / Run Tests (pull_request) Successful in 1m53s
CI/CD Pipeline / Telegram Notify Success (push) Has been cancelled
CI/CD Pipeline / Run Tests (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (push) Has been cancelled
CI/CD Pipeline / Code Quality Checks (pull_request) Failing after 2m54s
CI/CD Pipeline / Telegram Notify Success (pull_request) Has been skipped
This commit is contained in:
@@ -18,6 +18,7 @@ class ParserLoadLog(TimestampMixin, models.Model):
|
||||
|
||||
class Source(models.TextChoices):
|
||||
INDUSTRIAL = "industrial", _("Промышленное производство")
|
||||
INDUSTRIAL_PRODUCTS = "industrial_products", _("Реестр промышленной продукции")
|
||||
MANUFACTURES = "manufactures", _("Реестр производителей")
|
||||
INSPECTIONS = "inspections", _("Единый реестр проверок")
|
||||
PROCUREMENTS = "procurements", _("Государственные закупки")
|
||||
@@ -228,6 +229,92 @@ class ManufacturerRecord(TimestampMixin, models.Model):
|
||||
return f"{self.inn} - {self.full_legal_name[:50]}"
|
||||
|
||||
|
||||
class IndustrialProductRecord(TimestampMixin, models.Model):
|
||||
"""
|
||||
Промышленная продукция из реестра Минпромторга.
|
||||
|
||||
Данные загружаются из Минпромторга.
|
||||
"""
|
||||
|
||||
load_batch = models.PositiveIntegerField(
|
||||
_("ID пакета загрузки"),
|
||||
db_index=True,
|
||||
help_text=_("Идентификатор пакета загрузки"),
|
||||
)
|
||||
full_organisation_name = models.TextField(
|
||||
_("полное наименование организации"),
|
||||
help_text=_("Полное наименование организации"),
|
||||
)
|
||||
ogrn = models.CharField(
|
||||
_("ОГРН"),
|
||||
max_length=15,
|
||||
db_index=True,
|
||||
help_text=_("ОГРН организации"),
|
||||
)
|
||||
inn = models.CharField(
|
||||
_("ИНН"),
|
||||
max_length=12,
|
||||
db_index=True,
|
||||
help_text=_("ИНН организации"),
|
||||
)
|
||||
registry_number = models.CharField(
|
||||
_("регистрационный номер"),
|
||||
max_length=100,
|
||||
db_index=True,
|
||||
help_text=_("Регистрационный номер записи"),
|
||||
)
|
||||
product_name = models.TextField(
|
||||
_("наименование продукции"),
|
||||
help_text=_("Наименование продукции"),
|
||||
)
|
||||
product_model = models.CharField(
|
||||
_("модель или модификация"),
|
||||
max_length=255,
|
||||
blank=True,
|
||||
help_text=_("Модель или модификация продукции"),
|
||||
)
|
||||
okpd2_code = models.CharField(
|
||||
_("код ОКПД2"),
|
||||
max_length=20,
|
||||
blank=True,
|
||||
help_text=_("Код по ОКПД2"),
|
||||
)
|
||||
tnved_code = models.CharField(
|
||||
_("код ТН ВЭД"),
|
||||
max_length=20,
|
||||
blank=True,
|
||||
help_text=_("Код по ТН ВЭД"),
|
||||
)
|
||||
regulatory_document = models.CharField(
|
||||
_("нормативный документ"),
|
||||
max_length=500,
|
||||
blank=True,
|
||||
help_text=_("Наименование нормативного документа"),
|
||||
)
|
||||
registry_organization = models.ForeignKey(
|
||||
"registers.Organization",
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name="industrial_product_records",
|
||||
verbose_name=_("организация из реестров"),
|
||||
help_text=_("Связь с организацией из приложения реестров"),
|
||||
)
|
||||
|
||||
class Meta:
|
||||
db_table = "parsers_industrial_product"
|
||||
verbose_name = _("промышленная продукция")
|
||||
verbose_name_plural = _("промышленная продукция")
|
||||
ordering = ["-created_at"]
|
||||
indexes = [
|
||||
models.Index(fields=["load_batch", "inn"]),
|
||||
models.Index(fields=["inn", "registry_number"]),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.registry_number} - {self.product_name[:50]}"
|
||||
|
||||
|
||||
class Proxy(TimestampMixin, models.Model):
|
||||
"""
|
||||
Прокси-сервер для парсеров.
|
||||
|
||||
Reference in New Issue
Block a user