# -*- coding: utf-8 -*-
from marshmallow import Schema, fields


class HidrocantabricoSchema(Schema):
    ref = fields.String(description="Punto de suministro", position=0, length=10)
    name = fields.String(description="CUPS", position=1, length=22)
    distri = fields.String(description="Empresa distribuidora", position=2, length=50)
    cod_distri = fields.String(description="Codigo distribuidora", position=3, length=4)
    direccio = fields.String(description="Ubicación PS", position=4, length=81)
    poblacio = fields.String(description="Población", position=5, length=8)
    codi_postal = fields.String(description="Codigo Postal", position=6, length=5)
    provincia = fields.String(description="Provincia", position=7, length=2)
    data_alta = fields.String(description="Fecha de alta", position=8, length=8)
    tarifa = fields.String(description="Tarifa en vigor", position=9, length=5)
    tensio = fields.String(description="Tensión", position=10, length=10)
    pot_max_bie = fields.String(description="Potencia Máxima Boletín", position=11, length=10)
    pot_max_puesta = fields.String(description="Potencia Máxima APM", position=12, length=10)
    tipo_pm = fields.String(description="Tipo Punto Medida", position=13, length=2)
    indicatiu_icp = fields.String(description="Disponibilidad ICP", position=14, length=1)
    perfil_consum = fields.String(description="Tipo Perfil Consumo", position=15, length=1)
    der_extensio = fields.String(description="Derechos Extensión", position=16, length=10)
    der_acces_llano = fields.String(description="Derechos Acceso", position=17, length=10)
    propietat_equip_mesura = fields.String(description="Propiedad Equipo Medida", position=18, length=1)
    propietat_icp = fields.String(description="Propiedad ICP", position=19, length=1)
    pot_cont_p1 = fields.String(description="Potencias Contratada 1", position=20, length=10)
    pot_cont_p2 = fields.String(description="Potencias Contratada 2", position=21, length=10)
    pot_cont_p3 = fields.String(description="Potencias Contratada 3", position=22, length=10)
    pot_cont_p4 = fields.String(description="Potencias Contratada 4", position=23, length=10)
    pot_cont_p5 = fields.String(description="Potencias Contratada 5", position=24, length=10)
    pot_cont_p6 = fields.String(description="Potencias Contratada 6", position=25, length=10)
    potencias_contratada_7 = fields.String(description="Potencias Contratada 7", position=26, length=10)
    data_ulti_mov = fields.String(description="Fecha Ultimo Movimiento de Contratacion", position=27, length=8)
    data_ult_canv = fields.String(description="Fecha Ultimo Cambio de Comercializador", position=28, length=8)
    data_lim_exten = fields.String(description="Fecha límite derechos extensión", position=29, length=8)
    fecha_ultima_lectura = fields.String(description="Fecha ultima lectura", position=30, length=8)
    persona_fj = fields.String(description="Tipo de interlocutor", position=31, length=1)
    nombre_ic = fields.String(description="Nombre IC", position=32, length=80)
    ubicacion_ic = fields.String(description="Ubicación IC", position=33, length=81)
    poblacion_ic = fields.String(description="Población IC", position=34, length=12)
    codigo_postal = fields.String(description="Código postal", position=35, length=10)
    provincia_ = fields.String(description="Provincia", position=36, length=3)
    primera_vivenda = fields.String(description="vivienda habitual", position=37, length=1)
    fianza = fields.String(description="Depósito garantía", position=38, length=13)
    deuda = fields.String(description="Deuda", position=39, length=1)


class HidrocantabricoMeasuresSchema(Schema):
    name = fields.String(description="Suministro", position=0, length=10)
    fecha_inicio = fields.String(description="Fecha inicio", position=1, length=8)
    data_final = fields.String(description="Fecha fin", position=2, length=8)
    tarifa = fields.String(description="Tarifa", position=3, length=5)
    dh = fields.String(description="DH", position=4, length=1)
    activa_1 = fields.String(description="Activa 1", position=5, length=12)
    signo_a1 = fields.String(description="Signo", position=6, length=1)
    activa_2 = fields.String(description="Activa 2", position=7, length=12)
    signo_a2 = fields.String(description="Signo", position=8, length=1)
    activa_3 = fields.String(description="Activa 3", position=9, length=12)
    signo_a3 = fields.String(description="Signo", position=10, length=1)
    activa_4 = fields.String(description="Activa 4", position=11, length=12)
    signo_a4 = fields.String(description="Signo", position=12, length=1)
    activa_5 = fields.String(description="Activa 5", position=13, length=12)
    signo_a5 = fields.String(description="Signo", position=14, length=1)
    activa_6 = fields.String(description="Activa 6", position=15, length=12)
    signo_a6 = fields.String(description="Signo", position=16, length=1)
    activa_7 = fields.String(description="Activa 7", position=17, length=12)
    signo_a7 = fields.String(description="Signo", position=18, length=1)
    reactiva_1 = fields.String(description="Reactiva 1", position=19, length=12)
    signo_r1 = fields.String(description="Signo", position=20, length=1)
    reactiva_2 = fields.String(description="Reactiva 2", position=21, length=12)
    signo_r2 = fields.String(description="Signo", position=22, length=1)
    reactiva_3 = fields.String(description="Reactiva 3", position=23, length=12)
    signo_r3 = fields.String(description="Signo", position=24, length=1)
    reactiva_4 = fields.String(description="Reactiva 4", position=25, length=12)
    signo_r4 = fields.String(description="Signo", position=26, length=1)
    reactiva_5 = fields.String(description="Reactiva 5", position=27, length=12)
    signo_r5 = fields.String(description="Signo", position=28, length=1)
    reactiva_6 = fields.String(description="Reactiva 6", position=29, length=12)
    signo_r6 = fields.String(description="Signo", position=30, length=1)
    reactiva_7 = fields.String(description="Reactiva 7", position=31, length=12)
    signo_r7 = fields.String(description="Signo", position=32, length=1)
    potencia_1 = fields.String(description="Potencia 1", position=33, length=10)
    signo_p1 = fields.String(description="Signo", position=34, length=1)
    potencia_2 = fields.String(description="Potencia 2", position=35, length=10)
    signo_p2 = fields.String(description="Signo", position=36, length=1)
    potencia_3 = fields.String(description="Potencia 3", position=37, length=10)
    signo_p3 = fields.String(description="Signo", position=38, length=1)
    potencia_4 = fields.String(description="Potencia 4", position=39, length=10)
    signo_p4 = fields.String(description="Signo", position=40, length=1)
    potencia_5 = fields.String(description="Potencia 5", position=41, length=10)
    signo_p5 = fields.String(description="Signo", position=42, length=1)
    potencia_6 = fields.String(description="Potencia 6", position=43, length=10)
    signo_p6 = fields.String(description="Signo", position=44, length=1)
    potencia_7 = fields.String(description="Potencia 7", position=45, length=10)
    signo_p7 = fields.String(description="Signo", position=46, length=1)