aboutsummaryrefslogtreecommitdiffstats
path: root/src/Utilities/EnumName.cs
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-06-01 21:13:43 +0200
committerivarlovlie <git@ivarlovlie.no>2022-06-01 21:13:43 +0200
commit9383a2fb09ffb60cfe63683106945bd688affa59 (patch)
tree65b3f4b48841583e355887db5de5a16e7005fc87 /src/Utilities/EnumName.cs
downloadvinjesvingenhandel.no-9383a2fb09ffb60cfe63683106945bd688affa59.tar.xz
vinjesvingenhandel.no-9383a2fb09ffb60cfe63683106945bd688affa59.zip
feat: Initial commit after clean slate
Diffstat (limited to 'src/Utilities/EnumName.cs')
-rw-r--r--src/Utilities/EnumName.cs38
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