package com.social.media.domain.content.valueobject;

import java.util.Objects;

/**
 * Value Object representing a Post ID
 */
public record PostId(Long value) {
    
    public PostId {
        Objects.requireNonNull(value, "Post ID cannot be null");
        if (value <= 0) {
            throw new IllegalArgumentException("Post ID must be positive");
        }
    }
    
    public static PostId of(Long value) {
        return new PostId(value);
    }
    
    public static PostId of(String value) {
        return new PostId(Long.valueOf(value));
    }
    
    public static PostId generate() {
        // For JPA auto-generation, return null - will be populated by persistence layer
        return null;
    }
    
    @Override
    public String toString() {
        return String.valueOf(value);
    }
}
