
package ge.mziuri.model;

import ge.mziuri.enums.Category;
import ge.mziuri.enums.Type;
import java.util.ArrayList;
import java.util.Date;


public class Event {
    
    private int id;
    private String name;
    private String desc;
    private Date date;
    private double price;
    private Category category;
    private Type type;
    private int places;
    private ArrayList availablePlaces;
    private int views;
    private User owner;

    public Event() {
        
    }

    public Event(int id, String name, String desc, Date date, double price,
            Category category, Type type, int places, int views, User owner) {
        this.id = id;
        this.name = name;
        this.desc = desc;
        this.date = date;
        this.price = price;
        this.category = category;
        this.type = type;
        this.places = places;
        availablePlaces = new ArrayList<>();
        this.views = views;
        this.owner = owner;
    }

    
    public String getName() {
        return name;
    }

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

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public int getPlaces() {
        return places;
    }

    public void setPlaces(int places) {
        this.places = places;
    }

    public User getOwner() {
        return owner;
    }

    public void setOwner(User owner) {
        this.owner = owner;
    }

    
    public int getId() {
        return id;
    }

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

    
    public ArrayList<Integer> getAvailablePlaces() {
        return availablePlaces;
    }

    
    public void setAvailablePlaces(ArrayList<Integer> availablePlaces) {
        this.availablePlaces = availablePlaces;
    }
    
    public int getViews() {
        return views;
    }

    
    public void setViews(int views) {
        this.views = views;
    }
    
    @Override
    public String toString() {
        return id + " " + name + " " + desc + " " + date.toString() + " " + price + " " + category + 
                " " + type + " " + places + " " + owner.getUsername();
    }

    
}

@@ -2600,16 +2600,24 @@
 turn
+ %22id:%22 +
  id + %22 
 %22 + 
@@ -2608,24 +2608,29 @@
 :%22 + id + %22 
+name:
 %22 + name + %22
@@ -2626,24 +2626,36 @@
  + name + %22 
+description:
 %22 + desc + %22
@@ -2651,24 +2651,29 @@
  + desc + %22 
+date:
 %22 + date.toS
@@ -2680,24 +2680,30 @@
 tring() + %22 
+price:
 %22 + price + 
@@ -2700,24 +2700,33 @@
 + price + %22 
+category:
 %22 + category
@@ -2747,16 +2747,21 @@
       %22 
+type:
 %22 + type
@@ -2761,24 +2761,30 @@
  + type + %22 
+seats:
 %22 + places +
@@ -2786,16 +2786,30 @@
 ces + %22 
+owner username
 %22 + owne
@@ -2823,16 +2823,36 @@
 ername()
+ + %22views: %22 + views
 ;%0A    %7D%0A

improve toString method