@ -1,21 +0,0 @@ | |||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; | |||
using Microsoft.eShopOnContainers.Services.Basket.API.Model; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Basket.API.IntegrationEvents.Events | |||
{ | |||
public class UserCheckoutAccepted : IntegrationEvent | |||
{ | |||
public string UserId {get; } | |||
CustomerBasket Basket { get; } | |||
public UserCheckoutAccepted(string userId, CustomerBasket basket) | |||
{ | |||
UserId = userId; | |||
Basket = basket; | |||
} | |||
} | |||
} |
@ -0,0 +1,64 @@ | |||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; | |||
using Microsoft.eShopOnContainers.Services.Basket.API.Model; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Basket.API.IntegrationEvents.Events | |||
{ | |||
public class UserCheckoutAcceptedIntegrationEvent : IntegrationEvent | |||
{ | |||
public string UserId { get; } | |||
public int OrderNumber { get; set; } | |||
public string City { get; set; } | |||
public string Street { get; set; } | |||
public string State { get; set; } | |||
public string Country { get; set; } | |||
public string ZipCode { get; set; } | |||
public string CardNumber { get; set; } | |||
public string CardHolderName { get; set; } | |||
public DateTime CardExpiration { get; set; } | |||
public string CardSecurityNumber { get; set; } | |||
public int CardTypeId { get; set; } | |||
public string Buyer { get; set; } | |||
public Guid RequestId { get; set; } | |||
public CustomerBasket Basket { get; } | |||
public UserCheckoutAcceptedIntegrationEvent(string userId, string city, string street, | |||
string state, string country, string zipCode, string cardNumber, string cardHolderName, | |||
DateTime cardExpiration, string cardSecurityNumber, int cardTypeId, string buyer, Guid requestId, | |||
CustomerBasket basket) | |||
{ | |||
UserId = userId; | |||
City = city; | |||
Street = street; | |||
State = state; | |||
Country = country; | |||
ZipCode = zipCode; | |||
CardNumber = cardNumber; | |||
CardHolderName = cardHolderName; | |||
CardExpiration = cardExpiration; | |||
CardSecurityNumber = cardSecurityNumber; | |||
CardTypeId = cardTypeId; | |||
Buyer = buyer; | |||
Basket = basket; | |||
RequestId = requestId; | |||
} | |||
} | |||
} |
@ -0,0 +1,35 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Basket.API.Model | |||
{ | |||
public class BasketCheckout | |||
{ | |||
public string City { get; set; } | |||
public string Street { get; set; } | |||
public string State { get; set; } | |||
public string Country { get; set; } | |||
public string ZipCode { get; set; } | |||
public string CardNumber { get; set; } | |||
public string CardHolderName { get; set; } | |||
public DateTime CardExpiration { get; set; } | |||
public string CardSecurityNumber { get; set; } | |||
public int CardTypeId { get; set; } | |||
public string Buyer { get; set; } | |||
public Guid RequestId { get; set; } | |||
} | |||
} | |||
@ -1,14 +0,0 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; | |||
namespace Ordering.API.Application.IntegrationCommands.Commands | |||
{ | |||
public class SubmitOrderCommandMsg : IntegrationEvent | |||
{ | |||
public int OrderNumber { get; private set; } | |||
//TODO: message should change to Integration command type once command bus is implemented | |||
} | |||
} |
@ -1,16 +0,0 @@ | |||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Ordering.API.Application.IntegrationEvents.EventHandling | |||
{ | |||
public class UserCheckoutAcceptedIntegrationEventHandler : IDynamicIntegrationEventHandler | |||
{ | |||
public async Task Handle(dynamic eventData) | |||
{ | |||
int i = 0; | |||
} | |||
} | |||
} |
@ -0,0 +1,62 @@ | |||
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; | |||
using Ordering.API.Application.Models; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Ordering.API.Application.IntegrationEvents.Events | |||
{ | |||
public class UserCheckoutAcceptedIntegrationEvent : IntegrationEvent | |||
{ | |||
public string UserId { get; } | |||
public string City { get; set; } | |||
public string Street { get; set; } | |||
public string State { get; set; } | |||
public string Country { get; set; } | |||
public string ZipCode { get; set; } | |||
public string CardNumber { get; set; } | |||
public string CardHolderName { get; set; } | |||
public DateTime CardExpiration { get; set; } | |||
public string CardSecurityNumber { get; set; } | |||
public int CardTypeId { get; set; } | |||
public string Buyer { get; set; } | |||
public Guid RequestId { get; set; } | |||
public CustomerBasket Basket { get; } | |||
public UserCheckoutAcceptedIntegrationEvent(string userId, string city, string street, | |||
string state, string country, string zipCode, string cardNumber, string cardHolderName, | |||
DateTime cardExpiration, string cardSecurityNumber, int cardTypeId, string buyer, Guid requestId, | |||
CustomerBasket basket) | |||
{ | |||
UserId = userId; | |||
City = city; | |||
Street = street; | |||
State = state; | |||
Country = country; | |||
ZipCode = zipCode; | |||
CardNumber = cardNumber; | |||
CardHolderName = cardHolderName; | |||
CardExpiration = cardExpiration; | |||
CardSecurityNumber = cardSecurityNumber; | |||
CardTypeId = cardTypeId; | |||
Buyer = buyer; | |||
Basket = basket; | |||
RequestId = requestId; | |||
} | |||
} | |||
} |
@ -0,0 +1,18 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Ordering.API.Application.Models | |||
{ | |||
public class BasketItem | |||
{ | |||
public string Id { get; set; } | |||
public string ProductId { get; set; } | |||
public string ProductName { get; set; } | |||
public decimal UnitPrice { get; set; } | |||
public decimal OldUnitPrice { get; set; } | |||
public int Quantity { get; set; } | |||
public string PictureUrl { get; set; } | |||
} | |||
} |
@ -0,0 +1,19 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Threading.Tasks; | |||
namespace Ordering.API.Application.Models | |||
{ | |||
public class CustomerBasket | |||
{ | |||
public string BuyerId { get; set; } | |||
public List<BasketItem> Items { get; set; } | |||
public CustomerBasket(string customerId) | |||
{ | |||
BuyerId = customerId; | |||
Items = new List<BasketItem>(); | |||
} | |||
} | |||
} |
@ -0,0 +1,37 @@ | |||
using System; | |||
using System.ComponentModel.DataAnnotations; | |||
namespace WebMVC.Models | |||
{ | |||
public class BasketDTO | |||
{ | |||
[Required] | |||
public string City { get; set; } | |||
[Required] | |||
public string Street { get; set; } | |||
[Required] | |||
public string State { get; set; } | |||
[Required] | |||
public string Country { get; set; } | |||
public string ZipCode { get; set; } | |||
[Required] | |||
public string CardNumber { get; set; } | |||
[Required] | |||
public string CardHolderName { get; set; } | |||
[Required] | |||
public DateTime CardExpiration { get; set; } | |||
[Required] | |||
public string CardSecurityNumber { get; set; } | |||
public int CardTypeId { get; set; } | |||
public string Buyer { get; set; } | |||
[Required] | |||
public Guid RequestId { get; set; } | |||
} | |||
} | |||