package net.shyshkin.study.fullstack.supportportal.backend.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;
import org.hibernate.annotations.Type;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;



@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
@Builder
public class Professor implements Serializable {

    private static final long serialVersionUID = -4372214856545239049L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    // @EqualsAndHashCode.Include
    // @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Long id;

    @Type(type = "org.hibernate.type.UUIDCharType")
    @Column(length = 36, columnDefinition = "varchar(36)", updatable = false, nullable = false)
    private UUID professorId;

    private String firstName;
    private String lastName;
    private String email;
    private String department;
    private String position;
    private String officeLocation;
    private LocalDateTime joinDate;
    private String profileImageUrl;

    @Enumerated(EnumType.STRING)
    private WorkingStatus status; // Use enum to track detailed working status


    @ManyToMany(mappedBy = "professors")
    @JsonIgnore
    private List<Post> posts;

}
