package com.rit.ems.model;

import jakarta.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Entity
@Table(name = "ems_users")
public class User {
    @Id
    private Long id;

    @Column(unique = true, nullable = false)
    private String email;

    private String password;
    
    @Column(name = "full_name")
    private String fullName;
    
    private String role;
    
    private String department;

    @Column(name = "is_club_coordinator")
    private Boolean isClubCoordinator = false;

    @Column(name = "is_placement_staff")
    private Boolean isPlacementStaff = false;

    @Column(name = "is_class_incharge")
    private Boolean isClassIncharge = false;

    @Column(name = "class_strength")
    private Integer classStrength = 0;

    @Column(name = "incharge_class")
    private String inchargeClass;

    @Column(name = "incharge_batch")
    private String inchargeBatch;

    @Column(name = "incharge_section")
    private String inchargeSection;

    private String year;
    private String section;

    @Column(name = "reg_no")
    private String regNo;

    private String phone;
    private String gender;

    @Column(name = "college_name")
    private String collegeName;

    @ElementCollection(fetch = FetchType.EAGER)
    @CollectionTable(name = "ems_user_assigned_clubs", joinColumns = @JoinColumn(name = "user_id"))
    @Column(name = "club_name")
    private List<String> assignedClubs = new ArrayList<>();

    public User() {}

    public User(Long id, String email, String password, String fullName, String role, String department, Boolean isClubCoordinator, Boolean isPlacementStaff, Boolean isClassIncharge, Integer classStrength, String inchargeClass, String inchargeBatch, String inchargeSection, String year, String section, String regNo, String phone, String gender, String collegeName, List<String> assignedClubs) {
        this.id = id;
        this.email = email;
        this.password = password;
        this.fullName = fullName;
        this.role = role;
        this.department = department;
        this.isClubCoordinator = isClubCoordinator;
        this.isPlacementStaff = isPlacementStaff;
        this.isClassIncharge = isClassIncharge;
        this.classStrength = classStrength;
        this.inchargeClass = inchargeClass;
        this.inchargeBatch = inchargeBatch;
        this.inchargeSection = inchargeSection;
        this.year = year;
        this.section = section;
        this.regNo = regNo;
        this.phone = phone;
        this.gender = gender;
        this.collegeName = collegeName;
        this.assignedClubs = assignedClubs;
    }

    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }

    public String getPassword() { return password; }
    public void setPassword(String password) { this.password = password; }

    public String getFullName() { return fullName; }
    public void setFullName(String fullName) { this.fullName = fullName; }

    public String getRole() { return role; }
    public void setRole(String role) { this.role = role; }

    public String getDepartment() { return department; }
    public void setDepartment(String department) { this.department = department; }

    public Boolean getIsClubCoordinator() { return isClubCoordinator; }
    public void setIsClubCoordinator(Boolean isClubCoordinator) { this.isClubCoordinator = isClubCoordinator; }

    public Boolean getIsPlacementStaff() { return isPlacementStaff; }
    public void setIsPlacementStaff(Boolean isPlacementStaff) { this.isPlacementStaff = isPlacementStaff; }

    public Boolean getIsClassIncharge() { return isClassIncharge; }
    public void setIsClassIncharge(Boolean isClassIncharge) { this.isClassIncharge = isClassIncharge; }

    public Integer getClassStrength() { return classStrength; }
    public void setClassStrength(Integer classStrength) { this.classStrength = classStrength; }

    public String getInchargeClass() { return inchargeClass; }
    public void setInchargeClass(String inchargeClass) { this.inchargeClass = inchargeClass; }

    public String getInchargeBatch() { return inchargeBatch; }
    public void setInchargeBatch(String inchargeBatch) { this.inchargeBatch = inchargeBatch; }

    public String getInchargeSection() { return inchargeSection; }
    public void setInchargeSection(String inchargeSection) { this.inchargeSection = inchargeSection; }

    public String getYear() { return year; }
    public void setYear(String year) { this.year = year; }

    public String getSection() { return section; }
    public void setSection(String section) { this.section = section; }

    public String getRegNo() { return regNo; }
    public void setRegNo(String regNo) { this.regNo = regNo; }

    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }

    public String getGender() { return gender; }
    public void setGender(String gender) { this.gender = gender; }

    public String getCollegeName() { return collegeName; }
    public void setCollegeName(String collegeName) { this.collegeName = collegeName; }

    public List<String> getAssignedClubs() { return assignedClubs; }
    public void setAssignedClubs(List<String> assignedClubs) { this.assignedClubs = assignedClubs; }
}
