package com.ibtp.kontor.comics.entity;

import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;
import org.mongodb.morphia.annotations.Property;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by thomas on 01.03.16.
 */
@Entity("comic")
public class Comic {

    @Id
    private ObjectId id;

    @Property
    private String title;

    @Property
    private ObjectId publisher;

    @Property
    private Boolean current_order;

    @Property
    private Boolean completed;

    @Property
    private List<Issue> issues = new ArrayList<Issue>();

    @Property
    private List<StoryArc> stories = new ArrayList<StoryArc>();

    public ObjectId getId() {
        return id;
    }

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

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public ObjectId getPublisher() {
        return publisher;
    }

    public void setPublisher(ObjectId publisher) {
        this.publisher = publisher;
    }

    public Boolean getCurrent_order() {
        return current_order;
    }

    public void setCurrent_order(Boolean current_order) {
        this.current_order = current_order;
    }

    public Boolean getCompleted() {
        return completed;
    }

    public void setCompleted(Boolean completed) {
        this.completed = completed;
    }

    public List<Issue> getIssues() {
        return issues;
    }

    public void setIssues(List<Issue> issues) {
        this.issues = issues;
    }

    public List<StoryArc> getStories() {
        return stories;
    }

    public void setStories(List<StoryArc> stories) {
        this.stories = stories;
    }

    @Override
    public String toString() {
        return title + " - " + Publisher.getById(publisher);
    }
}
