Files
PowderCoatingLogix/src/PowderCoating.Core/Entities/AiUsageLog.cs
T
2026-04-23 21:38:24 -04:00

27 lines
1.0 KiB
C#

namespace PowderCoating.Core.Entities;
/// <summary>
/// Immutable audit log of every Anthropic API call made on behalf of a tenant.
/// Intentionally omits BaseEntity — no soft delete, no UpdatedAt, no per-tenant query filter
/// (this is a platform-wide log read by SuperAdmins across all companies).
/// </summary>
public class AiUsageLog
{
public long Id { get; set; }
public int CompanyId { get; set; }
public string UserId { get; set; } = string.Empty;
/// <summary>Which AI feature triggered this call. Use AppConstants.AiFeatures constants.</summary>
public string Feature { get; set; } = string.Empty;
/// <summary>True when the AI service returned successfully; false on exception or upstream error.</summary>
public bool Success { get; set; } = true;
/// <summary>Approximate input size in characters/bytes — used as a rough token-cost proxy.</summary>
public int InputLength { get; set; }
public DateTime CalledAt { get; set; }
public Company? Company { get; set; }
}