from django.db import models

class Megrendeles(models.Model):
    azonosito = models.CharField("Azonosító", max_length=10, unique=True)
    megrendeloNeve = models.CharField("Megrendelő neve", max_length=100)
    megrendeloTelSzam = models.CharField(default="", max_length=30)
    ingatlanIrszam = models.IntegerField()
    ingatlanVaros = models.CharField("Ingatlan város", max_length=100)
    ingatlanCim = models.CharField("Ingatlan Cím", max_length=100)
    felmeresNapja = models.DateField(blank=True, null=True)
    felmeresIdopontja = models.TimeField(blank=True, null=True)
    felmeresDija = models.IntegerField()
    
    def __str__(self):
        return self.azonosito

class Iranyitoszam(models.Model):
    irSzam = models.IntegerField()
    varos = models.CharField(max_length=100, unique=True)

    def __str__(self):
        return self.varos
    
class Felmeres(models.Model):
    megrendeles = models.OneToOneField(Megrendeles, on_delete=models.CASCADE)
    azonosito = models.CharField("Azonosító", max_length=10, unique=True)
    telSzamFutar = models.CharField(max_length=15, blank=True)
    szla = models.CharField(max_length=1, default="0")
    hRSZ = models.CharField("Helyrajzi szám", max_length=15, blank=True)
    megrendeloIrszam = models.CharField(max_length=5, blank=True)
    megrendeloVaros = models.CharField(max_length=100, blank=True)
    megrendeloCim = models.CharField(max_length=100, blank=True)
    szallitasiIrszam = models.CharField(max_length=5, blank=True)
    szallitasiVaros = models.CharField(max_length=100, blank=True)
    szallitasiCim = models.CharField(max_length=100, blank=True)
    sMSTelSzam = models.CharField(max_length=15, blank=True)
    bmPince = models.CharField(max_length=20, default="---")
    bmFsz = models.CharField(max_length=20, default="---")
    bmEmelet = models.CharField(max_length=20, default="---")
    teruletPince = models.CharField(max_length=20, default="---")
    teruletFsz = models.CharField(max_length=20, default="---")
    teruletEmelet = models.CharField(max_length=20, default="---")
    padloHoszig = models.CharField(max_length=20, default="0")
    padloFutott = models.BooleanField(default=False)
    padloFutetlenPince = models.BooleanField(default=False)
    padloFutetlen = models.BooleanField(default=False)
    padloAnyagFa = models.BooleanField(default=False)
    padloAnyagBeton = models.BooleanField(default=False)
    padloAnyagAcel = models.BooleanField(default=False)
    padloAnyagTegla = models.BooleanField(default=False)
    fodemHoszig = models.CharField(max_length=20, default="0")
    fodemFutott = models.BooleanField(default=False)
    fodemFutetlenPadlas = models.BooleanField(default=False)
    fodemFutetlen = models.BooleanField(default=False)
    fodemAnyagFa = models.BooleanField(default=False)
    fodemAnyagBeton = models.BooleanField(default=False)
    fodemAnyagAcel = models.BooleanField(default=False)
    fodemAnyagTegla = models.BooleanField(default=False)
    futesHelyeKivul = models.BooleanField(default=False)
    futesHelyeBelul = models.BooleanField(default=False)
    futes = models.CharField(max_length=200, blank=True)
    melegVizHelyeKivul = models.BooleanField(default=False)
    melegVizHelyeBelul = models.BooleanField(default=False)
    melegViz = models.CharField(max_length=200, blank=True)
    epitesEve = models.CharField(max_length=30, blank=True)
    hoszig = models.CharField(max_length=40, default="0")
    fal = models.CharField(max_length=100, blank=True)
    teruletTulLap = models.CharField(max_length=20, default="---")
    szK = models.CharField(max_length=10, default="---")
    a = models.CharField(max_length=10, default="---")
    v = models.CharField(max_length=10, default="---")
    u = models.CharField(max_length=10, blank=True)
    nyilasZBeepites = models.CharField(max_length=30, blank=True)
    nyilasZUj = models.BooleanField(default=False)
    nyilasZRegi =models.BooleanField(default=False)
    nyilasZ1x = models.BooleanField(default=False)
    nyilasZ2x = models.BooleanField(default=False)
    nyilasZ3x = models.BooleanField(default=False)
    nyilasZ4x = models.BooleanField(default=False)
    nyilasZFa = models.BooleanField(default=False)
    nyilasZPVC = models.BooleanField(default=False)
    nyilasZFem = models.BooleanField(default=False)
    ajtoUveg = models.CharField(max_length=10, default="---")
    ajtoUj = models.BooleanField(default=False)
    ajtoRegi =models.BooleanField(default=False)
    ajto1x = models.BooleanField(default=False)
    ajto2x = models.BooleanField(default=False)
    ajto3x = models.BooleanField(default=False)
    ajto4x = models.BooleanField(default=False)
    ajtoFa = models.BooleanField(default=False)
    ajtoPVC = models.BooleanField(default=False)
    ajtoFem = models.BooleanField(default=False)
    
    def __str__(self):
        return self.azonosito