diff options
Diffstat (limited to 'src/Utilities/EnumName.cs')
| -rw-r--r-- | src/Utilities/EnumName.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Utilities/EnumName.cs b/src/Utilities/EnumName.cs new file mode 100644 index 0000000..0bd871d --- /dev/null +++ b/src/Utilities/EnumName.cs @@ -0,0 +1,38 @@ +using System; +using VSH.Data.Enums; + +namespace VSH.Utilities; + +public static class EnumName +{ + public static string ForDocumentType(DocumentType type) => type switch { + DocumentType.SALES_TERMS => "Salsvilkår", + DocumentType.CONTACT_PAGE => "Kontaktside", + DocumentType.PRIVACY_POLICY => "Personvernerklæring", + DocumentType.ABOUT_PAGE => "Om oss", + DocumentType.DEALERS_PAGE => "Leverandørar", + _ => throw new ArgumentException("Unknown DocumentType " + type) + }; + + public static string ForOrderStatus(OrderStatus type) => type switch { + OrderStatus.FAILED => "Feila", + OrderStatus.CANCELLED => "Kansellert", + OrderStatus.COMPLETED => "Fullført", + OrderStatus.IN_PROGRESS => "Pågåande", + OrderStatus.AWAITING_VIPPS => "Ventar på vipps", + OrderStatus.AWAITING_INVOICE => "Ventar på faktura", + _ => throw new ArgumentException("Unknown OrderStatus " + type) + }; + + public static string ForPriceSuffix(PriceSuffix type) => type switch { + PriceSuffix.PER => ",-", + PriceSuffix.KILOS => ",- kg", + _ => throw new ArgumentException("Unknown PriceSuffix " + type) + }; + + public static string ForPaymentType(OrderPaymentType type) => type switch { + OrderPaymentType.VIPPS => "Vipps", + OrderPaymentType.INVOICE_BY_EMAIL => "Faktura på mail", + _ => throw new ArgumentException("Unknown OrderPaymentType " + type) + }; +}
\ No newline at end of file |
