/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package plate.wellmann.shop.persistence;

import java.time.LocalDateTime;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;

/**
 *
 * @author Patrick
 */
@Entity
public class Comment extends AbstractEntity {

    private String text;
    private final Customer writer;
    private final LocalDateTime creationDate;
    private LocalDateTime lastEditedDate;
    private boolean edited;
    
    @ManyToOne
    private Item item;

    public Comment(Customer customer) {
        this.writer = customer;
        this.creationDate = LocalDateTime.now();
        this.edited = false;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public LocalDateTime getLastEditedDate() {
        return lastEditedDate;
    }

    public void setLastEditedDate(LocalDateTime lastEditedDate) {
        this.lastEditedDate = lastEditedDate;
    }

    public boolean isEdited() {
        return edited;
    }

    public void setEdited(boolean edited) {
        this.edited = edited;
    }

    public Item getItem() {
        return item;
    }

    public void setItem(Item item) {
        this.item = item;
    }
}
