From 9383a2fb09ffb60cfe63683106945bd688affa59 Mon Sep 17 00:00:00 2001 From: ivarlovlie Date: Wed, 1 Jun 2022 21:13:43 +0200 Subject: feat: Initial commit after clean slate --- src/Utilities/EnumName.cs | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/Utilities/EnumName.cs (limited to 'src/Utilities/EnumName.cs') 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 -- cgit v1.3