package com.jasamedika.medifirst2000.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.jasamedika.medifirst2000.base.BaseMaster;
import com.jasamedika.medifirst2000.helper.Caption;
import org.hibernate.envers.Audited;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity // @Audited
@Table(name = "JenisKartuDetail_M")
public class JenisKartuDetail extends BaseMaster {
	@Column(name = "nameOnCard", length = 100)
	@Caption(value = "Name On Card")
	private String nameOnCard;

	@Column(name = "cardNumber", length = 100)
	@Caption(value = "Card Number")
	private String cardNumber;

	@ManyToOne
	@JoinColumn(name = "ObjectJenisKartuFk")
	@Caption(value = "Object Jenis Kartu")
	private JenisKartu jenisKartu;

	@Column(name = "ObjectJenisKartuFk", insertable = false, updatable = false)
	private Integer jenisKartuId;

	@Column(name = "cardExpired")
	@Caption(value = "Card Expired")
	private Date cardExpired;

	@Column(name = "securityCode", length = 100)
	@Caption(value = "Security Code")
	private String securityCode;

	@Column(name = "billingAddressAlamat", length = 100)
	@Caption(value = "Billing Address Alamat")
	private String billingAddressAlamat;

	@Column(name = "kodePost", length = 100)
	@Caption(value = "Kode Pos")
	private String kodePost;

	@Column(name = "kecamatan", length = 100)
	@Caption(value = "Kecamatan")
	private String kecamatan;

	@Column(name = "kotaKabupaten", length = 100)
	@Caption(value = "Kecamatan")
	private String kotaKabupaten;

	@Column(name = "propinsi", length = 100)
	@Caption(value = "Kecamatan")
	private String propinsi;

	@ManyToOne
	@JoinColumn(name = "ObjectNegaraFk")
	@Caption(value = "Object Negara")
	private Negara negara;

	@Column(name = "ObjectNegaraFk", insertable = false, updatable = false)
	private Integer negaraiId;

	@Column(name = "emailAddress", length = 100)
	@Caption(value = "Email Address")
	private String emailAddress;

	@Column(name = "phoneNumber", length = 100)
	@Caption(value = "Phone Number")
	private String phoneNumber;

	public String getNameOnCard() {
		return nameOnCard;
	}

	public void setNameOnCard(String nameOnCard) {
		this.nameOnCard = nameOnCard;
	}

	public String getCardNumber() {
		return cardNumber;
	}

	public void setCardNumber(String cardNumber) {
		this.cardNumber = cardNumber;
	}

	public Date getCardExpired() {
		return cardExpired;
	}

	public void setCardExpired(Date cardExpired) {
		this.cardExpired = cardExpired;
	}

	public String getSecurityCode() {
		return securityCode;
	}

	public void setSecurityCode(String securityCode) {
		this.securityCode = securityCode;
	}

	public String getBillingAddressAlamat() {
		return billingAddressAlamat;
	}

	public void setBillingAddressAlamat(String billingAddressAlamat) {
		this.billingAddressAlamat = billingAddressAlamat;
	}

	public String getEmailAddress() {
		return emailAddress;
	}

	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public JenisKartu getJenisKartu() {
		return jenisKartu;
	}

	public void setJenisKartu(JenisKartu jenisKartu) {
		this.jenisKartu = jenisKartu;
	}

	public String getKodePost() {
		return kodePost;
	}

	public void setKodePost(String kodePost) {
		this.kodePost = kodePost;
	}

	public String getKecamatan() {
		return kecamatan;
	}

	public void setKecamatan(String kecamatan) {
		this.kecamatan = kecamatan;
	}

	public String getKotaKabupaten() {
		return kotaKabupaten;
	}

	public void setKotaKabupaten(String kotaKabupaten) {
		this.kotaKabupaten = kotaKabupaten;
	}

	public String getPropinsi() {
		return propinsi;
	}

	public void setPropinsi(String propinsi) {
		this.propinsi = propinsi;
	}

	public Negara getNegara() {
		return negara;
	}

	public void setNegara(Negara negara) {
		this.negara = negara;
	}

	@JsonManagedReference
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "jenisKartuDetail")
	private Set<AntrianPasienRegistrasiDetail> antrianPasienRegistrasiDetails = new HashSet<AntrianPasienRegistrasiDetail>();

	public Set<AntrianPasienRegistrasiDetail> getAntrianPasienRegistrasiDetails() {
		return antrianPasienRegistrasiDetails;
	}

	public void setAntrianPasienRegistrasiDetails(Set<AntrianPasienRegistrasiDetail> antrianPasienRegistrasiDetails) {
		this.antrianPasienRegistrasiDetails = antrianPasienRegistrasiDetails;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "public.jeniskartudetail_m_id_seq")
	@javax.persistence.SequenceGenerator(name = "public.jeniskartudetail_m_id_seq", sequenceName = "public.jeniskartudetail_m_id_seq", allocationSize = 1)
	@Column(name = "id")
	protected Integer id;

	public Integer getId() {

		return id;
	}

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