95 lines
2.4 KiB
Python
95 lines
2.4 KiB
Python
"""Serializers for external data registries."""
|
|
|
|
from apps.external_data.models import (
|
|
ArbitrationCase,
|
|
IndustrialProduct,
|
|
ProsecutorCheck,
|
|
PublicProcurement,
|
|
InformationSecurityRegistryEntry,
|
|
)
|
|
from rest_framework import serializers
|
|
|
|
|
|
class IndustrialProductSerializer(serializers.ModelSerializer):
|
|
organization = serializers.UUIDField(source="organization_id", read_only=True)
|
|
|
|
class Meta:
|
|
model = IndustrialProduct
|
|
fields = [
|
|
"id",
|
|
"organization",
|
|
"product_name",
|
|
"product_class",
|
|
"okpd2_code",
|
|
"tnved_code",
|
|
"registry_number",
|
|
]
|
|
|
|
|
|
class ProsecutorCheckSerializer(serializers.ModelSerializer):
|
|
organization = serializers.UUIDField(source="organization_id", read_only=True)
|
|
|
|
class Meta:
|
|
model = ProsecutorCheck
|
|
fields = [
|
|
"id",
|
|
"organization",
|
|
"registration_number",
|
|
"law_type",
|
|
"control_authority",
|
|
"prosecutor_office",
|
|
"start_date",
|
|
"status",
|
|
]
|
|
|
|
|
|
class PublicProcurementSerializer(serializers.ModelSerializer):
|
|
organization = serializers.UUIDField(source="organization_id", read_only=True)
|
|
|
|
class Meta:
|
|
model = PublicProcurement
|
|
fields = [
|
|
"id",
|
|
"organization",
|
|
"purchase_number",
|
|
"law_type",
|
|
"status",
|
|
"contract_amount",
|
|
"contract_date",
|
|
"execution_start_date",
|
|
"execution_end_date",
|
|
"purchase_name",
|
|
]
|
|
|
|
|
|
class ArbitrationCaseSerializer(serializers.ModelSerializer):
|
|
organization = serializers.UUIDField(source="organization_id", read_only=True)
|
|
|
|
class Meta:
|
|
model = ArbitrationCase
|
|
fields = [
|
|
"id",
|
|
"organization",
|
|
"case_number",
|
|
"court_name",
|
|
"party_role",
|
|
"status",
|
|
"decision_date",
|
|
]
|
|
|
|
|
|
class InformationSecurityRegistryEntrySerializer(serializers.ModelSerializer):
|
|
organization = serializers.UUIDField(source="organization_id", read_only=True)
|
|
|
|
class Meta:
|
|
model = InformationSecurityRegistryEntry
|
|
fields = [
|
|
"id",
|
|
"organization",
|
|
"registry_name",
|
|
"presence_status",
|
|
"entry_number",
|
|
"issued_at",
|
|
"expires_at",
|
|
]
|