standarize the productId type

This commit is contained in:
ericuss 2019-09-04 15:02:09 +02:00
parent 1671062715
commit 791e7d646c
15 changed files with 15 additions and 16 deletions

View File

@ -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; }

View File

@ -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; }

View File

@ -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;

View File

@ -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; }

View File

@ -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")]

View File

@ -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)
{

View File

@ -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; }

View File

@ -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;

View File

@ -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

View File

@ -75,7 +75,7 @@ namespace Basket.FunctionalTests
{
Id = "basketId",
PictureUrl = "pictureurl",
ProductId = "productId",
ProductId = 1,
ProductName = "productName",
Quantity = 1,
UnitPrice = 1

View File

@ -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; }

View File

@ -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,

View File

@ -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;

View File

@ -1,6 +1,6 @@
export interface IBasketItem {
id: string;
productId: string;
productId: number;
productName: string;
unitPrice: number;
oldUnitPrice: number;

View File

@ -1,5 +1,5 @@
export interface ICatalogItem {
id: string;
id: number;
name: string;
description: string;
price: number;