Example #1
0
class M1(C2):
    """Classe que implementa M1."""

    steps_T = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Naturaldays(30)),
        DeadLine('05', Workdays(1)),
        DeadLine('06', Workdays(5)),
    ]

    steps_S = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(5)),
        DeadLine('06', Workdays(5)),
    ]
    steps_A = steps_S
    steps_C = steps_S

    steps_P = steps_T

    steps = steps_T

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        else:
            return False
Example #2
0
class A3(C2):
    """Clase que implementa A3."""

    steps = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Naturaldays(30)),
        DeadLine('05', Workdays(1)),
        DeadLine('06', Workdays(5)),
    ]
Example #3
0
class R1(C2):
    """Clase que implementa R1."""

    steps = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(15)),
        DeadLine('03', Naturaldays(20)),
    ]

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        else:
            return False

    @property
    def variables_detalle_reclamacion(self):
        tree = '{0}.VariablesDetalleReclamacion'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        data = []
        if obj not in [None, False] and hasattr(obj, "VariableDetalleReclamacion"):
            for i in obj.VariableDetalleReclamacion:
                data.append(VariableDetalleReclamacion(i))
            return data
        return data

    @property
    def tipo_reclamante(self):
        tree = '{0}.TipoReclamante'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def reclamante(self):
        tree = '{0}.Reclamante'.format(self._header)
        cli = get_rec_attr(self.obj, tree, False)
        if cli not in [None, False]:
            return Reclamante(cli)
        else:
            return False

    # Datos paso 02 aceptacion
    @property
    def datos_aceptacion(self):
        tree = '{0}.DatosAceptacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosAceptacion(data)
        else:
            return False

    # Datos paso 03
    @property
    def datos_informacion(self):
        tree = '{0}.DatosInformacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosInformacion(data)
        else:
            return False

    @property
    def informacion_intermedia(self):
        tree = '{0}.InformacionIntermedia'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return InformacionIntermedia(data)
        else:
            return False

    @property
    def retipificacion(self):
        tree = '{0}.Retipificacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return Retipificacion(data)
        else:
            return False

    @property
    def solicitudes_informacion_adicional(self):
        data = []
        tree = '{0}.SolicitudesInformacionAdicional'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        if obj:
            sol = get_rec_attr(obj, 'SolicitudInformacionAdicional', False)
            if sol:
                for d in sol:
                    data.append(SolicitudInformacionAdicional(d))
        return data

    @property
    def solicitud_informacion_adicional_para_retipificacion(self):
        tree = '{0}.SolicitudesInformacionAdicional.SolicitudInformacionAdicionalParaRetipificacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return SolicitudInformacionAdicionalParaRetipificacion(data)
        else:
            return False

    # Datos paso 04
    @property
    def datos_envio_informacion(self):
        tree = '{0}.DatosEnvioInformacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DatosEnvioInformacion(data)
        else:
            return False

    @property
    def variables_aportacion_informacion(self):
        data = []
        tree = '{0}.VariablesAportacionInformacion'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        if obj:
            for d in obj.VariableAportacionInformacion:
                data.append(VariableAportacionInformacion(d))
        return data

    @property
    def variables_aportacion_informacion_para_retipificacion(self):
        data = []
        tree = '{0}.VariablesAportacionInformacionParaRetipificacion'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        if obj:
            for d in obj.VariableAportacionInformacionParaRetipificacion:
                data.append(VariableDetalleReclamacion(d))
        return data

    # Datos paso 5
    @property
    def datos_cierre(self):
        tree = '{0}.DatosCierre'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosCierre(sol)
        else:
            return False

    @property
    def cod_contrato(self):
        tree = '{0}.CodContrato'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol:
            return sol.text
        else:
            return False

    # Campos Minimos
    def get_subtypes(self):
        r1_type = self.datos_solicitud.tipo
        return [x['code'] for x in SUBTYPES_R101 if x['type'] == r1_type]

    def get_type_from_subtype(self):
        r1_subtype = self.datos_solicitud.subtipo
        for x in SUBTYPES_R101:
            if x['code'] == r1_subtype:
                return x['type']
        return []

    def get_minimum_fields(self):
        subtype = self.datos_solicitud.subtipo
        for x in SUBTYPES_R101:
            if x['code'] == subtype:
                return x['min_fields']
        return []

    def check_minimum_fields(self):
        checker = MinimumFieldsChecker(self)
        return checker.check()
Example #4
0
class C2(C1):
    """Clase que implementa C2."""

    steps = [
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Naturaldays(30)),
        DeadLine('05', Workdays(1)),
        DeadLine('06', Workdays(1)),
        DeadLine('08', Workdays(5))
    ]

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        return False

    @property
    def cliente(self):
        tree = '{0}.Cliente'.format(self._header)
        cli = get_rec_attr(self.obj, tree, False)
        if cli not in [None, False]:
            return Cliente(cli)
        else:
            return False

    @property
    def contrato(self):
        tree = '{0}.Contrato'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return Contrato(data)
        else:
            return False

    @property
    def medida(self):
        tree = '{0}.Medida'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return Medida(data)
        else:
            return False

    @property
    def doc_tecnica(self):
        tree = '{0}.DocTecnica'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data not in [None, False]:
            return DocTecnica(data)
        else:
            return False

    # Datos Paso 03
    @property
    def fecha_prevista_accion(self):
        tree = '{0}.FechaPrevistaAccion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def fecha_incidencia(self):
        tree = '{0}.FechaIncidencia'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def incidencias(self):
        tree = '{0}.Incidencia'.format(self._header)
        obj = get_rec_attr(self.obj, tree, False)
        data = []
        if obj not in [None, False]:
            for i in obj:
                data.append(Incidencia(i))
            return data
        return data
Example #5
0
class B1(C2):
    """Classe que implementa B1."""

    steps_01 = [
        DeadLine('00', Workdays(-5)),
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Workdays(5)),
        DeadLine('05', Workdays(1)),
    ]

    steps_02 = [
        DeadLine('00', Workdays(-15)),
        DeadLine('01', Workdays(5)),
        DeadLine('02', Workdays(1)),
        DeadLine('03', Workdays(5)),
        DeadLine('05', Workdays(1)),
    ]

    steps_03 = [
        DeadLine('02', Naturaldays(60)),
        DeadLine('03', Workdays(1)),
        DeadLine('05', Naturaldays(60)),
    ]

    steps_04 = steps_01

    steps = steps_01

    # Datos paso 01
    @property
    def datos_solicitud(self):
        tree = '{0}.DatosSolicitud'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosSolicitud(sol)
        else:
            return False

    @property
    def iban(self):
        tree = '{0}.IBAN'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    @property
    def contacto(self):
        tree = '{0}.Contacto'.format(self._header)
        cli = get_rec_attr(self.obj, tree, False)
        if cli not in [None, False]:
            return Contacto(cli)
        else:
            return False

    # Datos paso 02
    @property
    def datos_aceptacion(self):
        tree = '{0}.DatosAceptacion'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosAceptacion(sol)
        else:
            return False

    # Datos paso 04
    @property
    def hora_aceptacion(self):
        tree = '{0}.HoraAceptacion'.format(self._header)
        data = get_rec_attr(self.obj, tree, False)
        if data:
            return data.text
        else:
            return False

    # Datos paso 05
    @property
    def datos_activacion_baja(self):
        tree = '{0}.DatosActivacionBaja'.format(self._header)
        sol = get_rec_attr(self.obj, tree, False)
        if sol not in [None, False]:
            return DatosActivacionBaja(sol)
        else:
            return False