package com.jh.radegast.model;

import java.util.Locale;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jh.common.i18n.I18nContext;
import com.jh.common.jpa.AbstractIdEntity;


/**
 * The Class Unit.
 */
@Entity
@Table(name = "UNIT")
public class Unit extends AbstractIdEntity implements I18nContext {

    /** The Constant UNIT_KEY. */
    public static final String UNIT_KEY = "_unit";
    
    /** The version. */
    @Column(name = "VERSION")
    @Version
    private Long version;
    
    /** The deleted. */
    @Column(name = "DELETED")
    private Boolean deleted;
    
    /** The owner id. */
    @Column(name = "OWNER_ID")
    private Long ownerId;

    /** The name. */
    @Column(name = "NAME")
    private String name;
    
    /** The timezone. */
    @Column(name = "TIMEZONE")
    private String timezone;
    
    /** The locale. */
    @Column(name = "LOCALE")
    private String locale;
    
    /** The decimal precission. */
    @Column(name = "DECIMAL_PRECISSION")
    private Integer decimalPrecission;
    
    /** The rounding precission. */
    @Column(name = "ROUNDING_PRECISSION")
    private Integer roundingPrecission;
    
    /** The invoice sequence type. */
    @Column(name = "INVOICE_SEQUENCE_TYPE")
    private String invoiceSequenceType;
    
    /** The currency. */
    @Column(name = "CURRENCY")
    private String currency;
    
    /** The currency symbol. */
    @Column(name = "CURRENCY_SYMBOL")
    private String currencySymbol;
    
    /** The date format. */
    @Column(name = "DATE_FORMAT")
    private String dateFormat;
    
    /** The currency format. */
    @Column(name = "CURRENCY_FORMAT")
    private String currencyFormat;
    
    /** The thousand delimiter. */
    @Column(name = "THOUSAND_DELIMITER")
    private String thousandDelimiter;
    
    /** The decimal delimiter. */
    @Column(name = "DECIMAL_DELIMITER")
    private String decimalDelimiter;

    /** The initialized. */
    @Column(name = "initialized")
    private Boolean initialized;
    
    /** The resolved locale. */
    @Transient
    @JsonIgnore
    private Locale resolvedLocale;
    

    /**
	 * Instantiates a new unit.
	 */
	public Unit() {
		super();
	}

	/**
	 * Instantiates a new unit.
	 *
	 * @param id the id
	 */
	public Unit(Long id) {
		super();
		setId(id);
	}

	public Long getVersion() {
		return version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}

	public Boolean getDeleted() {
		return deleted;
	}

	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}

	public Long getOwnerId() {
		return ownerId;
	}

	public void setOwnerId(Long ownerId) {
		this.ownerId = ownerId;
	}

	public String getName() {
		return name;
	}

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

	public String getTimezone() {
		return timezone;
	}

	public void setTimezone(String timezone) {
		this.timezone = timezone;
	}

	public String getLocale() {
		return locale;
	}

	public void setLocale(String locale) {
		this.locale = locale;
	}

	public Integer getDecimalPrecission() {
		return decimalPrecission;
	}

	public void setDecimalPrecission(Integer decimalPrecission) {
		this.decimalPrecission = decimalPrecission;
	}

	public Integer getRoundingPrecission() {
		return roundingPrecission;
	}

	public void setRoundingPrecission(Integer roundingPrecission) {
		this.roundingPrecission = roundingPrecission;
	}

	public String getInvoiceSequenceType() {
		return invoiceSequenceType;
	}

	public void setInvoiceSequenceType(String invoiceSequenceType) {
		this.invoiceSequenceType = invoiceSequenceType;
	}

	public String getCurrency() {
		return currency;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public String getCurrencySymbol() {
		return currencySymbol;
	}

	public void setCurrencySymbol(String currencySymbol) {
		this.currencySymbol = currencySymbol;
	}

	public String getDateFormat() {
		return dateFormat;
	}

	public void setDateFormat(String dateFormat) {
		this.dateFormat = dateFormat;
	}

	public String getCurrencyFormat() {
		return currencyFormat;
	}

	public void setCurrencyFormat(String currencyFormat) {
		this.currencyFormat = currencyFormat;
	}

	public String getThousandDelimiter() {
		return thousandDelimiter;
	}

	public void setThousandDelimiter(String thousandDelimiter) {
		this.thousandDelimiter = thousandDelimiter;
	}

	public String getDecimalDelimiter() {
		return decimalDelimiter;
	}

	public void setDecimalDelimiter(String decimalDelimiter) {
		this.decimalDelimiter = decimalDelimiter;
	}

	public Boolean getInitialized() {
		return initialized;
	}

	public void setInitialized(Boolean initialized) {
		this.initialized = initialized;
	}

	public Locale getResolvedLocale() {
		return resolvedLocale;
	}

	public void setResolvedLocale(Locale resolvedLocale) {
		this.resolvedLocale = resolvedLocale;
	}

	public static String getUnitKey() {
		return UNIT_KEY;
	}

	
}
