// -----------------------------------------------------------------------------
// ArtifactIndexEntry.cs
// Sprint: SPRINT_20260118_017_Evidence_artifact_store_unification
// Task: AS-003 - Create ArtifactStore PostgreSQL index
// Description: Artifact index entry model for storage and querying
// -----------------------------------------------------------------------------
using StellaOps.Artifact.Core;
namespace StellaOps.Artifact.Infrastructure;
///
/// Artifact index entry for PostgreSQL storage.
///
public sealed record ArtifactIndexEntry
{
/// Primary key.
public Guid Id { get; init; } = Guid.NewGuid();
/// Tenant ID.
public required Guid TenantId { get; init; }
/// Package URL or bom-ref.
public required string BomRef { get; init; }
/// CycloneDX serialNumber.
public required string SerialNumber { get; init; }
/// Artifact ID.
public required string ArtifactId { get; init; }
/// Full storage key/path.
public required string StorageKey { get; init; }
/// Artifact type.
public required ArtifactType Type { get; init; }
/// Content type (MIME).
public required string ContentType { get; init; }
/// SHA-256 hash.
public required string Sha256 { get; init; }
/// Size in bytes.
public required long SizeBytes { get; init; }
/// When the artifact was stored.
public required DateTimeOffset CreatedAt { get; init; }
/// When the index entry was last updated.
public DateTimeOffset? UpdatedAt { get; init; }
/// Whether the artifact has been deleted.
public bool IsDeleted { get; init; }
/// Deletion timestamp.
public DateTimeOffset? DeletedAt { get; init; }
}