feat: import mostovik exchange sections
All checks were successful
CI/CD Pipeline / Run Tests (push) Successful in 6m12s
CI/CD Pipeline / Code Quality Checks (push) Successful in 6m19s
CI/CD Pipeline / Build Docker Images (push) Successful in 2m21s
CI/CD Pipeline / Push to Gitea Registry (push) Successful in 1s
CI/CD Pipeline / Deploy to Server (push) Successful in 1s
All checks were successful
CI/CD Pipeline / Run Tests (push) Successful in 6m12s
CI/CD Pipeline / Code Quality Checks (push) Successful in 6m19s
CI/CD Pipeline / Build Docker Images (push) Successful in 2m21s
CI/CD Pipeline / Push to Gitea Registry (push) Successful in 1s
CI/CD Pipeline / Deploy to Server (push) Successful in 1s
This commit is contained in:
@@ -34,6 +34,57 @@ class IndustrialProduct(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
return f"{self.product_name} ({self.organization_id})"
|
||||
|
||||
|
||||
class IndustrialCertificate(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="industrial_certificates",
|
||||
verbose_name=_("организация"),
|
||||
)
|
||||
certificate_number = models.CharField(
|
||||
_("номер сертификата"), max_length=100, db_index=True
|
||||
)
|
||||
issue_date = models.DateField(_("дата выдачи"), null=True, blank=True)
|
||||
expiry_date = models.DateField(_("дата окончания"), null=True, blank=True)
|
||||
certificate_file_url = models.TextField(
|
||||
_("ссылка на файл сертификата"), blank=True, default=""
|
||||
)
|
||||
organisation_name = models.CharField(
|
||||
_("наименование организации из источника"),
|
||||
max_length=500,
|
||||
blank=True,
|
||||
default="",
|
||||
)
|
||||
ogrn = models.CharField(_("ОГРН"), max_length=15, blank=True, default="")
|
||||
|
||||
class Meta:
|
||||
ordering = ["-issue_date", "certificate_number"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.certificate_number} ({self.organization_id})"
|
||||
|
||||
|
||||
class ManufacturerRegistryEntry(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="manufacturer_registry_entries",
|
||||
verbose_name=_("организация"),
|
||||
)
|
||||
full_legal_name = models.CharField(
|
||||
_("полное наименование"), max_length=1024, db_index=True
|
||||
)
|
||||
inn = models.CharField(_("ИНН"), max_length=12, db_index=True)
|
||||
ogrn = models.CharField(_("ОГРН"), max_length=15, blank=True, default="")
|
||||
address = models.TextField(_("адрес"), blank=True, default="")
|
||||
|
||||
class Meta:
|
||||
ordering = ["full_legal_name", "created_at"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.full_legal_name} ({self.organization_id})"
|
||||
|
||||
|
||||
class ProsecutorCheck(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
@@ -247,3 +298,69 @@ class LaborVacancy(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.title} ({self.organization_id})"
|
||||
|
||||
|
||||
class FinancialReport(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
organization = models.ForeignKey(
|
||||
Organization,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="financial_reports",
|
||||
verbose_name=_("организация"),
|
||||
)
|
||||
external_id = models.CharField(_("внешний ID"), max_length=255, db_index=True)
|
||||
ogrn = models.CharField(_("ОГРН"), max_length=15, blank=True, default="")
|
||||
file_name = models.CharField(_("имя файла"), max_length=255, blank=True, default="")
|
||||
file_hash = models.CharField(_("хеш файла"), max_length=64, blank=True, default="")
|
||||
load_batch = models.PositiveIntegerField(
|
||||
_("ID пакета загрузки"), null=True, blank=True, db_index=True
|
||||
)
|
||||
status = models.CharField(
|
||||
_("статус"), max_length=64, blank=True, default="", db_index=True
|
||||
)
|
||||
source = models.CharField(_("источник"), max_length=64, blank=True, default="")
|
||||
error_message = models.TextField(_("сообщение об ошибке"), blank=True, default="")
|
||||
|
||||
class Meta:
|
||||
ordering = ["-created_at", "external_id"]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.external_id} ({self.organization_id})"
|
||||
|
||||
|
||||
class FinancialReportLine(UUIDPrimaryKeyMixin, TimestampMixin, models.Model):
|
||||
report = models.ForeignKey(
|
||||
FinancialReport,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="lines",
|
||||
verbose_name=_("финансовый отчет"),
|
||||
)
|
||||
form_code = models.CharField(_("код формы"), max_length=10, db_index=True)
|
||||
line_code = models.CharField(_("код строки"), max_length=10, db_index=True)
|
||||
line_name = models.CharField(_("наименование строки"), max_length=255)
|
||||
year = models.PositiveSmallIntegerField(_("год"), db_index=True)
|
||||
period_start = models.BigIntegerField(
|
||||
_("на начало периода"),
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
period_end = models.BigIntegerField(
|
||||
_("на конец периода"),
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
|
||||
class Meta:
|
||||
ordering = ["year", "form_code", "line_code"]
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
fields=["report", "form_code", "line_code", "year"],
|
||||
name="unique_external_financial_report_line_year",
|
||||
),
|
||||
]
|
||||
indexes = [
|
||||
models.Index(fields=["report", "form_code", "line_code"]),
|
||||
models.Index(fields=["year", "line_code"]),
|
||||
]
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f"{self.line_code} ({self.line_name[:30]}) - {self.year}"
|
||||
|
||||
Reference in New Issue
Block a user