package online.wesal.wesal.dto;

import online.wesal.wesal.entity.Post;
import online.wesal.wesal.entity.User;
import java.time.LocalDateTime;
import java.util.List;

public class PostWithLikesResponseDTO {
    
    private String id;
    private CreatorDTO creator;
    private String body;
    private String likes;
    private String comments;
    private boolean liked;
    private LocalDateTime creationDate;
    private List<LikedUserDTO> likedUsers;
    
    public PostWithLikesResponseDTO() {}
    
    public PostWithLikesResponseDTO(Post post, User creator, boolean liked, List<LikedUserDTO> likedUsers) {
        this.id = String.valueOf(post.getId());
        this.creator = new CreatorDTO(creator);
        this.body = post.getBody();
        this.likes = String.valueOf(post.getLikes());
        this.comments = String.valueOf(post.getComments());
        this.liked = liked;
        this.creationDate = post.getCreationDate();
        this.likedUsers = likedUsers;
    }
    
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public CreatorDTO getCreator() {
        return creator;
    }
    
    public void setCreator(CreatorDTO creator) {
        this.creator = creator;
    }
    
    public String getBody() {
        return body;
    }
    
    public void setBody(String body) {
        this.body = body;
    }
    
    public String getLikes() {
        return likes;
    }
    
    public void setLikes(String likes) {
        this.likes = likes;
    }
    
    public String getComments() {
        return comments;
    }
    
    public void setComments(String comments) {
        this.comments = comments;
    }
    
    public boolean isLiked() {
        return liked;
    }
    
    public void setLiked(boolean liked) {
        this.liked = liked;
    }
    
    public LocalDateTime getCreationDate() {
        return creationDate;
    }
    
    public void setCreationDate(LocalDateTime creationDate) {
        this.creationDate = creationDate;
    }
    
    public List<LikedUserDTO> getLikedUsers() {
        return likedUsers;
    }
    
    public void setLikedUsers(List<LikedUserDTO> likedUsers) {
        this.likedUsers = likedUsers;
    }
}