Billing: Add EditBillingData class

This commit is contained in:
2024-01-18 21:30:42 +01:00
parent 403e7723d2
commit cb541cb6e6
5 changed files with 112 additions and 36 deletions

View File

@ -1,9 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Generic;
using System.Text.Json.Nodes;
using System.Threading.Tasks;
namespace Elwig.Helpers.Billing {
public class GraphEntry {
@ -26,12 +22,20 @@ namespace Elwig.Helpers.Billing {
Contracts = [];
}
public GraphEntry(int id, BillingData.CurveMode mode, Dictionary<double, decimal> data, int minX, int maxX) : this(id, mode, minX, maxX) {
public GraphEntry(int id, BillingData.CurveMode mode, Dictionary<double, decimal> data, int minX, int maxX) :
this(id, mode, minX, maxX) {
DataGraph = new Graph(data, minX, maxX);
}
public GraphEntry(int id, BillingData.Curve curve, int minX, int maxX) :
this(id, curve.Mode, minX, maxX) {
DataGraph = new Graph(curve.Normal, minX, maxX);
if (curve.Gebunden != null)
GebundenGraph = new Graph(curve.Gebunden, minX, maxX);
}
private GraphEntry(int id, BillingData.CurveMode mode, Graph dataGraph, Graph? gebundenGraph,
decimal? gebundenFlatPrice, List<string> contracts, int minX, int maxX) {
decimal? gebundenFlatPrice, List<string> contracts, int minX, int maxX) {
Id = id;
Mode = mode;
MinX = minX;