package com.social.media.domain.analytics.valueobject;

import java.util.Objects;
import java.util.UUID;

/**
 * Value Object representing an Account Metrics ID
 */
public record AccountMetricsId(String value) {
    
    public AccountMetricsId {
        Objects.requireNonNull(value, "Account Metrics ID cannot be null");
        if (value.trim().isEmpty()) {
            throw new IllegalArgumentException("Account Metrics ID cannot be empty");
        }
    }
    
    public static AccountMetricsId generate() {
        return new AccountMetricsId(UUID.randomUUID().toString());
    }
    
    public static AccountMetricsId of(String value) {
        return new AccountMetricsId(value);
    }
    
    public static AccountMetricsId of(Long id) {
        return new AccountMetricsId(String.valueOf(id));
    }
    
    @Override
    public String toString() {
        return value;
    }
}
