Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from spyne import ComplexModel, String, Integer, Array, Date, Boolean, Decimal, DateTime
- from exim.models import ExportFSS, ImportFSS
- import uuid
- guid = String.customize(
- max_length=36, pattern='[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}',
- nullable=True)
- send_date_time = DateTime.customize(
- format="%Y-%m-%dT%H:%M:%SZ", nullable=False)
- status = String.customize(min_occurs=0, max_occurs=1)
- status_code = Integer.customize(min_occurs=0, max_occurs=1)
- inspector = String.customize(min_occurs=0, max_occurs=1, max_length=255)
- class Man(ComplexModel):
- man_name = String.customize(max_length=255, nullable=False)
- man_father_name = String.customize(max_length=255, nullable=False)
- man_family = String.customize(max_length=255, nullable=False)
- class Consignor(ComplexModel):
- code = String.customize(min_occurs=0, max_length=10, nullable=True)
- name = String.customize(max_length=255, nullable=False)
- identifier = String.customize(max_length=30, nullable=True)
- identifier_2 = String.customize(max_length=30, nullable=True)
- place = String.customize(max_length=512, nullable=False)
- address = String.customize(min_occurs=0, max_length=512, nullable=True)
- address_code = String.customize(min_occurs=0, max_length=36, nullable=True)
- agent = String.customize(max_length=255, nullable=True)
- agent_code = Integer.customize(min_occurs=0, nullable=True)
- behalf = String.customize(min_occurs=0, max_length=512, nullable=True)
- man = Man
- type = Integer
- class Consignee(ComplexModel):
- code = String.customize(min_occurs=0, max_length=10, nullable=True)
- name = String.customize(max_length=255, nullable=False)
- identifier = String.customize(max_length=30, nullable=True)
- identifier_2 = String.customize(max_length=30, nullable=True)
- place = String.customize(max_length=512, nullable=False)
- address = String.customize(min_occurs=0, max_length=512, nullable=True)
- address_code = String.customize(min_occurs=0, max_length=36, nullable=True)
- agent = String.customize(max_length=255, nullable=True)
- agent_code = Integer.customize(min_occurs=0, nullable=True)
- behalf = String.customize(min_occurs=0, max_length=512, nullable=True)
- man = Man
- type = Integer
- class Transport(ComplexModel):
- __namespace__ = ''
- name = String.customize(min_occurs=0, max_length=255, nullable=True)
- number = String.customize(max_length=512, nullable=False)
- country_code = String.customize(
- min_occurs=0, max_length=2, pattern='[A-Z]', nullable=True)
- declared_type = String.customize(max_length=100, nullable=False)
- declared_type_code = Integer
- arrival_date = Date.customize(
- min_occurs=0, format='%Y-%m-%d', nullable=True)
- arrival_place = String.customize(
- min_occurs=0, max_length=512, nullable=True)
- document = String.customize(min_occurs=0, max_length=255, nullable=True)
- document_date = Date.customize(
- min_occurs=0, format='%Y-%m-%d', nullable=True)
- document_number = String.customize(
- min_occurs=0, max_length=255, nullable=True)
- class ProductDescription(ComplexModel):
- __namespace__ = ''
- name_rus = String.customize(max_length=1024, nullable=False)
- name_eng = String.customize(min_occurs=0, max_length=1024, nullable=True)
- name_botanic = String.customize(
- min_occurs=0, max_length=1024, nullable=False)
- hs = String.customize(min_occurs=0, max_length=512, nullable=True)
- hs_code = String.customize(
- min_occurs=0, min_length=4, max_length=10, nullable=False)
- origin_place = String.customize(max_length=512, nullable=False)
- origin_country = String.customize(max_length=100, nullable=False)
- origin_country_code = String.customize(
- min_occurs=0, max_length=2, pattern='[A-Z]', nullable=True)
- manufacturer = String.customize(
- min_occurs=0, max_length=255, nullable=False)
- manufacturer_code = Integer.customize(min_occurs=0, nullable=True)
- manufacturer_identifier = String.customize(
- min_occurs=0, max_length=30, nullable=True)
- manufacturer_identifier_2 = String.customize(
- min_occurs=0, max_length=30, nullable=True)
- manufacturer_place = String.customize(
- min_occurs=0, max_length=512, nullable=True)
- quantity = Decimal.customize(fraction_digits=3, nullable=False)
- quantity_unit = String.customize(max_length=100, nullable=False)
- quantity_unit_code = String.customize(
- min_occurs=0, max_length=3, nullable=True)
- quantity_gross = Decimal.customize(
- min_occurs=0, fraction_digits=3, nullable=True)
- quantity_gross_unit = String.customize(max_length=100, nullable=True)
- quantity_gross_unit_code = String.customize(
- min_occurs=0, max_length=3, nullable=True)
- quantity_special = Decimal.customize(fraction_digits=3, nullable=True)
- quantity_special_unit = String.customize(max_length=100, nullable=True)
- quantity_special_unit_code = String.customize(
- min_occurs=0, max_length=3, nullable=True)
- packages = Integer.customize(min_occurs=0, nullable=True)
- packages_unit = String.customize(max_length=100, nullable=True)
- packages_unit_code = String.customize(
- min_occurs=0, max_length=3, nullable=True)
- packages_type = String.customize(max_length=100, nullable=True)
- packages_type_code = String.customize(
- max_length=2, pattern='[0-9A-Z]', nullable=True)
- packages_description = String.customize(
- min_occurs=0, max_length=512, nullable=True)
- volume = Decimal.customize(min_occurs=0, fraction_digits=3, nullable=True)
- volume_unit = String.customize(max_length=100, nullable=True)
- volume_unit_code = String.customize(
- min_occurs=0, max_length=3, nullable=True)
- marking = String.customize(min_occurs=0, max_length=255, nullable=True)
- expert_opinion_date = Date.customize(
- min_occurs=0, format='%Y-%m-%d', nullable=True)
- expert_opinion_number = String.customize(
- min_occurs=0, max_length=255, nullable=True)
- expert_samples = String.customize(
- min_occurs=0, max_length=512, nullable=True)
- additional_info = String.customize(
- min_occurs=0, max_length=2000, nullable=True)
- class Disinfection(ComplexModel):
- date = Date.customize(min_occurs=0, format='%Y-%m-%d', nullable=True)
- method = String.customize(min_occurs=0, max_length=100, nullable=True)
- chemical = String.customize(min_occurs=0, max_length=100, nullable=True)
- temperature_times = String.customize(
- min_occurs=0, max_length=100, nullable=True)
- concentration = String.customize(
- min_occurs=0, max_length=100, nullable=True)
- additional_info = String.customize(
- min_occurs=0, max_length=2000, nullable=True)
- class CertificateMinimumType(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- date = Date.customize(format='%Y-%m-%d', nullable=False)
- number = String.customize(max_length=100, nullable=False)
- blanc = String.customize(max_length=100, nullable=False)
- country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=True)
- expiration_date = Date.customize(format='%Y-%m-%d', nullable=True)
- cancelled = Boolean.customize(nullable=True)
- issue_place = String.customize(max_length=255, nullable=True)
- inspector = inspector
- # @staticmethod
- # def generate(valid=False):
- # return {
- # 'date': ExportFSS.given_date,
- # 'number': ExportFSS.number,
- # 'blanc': ExportFSS.order_number,
- # 'country_code': ExportFSS.exporter_country.code,
- # 'expiration_date': None,
- # 'cancelled': "false",
- # 'issue_place': ExportFSS.point.name_ru,
- # 'inspector': ExportFSS.inspector_name
- # } if valid else {
- # 'date': None,
- # 'number': None,
- # 'blanc': None,
- # 'country_code': None,
- # 'expiration_date': None,
- # 'cancelled': None,
- # 'issue_place': None,
- # 'inspector': None
- # }
- @staticmethod
- def generate(valid=True):
- return {
- 'Date': '2022-03-31',
- 'Number': 'UZ33333',
- 'Blanc': 'UZ33333',
- 'CountryCode': 'UZ',
- 'ExpirationDate': '0001-01-01',
- 'Cancelled': "false",
- 'IssuePlace': 'Республика Узбекистан, ',
- 'Inspector': 'Абдуллаев'
- } if valid else {
- 'Date': None,
- 'Number': None,
- 'Blanc': None,
- 'CountryCode': None,
- 'ExpirationDate': None,
- 'Cancelled': None,
- 'IssuePlace': None,
- 'Inspector': None
- }
- @staticmethod
- def guid_generate():
- return str(uuid)
- class CertificateMaximumType(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- date = Date.customize(format='%Y-%m-%d', nullable=False)
- number = String.customize(max_length=100, nullable=False)
- blanc = String.customize(max_length=100, nullable=False)
- country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=True)
- expiration_date = Date.customize(format='%Y-%m-%d', nullable=True)
- cancelled = Boolean.customize(nullable=True)
- issue_place = String.customize(max_length=255, nullable=True)
- inspector = inspector
- departure_country = String.customize(max_length=100, nullable=False)
- departure_country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=False)
- destination_country = String.customize(max_length=100, nullable=False)
- destination_country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=False)
- entry_checkpoint = String.customize(max_length=255, nullable=False)
- entry_checkpoint_code = Integer.customize(nullable=True)
- consignor = Consignor
- consignee = Consignee
- transport = Transport
- product_description = ProductDescription(many=True)
- general_marking = String.customize(max_length=512, nullable=True)
- general_quarantine_condition = String.customize(
- max_length=512, nullable=True)
- general_base_document = String.customize(max_length=512, nullable=True)
- general_additional_declaration = String.customize(
- max_length=4000, nullable=True)
- general_mandatory_actions = String.customize(max_length=512, nullable=True)
- disinfection = Disinfection
- additional_info = String.customize(max_length=2000, nullable=True)
- annex_doc = String.customize(max_length=100000, nullable=True)
- annex_text = String.customize(max_length=4000, nullable=True)
- @staticmethod
- def generate(valid=True):
- return{
- "ID": "",
- "GUID": "72c368e0-bf6d-4150-b98f-ef4132b0e40f",
- "SendDateTime": "2022-04-11T19:50:11",
- "Date": "2022-03-31",
- "Number": "UZ33333",
- "Blanc": "UZ33333",
- "CountryCode": "UZ",
- "ExpirationDate": "0001-01-01",
- "Cancelled": "false",
- "IssuePlace": "Республика Узбекистан",
- "Inspector": "Абдуллаев.",
- "DepartureCountry": "Узбекистан",
- "DepartureCountryCode": "UZ",
- "DestinationCountry": "Российская Федерация",
- "DestinationCountryCode": "RU",
- "EntryCheckpoint": "Россия",
- "EntryCheckpointCode": "0",
- "Consignor": {
- "Name": "ТОХИРОВ ШУХРАТ ТОХИРОВИЧ Р.УЗБЕКИСТАН, ",
- "Identifier": "2310031475",
- "Place": "Р.УЗБЕКИСТАН, ФЕРГАНСКАЯ ОБЛАСТЬ, Г.МАРГИЛАН, УЛИЦА ТАДБИРКОР, 7",
- "Type": "0 ",
- },
- "Consignee": {
- "Name": "2310031475 АО ТАНДЕР 350002,РОССИЯ,КРАСНОДАРСКИЙ КРАЙ,",
- "Identifier": "2310031475",
- "Place": "350002,РОССИЯ,КРАСНОДАРСКИЙ КРАЙ,Г.КРАСНОДАР,УЛ.ЛЕВАНЕВСКОГО,185",
- "Type": "0 ",
- },
- "Transport": {
- "Name": "АВТОМОБИЛЬНЫЙ/АВТОМОБИЛЬНЫЙ ГАЗЕЛЬ 884 DAA 07",
- "Number": "ГАЗЕЛЬ 884 DAA 07",
- "CountryCode": "UZ",
- "DeclaredType": "автодорожный транспорт",
- "DeclaredTypeCode": "30",
- "ArrivalDateTime": "0001-01-01T00:00:00",
- "ArrivalPlace": ""
- },
- "ProductDescription": {
- "NameRus": "слива свежая",
- "NameEng": "Рlum",
- "NameBotanic": "Prunus domestica",
- "HS": "",
- "HSCode": "0809400500",
- "OriginPlace": "РЕСПУБЛИКА УЗБЕКИСТАН ",
- "OriginCountry": "РЕСПУБЛИКА УЗБЕКИСТАН ",
- "OriginCountryCode": "UZ",
- "Manufacturer": "OOO AZAMAT ESTERN TRADE",
- "ManufacturerCode": "0",
- "ManufacturerIdentifier": "",
- "ManufacturerIdentifier2": "",
- "ManufacturerPlace": "",
- "Quantity": "",
- "QuantityUnit": "0.6",
- "Packages": "80",
- "PackagesUnit": "Место",
- "PackagesUnitCode": "698",
- "PackagesType": "ящики",
- "PackagesDescription": "80 ЯЩИК(ОВ)",
- "Marking": "МАРКИРОВАН",
- },
- "GeneralMarking": "МАРКИРОВАН",
- "GeneralAdditionalDeclaration": "КАРАНТИННЫЕ ОБЪЕКТЫ НЕ ОБНАРУЖЕНЫ. СОГЛАСНО ТАБЛИЦЫ ЕДИНЫХ КАРАНТИННЫХ ФИТОСАНИТАРНЫХ ТРЕБОВАНИЙ, ПРЕДЪЯВЛЯЕМЫХ К ПОДКАРАНТИННОЙ ПРОДУКЦИИ И ПОДКАРАНТИННЫМ ОБЪЕКТАМ НА ТАМОЖЕННОЙ ТЕРРИТОРИИ ЕВРАЗИЙСКОГО ЭКОНОМИЧЕСКОГО СОЮЗА (РЕШЕНИЕ СОВЕТА ЕВРАЗИЙСКОЙ ЭКОНОМИЧЕСКОЙ КОМИССИИ ОТ 30.11.2016 ГОДА) №157)",
- "GeneralMandatoryActions": "В соответствии со ст. 32 Федерального Закона 'О карантине растений' № 206-ФЗ от 21.07.2014 г.немедленно извещать федеральный орган исполнительной власти по обеспечению карантина растений о прибытии подкарантинной продукции (подкарантинного материала, подкарантинного груза):",
- "Disinfection": {
- "Date": "0001-01-01T00:00:00",
- "Method": "НЕТ",
- "Chemical": "НЕТ",
- "TemperatureTimes": "НЕТ",
- "Concentration": "НЕТ",
- "AdditionalInfo": "",
- },
- "AdditionalInfo": "Адрес места выдачи: Управление Россельхознадзора по Оренбургской области (56), Управление Федеральной службы по ветеринарному и фитосанитарному надзору по Оренбургской области, г.Оренбург, ул.Монтажников, 34. . Количество мест груза: 180",
- }if valid else {
- 'Date': None,
- }
- class ActMinimumType(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- date = Date.customize(format='%Y-%m-%d', nullable=False)
- number = String.customize(max_length=100, nullable=False)
- blanc = String.customize(max_length=100, nullable=False)
- old_date = Date.customize(format='%Y-%m-%d', nullable=True)
- old_number = String.customize(max_length=100, nullable=True)
- old_blanc = String.customize(max_length=100, nullable=True)
- country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=True)
- issue_place = String.customize(max_length=255, nullable=True)
- inspector = inspector
- inspection_result = String.customize(max_length=255, nullable=False)
- inspection_result_code = Integer.customize(nullable=False)
- inspection_result_report = String.customize(max_length=512, nullable=False)
- inspection_type = String.customize(
- min_occurs=0, max_length=255, nullable=True)
- inspection_type_code = Integer.customize(min_occurs=0, nullable=True)
- @staticmethod
- def generate(valid=True):
- return {
- 'Date': '2022-03-31',
- 'Number': 'UZ33333',
- 'Blanc': 'UZ33333',
- 'OldDate': '0001-01-01',
- 'OldNumber': None,
- 'OldBlanc': None,
- 'CountryCode': 'UZ',
- 'IssuePlace': 'Республика Узбекистан, ',
- 'Inspector': 'Абдуллаев',
- 'InspectionResult': 'ВЫПУСК РАЗРЕШЕН',
- 'InspectionResultCode': 'Абдуллаев',
- 'InspectionResultReport': 'В результате документарной проверки,осмотра транспортных средств,осмотра подкарантинной продукции,досмотра подкарантинной продукции установлено: нарушений не выявлено',
- 'InspectionType': 'Вторичный',
- 'InspectionTypeCode': '2'
- } if valid else {
- 'Date': None,
- 'Number': None,
- 'Blanc': None,
- 'OldDate': None,
- 'OldNumber': None,
- 'OldBlanc': None,
- 'CountryCode': None,
- 'IssuePlace': None,
- 'Inspector': None,
- 'InspectionResult': None,
- 'InspectionResultCode': None,
- 'InspectionResultReport': None,
- 'InspectionType': None,
- 'InspectionTypeCode': None
- }
- class ActMaximumType(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- date = Date.customize(format='%Y-%m-%d', nullable=False)
- number = String.customize(max_length=100, nullable=False)
- blanc = String.customize(max_length=100, nullable=False)
- old_date = Date.customize(format='%Y-%m-%d', nullable=True)
- old_number = String.customize(max_length=100, nullable=True)
- old_blanc = String.customize(max_length=100, nullable=True)
- country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=True)
- issue_place = String.customize(max_length=255, nullable=True)
- inspector = inspector
- inspection_result = String.customize(max_length=255, nullable=False)
- inspection_result_code = Integer.customize(nullable=False)
- inspection_result_report = String.customize(max_length=512, nullable=False)
- inspection_type = String.customize(
- min_occurs=0, max_length=255, nullable=True)
- inspection_type_code = Integer.customize(min_occurs=0, nullable=True)
- certificate = CertificateMaximumType
- expert_opinion_date = Date.customize(
- min_occurs=0, format='%Y-%m-%d', nullable=True)
- expert_opinion_number = String.customize(
- min_occurs=0, max_length=255, nullable=True)
- expert_samples = String.customize(
- min_occurs=0, max_length=512, nullable=True)
- departure_country = String.customize(max_length=100, nullable=False)
- departure_country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=False)
- destination_country = String.customize(max_length=100, nullable=False)
- destination_country_code = String.customize(
- max_length=2, pattern='[A-Z]{2}', nullable=False)
- consignor = Consignor
- consignee = Consignee
- transport = Transport
- general_marking = String.customize(max_length=512, nullable=True)
- general_quarantine_condition = String.customize(
- max_length=512, nullable=True)
- general_base_document = String.customize(max_length=512, nullable=True)
- general_additional_declaration = String.customize(
- max_length=4000, nullable=True)
- general_mandatory_actions = String.customize(max_length=512, nullable=True)
- disinfection = Disinfection
- additional_info = String.customize(max_length=2000, nullable=True)
- annex_doc = String.customize(max_length=100000, nullable=True)
- annex_text = String.customize(max_length=4000, nullable=True)
- class Request1Type(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- certificate = CertificateMinimumType
- status = status
- status_code = status_code
- inspector = inspector
- class Request31Type(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- act = ActMaximumType
- phytosanitary_checkpoint = String.customize(
- min_occurs=0, max_occurs=1, max_length=255)
- phytosanitary_checkpoint_code = Integer.customize(
- min_occurs=0, max_occurs=1)
- status = status
- status_code = status_code
- inspector = inspector
- class Request91Type(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- certificate = CertificateMaximumType
- status = status
- status_code = status_code
- inspector = inspector
- class Response11Type(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- certificate = CertificateMaximumType
- status = status
- status_code = status_code
- inspector = inspector
- class Response12Type(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- certificate = CertificateMinimumType
- status = status
- status_code = status_code
- inspector = inspector
- class Response3Type(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- act = ActMinimumType
- status = status
- status_code = status_code
- inspector = inspector
- class Response91Type(ComplexModel):
- guid = guid
- send_date_time = send_date_time
- certificate = CertificateMinimumType
- status = status
- status_code = status_code
- inspector = inspector
Advertisement
Add Comment
Please, Sign In to add comment