Skip to content

Commit 791e7d6

Browse files
author
ericuss
committed
standarize the productId type
1 parent 1671062 commit 791e7d6

15 files changed

Lines changed: 15 additions & 16 deletions

File tree

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/BasketData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public BasketData(string buyerId)
2222
public class BasketDataItem
2323
{
2424
public string Id { get; set; }
25-
public string ProductId { get; set; }
25+
public int ProductId { get; set; }
2626
public string ProductName { get; set; }
2727
public decimal UnitPrice { get; set; }
2828
public decimal OldUnitPrice { get; set; }

src/ApiGateways/Web.Bff.Shopping/aggregator/Models/BasketData.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public BasketData(string buyerId)
2222
public class BasketDataItem
2323
{
2424
public string Id { get; set; }
25-
public string ProductId { get; set; }
25+
public int ProductId { get; set; }
2626
public string ProductName { get; set; }
2727
public decimal UnitPrice { get; set; }
2828
public decimal OldUnitPrice { get; set; }

src/Clients/Clients.Grpc.Caller/Protos/basket.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ message CustomerBasketResponse {
2525

2626
message BasketItemResponse {
2727
string id = 1;
28-
string productid = 2;
28+
int32 productid = 2;
2929
string productname = 3;
3030
double unitprice = 4;
3131
double oldunitprice = 5;

src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Basket/BasketItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class BasketItem : BindableObject
99

1010
public string Id { get; set; }
1111

12-
public string ProductId { get; set; }
12+
public int ProductId { get; set; }
1313

1414
public string ProductName { get; set; }
1515

src/Mobile/eShopOnContainers/eShopOnContainers.Core/Models/Orders/OrderItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace eShopOnContainers.Core.Models.Orders
55
{
66
public class OrderItem
77
{
8-
public string ProductId { get; set; }
8+
public int ProductId { get; set; }
99
public Guid? OrderId { get; set; }
1010

1111
[JsonProperty("unitprice")]

src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public async Task Handle(ProductPriceChangedIntegrationEvent @event)
3939

4040
private async Task UpdatePriceInBasketItems(int productId, decimal newPrice, decimal oldPrice, CustomerBasket basket)
4141
{
42-
string match = productId.ToString();
43-
var itemsToUpdate = basket?.Items?.Where(x => x.ProductId == match).ToList();
42+
var itemsToUpdate = basket?.Items?.Where(x => x.ProductId == productId).ToList();
4443

4544
if (itemsToUpdate != null)
4645
{

src/Services/Basket/Basket.API/Model/BasketItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model
66
public class BasketItem : IValidatableObject
77
{
88
public string Id { get; set; }
9-
public string ProductId { get; set; }
9+
public int ProductId { get; set; }
1010
public string ProductName { get; set; }
1111
public decimal UnitPrice { get; set; }
1212
public decimal OldUnitPrice { get; set; }

src/Services/Basket/Basket.API/Proto/basket.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ message CustomerBasketResponse {
2525

2626
message BasketItemResponse {
2727
string id = 1;
28-
string productid = 2;
28+
int32 productid = 2;
2929
string productname = 3;
3030
double unitprice = 4;
3131
double oldunitprice = 5;

src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ string BuildBasket()
6363

6464
order.Items.Add(new BasketItem
6565
{
66-
ProductId = "1",
66+
ProductId = 1,
6767
ProductName = ".NET Bot Black Hoodie",
6868
UnitPrice = 10,
6969
Quantity = 1

src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ List<BasketItem> BuildBasketItems()
7575
{
7676
Id = "basketId",
7777
PictureUrl = "pictureurl",
78-
ProductId = "productId",
78+
ProductId = 1,
7979
ProductName = "productName",
8080
Quantity = 1,
8181
UnitPrice = 1

0 commit comments

Comments
 (0)