using MongoDB.Bson;

namespace StellaOps.Feedser.Storage.Mongo.Documents;

public sealed record DocumentRecord(
    Guid Id,
    string SourceName,
    string Uri,
    DateTimeOffset FetchedAt,
    string Sha256,
    string Status,
    string? ContentType,
    IReadOnlyDictionary<string, string>? Headers,
    IReadOnlyDictionary<string, string>? Metadata,
    string? Etag,
    DateTimeOffset? LastModified,
    ObjectId? GridFsId,
    DateTimeOffset? ExpiresAt = null)
{
    public DocumentRecord WithStatus(string status)
        => this with { Status = status };
}
