using System;

namespace Knot.Contracts.Messaging.Domain;

public class StoryMessage : Message
{
    public override string Type => "story";
    public override string? Content { get; protected set; }
    public Guid? StoryId { get; private set; }
    public string? StoryMediaUrl { get; private set; }
    public string? StoryMediaType { get; private set; }

    public StoryMessage() : base() { }

    public StoryMessage(Guid id, Guid chatId, Guid senderId, Guid storyId, string? storyMediaUrl, string? storyMediaType, DateTime createdAt)
        : base(id, chatId, senderId, null, null, createdAt, false) 
    { 
        StoryId = storyId; 
        StoryMediaUrl = storyMediaUrl; 
        StoryMediaType = storyMediaType; 
    }

    public StoryMessage(Guid id, Guid chatId, Guid senderId, Guid storyId, string? storyMediaUrl, string? storyMediaType, string? content, Guid? replyToId, Guid? forwardedFromId, DateTime createdAt, bool isImported)
        : this(id, chatId, senderId, storyId, storyMediaUrl, storyMediaType, createdAt) 
    { 
        Content = content; 
        ReplyToId = replyToId; 
        ForwardedFromId = forwardedFromId; 
        if (isImported) AddState(MessageState.IsImported); 
    }
}
