api url fix in settings
This commit is contained in:
parent
b727faaa5b
commit
3c7449b7b0
|
|
@ -48,48 +48,7 @@ namespace TIAMWebApp.Server.Controllers
|
|||
_adminDal = adminDal;
|
||||
}
|
||||
|
||||
public double GetTransferPrice(Guid productId, Guid fromTransferDestinationId, Guid toTranferDestinationId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public double GetTransferPrice(Guid productId, TransferDestination fromTransferDestination, TransferDestination toTransferDestination, in byte seatNumber)
|
||||
{
|
||||
var product = _adminDal.GetProductById(productId);
|
||||
|
||||
if (product == null) return -1;
|
||||
|
||||
return GetTransferPrice(product, fromTransferDestination, toTransferDestination, in seatNumber);
|
||||
}
|
||||
|
||||
public double GetTransferPrice(Product product, TransferDestination fromTransferDestination, TransferDestination toTransferDestination, in byte seatNumber)
|
||||
{
|
||||
var baseDestination = product.Profile.AddressId == fromTransferDestination.AddressId ? toTransferDestination : fromTransferDestination;
|
||||
|
||||
var transferDestinationToProduct = _adminDal.GetTransferDestinationToProduct(product.Id, baseDestination.Id);
|
||||
|
||||
var tranferDestinationPrice = transferDestinationToProduct ?? baseDestination as ITransfeDestinationPrices;
|
||||
|
||||
var price = GetSeatNumberPrice(in tranferDestinationPrice, seatNumber);
|
||||
|
||||
//TODO: ExtraPrice - J.
|
||||
|
||||
return price;
|
||||
}
|
||||
|
||||
public double GetSeatNumberPrice(in ITransfeDestinationPrices transfeDestinationPrices, in byte seatNumber)
|
||||
=> GetSeatNumberPrice(transfeDestinationPrices.Price, transfeDestinationPrices.Price2, transfeDestinationPrices.Price3, seatNumber);
|
||||
|
||||
public double GetSeatNumberPrice(in double price, in double? price2, in double? price3, in byte seatNumber)
|
||||
{
|
||||
if (seatNumber >= (byte)SeatNumberPriceType.Price3SeatNum)
|
||||
return price3 ?? price; //TODO: *seatnum percent - J.
|
||||
|
||||
if (seatNumber >= (byte)SeatNumberPriceType.Price2SeatNum)
|
||||
return price2 ?? price; //TODO: *seatnum percent - J.
|
||||
|
||||
return price;
|
||||
}
|
||||
|
||||
//public double GetExtraPrice(bool? extraPriceType){}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
using TIAM.Core.Enums;
|
||||
using TIAM.Database.DataLayers.Admins;
|
||||
using TIAM.Database.DataLayers.Users;
|
||||
using TIAM.Entities.Products;
|
||||
using TIAM.Entities.Transfers;
|
||||
|
||||
namespace TIAMWebApp.Server.Services
|
||||
{
|
||||
public class TransferBackendService
|
||||
{
|
||||
private readonly IConfiguration _configuration;
|
||||
public AdminDal _adminDal;
|
||||
|
||||
public TransferBackendService(IConfiguration configuration, AdminDal adminDal)
|
||||
{
|
||||
|
||||
_configuration = configuration;
|
||||
_adminDal = adminDal;
|
||||
}
|
||||
|
||||
public double GetTransferPrice(Guid productId, Guid fromTransferDestinationId, Guid toTranferDestinationId)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public double GetTransferPrice(Guid productId, TransferDestination fromTransferDestination, TransferDestination toTransferDestination, in byte seatNumber)
|
||||
{
|
||||
var product = _adminDal.GetProductById(productId);
|
||||
|
||||
if (product == null) return -1;
|
||||
|
||||
return GetTransferPrice(product, fromTransferDestination, toTransferDestination, in seatNumber);
|
||||
}
|
||||
|
||||
public double GetTransferPrice(Product product, TransferDestination fromTransferDestination, TransferDestination toTransferDestination, in byte seatNumber)
|
||||
{
|
||||
var baseDestination = product.Profile.AddressId == fromTransferDestination.AddressId ? toTransferDestination : fromTransferDestination;
|
||||
|
||||
var transferDestinationToProduct = _adminDal.GetTransferDestinationToProduct(product.Id, baseDestination.Id);
|
||||
|
||||
var tranferDestinationPrice = transferDestinationToProduct ?? baseDestination as ITransfeDestinationPrices;
|
||||
|
||||
var price = GetSeatNumberPrice(in tranferDestinationPrice, seatNumber);
|
||||
|
||||
//TODO: ExtraPrice - J.
|
||||
|
||||
return price;
|
||||
}
|
||||
|
||||
public double GetSeatNumberPrice(in ITransfeDestinationPrices transfeDestinationPrices, in byte seatNumber)
|
||||
=> GetSeatNumberPrice(transfeDestinationPrices.Price, transfeDestinationPrices.Price2, transfeDestinationPrices.Price3, seatNumber);
|
||||
|
||||
public double GetSeatNumberPrice(in double price, in double? price2, in double? price3, in byte seatNumber)
|
||||
{
|
||||
if (seatNumber >= (byte)SeatNumberPriceType.Price3SeatNum)
|
||||
return price3 ?? price; //TODO: *seatnum percent - J.
|
||||
|
||||
if (seatNumber >= (byte)SeatNumberPriceType.Price2SeatNum)
|
||||
return price2 ?? price; //TODO: *seatnum percent - J.
|
||||
|
||||
return price;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,9 +9,10 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide
|
|||
public class Setting
|
||||
{
|
||||
public static UserBasicDetails UserBasicDetails { get; set; }
|
||||
//public const string BaseUrl = "https://localhost:7116";
|
||||
public const string BaseUrl = "https://touriam.mangoweb.hu";
|
||||
public const string ApiBaseUrl = "https://touriam.mangoweb.hu";
|
||||
public const string BaseUrl = "https://localhost:7116";
|
||||
public const string ApiBaseUrl = "https://localhost:7116";
|
||||
//public const string BaseUrl = "https://touriam.mangoweb.hu";
|
||||
//public const string ApiBaseUrl = "https://touriam.mangoweb.hu";
|
||||
public const bool DarkMode = false;
|
||||
public static string Locale { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ namespace TIAMWebApp.Shared.Application.Models.ClientSide.UI.WizardModels
|
|||
UserProductMappingId = Guid.NewGuid(),
|
||||
TransferStatusType = TIAM.Core.Enums.TransferStatusType.OrderSubmitted,
|
||||
Comment = "Transfer order",
|
||||
ReferralProductId = Guid.NewGuid(),
|
||||
|
||||
};
|
||||
|
||||
return transfer;
|
||||
|
|
|
|||
Loading…
Reference in New Issue