Implement exchange imports and frontend reporting APIs
Some checks failed
CI/CD Pipeline / Code Quality Checks (push) Failing after 3m50s
CI/CD Pipeline / Run Tests (push) Successful in 3m57s
CI/CD Pipeline / Build Docker Images (push) Has been skipped
CI/CD Pipeline / Push to Gitea Registry (push) Has been skipped
CI/CD Pipeline / Deploy to Server (push) Has been skipped

This commit is contained in:
2026-04-07 16:31:04 +02:00
parent 76a86d0b20
commit 697ecb7d1c
155 changed files with 5604 additions and 346 deletions

View File

@@ -1,9 +1,10 @@
"""Factories for organization app."""
import factory
from apps.organization.models import Organization
from faker import Faker
from apps.organization.models import IndustryCluster, Organization, OrganizationType
fake = Faker("ru_RU")
@@ -14,10 +15,47 @@ class OrganizationFactory(factory.django.DjangoModelFactory):
model = Organization
name = factory.LazyAttribute(lambda _: fake.company())
short_name = factory.LazyAttribute(lambda _: f"АО «{fake.company()}»")
organization_type = factory.LazyAttribute(
lambda _: fake.random_element(
[OrganizationType.AO, OrganizationType.PAO, OrganizationType.FGUP]
)
)
cluster = factory.LazyAttribute(
lambda _: fake.random_element(
[
IndustryCluster.RADIOELECTRONICS,
IndustryCluster.NUCLEAR,
IndustryCluster.SPACE,
]
)
)
inn = factory.LazyAttribute(lambda _: fake.numerify("##########"))
ogrn = factory.LazyAttribute(lambda _: fake.numerify("#############"))
kpp = factory.LazyAttribute(lambda _: fake.numerify("#########"))
okpo = factory.LazyAttribute(lambda _: fake.numerify("########"))
registration_date = factory.LazyAttribute(lambda _: fake.date_this_century())
legal_address = factory.LazyAttribute(lambda _: fake.address().replace("\n", ", "))
activity_type = factory.LazyAttribute(lambda _: fake.job())
founder_name = factory.LazyAttribute(lambda _: fake.company())
ownership_type = "Собственность государственных корпораций"
legal_form = "Акционерное общество"
charter_capital_amount = factory.LazyAttribute(
lambda _: fake.pydecimal(left_digits=9, right_digits=2, positive=True)
)
general_director_name = factory.LazyAttribute(lambda _: fake.name())
general_director_inn = factory.LazyAttribute(
lambda _: fake.numerify("############")
)
general_director_appointment_date = factory.LazyAttribute(
lambda _: fake.date_this_decade()
)
executors_count = factory.LazyAttribute(lambda _: fake.random_int(min=20, max=500))
financial_reports_available = True
tax_reports_available = True
in_defense_unreliable_suppliers_registry = False
in_275_fz_registry = False
bankruptcy_messages_found = False
@classmethod
def create_organization(cls, **kwargs):