169 lines
6.4 KiB
C#
169 lines
6.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using gehGassi.Domain.Common;
|
|
|
|
namespace gehGassi.Core.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// Schnittestellenbeschreibung für einen Service der die Preise eines Produktes berechnet
|
|
/// </summary>
|
|
public interface IShopCalculationService
|
|
{
|
|
/// <summary>
|
|
/// Berechnet den Preis einer Produktes für einen Kunden.
|
|
/// Berücksichtigt die Länder- und Kundeneinstellungen
|
|
/// </summary>
|
|
/// <param name="productId">Id des Produktes</param>
|
|
/// <param name="customerId">Id des Kunden</param>
|
|
/// <param name="quantity">Anzahl - Stück</param>
|
|
/// <returns>Preis-Kalkulation</returns>
|
|
Task<PriceCalculation> CalculatePriceAsync(int productId, long customerId, int quantity);
|
|
|
|
/// <summary>
|
|
/// Berechnet den Preis einer Produktes für einen Kunden.
|
|
/// Berücksichtigt die Länder- und Kundeneinstellungen
|
|
/// </summary>
|
|
/// <param name="productId">Id des Produktes</param>
|
|
/// <param name="customerId">Id des Kunden</param>
|
|
/// <param name="billingCountry">Iso2 Land für die Rechnung</param>
|
|
/// <param name="quantity">Anzahl - Stück</param>
|
|
/// <returns>Preis-Kalkulation</returns>
|
|
Task<PriceCalculation> CalculatePriceAsync(int productId, long customerId, string billingCountry, int quantity);
|
|
|
|
/// <summary>
|
|
/// Berechnet den Preis einer Produktes für einen Kunden.
|
|
/// Berücksichtigt die Länder- und Kundeneinstellungen
|
|
/// </summary>
|
|
/// <param name="productId">Id des Produktes</param>
|
|
/// <param name="customerId">Id des Kunden</param>
|
|
/// <param name="billingCountry">Iso2 Land für die Rechnung</param>
|
|
/// <param name="quantity">Anzahl - Stück</param>
|
|
/// <param name="budget">Budget für Banner</param>
|
|
/// <returns>Preis-Kalkulation</returns>
|
|
Task<PriceCalculation> CalculatePriceBannerAsync(int productId, long customerId, string billingCountry, int quantity, decimal budget);
|
|
|
|
/// <summary>
|
|
/// Berechnet den Preis einer Produktes für einen Kunden.
|
|
/// Berücksichtigt die Länder- und Kundeneinstellungen
|
|
/// </summary>
|
|
/// <param name="productId">Id des Produktes</param>
|
|
/// <param name="customerId">Id des Kunden</param>
|
|
/// <param name="priceType">Preistype</param>
|
|
/// <param name="priceAliquotType">Typ der aliquoten Berechnung</param>
|
|
/// <param name="startDate">Startdatum</param>
|
|
/// <param name="endDate">Enddatum</param>
|
|
/// <param name="quantity">Anzahl - Stück</param>
|
|
/// <returns>Preis-Kalkulation</returns>
|
|
Task<PriceCalculation> CalculatePriceAsync(int productId, long customerId, PriceType priceType, PriceAliquotType priceAliquotType, DateTimeOffset startDate, DateTimeOffset endDate, int quantity);
|
|
|
|
/// <summary>
|
|
/// Berechnet den Preis einer Produktes für einen Kunden.
|
|
/// Berücksichtigt die Länder- und Kundeneinstellungen
|
|
/// </summary>
|
|
/// <param name="productId">Id des Produktes</param>
|
|
/// <param name="customerId">Id des Kunden</param>
|
|
/// <param name="priceType">Preistype</param>
|
|
/// <param name="priceAliquotType">Typ der aliquoten Berechnung</param>
|
|
/// <param name="startDate">Startdatum</param>
|
|
/// <param name="endDate">Enddatum</param>
|
|
/// <param name="billingCountry">Iso2 Land für die Rechnung</param>
|
|
/// <param name="quantity">Anzahl - Stück</param>
|
|
/// <returns>Preis-Kalkulation</returns>
|
|
Task<PriceCalculation> CalculatePriceAsync(int productId, long customerId, PriceType priceType, PriceAliquotType priceAliquotType, DateTimeOffset startDate, DateTimeOffset endDate, string billingCountry, int quantity);
|
|
|
|
/// <summary>
|
|
/// Aufschlagen von X Prozent auf eine Preis-Kalkulation
|
|
/// </summary>
|
|
/// <param name="priceCalculation">Preis-Kalkulation</param>
|
|
/// <param name="markup">Aufschlag in Prozent</param>
|
|
/// <param name="productId">Id des Produktes</param>
|
|
/// <param name="billingCountry">Iso2 Land für die Rechnung</param>
|
|
/// <returns>Preis-Kalkulation</returns>
|
|
Task<PriceCalculation> AddMarkupAsync(PriceCalculation priceCalculation, decimal markup, int productId, string billingCountry);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergebnis einer Preis-Kalkulation
|
|
/// </summary>
|
|
public class PriceCalculation
|
|
{
|
|
/// <summary>
|
|
/// Preis netto
|
|
/// </summary>
|
|
public decimal Price { get; set; }
|
|
|
|
/// <summary>
|
|
/// Preis brutto
|
|
/// </summary>
|
|
public decimal PriceGross { get; set; }
|
|
|
|
/// <summary>
|
|
/// Vorheriger Preis netto
|
|
/// </summary>
|
|
public decimal OldPrice{ get; set; }
|
|
|
|
/// <summary>
|
|
/// Vorheriger Preis brutto
|
|
/// </summary>
|
|
public decimal OldPriceGross { get; set; }
|
|
|
|
/// <summary>
|
|
/// Preis2 netto
|
|
/// </summary>
|
|
public decimal Price2 { get; set; }
|
|
|
|
/// <summary>
|
|
/// Preis2 brutto
|
|
/// </summary>
|
|
public decimal Price2Gross { get; set; }
|
|
|
|
/// <summary>
|
|
/// Vorheriger Preis2 netto
|
|
/// </summary>
|
|
public decimal OldPrice2 { get; set; }
|
|
|
|
/// <summary>
|
|
/// Vorheriger Preis2 brutto
|
|
/// </summary>
|
|
public decimal OldPrice2Gross { get; set; }
|
|
|
|
/// <summary>
|
|
/// Angewandte Steuer - z.B. 10%, 20%
|
|
/// </summary>
|
|
public decimal TaxRate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Kalkulierte Steuer
|
|
/// </summary>
|
|
public decimal TaxValue { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gesamtwert Netto (Preis + Preis2)
|
|
/// </summary>
|
|
public decimal Total { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gesamtwert Brutto (Preis + Preis2)
|
|
/// </summary>
|
|
public decimal TotalGross { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gesamtwert Vorherig Netto (Preis + Preis2)
|
|
/// </summary>
|
|
public decimal TotalOld { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gesamtwert vorherig Brutto (Preis + Preis2)
|
|
/// </summary>
|
|
public decimal TotalOldGross { get; set; }
|
|
|
|
/// <summary>
|
|
/// Stückzahl
|
|
/// </summary>
|
|
public int Quantity { get; set; }
|
|
}
|
|
}
|