Pin nixpkgs to the revision used by itc.componentware: the channel version ships a latexminted that crashes on Python 3.14, which made every listing fail and sent latexmk into an endless error prompt. Also force nonstopmode/halt-on-error so a broken listing can never loop again.
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using System.Globalization;
|
|
using Houston.Resources;
|
|
|
|
namespace Houston.Model.Documents;
|
|
|
|
public enum DocumentType
|
|
{
|
|
ServiceProtocol,
|
|
AcceptanceDocuments,
|
|
SlaReportsTicketProcessing,
|
|
MonitoringReports,
|
|
SecurityAssessments,
|
|
BillingData,
|
|
ContractDocuments,
|
|
}
|
|
|
|
public static class DocumentTypeExtensions
|
|
{
|
|
public const string OtherDocumentsDisplayName = "Sonstige Dokumente";
|
|
public const string OtherDocumentsValue = "OtherDocuments";
|
|
|
|
public static string? FromStorageFolderName(string storageFolderName) =>
|
|
APITranslation.ResourceManager.GetString(storageFolderName, CultureInfo.InvariantCulture);
|
|
|
|
public static DocumentType? ParseStorageFolderName(string storageFolderName)
|
|
{
|
|
var type = FromStorageFolderName(storageFolderName);
|
|
if (!Enum.TryParse<DocumentType>(type, ignoreCase: true, out var variant))
|
|
return null;
|
|
|
|
return variant;
|
|
}
|
|
|
|
extension(DocumentType documentType)
|
|
{
|
|
/// <summary>
|
|
/// The name of the S3 subfolder that holds documents of this type, i.e. the German translation.
|
|
/// </summary>
|
|
public string StorageFolderName =>
|
|
APITranslation.ResourceManager.GetString(documentType.ToString(), CultureInfo.InvariantCulture)
|
|
?? throw new NotImplementedException($"Missing translation for DocumentType '{documentType}'.");
|
|
}
|