package cn.com.qmth.stmms.ms.core.domain;

import cn.com.qmth.stmms.ms.core.domain.user.MarkUser;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *机构
 */
@Entity
public class Organization implements Serializable{

    @Id
    @GeneratedValue
    private Long id;

    private String name;

    private String abbreviation;

    private boolean enabled;

    @Temporal(value = TemporalType.DATE)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createdOn;

    @Transient
    private List<MarkUser> markUsers = new ArrayList<>();

    public Long getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAbbreviation() {
        return abbreviation;
    }

    public void setAbbreviation(String abbreviation) {
        this.abbreviation = abbreviation;
    }

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public Date getCreatedOn() {
        return createdOn;
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = createdOn;
    }

    public List<MarkUser> getMarkUsers() {
        return markUsers;
    }

    public void setMarkUsers(List<MarkUser> markUsers) {
        this.markUsers = markUsers;
    }
}
