standarize the productId type
This commit is contained in:
parent
1671062715
commit
791e7d646c
@ -22,7 +22,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
|
||||
public class BasketDataItem
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string ProductId { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
public decimal UnitPrice { get; set; }
|
||||
public decimal OldUnitPrice { get; set; }
|
||||
|
@ -22,7 +22,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models
|
||||
public class BasketDataItem
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string ProductId { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
public decimal UnitPrice { get; set; }
|
||||
public decimal OldUnitPrice { get; set; }
|
||||
|
@ -25,7 +25,7 @@ message CustomerBasketResponse {
|
||||
|
||||
message BasketItemResponse {
|
||||
string id = 1;
|
||||
string productid = 2;
|
||||
int32 productid = 2;
|
||||
string productname = 3;
|
||||
double unitprice = 4;
|
||||
double oldunitprice = 5;
|
||||
|
@ -9,7 +9,7 @@ namespace eShopOnContainers.Core.Models.Basket
|
||||
|
||||
public string Id { get; set; }
|
||||
|
||||
public string ProductId { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
|
||||
public string ProductName { get; set; }
|
||||
|
||||
|
@ -5,7 +5,7 @@ namespace eShopOnContainers.Core.Models.Orders
|
||||
{
|
||||
public class OrderItem
|
||||
{
|
||||
public string ProductId { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public Guid? OrderId { get; set; }
|
||||
|
||||
[JsonProperty("unitprice")]
|
||||
|
@ -39,8 +39,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even
|
||||
|
||||
private async Task UpdatePriceInBasketItems(int productId, decimal newPrice, decimal oldPrice, CustomerBasket basket)
|
||||
{
|
||||
string match = productId.ToString();
|
||||
var itemsToUpdate = basket?.Items?.Where(x => x.ProductId == match).ToList();
|
||||
var itemsToUpdate = basket?.Items?.Where(x => x.ProductId == productId).ToList();
|
||||
|
||||
if (itemsToUpdate != null)
|
||||
{
|
||||
|
@ -6,7 +6,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
|
||||
public class BasketItem : IValidatableObject
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string ProductId { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
public decimal UnitPrice { get; set; }
|
||||
public decimal OldUnitPrice { get; set; }
|
||||
|
@ -25,7 +25,7 @@ message CustomerBasketResponse {
|
||||
|
||||
message BasketItemResponse {
|
||||
string id = 1;
|
||||
string productid = 2;
|
||||
int32 productid = 2;
|
||||
string productname = 3;
|
||||
double unitprice = 4;
|
||||
double oldunitprice = 5;
|
||||
|
@ -63,7 +63,7 @@ namespace Basket.FunctionalTests
|
||||
|
||||
order.Items.Add(new BasketItem
|
||||
{
|
||||
ProductId = "1",
|
||||
ProductId = 1,
|
||||
ProductName = ".NET Bot Black Hoodie",
|
||||
UnitPrice = 10,
|
||||
Quantity = 1
|
||||
|
@ -75,7 +75,7 @@ namespace Basket.FunctionalTests
|
||||
{
|
||||
Id = "basketId",
|
||||
PictureUrl = "pictureurl",
|
||||
ProductId = "productId",
|
||||
ProductId = 1,
|
||||
ProductName = "productName",
|
||||
Quantity = 1,
|
||||
UnitPrice = 1
|
||||
|
@ -8,7 +8,7 @@ namespace Ordering.API.Application.Models
|
||||
public class BasketItem
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string ProductId { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
public decimal UnitPrice { get; set; }
|
||||
public decimal OldUnitPrice { get; set; }
|
||||
|
@ -21,7 +21,7 @@ namespace Ordering.API.Application.Models
|
||||
{
|
||||
return new OrderItemDTO()
|
||||
{
|
||||
ProductId = int.TryParse(item.ProductId, out int id) ? id : -1,
|
||||
ProductId = item.ProductId,
|
||||
ProductName = item.ProductName,
|
||||
PictureUrl = item.PictureUrl,
|
||||
UnitPrice = item.UnitPrice,
|
||||
|
@ -16,7 +16,7 @@ message CreateOrderDraftCommand {
|
||||
|
||||
message BasketItem {
|
||||
string id = 1;
|
||||
string productId = 2;
|
||||
int32 productId = 2;
|
||||
string productName = 3;
|
||||
double unitPrice = 4;
|
||||
double oldUnitPrice = 5;
|
||||
|
@ -1,6 +1,6 @@
|
||||
export interface IBasketItem {
|
||||
id: string;
|
||||
productId: string;
|
||||
productId: number;
|
||||
productName: string;
|
||||
unitPrice: number;
|
||||
oldUnitPrice: number;
|
||||
|
@ -1,5 +1,5 @@
|
||||
export interface ICatalogItem {
|
||||
id: string;
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
price: number;
|
||||
|
Loading…
x
Reference in New Issue
Block a user