# -*- coding: utf-8 -*-
from ppms.migration import SQLPacket, PacketCategory, MaxVersionDependency, VersionType, PacketDependency, PacketState

PACKET_PATH = 'migration.hotfix.S_39_5_4.wi11533_port_universal_interface_VoE.PortCustomizingUniversalInterface'


class PortSanityDialogMessage(SQLPacket):
    """Port a new dialog message from Venus to VoE"""
    done_after_success = True
    run_on_startup = True
    category = PacketCategory.CATEGORY_MANDATORY
    wi_number = 13297

    FILENAME = 'wi13297_question_sanity.sql'

    def get_dependencies(self):
        return (PacketDependency(packet_path=PACKET_PATH, expected_state=PacketState.INSTALLED),
                MaxVersionDependency(version='39.5.3', version_type=VersionType.CUSTOMIZING))

    def fix(self, runner):
        self.apply_dml_file(self.sql_planta_de_dbms, self.FILENAME)

        return self.success()