Skip to content

Commit

Permalink
[Aggregator] Added Dto Model Class for Api Aggreation Operations
Browse files Browse the repository at this point in the history
  • Loading branch information
hidayatarg committed Oct 12, 2023
1 parent f7709c9 commit 203e6b4
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace Shopping.Aggregator.Models;
/// <summary>
/// It is the DTO of the Basket.API -> Entities -> ShoppingCartItem
/// </summary>
public class BasketItemExtendedModel
{
public int Quantity { get; set; }
public string Color { get; set; }
public decimal Price { get; set; }
public string ProductId { get; set; }
public string ProductName { get; set; }

// Product Related Additional Fields -> these info will be retrieved from mongoDB by using productId
public string Category { get; set; }
public string Summary { get; set; }
public string Description { get; set; }
public string ImageFile { get; set; }
}
10 changes: 10 additions & 0 deletions src/ApiGateways/Shopping.Aggregator/Models/BasketModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace Shopping.Aggregator.Models;
/// <summary>
/// It is the DTO of the Basket.API -> Entities -> ShoppingCart
/// </summary>
public class BasketModel
{
public string UserName { get; set; }
public List<BasketItemExtendedModel> Items { get; set; } = new List<BasketItemExtendedModel>();
public decimal TotalPrice { get; set; }
}
14 changes: 14 additions & 0 deletions src/ApiGateways/Shopping.Aggregator/Models/CatalogModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Shopping.Aggregator.Models;
/// <summary>
/// It is the DTO of the Catalog.API -> Entities -> Product
/// </summary>
public class CatalogModel
{
public string Id { get; set; }
public string Name { get; set; }
public string Category { get; set; }
public string Summary { get; set; }
public string Description { get; set; }
public string ImageFile { get; set; }
public decimal Price { get; set; }
}
25 changes: 25 additions & 0 deletions src/ApiGateways/Shopping.Aggregator/Models/OrderResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace Shopping.Aggregator.Models;
/// <summary>
/// It is the DTO of the Ordering.Domain -> Entities -> Order
/// </summary>
public class OrderResponse
{
public string UserName { get; set; }
public decimal TotalPrice { get; set; }

// BillingAddress
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }
public string AddressLine { get; set; }
public string Country { get; set; }
public string? State { get; set; }
public string? ZipCode { get; set; }

// Payment
public string? CardName { get; set; }
public string? CardNumber { get; set; }
public string? Expiration { get; set; }
public string? CVV { get; set; }
public int PaymentMethod { get; set; }
}

0 comments on commit 203e6b4

Please sign in to comment.