package oracle.maf.data.entities;

import oracle.adfmf.java.beans.PropertyChangeListener;
import oracle.adfmf.java.beans.PropertyChangeSupport;

public class Customer {
    
    private Integer id = null;
    private String name = null;
    private String phone = null;
    private String address = null;
    private String city  = null;
    private String state = null;
    private Integer countryId = null;
    private String  country = null;
    private String zipCode = null;
    private Integer creditRatingId = null;
    private Integer salesRepId = null;
    private String comments = null;
    private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);


    public Customer() {     
        super();
    }
    
    public Customer(Integer id, String name, String phone, String address, 
                    String city, String state, Integer countryId, String zipCode, 
                    Integer creditRatingId, Integer salesRepId, String comments) {     
        super();
        
        this.id = id;
        this.name = name;
        this.phone = phone;
        this.address =  address;
        this.city =  city;
        this.state = state;
        this.countryId = countryId;
        this.zipCode = zipCode;
        this.creditRatingId = creditRatingId;
        this.salesRepId = salesRepId;
        this.comments = comments;
        
    }


    public void setId(Integer id) {
        Integer oldId = this.id;
        this.id = id;
        propertyChangeSupport.firePropertyChange("id", oldId, id);
    }

    public Integer getId() {
        return id;
    }

    public void setName(String name) {
        String oldName = this.name;
        this.name = name;
        propertyChangeSupport.firePropertyChange("name", oldName, name);
    }

    public String getName() {
        return name;
    }

    public void setPhone(String phone) {
        String oldPhone = this.phone;
        this.phone = phone;
        propertyChangeSupport.firePropertyChange("phone", oldPhone, phone);
    }

    public String getPhone() {
        return phone;
    }

    public void setAddress(String address) {
        String oldAddress = this.address;
        this.address = address;
        propertyChangeSupport.firePropertyChange("address", oldAddress, address);
    }

    public String getAddress() {
        return address;
    }

    public void setCity(String city) {
        String oldCity = this.city;
        this.city = city;
        propertyChangeSupport.firePropertyChange("city", oldCity, city);
    }

    public String getCity() {
        return city;
    }

    public void setState(String state) {
        String oldState = this.state;
        this.state = state;
        propertyChangeSupport.firePropertyChange("state", oldState, state);
    }

    public String getState() {
        return state;
    }

    public void setCountryId(Integer countryId) {
        Integer oldCountryId = this.countryId;
        this.countryId = countryId;
        propertyChangeSupport.firePropertyChange("countryId", oldCountryId, countryId);
    }

    public Integer getCountryId() {
        return countryId;
    }

    public void setZipCode(String zipCode) {
        String oldZipCode = this.zipCode;
        this.zipCode = zipCode;
        propertyChangeSupport.firePropertyChange("zipCode", oldZipCode, zipCode);
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setCreditRatingId(Integer creditRatingId) {
        Integer oldCreditRatingId = this.creditRatingId;
        this.creditRatingId = creditRatingId;
        propertyChangeSupport.firePropertyChange("creditRatingId", oldCreditRatingId, creditRatingId);
    }

    public Integer getCreditRatingId() {
        return creditRatingId;
    }

    public void setSalesRepId(Integer salesRepId) {
        Integer oldSalesRepId = this.salesRepId;
        this.salesRepId = salesRepId;
        propertyChangeSupport.firePropertyChange("salesRepId", oldSalesRepId, salesRepId);
    }

    public Integer getSalesRepId() {
        return salesRepId;
    }

    public void setComments(String comments) {
        String oldComments = this.comments;
        this.comments = comments;
        propertyChangeSupport.firePropertyChange("comments", oldComments, comments);
    }

    public String getComments() {
        return comments;
    }

    public void addPropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.addPropertyChangeListener(l);
    }

    public void removePropertyChangeListener(PropertyChangeListener l) {
        propertyChangeSupport.removePropertyChangeListener(l);
    }


    public void setCountry(String country) {
        this.country = country;
    }

    public String getCountry() {
        return country;
    }
}
