Billing: Rename attributeVariants and contracts to vaributes

This commit is contained in:
2024-01-27 11:08:10 +01:00
parent 31b0ae245d
commit dd568b81e8
10 changed files with 81 additions and 81 deletions

View File

@ -9,24 +9,24 @@ namespace Elwig.Helpers.Billing {
protected readonly Dictionary<int, Curve> Curves;
protected readonly Dictionary<string, Curve> PaymentData;
protected readonly Dictionary<string, Curve> QualityData;
protected readonly IEnumerable<string> AttributeVariants;
protected readonly IEnumerable<string> Vaributes;
public PaymentBillingData(JsonObject data, IEnumerable<string> attributeVariants) :
public PaymentBillingData(JsonObject data, IEnumerable<string> vaributes) :
base(data) {
if (attributeVariants.Any(e => e.Any(c => c < 'A' || c > 'Z')))
throw new ArgumentException("Invalid attributeVariants");
AttributeVariants = attributeVariants;
if (vaributes.Any(e => e.Any(c => c < 'A' || c > 'Z')))
throw new ArgumentException("Invalid vaributes");
Vaributes = vaributes;
Curves = GetCurves();
PaymentData = GetPaymentData();
QualityData = GetQualityData();
}
public static PaymentBillingData FromJson(string json, IEnumerable<string> attributeVariants) {
return new(ParseJson(json), attributeVariants);
public static PaymentBillingData FromJson(string json, IEnumerable<string> vaributes) {
return new(ParseJson(json), vaributes);
}
private Dictionary<string, Curve> GetData(JsonNode data) {
return GetSelection(data, AttributeVariants).ToDictionary(e => e.Key, e => LookupCurve(e.Value));
return GetSelection(data, Vaributes).ToDictionary(e => e.Key, e => LookupCurve(e.Value));
}
protected Dictionary<string, Curve> GetPaymentData() {