public enum BatchStatus { Uploaded, InEntry, PendingVerification, Rejected, Verified, AwaitingClinicalApproval, Approved, Promoted, Cancelled }

public static class BatchStatusExtensions
{
    public static string ToDbString(this BatchStatus s) => s switch
    {
        BatchStatus.Uploaded                 => "UPLOADED",
        BatchStatus.InEntry                  => "IN_ENTRY",
        BatchStatus.PendingVerification      => "PENDING_VERIFICATION",
        BatchStatus.Rejected                 => "REJECTED",
        BatchStatus.Verified                 => "VERIFIED",
        BatchStatus.AwaitingClinicalApproval => "AWAITING_CLINICAL_APPROVAL",
        BatchStatus.Approved                 => "APPROVED",
        BatchStatus.Promoted                 => "PROMOTED",
        BatchStatus.Cancelled                => "CANCELLED",
        _ => throw new ArgumentOutOfRangeException(nameof(s))
    };

    public static BatchStatus FromDbString(string v) => v switch
    {
        "UPLOADED"                   => BatchStatus.Uploaded,
        "IN_ENTRY"                   => BatchStatus.InEntry,
        "PENDING_VERIFICATION"       => BatchStatus.PendingVerification,
        "REJECTED"                   => BatchStatus.Rejected,
        "VERIFIED"                   => BatchStatus.Verified,
        "AWAITING_CLINICAL_APPROVAL" => BatchStatus.AwaitingClinicalApproval,
        "APPROVED"                   => BatchStatus.Approved,
        "PROMOTED"                   => BatchStatus.Promoted,
        "CANCELLED"                  => BatchStatus.Cancelled,
        _ => throw new ArgumentOutOfRangeException(nameof(v), $"Unknown batch status: '{v}'")
    };
}