package com.storycove.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import java.util.UUID;

@Embeddable
public class CollectionStoryId implements java.io.Serializable {
    
    @Column(name = "collection_id")
    private UUID collectionId;
    
    @Column(name = "story_id")
    private UUID storyId;
    
    public CollectionStoryId() {}
    
    public CollectionStoryId(UUID collectionId, UUID storyId) {
        this.collectionId = collectionId;
        this.storyId = storyId;
    }
    
    // Getters and Setters
    public UUID getCollectionId() {
        return collectionId;
    }
    
    public void setCollectionId(UUID collectionId) {
        this.collectionId = collectionId;
    }
    
    public UUID getStoryId() {
        return storyId;
    }
    
    public void setStoryId(UUID storyId) {
        this.storyId = storyId;
    }
    
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof CollectionStoryId)) return false;
        CollectionStoryId that = (CollectionStoryId) o;
        return collectionId != null && collectionId.equals(that.collectionId) &&
               storyId != null && storyId.equals(that.storyId);
    }
    
    @Override
    public int hashCode() {
        return java.util.Objects.hash(collectionId, storyId);
    }
    
    @Override  
    public String toString() {
        return "CollectionStoryId{" +
                "collectionId=" + collectionId +
                ", storyId=" + storyId +
                '}';
    }
}