package de.oaa.xxx.user;

import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.time.Period;
import java.util.List;
import java.util.UUID;

@Getter
@Setter
public class User {

    private UUID userId;
    private String name;
    private String email;
    private String password;
    private boolean admin;
    private String profilePicture;
    private LocalDate geburtsdatum;
    private Integer groesse;
    private Integer gewicht;
    private Geschlecht geschlecht;
    private Neigung neigung;
    private Beziehungsstatus beziehungsstatus;
    private String beschreibung;
    private boolean datingAktiv;
    private String datingStadt;
    private Double datingLat;
    private Double datingLon;
    private List<String> datingGeschlechter;
    private Integer datingMaxDistanzKm;
    private Integer datingMinAlter;
    private Integer datingMaxAlter;
    private String filterCity;
    private Double filterLat;
    private Double filterLon;
    private Integer filterMaxDistKm;

    public Integer getAlter() {
        return geburtsdatum != null ? Period.between(geburtsdatum, LocalDate.now()).getYears() : null;
    }

    @Override
    public String toString() {
        return "User[userId=" + userId + ", name=" + name + ", email=" + email + "]";
    }
}
