package de.assecutor.votianlt.model;

import lombok.Data;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.index.Indexed;

import java.time.LocalDateTime;
import java.util.Set;

@Data
@Document(collection = "users")
public class User {

    @Id
    private ObjectId id;

    private int usrId;
    private String title;
    private String name; // Nachname
    private String firstname; // Vorname

    // Firmen-/Adressdaten
    private String company; // Firma
    private String street; // Straße
    private String houseNumber; // Hausnr
    private String addressAddition; // Adresszusatz (optional)
    private String zip; // Postleitzahl
    private String city; // Stadt

    @Indexed(unique = true)
    private String email;

    private String phone;
    private String phone2;
    private String fax;
    private String password;
    private byte isActivated;
    private byte isEmailConfirmed;
    private String passwordCode;
    private LocalDateTime passwordTimestamp;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    private Set<String> roles;
}