package com.social.media.application.socialaccount.dto;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * DTO for Social Account responses
 */
public record SocialAccountResponseDto(
    String id,
    String userId,
    String companyId,
    String socialNetworkId,
    String platformAccountId,
    String username,
    String displayName,
    String profileUrl,
    String avatarUrl,
    String status,
    boolean verified,
    int followersCount,
    int followingCount,
    int postsCount,
    Map<String, Object> authTokens,
    Map<String, Object> accountMetrics,
    LocalDateTime lastSyncDate,
    LocalDateTime connectedAt,
    LocalDateTime createdAt,
    LocalDateTime updatedAt
) {
    
    public static Builder builder() {
        return new Builder();
    }
    
    public static class Builder {
        private String id;
        private String userId;
        private String companyId;
        private String socialNetworkId;
        private String platformAccountId;
        private String username;
        private String displayName;
        private String profileUrl;
        private String avatarUrl;
        private String status;
        private boolean verified;
        private int followersCount;
        private int followingCount;
        private int postsCount;
        private Map<String, Object> authTokens;
        private Map<String, Object> accountMetrics;
        private LocalDateTime lastSyncDate;
        private LocalDateTime connectedAt;
        private LocalDateTime createdAt;
        private LocalDateTime updatedAt;
        
        public Builder id(String id) {
            this.id = id;
            return this;
        }
        
        public Builder userId(String userId) {
            this.userId = userId;
            return this;
        }
        
        public Builder companyId(String companyId) {
            this.companyId = companyId;
            return this;
        }
        
        public Builder socialNetworkId(String socialNetworkId) {
            this.socialNetworkId = socialNetworkId;
            return this;
        }
        
        public Builder platformAccountId(String platformAccountId) {
            this.platformAccountId = platformAccountId;
            return this;
        }
        
        public Builder username(String username) {
            this.username = username;
            return this;
        }
        
        public Builder displayName(String displayName) {
            this.displayName = displayName;
            return this;
        }
        
        public Builder profileUrl(String profileUrl) {
            this.profileUrl = profileUrl;
            return this;
        }
        
        public Builder avatarUrl(String avatarUrl) {
            this.avatarUrl = avatarUrl;
            return this;
        }
        
        public Builder status(String status) {
            this.status = status;
            return this;
        }
        
        public Builder verified(boolean verified) {
            this.verified = verified;
            return this;
        }
        
        public Builder followersCount(int followersCount) {
            this.followersCount = followersCount;
            return this;
        }
        
        public Builder followingCount(int followingCount) {
            this.followingCount = followingCount;
            return this;
        }
        
        public Builder postsCount(int postsCount) {
            this.postsCount = postsCount;
            return this;
        }
        
        public Builder authTokens(Map<String, Object> authTokens) {
            this.authTokens = authTokens;
            return this;
        }
        
        public Builder accountMetrics(Map<String, Object> accountMetrics) {
            this.accountMetrics = accountMetrics;
            return this;
        }
        
        public Builder lastSyncDate(LocalDateTime lastSyncDate) {
            this.lastSyncDate = lastSyncDate;
            return this;
        }
        
        public Builder connectedAt(LocalDateTime connectedAt) {
            this.connectedAt = connectedAt;
            return this;
        }
        
        public Builder createdAt(LocalDateTime createdAt) {
            this.createdAt = createdAt;
            return this;
        }
        
        public Builder updatedAt(LocalDateTime updatedAt) {
            this.updatedAt = updatedAt;
            return this;
        }
        
        public SocialAccountResponseDto build() {
            return new SocialAccountResponseDto(id, userId, companyId, socialNetworkId, platformAccountId, 
                username, displayName, profileUrl, avatarUrl, status, verified, followersCount, 
                followingCount, postsCount, authTokens, accountMetrics, lastSyncDate, connectedAt, 
                createdAt, updatedAt);
        }
    }
}

