namespace ERPCore.System.Errors;

/// <summary>
/// Stable domain error codes carried in the <c>code</c> extension of RFC 7807
/// ProblemDetails responses. The authoritative catalog lives in
/// docs/11-BACKEND-PHASE1.md §7; add codes here as endpoints are implemented so
/// the two stay in sync.
/// </summary>
public static class ErrorCodes
{
    // Generic (framework-level) helpers used by the exception types below.
    public const string Validation = "validation_error";
    public const string NotFound = "not_found";
    public const string Conflict = "conflict";

    // Catalog (docs/11 §7) — exact strings surfaced to clients.
    public const string SkuDuplicate = "SKU_DUPLICATE";
    public const string MasterInUse = "MASTER_IN_USE";
    public const string PoNotEditable = "PO_NOT_EDITABLE";
    public const string OverReceiptTolerance = "OVER_RECEIPT_TOLERANCE";
    public const string StockNegativeBlocked = "STOCK_NEGATIVE_BLOCKED";
    public const string ExpiredBatchBlocked = "EXPIRED_BATCH_BLOCKED";
    public const string OnHoldNotIssuable = "ONHOLD_NOT_ISSUABLE";
    public const string ReasonCodeRequired = "REASON_CODE_REQUIRED";
    public const string ConcurrencyConflict = "CONCURRENCY_CONFLICT";
    public const string IdempotencyReplay = "IDEMPOTENCY_REPLAY";
}
