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:
@@ -32,6 +32,19 @@ class ManufacturerRow:
|
||||
address: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class IndustrialProductRow:
|
||||
full_organisation_name: str
|
||||
ogrn: str
|
||||
inn: str
|
||||
registry_number: str
|
||||
product_name: str
|
||||
product_model: str
|
||||
okpd2_code: str
|
||||
tnved_code: str
|
||||
regulatory_document: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class InspectionRow:
|
||||
registration_number: str
|
||||
@@ -138,6 +151,64 @@ def build_minpromtorg_manufacturers_excel(
|
||||
return buf.getvalue(), rows
|
||||
|
||||
|
||||
def build_minpromtorg_products_excel(
|
||||
count: int = 5,
|
||||
) -> tuple[bytes, list[IndustrialProductRow]]:
|
||||
wb = Workbook()
|
||||
ws = wb.active
|
||||
ws.append(
|
||||
[
|
||||
"Реестр промышленной продукции, произведенной на территории РФ",
|
||||
]
|
||||
)
|
||||
ws.append(
|
||||
[
|
||||
"Полное наименование организации",
|
||||
"ОГРН",
|
||||
"ИНН",
|
||||
"Регистрационный номер записи",
|
||||
"Наименование продукции",
|
||||
"Модель или модификация",
|
||||
"Код по ОКПД2",
|
||||
"Код по ТН ВЭД",
|
||||
"Наименование нормативного документа",
|
||||
]
|
||||
)
|
||||
|
||||
rows: list[IndustrialProductRow] = []
|
||||
for _ in range(count):
|
||||
row = IndustrialProductRow(
|
||||
full_organisation_name=fake.company(),
|
||||
ogrn=_digits(13),
|
||||
inn=_digits(10),
|
||||
registry_number=f"MPP-{_digits(8)}",
|
||||
product_name=fake.sentence(nb_words=4),
|
||||
product_model=fake.bothify(text="MODEL-###"),
|
||||
okpd2_code=f"{fake.random_int(min=10, max=99)}.{fake.random_int(min=10, max=99)}",
|
||||
tnved_code=_digits(10),
|
||||
regulatory_document=fake.sentence(nb_words=5),
|
||||
)
|
||||
rows.append(row)
|
||||
ws.append(
|
||||
[
|
||||
row.full_organisation_name,
|
||||
row.ogrn,
|
||||
row.inn,
|
||||
row.registry_number,
|
||||
row.product_name,
|
||||
row.product_model,
|
||||
row.okpd2_code,
|
||||
row.tnved_code,
|
||||
row.regulatory_document,
|
||||
]
|
||||
)
|
||||
|
||||
buf = io.BytesIO()
|
||||
wb.save(buf)
|
||||
wb.close()
|
||||
return buf.getvalue(), rows
|
||||
|
||||
|
||||
def build_proverki_xml(count: int = 3) -> tuple[bytes, list[InspectionRow]]:
|
||||
rows: list[InspectionRow] = []
|
||||
parts = ["<?xml version='1.0' encoding='utf-8'?>", "<INSPECTIONS>"]
|
||||
|
||||
Reference in New Issue
Block a user