aboutsummaryrefslogtreecommitdiffstats
path: root/src/Utilities/EnumName.cs
blob: 0bd871d69b0e3408b5f7e94aeac927fcbc7def11 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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)
	};
}