package com.social.media.application.content.dto;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Set;

/**
 * Response DTO for Post operations
 */
public class PostResponseDto {
    
    private final String id;
    private final String companyId;
    private final String authorId;
    private final String categoryId;
    private final String title;
    private final String content;
    private final String postType;
    private final String status;
    private final List<String> mediaIds;
    private final Set<String> targetSocialAccountIds;
    private final LocalDateTime scheduledFor;
    private final LocalDateTime publishedAt;
    private final LocalDateTime createdAt;
    private final LocalDateTime updatedAt;
    private final String tags;
    private final boolean isPinned;
    private final int viewCount;
    private final int likeCount;
    private final int shareCount;
    private final int commentCount;
    private final List<String> hashtags;
    private final List<String> mentions;
    
    private PostResponseDto(Builder builder) {
        this.id = builder.id;
        this.companyId = builder.companyId;
        this.authorId = builder.authorId;
        this.categoryId = builder.categoryId;
        this.title = builder.title;
        this.content = builder.content;
        this.postType = builder.postType;
        this.status = builder.status;
        this.mediaIds = builder.mediaIds;
        this.targetSocialAccountIds = builder.targetSocialAccountIds;
        this.scheduledFor = builder.scheduledFor;
        this.publishedAt = builder.publishedAt;
        this.createdAt = builder.createdAt;
        this.updatedAt = builder.updatedAt;
        this.tags = builder.tags;
        this.isPinned = builder.isPinned;
        this.viewCount = builder.viewCount;
        this.likeCount = builder.likeCount;
        this.shareCount = builder.shareCount;
        this.commentCount = builder.commentCount;
        this.hashtags = builder.hashtags;
        this.mentions = builder.mentions;
    }
    
    public static Builder builder() {
        return new Builder();
    }
    
    // Getters
    public String getId() { return id; }
    public String getCompanyId() { return companyId; }
    public String getAuthorId() { return authorId; }
    public String getCategoryId() { return categoryId; }
    public String getTitle() { return title; }
    public String getContent() { return content; }
    public String getPostType() { return postType; }
    public String getStatus() { return status; }
    public List<String> getMediaIds() { return mediaIds; }
    public Set<String> getTargetSocialAccountIds() { return targetSocialAccountIds; }
    public LocalDateTime getScheduledFor() { return scheduledFor; }
    public LocalDateTime getPublishedAt() { return publishedAt; }
    public LocalDateTime getCreatedAt() { return createdAt; }
    public LocalDateTime getUpdatedAt() { return updatedAt; }
    public String getTags() { return tags; }
    public boolean isPinned() { return isPinned; }
    public int getViewCount() { return viewCount; }
    public int getLikeCount() { return likeCount; }
    public int getShareCount() { return shareCount; }
    public int getCommentCount() { return commentCount; }
    public List<String> getHashtags() { return hashtags; }
    public List<String> getMentions() { return mentions; }
    
    public static class Builder {
        private String id;
        private String companyId;
        private String authorId;
        private String categoryId;
        private String title;
        private String content;
        private String postType;
        private String status;
        private List<String> mediaIds;
        private Set<String> targetSocialAccountIds;
        private LocalDateTime scheduledFor;
        private LocalDateTime publishedAt;
        private LocalDateTime createdAt;
        private LocalDateTime updatedAt;
        private String tags;
        private boolean isPinned;
        private int viewCount;
        private int likeCount;
        private int shareCount;
        private int commentCount;
        private List<String> hashtags;
        private List<String> mentions;
        
        public Builder id(String id) { this.id = id; return this; }
        public Builder companyId(String companyId) { this.companyId = companyId; return this; }
        public Builder authorId(String authorId) { this.authorId = authorId; return this; }
        public Builder categoryId(String categoryId) { this.categoryId = categoryId; return this; }
        public Builder title(String title) { this.title = title; return this; }
        public Builder content(String content) { this.content = content; return this; }
        public Builder postType(String postType) { this.postType = postType; return this; }
        public Builder status(String status) { this.status = status; return this; }
        public Builder mediaIds(List<String> mediaIds) { this.mediaIds = mediaIds; return this; }
        public Builder targetSocialAccountIds(Set<String> targetSocialAccountIds) { this.targetSocialAccountIds = targetSocialAccountIds; return this; }
        public Builder scheduledFor(LocalDateTime scheduledFor) { this.scheduledFor = scheduledFor; return this; }
        public Builder publishedAt(LocalDateTime publishedAt) { this.publishedAt = publishedAt; return this; }
        public Builder createdAt(LocalDateTime createdAt) { this.createdAt = createdAt; return this; }
        public Builder updatedAt(LocalDateTime updatedAt) { this.updatedAt = updatedAt; return this; }
        public Builder tags(String tags) { this.tags = tags; return this; }
        public Builder isPinned(boolean isPinned) { this.isPinned = isPinned; return this; }
        public Builder viewCount(int viewCount) { this.viewCount = viewCount; return this; }
        public Builder likeCount(int likeCount) { this.likeCount = likeCount; return this; }
        public Builder shareCount(int shareCount) { this.shareCount = shareCount; return this; }
        public Builder commentCount(int commentCount) { this.commentCount = commentCount; return this; }
        public Builder hashtags(List<String> hashtags) { this.hashtags = hashtags; return this; }
        public Builder mentions(List<String> mentions) { this.mentions = mentions; return this; }
        
        public PostResponseDto build() {
            return new PostResponseDto(this);
        }
    }
}

