From 9d2d152c2d8e9f722983ca1eb53f5c4a62f30ef5 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Wed, 25 Jan 2017 17:10:08 +0100 Subject: [PATCH 1/6] Improve ordering int order to solve feedback --- .../Commands/CreateOrderCommand.cs | 43 ++-- .../Commands/CreateOrderCommandHandler.cs | 92 ++----- .../Application/Decorators/LogDecorator.cs | 2 +- .../Application/Queries/IOrderQueries.cs | 2 +- .../Application/Queries/OrderQueries.cs | 2 +- .../Controllers/OrdersController.cs | 26 +- .../AutofacModules/ApplicationModule.cs | 11 +- .../AutofacModules/MediatorModule.cs | 20 +- .../20161124133626_InitialModel.Designer.cs | 227 ------------------ .../20170118230807_PaymentMethodWithAlias.cs | 28 --- ....cs => 20170125143653_Initial.Designer.cs} | 89 +++---- ...tialModel.cs => 20170125143653_Initial.cs} | 134 ++++------- .../OrderingContextModelSnapshot.cs | 85 +++---- .../Ordering.API/Models/NewOrderViewModel.cs | 35 --- .../Ordering.API/Models/OrderItemViewModel.cs | 19 -- ...ORING TO DO - Remove ViewModel classes.txt | 5 - .../Ordering/Ordering.API/project.json | 51 ++-- .../Ordering/Ordering.API/settings.json | 2 +- .../AggregatesModel/BuyerAggregate/Buyer.cs | 47 +++- .../BuyerAggregate/CardType.cs | 11 +- .../AggregatesModel/BuyerAggregate/Payment.cs | 52 ++-- .../AggregatesModel/OrderAggregate/Address.cs | 28 ++- .../OrderAggregate/IOrderRepository.cs | 6 +- .../AggregatesModel/OrderAggregate/Order.cs | 109 ++++----- .../OrderAggregate/OrderItem.cs | 78 ++++-- .../Ordering/Ordering.Domain/project.json | 4 +- .../OrderingContext.cs | 104 ++++---- .../Repositories/BuyerRepository.cs | 35 +-- .../Repositories/OrderRepository.cs | 12 +- .../Ordering.Infrastructure/project.json | 8 +- .../Services/Ordering/OrderingScenarios.cs | 38 ++- test/Services/FunctionalTests/project.json | 21 +- .../Application/NewOrderCommandHandlerTest.cs | 32 ++- test/Services/UnitTest/project.json | 24 +- 34 files changed, 581 insertions(+), 901 deletions(-) delete mode 100644 src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20161124133626_InitialModel.Designer.cs delete mode 100644 src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170118230807_PaymentMethodWithAlias.cs rename src/Services/Ordering/Ordering.API/Infrastructure/Migrations/{20170118230807_PaymentMethodWithAlias.Designer.cs => 20170125143653_Initial.Designer.cs} (78%) rename src/Services/Ordering/Ordering.API/Infrastructure/Migrations/{20161124133626_InitialModel.cs => 20170125143653_Initial.cs} (78%) delete mode 100644 src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs delete mode 100644 src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs delete mode 100644 src/Services/Ordering/Ordering.API/Models/_REFACTORING TO DO - Remove ViewModel classes.txt diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs index bdaff000e..83ae8ef94 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs @@ -1,21 +1,16 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Commands -{ - using System; - using MediatR; - using Domain; - using System.Collections; - using System.Collections.Generic; +using System; +using MediatR; +using System.Collections.Generic; - //(CDLTLL) TO DO: This is wrong, we must NOT use a child-entity class within a Command class!! - //Need to create a different DTO class, like OrderLineDTO or similar... - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands +{ + public class CreateOrderCommand :IAsyncRequest { - //(CDLTLL) TO DO: This is wrong, we must NOT use a child-entity class (OrderItem) within a Command class!! - //Need to create a different DTO class, like OrderLineData or similar within the CreateOrderCommand class... - private readonly List _orderItems; + private readonly List _orderItems; + public string City { get; set; } public string Street { get; set; } @@ -36,18 +31,32 @@ public int CardTypeId { get; set; } - public string BuyerIdentityGuid { get; set; } + public string BuyerFullName { get; set; } - public IEnumerable OrderItems => _orderItems; + public IEnumerable Items => _orderItems; - public void AddOrderItem(OrderItem item) + public void AddOrderItem(OrderItemDTO item) { _orderItems.Add(item); } public CreateOrderCommand() { - _orderItems = new List(); + _orderItems = new List(); + } + + + public class OrderItemDTO + { + public int ProductId { get; set; } + + public string ProductName { get; set; } + + public decimal UnitPrice { get; set; } + + public decimal Discount { get; set; } + + public int Units { get; set; } } } } diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs index b584d0d01..92a5e691d 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs @@ -1,12 +1,10 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Commands +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands { - using Domain.AggregatesModel.OrderAggregate; using Domain.AggregatesModel.BuyerAggregate; + using Domain.AggregatesModel.OrderAggregate; using MediatR; - using System.Linq; using System; using System.Threading.Tasks; - using Domain; public class CreateOrderCommandHandler : IAsyncRequestHandler @@ -14,7 +12,7 @@ private readonly IBuyerRepository _buyerRepository; private readonly IOrderRepository _orderRepository; - public CreateOrderCommandHandler(IBuyerRepository buyerRepository,IOrderRepository orderRepository) + public CreateOrderCommandHandler(IBuyerRepository buyerRepository, IOrderRepository orderRepository) { if (buyerRepository == null) { @@ -29,36 +27,37 @@ _buyerRepository = buyerRepository; _orderRepository = orderRepository; } + public async Task Handle(CreateOrderCommand message) { //find buyer/payment or add a new one buyer/payment - var buyer = await _buyerRepository.FindAsync(message.BuyerIdentityGuid); + var buyer = await _buyerRepository.FindAsync(message.BuyerFullName); if (buyer == null) { - buyer = CreateBuyer(message); + buyer = new Buyer(message.BuyerFullName); } - var payment = GetExistingPaymentOrAddANewOne(buyer, message); + var payment = buyer.AddPayment(message.CardTypeId, + $"Payment Method on {DateTime.UtcNow}", + message.CardNumber, + message.CardSecurityNumber, + message.CardHolderName, + message.CardExpiration); + + _buyerRepository.Add(buyer); await _buyerRepository.UnitOfWork .SaveChangesAsync(); //create order for buyer and payment method - var order = CreateOrder(buyer.Id, payment.Id, 0); - order.SetAddress( new Address() - { - City = message.City, - State = message.State, - Street = message.Street, - ZipCode = message.ZipCode - }); + var order = new Order(buyer.Id, payment.Id, new Address(message.Street, message.City, message.State, message.Country, message.ZipCode)); - foreach (var item in message.OrderItems) + foreach (var item in message.Items) { - order.AddOrderItem(item); + order.AddOrderItem(item.ProductId, item.ProductName, item.UnitPrice, item.Discount, item.Units); } _orderRepository.Add(order); @@ -68,62 +67,5 @@ return result > 0; } - - Buyer CreateBuyer(CreateOrderCommand message) - { - return _buyerRepository.Add( - new Buyer(message.BuyerIdentityGuid)); - } - - Order CreateOrder(int buyerId, int paymentId, int addressId) - { - return new Order(buyerId, paymentId); - } - - - //TO DO: - //(CDLTLL) This is wrong. We shouldn't be able to create a PaymentMethod from a CommandHandler or anywhere in the Application Layer - //because a PaymentMethod is a child-entity, part of the Buyer Aggregate. - //So, any creation/update of a PaymentMethod should be done through its Aggregate-Root: the Buyer root entity. - //Need to move this logic to the Buyer Aggregate-Root and rename to "AddPaymentMethod()" - Payment CreatePayment(CreateOrderCommand message) - { - return new Payment("My Default Payment Method", message.CardNumber, message.CardSecurityNumber, message.CardHolderName, message.CardExpiration, message.CardTypeId); - } - - //TO DO: - //(CDLTLL) This is wrong. As explained, this logic should be part of the - //Buyer Aggregate Root, as a PaymentMethod is a child-entity of that Aggregate. - Payment GetExistingPaymentOrAddANewOne(Buyer buyer, CreateOrderCommand message) - { - Payment payment = PaymentAlreadyExist(buyer, message); - - if (payment == null) - { - payment = CreatePayment(message); - buyer.Payments.Add(payment); - } - - return payment; - - } - - //TO DO: - //(CDLTLL) This is wrong. As explained, this logic should be part of the - //Buyer Aggregate Root, as a PaymentMethod is a child-entity of that Aggregate. - Payment PaymentAlreadyExist(Buyer buyer, CreateOrderCommand message) - { - return buyer.Payments - .SingleOrDefault(p => - { - return p.CardHolderName == message.CardHolderName - && - p.CardNumber == message.CardNumber - && - p.Expiration == message.CardExpiration - && - p.SecurityNumber == message.CardSecurityNumber; - }); - } } } diff --git a/src/Services/Ordering/Ordering.API/Application/Decorators/LogDecorator.cs b/src/Services/Ordering/Ordering.API/Application/Decorators/LogDecorator.cs index 6830d9db0..693151be3 100644 --- a/src/Services/Ordering/Ordering.API/Application/Decorators/LogDecorator.cs +++ b/src/Services/Ordering/Ordering.API/Application/Decorators/LogDecorator.cs @@ -1,4 +1,4 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Decorators +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Decorators { using Extensions.Logging; using MediatR; diff --git a/src/Services/Ordering/Ordering.API/Application/Queries/IOrderQueries.cs b/src/Services/Ordering/Ordering.API/Application/Queries/IOrderQueries.cs index c036e8806..f12a9e418 100644 --- a/src/Services/Ordering/Ordering.API/Application/Queries/IOrderQueries.cs +++ b/src/Services/Ordering/Ordering.API/Application/Queries/IOrderQueries.cs @@ -1,4 +1,4 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Queries +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries { using System.Threading.Tasks; diff --git a/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs b/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs index 899b3dccc..ed3e58c8d 100644 --- a/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs +++ b/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs @@ -1,4 +1,4 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Queries +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries { using Dapper; using Microsoft.Extensions.Configuration; diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index bc50824dd..eb6df071c 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -1,16 +1,14 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers +using MediatR; +using Microsoft.AspNetCore.Mvc; +using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; +using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries; +using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; + +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers { - using Api.Application.Commands; - using Api.Application.Queries; - using AspNetCore.Authorization; - using Infrastructure.Services; - using MediatR; - using Microsoft.AspNetCore.Mvc; - using Models; - using System; - using System.Collections.Generic; - using System.Threading.Tasks; - [Route("api/v1/[controller]")] [Authorize] public class OrdersController : Controller @@ -46,9 +44,11 @@ public async Task AddOrder([FromBody]CreateOrderCommand createOrderCommand) { if (createOrderCommand.CardTypeId == 0) + { createOrderCommand.CardTypeId = 1; + } - createOrderCommand.BuyerIdentityGuid = _identityService.GetUserIdentity(); + createOrderCommand.BuyerFullName = _identityService.GetUserIdentity(); var added = await _mediator.SendAsync(createOrderCommand); if (added) diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs index a0ad2412f..0f56720f2 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs @@ -1,12 +1,11 @@ - +using Autofac; +using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.AutofacModules { - using Api.Application.Queries; - using Autofac; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; - using Ordering.Infrastructure.Repositories; public class ApplicationModule :Autofac.Module diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs index 0c911139e..e5754eeca 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs @@ -1,14 +1,14 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.AutofacModules -{ - using Api.Application.Commands; - using Api.Application.Decorators; - using Autofac; - using Autofac.Core; - using MediatR; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; +using Autofac; +using Autofac.Core; +using MediatR; +using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; +using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Decorators; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.AutofacModules +{ public class MediatorModule : Autofac.Module { protected override void Load(ContainerBuilder builder) diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20161124133626_InitialModel.Designer.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20161124133626_InitialModel.Designer.cs deleted file mode 100644 index f7d11fbfb..000000000 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20161124133626_InitialModel.Designer.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; - -namespace Ordering.API.Infrastructure.Migrations -{ - [DbContext(typeof(OrderingContext))] - [Migration("20161124133626_InitialModel")] - partial class InitialModel - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { - modelBuilder - .HasAnnotation("ProductVersion", "1.0.1") - .HasAnnotation("SqlServer:Sequence:ordering.buyerseq", "'buyerseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") - .HasAnnotation("SqlServer:Sequence:ordering.orderseq", "'orderseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") - .HasAnnotation("SqlServer:Sequence:ordering.paymentseq", "'paymentseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("City"); - - b.Property("Country"); - - b.Property("State"); - - b.Property("Street"); - - b.Property("ZipCode"); - - b.HasKey("Id"); - - b.ToTable("address","ordering"); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.Buyer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasAnnotation("SqlServer:HiLoSequenceName", "buyerseq") - .HasAnnotation("SqlServer:HiLoSequenceSchema", "ordering") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo); - - b.Property("FullName") - .IsRequired() - .HasAnnotation("MaxLength", 200); - - b.HasKey("Id"); - - b.HasIndex("FullName") - .IsUnique(); - - b.ToTable("buyers","ordering"); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.CardType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasDefaultValue(1); - - b.Property("Name") - .IsRequired() - .HasAnnotation("MaxLength", 200); - - b.HasKey("Id"); - - b.ToTable("cardtypes","ordering"); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasAnnotation("SqlServer:HiLoSequenceName", "orderseq") - .HasAnnotation("SqlServer:HiLoSequenceSchema", "ordering") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo); - - b.Property("BuyerId"); - - b.Property("OrderDate"); - - b.Property("PaymentId"); - - b.Property("ShippingAddressId"); - - b.Property("StatusId"); - - b.HasKey("Id"); - - b.HasIndex("BuyerId"); - - b.HasIndex("PaymentId"); - - b.HasIndex("ShippingAddressId"); - - b.HasIndex("StatusId"); - - b.ToTable("orders","ordering"); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.OrderItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("Discount"); - - b.Property("OrderId"); - - b.Property("ProductId"); - - b.Property("ProductName") - .IsRequired(); - - b.Property("UnitPrice"); - - b.Property("Units") - .ValueGeneratedOnAdd() - .HasAnnotation("SqlServer:DefaultValue", 1); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("orderItems","ordering"); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.OrderStatus", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasDefaultValue(1); - - b.Property("Name") - .IsRequired() - .HasAnnotation("MaxLength", 200); - - b.HasKey("Id"); - - b.ToTable("orderstatus","ordering"); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.Payment", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasAnnotation("SqlServer:HiLoSequenceName", "paymentseq") - .HasAnnotation("SqlServer:HiLoSequenceSchema", "ordering") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo); - - b.Property("BuyerId"); - - b.Property("CardHolderName") - .IsRequired() - .HasAnnotation("MaxLength", 200); - - b.Property("CardNumber") - .IsRequired() - .HasAnnotation("MaxLength", 25); - - b.Property("CardTypeId"); - - b.Property("Expiration"); - - b.Property("SecurityNumber"); - - b.HasKey("Id"); - - b.HasIndex("BuyerId"); - - b.HasIndex("CardTypeId"); - - b.ToTable("payments","ordering"); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.Order", b => - { - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.Buyer", "Buyer") - .WithMany() - .HasForeignKey("BuyerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.Payment", "Payment") - .WithMany() - .HasForeignKey("PaymentId"); - - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.Address", "ShippingAddress") - .WithMany() - .HasForeignKey("ShippingAddressId"); - - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.OrderStatus", "Status") - .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.OrderItem", b => - { - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.Order") - .WithMany("OrderItems") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.Payment", b => - { - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.Buyer") - .WithMany("Payments") - .HasForeignKey("BuyerId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.CardType", "CardType") - .WithMany() - .HasForeignKey("CardTypeId") - .OnDelete(DeleteBehavior.Cascade); - }); - } - } -} diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170118230807_PaymentMethodWithAlias.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170118230807_PaymentMethodWithAlias.cs deleted file mode 100644 index a3152432b..000000000 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170118230807_PaymentMethodWithAlias.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Ordering.API.Infrastructure.Migrations -{ - public partial class PaymentMethodWithAlias : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Alias", - schema: "ordering", - table: "payments", - maxLength: 200, - nullable: false, - defaultValue: ""); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Alias", - schema: "ordering", - table: "payments"); - } - } -} diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170118230807_PaymentMethodWithAlias.Designer.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.Designer.cs similarity index 78% rename from src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170118230807_PaymentMethodWithAlias.Designer.cs rename to src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.Designer.cs index 4fe16d38a..497f5a95b 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170118230807_PaymentMethodWithAlias.Designer.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.Designer.cs @@ -5,16 +5,17 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; -namespace Ordering.API.Infrastructure.Migrations +namespace Ordering.API.Migrations { [DbContext(typeof(OrderingContext))] - [Migration("20170118230807_PaymentMethodWithAlias")] - partial class PaymentMethodWithAlias + [Migration("20170125143653_Initial")] + partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { modelBuilder - .HasAnnotation("ProductVersion", "1.0.1") + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:Sequence:.orderitemseq", "'orderitemseq', '', '1', '10', '', '', 'Int64', 'False'") .HasAnnotation("SqlServer:Sequence:ordering.buyerseq", "'buyerseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") .HasAnnotation("SqlServer:Sequence:ordering.orderseq", "'orderseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") .HasAnnotation("SqlServer:Sequence:ordering.paymentseq", "'paymentseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") @@ -30,7 +31,7 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("FullName") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.HasKey("Id"); @@ -43,12 +44,11 @@ namespace Ordering.API.Infrastructure.Migrations modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.CardType", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasDefaultValue(1); b.Property("Name") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.HasKey("Id"); @@ -65,24 +65,22 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("Alias") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.Property("BuyerId"); b.Property("CardHolderName") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.Property("CardNumber") .IsRequired() - .HasAnnotation("MaxLength", 25); + .HasMaxLength(25); b.Property("CardTypeId"); b.Property("Expiration"); - b.Property("SecurityNumber"); - b.HasKey("Id"); b.HasIndex("BuyerId"); @@ -92,26 +90,6 @@ namespace Ordering.API.Infrastructure.Migrations b.ToTable("payments","ordering"); }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("City"); - - b.Property("Country"); - - b.Property("State"); - - b.Property("Street"); - - b.Property("ZipCode"); - - b.HasKey("Id"); - - b.ToTable("address","ordering"); - }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Order", b => { b.Property("Id") @@ -122,23 +100,31 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("BuyerId"); + b.Property("City") + .IsRequired(); + b.Property("OrderDate"); + b.Property("OrderStatusId"); + b.Property("PaymentId"); - b.Property("ShippingAddressId"); + b.Property("State") + .IsRequired(); - b.Property("StatusId"); + b.Property("Street") + .IsRequired(); + + b.Property("ZipCode") + .IsRequired(); b.HasKey("Id"); b.HasIndex("BuyerId"); - b.HasIndex("PaymentId"); + b.HasIndex("OrderStatusId"); - b.HasIndex("ShippingAddressId"); - - b.HasIndex("StatusId"); + b.HasIndex("PaymentId"); b.ToTable("orders","ordering"); }); @@ -146,14 +132,14 @@ namespace Ordering.API.Infrastructure.Migrations modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderItem", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:HiLoSequenceName", "orderitemseq") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo); b.Property("Discount"); b.Property("OrderId"); - b.Property("PictureUrl"); - b.Property("ProductId"); b.Property("ProductName") @@ -161,9 +147,7 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("UnitPrice"); - b.Property("Units") - .ValueGeneratedOnAdd() - .HasAnnotation("SqlServer:DefaultValue", 1); + b.Property("Units"); b.HasKey("Id"); @@ -175,12 +159,11 @@ namespace Ordering.API.Infrastructure.Migrations modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderStatus", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasDefaultValue(1); b.Property("Name") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.HasKey("Id"); @@ -207,18 +190,14 @@ namespace Ordering.API.Infrastructure.Migrations .HasForeignKey("BuyerId") .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", "Payment") - .WithMany() - .HasForeignKey("PaymentId"); - - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Address", "ShippingAddress") + b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderStatus", "OrderStatus") .WithMany() - .HasForeignKey("ShippingAddressId"); + .HasForeignKey("OrderStatusId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderStatus", "Status") + b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", "Payment") .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade); + .HasForeignKey("PaymentId"); }); modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderItem", b => diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20161124133626_InitialModel.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.cs similarity index 78% rename from src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20161124133626_InitialModel.cs rename to src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.cs index e6ac74cee..2787184c7 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20161124133626_InitialModel.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.cs @@ -1,17 +1,20 @@ using System; using System.Collections.Generic; using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Metadata; -namespace Ordering.API.Infrastructure.Migrations +namespace Ordering.API.Migrations { - public partial class InitialModel : Migration + public partial class Initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.EnsureSchema( name: "ordering"); + migrationBuilder.CreateSequence( + name: "orderitemseq", + incrementBy: 10); + migrationBuilder.CreateSequence( name: "buyerseq", schema: "ordering", @@ -27,24 +30,6 @@ namespace Ordering.API.Infrastructure.Migrations schema: "ordering", incrementBy: 10); - migrationBuilder.CreateTable( - name: "address", - schema: "ordering", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - City = table.Column(nullable: true), - Country = table.Column(nullable: true), - State = table.Column(nullable: true), - Street = table.Column(nullable: true), - ZipCode = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_address", x => x.Id); - }); - migrationBuilder.CreateTable( name: "buyers", schema: "ordering", @@ -90,12 +75,12 @@ namespace Ordering.API.Infrastructure.Migrations columns: table => new { Id = table.Column(nullable: false), + Alias = table.Column(maxLength: 200, nullable: false), BuyerId = table.Column(nullable: false), CardHolderName = table.Column(maxLength: 200, nullable: false), CardNumber = table.Column(maxLength: 25, nullable: false), CardTypeId = table.Column(nullable: false), - Expiration = table.Column(nullable: false), - SecurityNumber = table.Column(nullable: true) + Expiration = table.Column(nullable: false) }, constraints: table => { @@ -123,10 +108,13 @@ namespace Ordering.API.Infrastructure.Migrations { Id = table.Column(nullable: false), BuyerId = table.Column(nullable: false), + City = table.Column(nullable: false), OrderDate = table.Column(nullable: false), + OrderStatusId = table.Column(nullable: false), PaymentId = table.Column(nullable: false), - ShippingAddressId = table.Column(nullable: true), - StatusId = table.Column(nullable: false) + State = table.Column(nullable: false), + Street = table.Column(nullable: false), + ZipCode = table.Column(nullable: false) }, constraints: table => { @@ -139,26 +127,19 @@ namespace Ordering.API.Infrastructure.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_orders_payments_PaymentId", - column: x => x.PaymentId, + name: "FK_orders_orderstatus_OrderStatusId", + column: x => x.OrderStatusId, principalSchema: "ordering", - principalTable: "payments", + principalTable: "orderstatus", principalColumn: "Id", - onDelete: ReferentialAction.Restrict); + onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_orders_address_ShippingAddressId", - column: x => x.ShippingAddressId, + name: "FK_orders_payments_PaymentId", + column: x => x.PaymentId, principalSchema: "ordering", - principalTable: "address", + principalTable: "payments", principalColumn: "Id", onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_orders_orderstatus_StatusId", - column: x => x.StatusId, - principalSchema: "ordering", - principalTable: "orderstatus", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( @@ -166,15 +147,13 @@ namespace Ordering.API.Infrastructure.Migrations schema: "ordering", columns: table => new { - Id = table.Column(nullable: false) - .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), + Id = table.Column(nullable: false), Discount = table.Column(nullable: false), OrderId = table.Column(nullable: false), ProductId = table.Column(nullable: false), ProductName = table.Column(nullable: false), - PictureUrl = table.Column(nullable: false), UnitPrice = table.Column(nullable: false), - Units = table.Column(nullable: false, defaultValue: 1) + Units = table.Column(nullable: false) }, constraints: table => { @@ -196,62 +175,44 @@ namespace Ordering.API.Infrastructure.Migrations unique: true); migrationBuilder.CreateIndex( - name: "IX_orders_BuyerId", + name: "IX_payments_BuyerId", schema: "ordering", - table: "orders", + table: "payments", column: "BuyerId"); migrationBuilder.CreateIndex( - name: "IX_orders_PaymentId", + name: "IX_payments_CardTypeId", + schema: "ordering", + table: "payments", + column: "CardTypeId"); + + migrationBuilder.CreateIndex( + name: "IX_orders_BuyerId", schema: "ordering", table: "orders", - column: "PaymentId"); + column: "BuyerId"); migrationBuilder.CreateIndex( - name: "IX_orders_ShippingAddressId", + name: "IX_orders_OrderStatusId", schema: "ordering", table: "orders", - column: "ShippingAddressId"); + column: "OrderStatusId"); migrationBuilder.CreateIndex( - name: "IX_orders_StatusId", + name: "IX_orders_PaymentId", schema: "ordering", table: "orders", - column: "StatusId"); + column: "PaymentId"); migrationBuilder.CreateIndex( name: "IX_orderItems_OrderId", schema: "ordering", table: "orderItems", column: "OrderId"); - - migrationBuilder.CreateIndex( - name: "IX_payments_BuyerId", - schema: "ordering", - table: "payments", - column: "BuyerId"); - - migrationBuilder.CreateIndex( - name: "IX_payments_CardTypeId", - schema: "ordering", - table: "payments", - column: "CardTypeId"); } protected override void Down(MigrationBuilder migrationBuilder) { - migrationBuilder.DropSequence( - name: "buyerseq", - schema: "ordering"); - - migrationBuilder.DropSequence( - name: "orderseq", - schema: "ordering"); - - migrationBuilder.DropSequence( - name: "paymentseq", - schema: "ordering"); - migrationBuilder.DropTable( name: "orderItems", schema: "ordering"); @@ -261,15 +222,11 @@ namespace Ordering.API.Infrastructure.Migrations schema: "ordering"); migrationBuilder.DropTable( - name: "payments", - schema: "ordering"); - - migrationBuilder.DropTable( - name: "address", + name: "orderstatus", schema: "ordering"); migrationBuilder.DropTable( - name: "orderstatus", + name: "payments", schema: "ordering"); migrationBuilder.DropTable( @@ -279,6 +236,21 @@ namespace Ordering.API.Infrastructure.Migrations migrationBuilder.DropTable( name: "cardtypes", schema: "ordering"); + + migrationBuilder.DropSequence( + name: "orderitemseq"); + + migrationBuilder.DropSequence( + name: "buyerseq", + schema: "ordering"); + + migrationBuilder.DropSequence( + name: "orderseq", + schema: "ordering"); + + migrationBuilder.DropSequence( + name: "paymentseq", + schema: "ordering"); } } } diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs index 1f385a316..5aefd0de7 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs @@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; -namespace Ordering.API.Infrastructure.Migrations +namespace Ordering.API.Migrations { [DbContext(typeof(OrderingContext))] partial class OrderingContextModelSnapshot : ModelSnapshot @@ -13,7 +13,8 @@ namespace Ordering.API.Infrastructure.Migrations protected override void BuildModel(ModelBuilder modelBuilder) { modelBuilder - .HasAnnotation("ProductVersion", "1.0.1") + .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") + .HasAnnotation("SqlServer:Sequence:.orderitemseq", "'orderitemseq', '', '1', '10', '', '', 'Int64', 'False'") .HasAnnotation("SqlServer:Sequence:ordering.buyerseq", "'buyerseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") .HasAnnotation("SqlServer:Sequence:ordering.orderseq", "'orderseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") .HasAnnotation("SqlServer:Sequence:ordering.paymentseq", "'paymentseq', 'ordering', '1', '10', '', '', 'Int64', 'False'") @@ -29,7 +30,7 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("FullName") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.HasKey("Id"); @@ -42,12 +43,11 @@ namespace Ordering.API.Infrastructure.Migrations modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.CardType", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasDefaultValue(1); b.Property("Name") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.HasKey("Id"); @@ -64,24 +64,22 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("Alias") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.Property("BuyerId"); b.Property("CardHolderName") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.Property("CardNumber") .IsRequired() - .HasAnnotation("MaxLength", 25); + .HasMaxLength(25); b.Property("CardTypeId"); b.Property("Expiration"); - b.Property("SecurityNumber"); - b.HasKey("Id"); b.HasIndex("BuyerId"); @@ -91,26 +89,6 @@ namespace Ordering.API.Infrastructure.Migrations b.ToTable("payments","ordering"); }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Address", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("City"); - - b.Property("Country"); - - b.Property("State"); - - b.Property("Street"); - - b.Property("ZipCode"); - - b.HasKey("Id"); - - b.ToTable("address","ordering"); - }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Order", b => { b.Property("Id") @@ -121,23 +99,31 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("BuyerId"); + b.Property("City") + .IsRequired(); + b.Property("OrderDate"); + b.Property("OrderStatusId"); + b.Property("PaymentId"); - b.Property("ShippingAddressId"); + b.Property("State") + .IsRequired(); - b.Property("StatusId"); + b.Property("Street") + .IsRequired(); + + b.Property("ZipCode") + .IsRequired(); b.HasKey("Id"); b.HasIndex("BuyerId"); - b.HasIndex("PaymentId"); + b.HasIndex("OrderStatusId"); - b.HasIndex("ShippingAddressId"); - - b.HasIndex("StatusId"); + b.HasIndex("PaymentId"); b.ToTable("orders","ordering"); }); @@ -145,14 +131,14 @@ namespace Ordering.API.Infrastructure.Migrations modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderItem", b => { b.Property("Id") - .ValueGeneratedOnAdd(); + .ValueGeneratedOnAdd() + .HasAnnotation("SqlServer:HiLoSequenceName", "orderitemseq") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.SequenceHiLo); b.Property("Discount"); b.Property("OrderId"); - b.Property("PictureUrl"); - b.Property("ProductId"); b.Property("ProductName") @@ -160,9 +146,7 @@ namespace Ordering.API.Infrastructure.Migrations b.Property("UnitPrice"); - b.Property("Units") - .ValueGeneratedOnAdd() - .HasAnnotation("SqlServer:DefaultValue", 1); + b.Property("Units"); b.HasKey("Id"); @@ -174,12 +158,11 @@ namespace Ordering.API.Infrastructure.Migrations modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderStatus", b => { b.Property("Id") - .ValueGeneratedOnAdd() .HasDefaultValue(1); b.Property("Name") .IsRequired() - .HasAnnotation("MaxLength", 200); + .HasMaxLength(200); b.HasKey("Id"); @@ -206,18 +189,14 @@ namespace Ordering.API.Infrastructure.Migrations .HasForeignKey("BuyerId") .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", "Payment") - .WithMany() - .HasForeignKey("PaymentId"); - - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Address", "ShippingAddress") + b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderStatus", "OrderStatus") .WithMany() - .HasForeignKey("ShippingAddressId"); + .HasForeignKey("OrderStatusId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderStatus", "Status") + b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", "Payment") .WithMany() - .HasForeignKey("StatusId") - .OnDelete(DeleteBehavior.Cascade); + .HasForeignKey("PaymentId"); }); modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderItem", b => diff --git a/src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs b/src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs deleted file mode 100644 index e2049947c..000000000 --- a/src/Services/Ordering/Ordering.API/Models/NewOrderViewModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Models -{ - //TO DO: Confirm if this class is not needed, if not, remove it - //(CDLTLL) - public class NewOrderViewModel - { - public string ShippingCity { get; set; } - - public string ShippingStreet { get; set; } - - public string ShippingState { get; set; } - - public string ShippingCountry { get; set; } - - public string CardType { get; set; } - - public string CardNumber { get; set; } - - public string CardHolderName { get; set; } - - public DateTime CardExpiration { get; set; } - - public string CardSecurityNumber { get; set; } - - public List Items { get; set; } - - public NewOrderViewModel() - { - Items = new List(); - } - } -} diff --git a/src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs b/src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs deleted file mode 100644 index 1f088f648..000000000 --- a/src/Services/Ordering/Ordering.API/Models/OrderItemViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Models -{ - //TO DO: Confirm if this class is not needed, if not, remove it - //(CDLTLL) - public class OrderItemViewModel - { - public int ProductId { get; set; } - - public string ProductName { get; set; } - - public decimal UnitPrice { get; set; } - - public decimal Discount { get; set; } - - public int Units { get; set; } - - public string PictureUrl { get; set; } - } -} \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Models/_REFACTORING TO DO - Remove ViewModel classes.txt b/src/Services/Ordering/Ordering.API/Models/_REFACTORING TO DO - Remove ViewModel classes.txt deleted file mode 100644 index a7ac46963..000000000 --- a/src/Services/Ordering/Ordering.API/Models/_REFACTORING TO DO - Remove ViewModel classes.txt +++ /dev/null @@ -1,5 +0,0 @@ - -REFACTORING TO DO: - //TO DO: Confirm if these ViewModel classes are still needed, if not, remove it - //and remove the related Unit Tests - //(CDLTLL) diff --git a/src/Services/Ordering/Ordering.API/project.json b/src/Services/Ordering/Ordering.API/project.json index 0c4d597ea..291892b40 100644 --- a/src/Services/Ordering/Ordering.API/project.json +++ b/src/Services/Ordering/Ordering.API/project.json @@ -1,44 +1,45 @@ { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.1", + "version": "1.1.0", "type": "platform" }, - "MediatR.Extensions.Microsoft.DependencyInjection": "1.0.1", + "MediatR.Extensions.Microsoft.DependencyInjection": "1.1.0", "Autofac.Extensions.DependencyInjection": "4.0.0", - "Microsoft.AspNetCore.Mvc": "1.0.0", - "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", - "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0", - "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0", - "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0", - "Microsoft.Extensions.Configuration.Json": "1.0.0", - "Microsoft.Extensions.Logging.Abstractions": "1.0.0", - "Microsoft.Extensions.Logging.Console": "1.0.0", - "Microsoft.Extensions.Logging.Debug": "1.0.0", - "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0", - "Microsoft.EntityFrameworkCore.SqlServer": "1.0.1", - "Microsoft.EntityFrameworkCore": "1.0.1", - "Microsoft.EntityFrameworkCore.Design": "1.0.0-preview2-final", - "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.0.1", - "Microsoft.AspNetCore.Diagnostics": "1.0.0", + "Microsoft.AspNetCore.Mvc": "1.1.0", + "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0", + "Microsoft.AspNetCore.Server.Kestrel":"1.0.1", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0", + "Microsoft.Extensions.Configuration.FileExtensions": "1.1.0", + "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0", + "Microsoft.Extensions.Configuration.Json": "1.1.0", + "Microsoft.Extensions.Logging.Abstractions": "1.1.0", + "Microsoft.Extensions.Logging.Console": "1.1.0", + "Microsoft.Extensions.Logging.Debug": "1.1.0", + "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0", + "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", + "Microsoft.EntityFrameworkCore": "1.1.0", + "Microsoft.EntityFrameworkCore.Design":"1.1.0", + "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0", + "Microsoft.AspNetCore.Diagnostics": "1.1.0", "Swashbuckle": "6.0.0-beta902", "MediatR": "2.1.0", - "Ordering.Domain": "1.0.0-*", - "Ordering.Infrastructure": "1.0.0-*", "System.Reflection": "4.3.0", "IdentityServer4.AccessTokenValidation": "1.0.1-rc3", - "Dapper": "1.50.2" + "Dapper": "1.50.2", + "Ordering.Domain": "1.0.0-*", + "Ordering.Infrastructure": "1.0.0-*" }, "tools": { - "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final", + "Microsoft.EntityFrameworkCore.Tools.DotNet": "1.1.0-preview4-final", "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" }, "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "imports": [ - "dotnet5.6", - "portable-net45+win8" + "netstandard1.6.1", + "dnxcore50", + "portable-net451+win8" ] } }, diff --git a/src/Services/Ordering/Ordering.API/settings.json b/src/Services/Ordering/Ordering.API/settings.json index a6c3d9cac..09552377a 100644 --- a/src/Services/Ordering/Ordering.API/settings.json +++ b/src/Services/Ordering/Ordering.API/settings.json @@ -1,6 +1,6 @@ { "ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;", - "IdentityUrl": "http://localhost:5105", + "IdentityUrl": "http://localhost:5105", "Logging": { "IncludeScopes": false, "LogLevel": { diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs index c10f38ff3..0203b72e3 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs @@ -1,27 +1,50 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate -{ - using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; - using System; - using System.Collections.Generic; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; +using System.Collections.Generic; +using System.Linq; +namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate +{ public class Buyer - :Entity,IAggregateRoot + : Entity, IAggregateRoot { public string FullName { get; private set; } - public HashSet Payments { get; private set; } + private HashSet _payments; + + public IEnumerable Payments => _payments?.ToList().AsEnumerable(); protected Buyer() { } - public Buyer(string IdentityGuid) + public Buyer(string identity) + { + if (String.IsNullOrWhiteSpace(identity)) + { + throw new ArgumentNullException(nameof(identity)); + } + + FullName = identity; + + _payments = new HashSet(); + } + + public Payment AddPayment(int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration) { - if (String.IsNullOrWhiteSpace(IdentityGuid)) + var existingPayment = Payments.Where(p => p.IsEqualTo(cardTypeId, cardNumber, expiration)) + .SingleOrDefault(); + + if (existingPayment != null) { - throw new ArgumentNullException(nameof(IdentityGuid)); + return existingPayment; } + else + { + var payment = new Payment(cardTypeId, alias, cardNumber, securityNumber, cardHolderName, expiration); + + _payments.Add(payment); - this.FullName = IdentityGuid; - this.Payments = new HashSet(); + return payment; + } } } } diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/CardType.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/CardType.cs index dc5cfe6f6..217ef6095 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/CardType.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/CardType.cs @@ -1,12 +1,11 @@ - +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; +using System.Collections.Generic; +using System.Linq; namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate { - using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; - using System; - using System.Collections.Generic; - using System.Linq; - + public class CardType : Entity { diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs index 3644bba35..5cf02e8b5 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs @@ -1,30 +1,25 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate -{ - using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; - using System; - +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; +namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate +{ public class Payment : Entity { - public string Alias { get; private set; } - public int BuyerId { get; private set; } - - public string CardNumber { get; private set; } - - public string SecurityNumber { get; private set; } - - public string CardHolderName { get; private set; } - - public int CardTypeId { get; private set; } - + private int _buyerId; + private string _alias; + private string _cardNumber; + private string _securityNumber; + private string _cardHolderName; + private DateTime _expiration; + + private int _cardTypeId; public CardType CardType { get; private set; } - public DateTime Expiration { get; private set; } protected Payment() { } - public Payment(string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration, int cardTypeId) + public Payment(int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration) { if (String.IsNullOrWhiteSpace(cardNumber)) { @@ -35,7 +30,7 @@ { throw new ArgumentException(nameof(securityNumber)); } - + if (String.IsNullOrWhiteSpace(cardHolderName)) { throw new ArgumentException(nameof(cardHolderName)); @@ -46,12 +41,19 @@ throw new ArgumentException(nameof(expiration)); } - this.Alias = alias; - this.CardNumber = cardNumber; - this.SecurityNumber = securityNumber; - this.CardHolderName = cardHolderName; - this.Expiration = expiration; - this.CardTypeId = cardTypeId; + _alias = alias; + _cardNumber = cardNumber; + _securityNumber = securityNumber; + _cardHolderName = cardHolderName; + _expiration = expiration; + _cardTypeId = cardTypeId; + } + + public bool IsEqualTo(int cardTypeId, string cardNumber,DateTime expiration) + { + return _cardTypeId == cardTypeId + && _cardNumber == cardNumber + && _expiration == expiration; } } } diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Address.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Address.cs index 9d36bcc17..b3760480c 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Address.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Address.cs @@ -1,22 +1,26 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate -{ - using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; - using System; +using System; - //(CDLTLL) - //TO DO: Need to convert this entity to a Value-Object (Address VO) +namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate +{ public class Address - : Entity { - public String Street { get; set; } + public String Street { get; } - public String City { get; set; } + public String City { get; } - public String State { get; set; } + public String State { get; } - public String Country { get; set; } + public String Country { get; } - public String ZipCode { get; set; } + public String ZipCode { get; } + public Address(string street, string city, string state, string country, string zipcode) + { + Street = street; + City = city; + State = state; + Country = country; + ZipCode = zipcode; + } } } diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs index 85dfe4eb1..c7af790eb 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs @@ -1,7 +1,7 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; + +namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate { - using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; //This is just the RepositoryContracts or Interface defined at the Domain Layer //as requisite for the Order Aggregate diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs index db86e5ba2..e1e44fcf0 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs @@ -1,79 +1,76 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate { - using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; - using System; - using System.Collections.Generic; - - //(CDLTLL) - //TO DO: Need to add additional Domain Logic to this Aggregate-Root for - //scenarios related to Order state changes, stock availability validation, etc. public class Order - : Entity, IAggregateRoot + : Entity { - public int BuyerId { get; private set; } - - public Buyer Buyer { get; private set; } - - public DateTime OrderDate { get; private set; } - public int StatusId { get; private set; } + private string _street; + private string _city; + private string _state; + private string _country; + private string _zipCode; + private DateTime _orderDate; - public OrderStatus Status { get; private set; } - - public ICollection OrderItems { get; private set; } - - public int? ShippingAddressId { get; private set; } + public Buyer Buyer { get; private set; } + int _buyerId; - public Address ShippingAddress { get; private set; } + public OrderStatus OrderStatus { get; private set; } + int _orderStatusId; - public int PaymentId { get; private set; } + HashSet _orderItems; + public IEnumerable OrderItems => _orderItems.ToList().AsEnumerable(); public Payment Payment { get; private set; } + int _paymentId; protected Order() { } - public Order(int buyerId, int paymentId) + public Order(int buyerId, int paymentId, Address address) { - BuyerId = buyerId; - PaymentId = paymentId; - StatusId = OrderStatus.InProcess.Id; - OrderDate = DateTime.UtcNow; - OrderItems = new List(); + + _buyerId = buyerId; + _paymentId = paymentId; + _orderStatusId = OrderStatus.InProcess.Id; + _orderDate = DateTime.UtcNow; + _street = address.Street; + _city = address.City; + _state = address.State; + _country = address.Country; + _zipCode = address.ZipCode; + + _orderItems = new HashSet(); } - public void SetAddress(Address address) + + public void AddOrderItem(int productId, string productName, decimal unitPrice, decimal discount, int units = 1) { - if (address == null) + var existingOrderForProduct = _orderItems.Where(o => o.ProductId == productId) + .SingleOrDefault(); + + if (existingOrderForProduct != null) { - throw new ArgumentNullException(nameof(address)); + //if previous line exist modify it with higher discount and units.. + + if (discount > existingOrderForProduct.GetCurrentDiscount()) + { + existingOrderForProduct.SetNewDiscount(discount); + existingOrderForProduct.AddUnits(units); + } } + else + { + //add validated new order item - ShippingAddress = address; - } + var orderItem = new OrderItem(productId, productName, unitPrice, discount, units); - //TO DO: - // (CDLTLL) Bad implementation, needs to be changed. - // The AddOrderItem should have the needed data params - // instead of an already created OrderItem object. - // The Aggregate-Root is responsible for any Update/Creation of its child entities - // If we are providing an already created OrderItem, that was created from the outside - // and the AggregateRoot cannot control/validate any rule/invariants/consistency. - public void AddOrderItem(OrderItem item) - { - //TO DO: Bad implementation, need to change. - // The code "new OrderItem(params);" should be done here - // Plus any validation/rule related - OrderItems.Add(item); - - //(CDLTLL) - // TO DO: Some more logic needs to be added here, - // Like consolidating items that are the same product in one single OrderItem with several units - // Also validation logic could be added here (like ensuring it is adding at least one item unit) - - //Or, If there are different amounts of discounts per added OrderItem - //but the product Id is the same to existing Order Items, you should - //apply the higher discount, or any other domain logic that makes sense. + _orderItems.Add(orderItem); + } } } } diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs index 0e57ea701..9a62ef1a3 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs @@ -1,28 +1,74 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate -{ - using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; - //TO DO: - //(CDLTLL) Wrong implementation. Need to put Setters as private - // and only be able to update the OrderItem through specific methods, if needed, so we can - // have validations/control/logic in those "update or set methods". - //We also need to have a constructor with the needed params, we must not use the "setters".. +namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate +{ public class OrderItem - :Entity + : Entity { - public int ProductId { get; set; } + private string _productName; + private string _pictureUrl; + private int _orderId; + private decimal _unitPrice; + private decimal _discount; + private int _units; + + public int ProductId { get; private set; } + + + protected OrderItem() { } + + public OrderItem(int productId, string productName, decimal unitPrice, decimal discount, int units = 1) + { + if (units <= 0) + { + throw new ArgumentNullException("Invalid number of units"); + } + + if ((unitPrice * units) < discount) + { + throw new ArgumentException("The total of order item is lower than applied discount"); + } + + ProductId = productId; - public string ProductName { get; set; } + _productName = productName; + _unitPrice = unitPrice; + _discount = discount; + _units = units; + } - public string PictureUrl { get; set; } + public void SetPictureUri(string pictureUri) + { + if (!String.IsNullOrWhiteSpace(pictureUri)) + { + _pictureUrl = pictureUri; + } + } - public int OrderId { get; set; } + public decimal GetCurrentDiscount() + { + return _discount; + } - public decimal UnitPrice { get; set; } + public void SetNewDiscount(decimal discount) + { + if (discount < 0) + { + throw new ArgumentException("Discount is not valid"); + } - public decimal Discount { get; set; } + _discount = discount; + } - public int Units { get; set; } + public void AddUnits(int units) + { + if (units < 0) + { + throw new ArgumentException("Invalid units"); + } + _units += units; + } } } diff --git a/src/Services/Ordering/Ordering.Domain/project.json b/src/Services/Ordering/Ordering.Domain/project.json index db56591f2..2feeaa08d 100644 --- a/src/Services/Ordering/Ordering.Domain/project.json +++ b/src/Services/Ordering/Ordering.Domain/project.json @@ -2,11 +2,11 @@ "version": "1.0.0-*", "dependencies": { - "NETStandard.Library": "1.6" + "NETStandard.Library": "1.6.1" }, "frameworks": { - "netstandard1.6": { + "netstandard1.6.1": { "imports": "dnxcore50" } } diff --git a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs index b34a6ee05..ac21ae53e 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs @@ -1,17 +1,15 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; + +namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure { - using System; - using System.Threading.Tasks; - using Domain.SeedWork; - using EntityFrameworkCore.Metadata; - using Microsoft.EntityFrameworkCore; - using Microsoft.EntityFrameworkCore.Metadata.Builders; - using Microsoft.eShopOnContainers.Services.Ordering.Domain; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; - public class OrderingContext - : DbContext,IUnitOfWork + : DbContext,IUnitOfWork { const string DEFAULT_SCHEMA = "ordering"; @@ -28,8 +26,6 @@ public DbSet OrderStatus { get; set; } - public DbSet
Addresses { get; set; } - public OrderingContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) @@ -40,29 +36,31 @@ modelBuilder.Entity(ConfigureOrderItems); modelBuilder.Entity(ConfigureCardTypes); modelBuilder.Entity(ConfigureOrderStatus); - modelBuilder.Entity
(ConfigureAddress); } void ConfigureBuyer(EntityTypeBuilder buyerConfiguration) { buyerConfiguration.ToTable("buyers", DEFAULT_SCHEMA); - buyerConfiguration.HasIndex(b => b.FullName) - .IsUnique(true); - buyerConfiguration.HasKey(b => b.Id); buyerConfiguration.Property(b => b.Id) .ForSqlServerUseSequenceHiLo("buyerseq", DEFAULT_SCHEMA); - buyerConfiguration.Property(b => b.FullName) + buyerConfiguration.Property(b=>b.FullName) .HasMaxLength(200) .IsRequired(); + buyerConfiguration.HasIndex("FullName") + .IsUnique(true); + buyerConfiguration.HasMany(b => b.Payments) - .WithOne() - .HasForeignKey(p => p.BuyerId) - .OnDelete(DeleteBehavior.Cascade); + .WithOne() + .HasForeignKey("BuyerId") + .OnDelete(DeleteBehavior.Cascade); + + var navigation = buyerConfiguration.Metadata.FindNavigation(nameof(Buyer.Payments)); + navigation.SetPropertyAccessMode(PropertyAccessMode.Field); } void ConfigurePayment(EntityTypeBuilder paymentConfiguration) @@ -74,24 +72,30 @@ paymentConfiguration.Property(b => b.Id) .ForSqlServerUseSequenceHiLo("paymentseq", DEFAULT_SCHEMA); - paymentConfiguration.Property(p => p.CardHolderName) + paymentConfiguration.Property("BuyerId") + .IsRequired(); + + paymentConfiguration.Property("CardHolderName") .HasMaxLength(200) .IsRequired(); - paymentConfiguration.Property(p => p.Alias) + paymentConfiguration.Property("Alias") .HasMaxLength(200) .IsRequired(); - paymentConfiguration.Property(p => p.CardNumber) + paymentConfiguration.Property("CardNumber") .HasMaxLength(25) .IsRequired(); - paymentConfiguration.Property(p => p.Expiration) + paymentConfiguration.Property("Expiration") + .IsRequired(); + + paymentConfiguration.Property("CardTypeId") .IsRequired(); paymentConfiguration.HasOne(p => p.CardType) .WithMany() - .HasForeignKey(p => p.CardTypeId); + .HasForeignKey("CardTypeId"); } void ConfigureOrder(EntityTypeBuilder orderConfiguration) @@ -103,21 +107,31 @@ orderConfiguration.Property(o => o.Id) .ForSqlServerUseSequenceHiLo("orderseq", DEFAULT_SCHEMA); - orderConfiguration.Property(o => o.OrderDate) - .IsRequired(); + orderConfiguration.Property("OrderDate").IsRequired(); + orderConfiguration.Property("Street").IsRequired(); + orderConfiguration.Property("State").IsRequired(); + orderConfiguration.Property("City").IsRequired(); + orderConfiguration.Property("ZipCode").IsRequired(); + orderConfiguration.Property("BuyerId").IsRequired(); + orderConfiguration.Property("OrderStatusId").IsRequired(); + orderConfiguration.Property("PaymentId").IsRequired(); + + var navigation = orderConfiguration.Metadata.FindNavigation(nameof(Order.OrderItems)); + + navigation.SetPropertyAccessMode(PropertyAccessMode.Field); orderConfiguration.HasOne(o => o.Payment) .WithMany() - .HasForeignKey(o => o.PaymentId) + .HasForeignKey("PaymentId") .OnDelete(DeleteBehavior.Restrict); orderConfiguration.HasOne(o => o.Buyer) .WithMany() - .HasForeignKey(o => o.BuyerId); + .HasForeignKey("BuyerId"); - orderConfiguration.HasOne(o => o.Status) + orderConfiguration.HasOne(o => o.OrderStatus) .WithMany() - .HasForeignKey(o => o.StatusId); + .HasForeignKey("OrderStatusId"); } void ConfigureOrderItems(EntityTypeBuilder orderItemConfiguration) @@ -126,20 +140,25 @@ orderItemConfiguration.HasKey(o => o.Id); - orderItemConfiguration.Property(o => o.Discount) + orderItemConfiguration.Property(o => o.Id) + .ForSqlServerUseSequenceHiLo("orderitemseq"); + + orderItemConfiguration.Property("OrderId") .IsRequired(); - orderItemConfiguration.Property(o => o.ProductId) + orderItemConfiguration.Property("Discount") .IsRequired(); - orderItemConfiguration.Property(o => o.ProductName) + orderItemConfiguration.Property("ProductId") .IsRequired(); - orderItemConfiguration.Property(o => o.UnitPrice) + orderItemConfiguration.Property("ProductName") .IsRequired(); - orderItemConfiguration.Property(o => o.Units) - .ForSqlServerHasDefaultValue(1) + orderItemConfiguration.Property("UnitPrice") + .IsRequired(); + + orderItemConfiguration.Property("Units") .IsRequired(); } @@ -151,6 +170,7 @@ orderStatusConfiguration.Property(o => o.Id) .HasDefaultValue(1) + .ValueGeneratedNever() .IsRequired(); orderStatusConfiguration.Property(o => o.Name) @@ -166,16 +186,12 @@ cardTypesConfiguration.Property(ct => ct.Id) .HasDefaultValue(1) + .ValueGeneratedNever() .IsRequired(); cardTypesConfiguration.Property(ct => ct.Name) .HasMaxLength(200) .IsRequired(); } - - void ConfigureAddress(EntityTypeBuilder
addressConfiguration) - { - addressConfiguration.ToTable("address", DEFAULT_SCHEMA); - } } } diff --git a/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs b/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs index cb1fe4049..2854e42e1 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs @@ -1,13 +1,12 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories -{ - using Domain.SeedWork; - using Microsoft.EntityFrameworkCore; - using Microsoft.eShopOnContainers.Services.Ordering.Domain; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; - using System; - using System.Linq; - using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; +using System.Linq; +using System.Threading.Tasks; +namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories +{ public class BuyerRepository : IBuyerRepository { @@ -33,16 +32,24 @@ public Buyer Add(Buyer buyer) { - return _context.Buyers - .Add(buyer) - .Entity; + if (buyer.IsTransient()) + { + return _context.Buyers + .Add(buyer) + .Entity; + } + else + { + return buyer; + } + } - public async Task FindAsync(string BuyerIdentityGuid) + public async Task FindAsync(string identity) { var buyer = await _context.Buyers .Include(b => b.Payments) - .Where(b => b.FullName == BuyerIdentityGuid) + .Where(b => b.FullName == identity) .SingleOrDefaultAsync(); return buyer; diff --git a/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs b/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs index b7995f039..62066dd91 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs @@ -1,14 +1,14 @@ -namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories -{ - using Domain; - using Domain.SeedWork; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; - using System; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; +using System; +namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories +{ public class OrderRepository : IOrderRepository { private readonly OrderingContext _context; + public IUnitOfWork UnitOfWork { get diff --git a/src/Services/Ordering/Ordering.Infrastructure/project.json b/src/Services/Ordering/Ordering.Infrastructure/project.json index 03c2eeef4..5d5355dfc 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/project.json +++ b/src/Services/Ordering/Ordering.Infrastructure/project.json @@ -2,14 +2,14 @@ "version": "1.0.0-*", "dependencies": { - "NETStandard.Library": "1.6.0", - "Microsoft.EntityFrameworkCore": "1.0.1", - "Microsoft.EntityFrameworkCore.SqlServer": "1.0.1", + "NETStandard.Library": "1.6.1", + "Microsoft.EntityFrameworkCore": "1.1.0", + "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0", "Ordering.Domain": "1.0.0-*" }, "frameworks": { - "netstandard1.6": { + "netstandard1.6.1": { "imports": "dnxcore50" } } diff --git a/test/Services/FunctionalTests/Services/Ordering/OrderingScenarios.cs b/test/Services/FunctionalTests/Services/Ordering/OrderingScenarios.cs index 3230b1924..1320d47e3 100644 --- a/test/Services/FunctionalTests/Services/Ordering/OrderingScenarios.cs +++ b/test/Services/FunctionalTests/Services/Ordering/OrderingScenarios.cs @@ -1,12 +1,13 @@ namespace FunctionalTests.Services.Ordering { - using Microsoft.eShopOnContainers.Services.Ordering.API.Models; + using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using Newtonsoft.Json; using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Xunit; + using static Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands.CreateOrderCommand; public class OrderingScenarios : OrderingScenarioBase @@ -64,34 +65,45 @@ string BuildOrder() { - var order = new NewOrderViewModel() + var order = new CreateOrderCommand() { CardExpiration = DateTime.UtcNow.AddYears(1), CardNumber = "5145-555-5555", CardHolderName = "Jhon Senna", CardSecurityNumber = "232", - CardType = "Amex", - ShippingCity = "Redmon", - ShippingCountry = "USA", - ShippingState = "WA", - ShippingStreet = "One way" + CardTypeId = 1, + City = "Redmon", + Country = "USA", + State = "WA", + Street = "One way", + ZipCode = "zipcode", }; + order.AddOrderItem(new OrderItemDTO() + { + ProductId = 1, + Discount = 10M, + UnitPrice = 10, + Units = 1, + ProductName = "Some name" + }); + return JsonConvert.SerializeObject(order); } string BuildOrderWithInvalidExperationTime() { - var order = new NewOrderViewModel() + var order = new CreateOrderCommand() { CardExpiration = DateTime.UtcNow.AddYears(-1), CardNumber = "5145-555-5555", CardHolderName = "Jhon Senna", CardSecurityNumber = "232", - CardType = "Amex", - ShippingCity = "Redmon", - ShippingCountry = "USA", - ShippingState = "WA", - ShippingStreet = "One way" + CardTypeId = 1, + City = "Redmon", + Country = "USA", + State = "WA", + Street = "One way", + ZipCode = "zipcode" }; return JsonConvert.SerializeObject(order); diff --git a/test/Services/FunctionalTests/project.json b/test/Services/FunctionalTests/project.json index 56d0182a2..9db48cfb1 100644 --- a/test/Services/FunctionalTests/project.json +++ b/test/Services/FunctionalTests/project.json @@ -2,21 +2,28 @@ "version": "1.0.0-*", "dependencies": { - "Microsoft.NETCore.App": "1.1.0", + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.1.0" + }, "Microsoft.AspNetCore.TestHost": "1.1.0", "dotnet-test-xunit": "2.2.0-preview2-build1029", + "Microsoft.DotNet.InternalAbstractions": "1.0.0", "xunit": "2.2.0-beta4-build3444", "Catalog.API": "1.0.0-*", "Ordering.API": "1.0.0-*" }, "testRunner": "xunit", - "runtimes": { - "win10-x64": {} - }, + //"runtimes": { + // "win10-x64": {} + //}, "frameworks": { - "netcoreapp1.0": { - "dependencies": { - } + "netcoreapp1.1": { + "imports": [ + "netstandard1.6.1", + "dnxcore50", + "portable-net451+win8" + ] } }, "publishOptions": { diff --git a/test/Services/UnitTest/Ordering/Application/NewOrderCommandHandlerTest.cs b/test/Services/UnitTest/Ordering/Application/NewOrderCommandHandlerTest.cs index 47a57d578..af26cbe49 100644 --- a/test/Services/UnitTest/Ordering/Application/NewOrderCommandHandlerTest.cs +++ b/test/Services/UnitTest/Ordering/Application/NewOrderCommandHandlerTest.cs @@ -1,15 +1,14 @@ -namespace UnitTest.Ordering.Application +using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; +using Moq; +using System; +using System.Threading; +using System.Threading.Tasks; +using Xunit; + +namespace UnitTest.Ordering.Application { - using Microsoft.eShopOnContainers.Services.Ordering.Api.Application.Commands; - using Microsoft.eShopOnContainers.Services.Ordering.Domain; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.Repositories; - using Moq; - using System; - using System.Threading; - using System.Threading.Tasks; - using Xunit; - - public class NewOrderRequestHandlerTest { private readonly Mock _buyerRepositoryMock; @@ -26,7 +25,7 @@ public async Task Handle_returns_true_when_order_is_persisted_succesfully() { // Arrange - _buyerRepositoryMock.Setup(buyerRepo => buyerRepo.FindAsync(FakeOrderRequestWithBuyer().BuyerIdentityGuid)) + _buyerRepositoryMock.Setup(buyerRepo => buyerRepo.FindAsync(FakeOrderRequestWithBuyer().BuyerFullName)) .Returns(Task.FromResult(FakeBuyer())); _buyerRepositoryMock.Setup(buyerRepo => buyerRepo.UnitOfWork.SaveChangesAsync(default(CancellationToken))) @@ -49,7 +48,7 @@ [Fact] public async Task Handle_return_false_if_order_is_not_persisted() { - _buyerRepositoryMock.Setup(buyerRepo => buyerRepo.FindAsync(FakeOrderRequestWithBuyer().BuyerIdentityGuid)) + _buyerRepositoryMock.Setup(buyerRepo => buyerRepo.FindAsync(FakeOrderRequestWithBuyer().BuyerFullName)) .Returns(Task.FromResult(FakeBuyer())); _buyerRepositoryMock.Setup(buyerRepo => buyerRepo.UnitOfWork.SaveChangesAsync(default(CancellationToken))) @@ -74,17 +73,14 @@ private Order FakeOrder() { - return new Order(1, 1) - { - - }; + return new Order(1, 1, new Address("street", "city", "state", "country", "zipcode")); } private CreateOrderCommand FakeOrderRequestWithBuyer() { return new CreateOrderCommand { - BuyerIdentityGuid = "1234", + BuyerFullName = "1234", CardNumber = "1234", CardExpiration = DateTime.Now.AddYears(1), CardSecurityNumber = "123", diff --git a/test/Services/UnitTest/project.json b/test/Services/UnitTest/project.json index 0e54e4c4f..e44322750 100644 --- a/test/Services/UnitTest/project.json +++ b/test/Services/UnitTest/project.json @@ -2,23 +2,27 @@ "version": "1.0.0-*", "dependencies": { + "Microsoft.NETCore.App": { + "type": "platform", + "version": "1.1.0" + }, "MediatR": "2.1.0", "Moq": "4.6.38-alpha", - "Microsoft.NETCore.App": "1.1.0", "xunit": "2.2.0-beta4-build3444", - "Ordering.API": "1.0.0-*", - "Catalog.API": "1.0.0-*", "Microsoft.AspNetCore.TestHost": "1.1.0", - "dotnet-test-xunit": "2.2.0-preview2-build1029" + "dotnet-test-xunit": "2.2.0-preview2-build1029", + "Ordering.API": "1.0.0-*", + "Ordering.Infrastructure": "1.0.0-*", + "Ordering.Domain": "1.0.0-*" }, "testRunner": "xunit", - "runtimes": { - "win10-x64": {} - }, "frameworks": { - "netcoreapp1.0": { - "dependencies": { - } + "netcoreapp1.1": { + "imports": [ + "netstandard1.6.1", + "dnxcore50", + "portable-net451+win8" + ] } } } From 607d1ca2fa4c05755920eed171fd2c75b83a6e84 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Fri, 27 Jan 2017 11:38:23 +0100 Subject: [PATCH 2/6] Fix query with new model. Add missing properties into migration. Work on github issues --- .../Commands/CreateOrderCommandHandler.cs | 2 +- .../Controllers/OrdersController.cs | 1 + ...orizationHeaderParameterOperationFilter.cs | 2 -- ....cs => 20170127103457_Initial.Designer.cs} | 23 +++++++------ ...3_Initial.cs => 20170127103457_Initial.cs} | 32 ++++++++++--------- .../OrderingContextModelSnapshot.cs | 21 +++++++----- .../AggregatesModel/BuyerAggregate/Buyer.cs | 14 ++++---- .../AggregatesModel/BuyerAggregate/Payment.cs | 6 ++-- .../OrderAggregate/IOrderRepository.cs | 3 +- .../AggregatesModel/OrderAggregate/Order.cs | 9 +++--- .../OrderingContext.cs | 23 +++++++------ .../Repositories/BuyerRepository.cs | 2 +- 12 files changed, 76 insertions(+), 62 deletions(-) rename src/Services/Ordering/Ordering.API/Infrastructure/Migrations/{20170125143653_Initial.Designer.cs => 20170127103457_Initial.Designer.cs} (92%) rename src/Services/Ordering/Ordering.API/Infrastructure/Migrations/{20170125143653_Initial.cs => 20170127103457_Initial.cs} (90%) diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs index 92a5e691d..576aa61b7 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommandHandler.cs @@ -39,7 +39,7 @@ buyer = new Buyer(message.BuyerFullName); } - var payment = buyer.AddPayment(message.CardTypeId, + var payment = buyer.AddPaymentMethod(message.CardTypeId, $"Payment Method on {DateTime.UtcNow}", message.CardNumber, message.CardSecurityNumber, diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index eb6df071c..2226c95e4 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -1,4 +1,5 @@ using MediatR; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries; diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs index 94e2a48c2..2b5b33fd7 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs @@ -1,10 +1,8 @@ using Microsoft.AspNetCore.Mvc.Authorization; using Swashbuckle.Swagger.Model; using Swashbuckle.SwaggerGen.Generator; -using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Auth { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.Designer.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170127103457_Initial.Designer.cs similarity index 92% rename from src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.Designer.cs rename to src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170127103457_Initial.Designer.cs index 497f5a95b..cf7e5fdfb 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.Designer.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170127103457_Initial.Designer.cs @@ -8,7 +8,7 @@ using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; namespace Ordering.API.Migrations { [DbContext(typeof(OrderingContext))] - [Migration("20170125143653_Initial")] + [Migration("20170127103457_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -55,7 +55,7 @@ namespace Ordering.API.Migrations b.ToTable("cardtypes","ordering"); }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", b => + modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -87,7 +87,7 @@ namespace Ordering.API.Migrations b.HasIndex("CardTypeId"); - b.ToTable("payments","ordering"); + b.ToTable("paymentmethods","ordering"); }); modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Order", b => @@ -103,11 +103,14 @@ namespace Ordering.API.Migrations b.Property("City") .IsRequired(); + b.Property("Country") + .IsRequired(); + b.Property("OrderDate"); b.Property("OrderStatusId"); - b.Property("PaymentId"); + b.Property("PaymentMethodId"); b.Property("State") .IsRequired(); @@ -124,7 +127,7 @@ namespace Ordering.API.Migrations b.HasIndex("OrderStatusId"); - b.HasIndex("PaymentId"); + b.HasIndex("PaymentMethodId"); b.ToTable("orders","ordering"); }); @@ -140,6 +143,8 @@ namespace Ordering.API.Migrations b.Property("OrderId"); + b.Property("PictureUrl"); + b.Property("ProductId"); b.Property("ProductName") @@ -170,10 +175,10 @@ namespace Ordering.API.Migrations b.ToTable("orderstatus","ordering"); }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", b => + modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod", b => { b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Buyer") - .WithMany("Payments") + .WithMany("PaymentMethods") .HasForeignKey("BuyerId") .OnDelete(DeleteBehavior.Cascade); @@ -195,9 +200,9 @@ namespace Ordering.API.Migrations .HasForeignKey("OrderStatusId") .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", "Payment") + b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod", "PaymentMethod") .WithMany() - .HasForeignKey("PaymentId"); + .HasForeignKey("PaymentMethodId"); }); modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderItem", b => diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170127103457_Initial.cs similarity index 90% rename from src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.cs rename to src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170127103457_Initial.cs index 2787184c7..86a9403c4 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170125143653_Initial.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170127103457_Initial.cs @@ -70,7 +70,7 @@ namespace Ordering.API.Migrations }); migrationBuilder.CreateTable( - name: "payments", + name: "paymentmethods", schema: "ordering", columns: table => new { @@ -84,16 +84,16 @@ namespace Ordering.API.Migrations }, constraints: table => { - table.PrimaryKey("PK_payments", x => x.Id); + table.PrimaryKey("PK_paymentmethods", x => x.Id); table.ForeignKey( - name: "FK_payments_buyers_BuyerId", + name: "FK_paymentmethods_buyers_BuyerId", column: x => x.BuyerId, principalSchema: "ordering", principalTable: "buyers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_payments_cardtypes_CardTypeId", + name: "FK_paymentmethods_cardtypes_CardTypeId", column: x => x.CardTypeId, principalSchema: "ordering", principalTable: "cardtypes", @@ -109,9 +109,10 @@ namespace Ordering.API.Migrations Id = table.Column(nullable: false), BuyerId = table.Column(nullable: false), City = table.Column(nullable: false), + Country = table.Column(nullable: false), OrderDate = table.Column(nullable: false), OrderStatusId = table.Column(nullable: false), - PaymentId = table.Column(nullable: false), + PaymentMethodId = table.Column(nullable: false), State = table.Column(nullable: false), Street = table.Column(nullable: false), ZipCode = table.Column(nullable: false) @@ -134,10 +135,10 @@ namespace Ordering.API.Migrations principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_orders_payments_PaymentId", - column: x => x.PaymentId, + name: "FK_orders_paymentmethods_PaymentMethodId", + column: x => x.PaymentMethodId, principalSchema: "ordering", - principalTable: "payments", + principalTable: "paymentmethods", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); @@ -150,6 +151,7 @@ namespace Ordering.API.Migrations Id = table.Column(nullable: false), Discount = table.Column(nullable: false), OrderId = table.Column(nullable: false), + PictureUrl = table.Column(nullable: true), ProductId = table.Column(nullable: false), ProductName = table.Column(nullable: false), UnitPrice = table.Column(nullable: false), @@ -175,15 +177,15 @@ namespace Ordering.API.Migrations unique: true); migrationBuilder.CreateIndex( - name: "IX_payments_BuyerId", + name: "IX_paymentmethods_BuyerId", schema: "ordering", - table: "payments", + table: "paymentmethods", column: "BuyerId"); migrationBuilder.CreateIndex( - name: "IX_payments_CardTypeId", + name: "IX_paymentmethods_CardTypeId", schema: "ordering", - table: "payments", + table: "paymentmethods", column: "CardTypeId"); migrationBuilder.CreateIndex( @@ -199,10 +201,10 @@ namespace Ordering.API.Migrations column: "OrderStatusId"); migrationBuilder.CreateIndex( - name: "IX_orders_PaymentId", + name: "IX_orders_PaymentMethodId", schema: "ordering", table: "orders", - column: "PaymentId"); + column: "PaymentMethodId"); migrationBuilder.CreateIndex( name: "IX_orderItems_OrderId", @@ -226,7 +228,7 @@ namespace Ordering.API.Migrations schema: "ordering"); migrationBuilder.DropTable( - name: "payments", + name: "paymentmethods", schema: "ordering"); migrationBuilder.DropTable( diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs index 5aefd0de7..81402440a 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/OrderingContextModelSnapshot.cs @@ -54,7 +54,7 @@ namespace Ordering.API.Migrations b.ToTable("cardtypes","ordering"); }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", b => + modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -86,7 +86,7 @@ namespace Ordering.API.Migrations b.HasIndex("CardTypeId"); - b.ToTable("payments","ordering"); + b.ToTable("paymentmethods","ordering"); }); modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.Order", b => @@ -102,11 +102,14 @@ namespace Ordering.API.Migrations b.Property("City") .IsRequired(); + b.Property("Country") + .IsRequired(); + b.Property("OrderDate"); b.Property("OrderStatusId"); - b.Property("PaymentId"); + b.Property("PaymentMethodId"); b.Property("State") .IsRequired(); @@ -123,7 +126,7 @@ namespace Ordering.API.Migrations b.HasIndex("OrderStatusId"); - b.HasIndex("PaymentId"); + b.HasIndex("PaymentMethodId"); b.ToTable("orders","ordering"); }); @@ -139,6 +142,8 @@ namespace Ordering.API.Migrations b.Property("OrderId"); + b.Property("PictureUrl"); + b.Property("ProductId"); b.Property("ProductName") @@ -169,10 +174,10 @@ namespace Ordering.API.Migrations b.ToTable("orderstatus","ordering"); }); - modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", b => + modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod", b => { b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Buyer") - .WithMany("Payments") + .WithMany("PaymentMethods") .HasForeignKey("BuyerId") .OnDelete(DeleteBehavior.Cascade); @@ -194,9 +199,9 @@ namespace Ordering.API.Migrations .HasForeignKey("OrderStatusId") .OnDelete(DeleteBehavior.Cascade); - b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.Payment", "Payment") + b.HasOne("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate.PaymentMethod", "PaymentMethod") .WithMany() - .HasForeignKey("PaymentId"); + .HasForeignKey("PaymentMethodId"); }); modelBuilder.Entity("Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate.OrderItem", b => diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs index 0203b72e3..e8a0684d3 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs @@ -10,9 +10,9 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B { public string FullName { get; private set; } - private HashSet _payments; + private HashSet _paymentMethods; - public IEnumerable Payments => _payments?.ToList().AsEnumerable(); + public IEnumerable PaymentMethods => _paymentMethods?.ToList().AsEnumerable(); protected Buyer() { } @@ -25,12 +25,12 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B FullName = identity; - _payments = new HashSet(); + _paymentMethods = new HashSet(); } - public Payment AddPayment(int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration) + public PaymentMethod AddPaymentMethod(int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration) { - var existingPayment = Payments.Where(p => p.IsEqualTo(cardTypeId, cardNumber, expiration)) + var existingPayment = _paymentMethods.Where(p => p.IsEqualTo(cardTypeId, cardNumber, expiration)) .SingleOrDefault(); if (existingPayment != null) @@ -39,9 +39,9 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B } else { - var payment = new Payment(cardTypeId, alias, cardNumber, securityNumber, cardHolderName, expiration); + var payment = new PaymentMethod(cardTypeId, alias, cardNumber, securityNumber, cardHolderName, expiration); - _payments.Add(payment); + _paymentMethods.Add(payment); return payment; } diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs index 5cf02e8b5..dc6af27b0 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Payment.cs @@ -3,7 +3,7 @@ using System; namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate { - public class Payment + public class PaymentMethod : Entity { private int _buyerId; @@ -17,9 +17,9 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B public CardType CardType { get; private set; } - protected Payment() { } + protected PaymentMethod() { } - public Payment(int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration) + public PaymentMethod(int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration) { if (String.IsNullOrWhiteSpace(cardNumber)) { diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs index c7af790eb..39e2f6466 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs @@ -1,8 +1,7 @@ using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate -{ - +{ //This is just the RepositoryContracts or Interface defined at the Domain Layer //as requisite for the Order Aggregate public interface IOrderRepository diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs index e1e44fcf0..344b154cd 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs @@ -9,7 +9,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O public class Order : Entity { - private string _street; private string _city; private string _state; @@ -26,16 +25,16 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O HashSet _orderItems; public IEnumerable OrderItems => _orderItems.ToList().AsEnumerable(); - public Payment Payment { get; private set; } - int _paymentId; + public PaymentMethod PaymentMethod { get; private set; } + int _paymentMethodId; protected Order() { } - public Order(int buyerId, int paymentId, Address address) + public Order(int buyerId, int paymentMethodId, Address address) { _buyerId = buyerId; - _paymentId = paymentId; + _paymentMethodId = paymentMethodId; _orderStatusId = OrderStatus.InProcess.Id; _orderDate = DateTime.UtcNow; _street = address.Street; diff --git a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs index ac21ae53e..87449d90c 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs @@ -18,7 +18,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure public DbSet OrderItems { get; set; } - public DbSet Payments { get; set; } + public DbSet Payments { get; set; } public DbSet Buyers { get; set; } @@ -31,7 +31,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity(ConfigureBuyer); - modelBuilder.Entity(ConfigurePayment); + modelBuilder.Entity(ConfigurePayment); modelBuilder.Entity(ConfigureOrder); modelBuilder.Entity(ConfigureOrderItems); modelBuilder.Entity(ConfigureCardTypes); @@ -54,18 +54,19 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure buyerConfiguration.HasIndex("FullName") .IsUnique(true); - buyerConfiguration.HasMany(b => b.Payments) + buyerConfiguration.HasMany(b => b.PaymentMethods) .WithOne() .HasForeignKey("BuyerId") .OnDelete(DeleteBehavior.Cascade); - var navigation = buyerConfiguration.Metadata.FindNavigation(nameof(Buyer.Payments)); + var navigation = buyerConfiguration.Metadata.FindNavigation(nameof(Buyer.PaymentMethods)); + navigation.SetPropertyAccessMode(PropertyAccessMode.Field); } - void ConfigurePayment(EntityTypeBuilder paymentConfiguration) + void ConfigurePayment(EntityTypeBuilder paymentConfiguration) { - paymentConfiguration.ToTable("payments", DEFAULT_SCHEMA); + paymentConfiguration.ToTable("paymentmethods", DEFAULT_SCHEMA); paymentConfiguration.HasKey(b => b.Id); @@ -112,17 +113,18 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure orderConfiguration.Property("State").IsRequired(); orderConfiguration.Property("City").IsRequired(); orderConfiguration.Property("ZipCode").IsRequired(); + orderConfiguration.Property("Country").IsRequired(); orderConfiguration.Property("BuyerId").IsRequired(); orderConfiguration.Property("OrderStatusId").IsRequired(); - orderConfiguration.Property("PaymentId").IsRequired(); + orderConfiguration.Property("PaymentMethodId").IsRequired(); var navigation = orderConfiguration.Metadata.FindNavigation(nameof(Order.OrderItems)); navigation.SetPropertyAccessMode(PropertyAccessMode.Field); - orderConfiguration.HasOne(o => o.Payment) + orderConfiguration.HasOne(o => o.PaymentMethod) .WithMany() - .HasForeignKey("PaymentId") + .HasForeignKey("PaymentMethodId") .OnDelete(DeleteBehavior.Restrict); orderConfiguration.HasOne(o => o.Buyer) @@ -160,6 +162,9 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure orderItemConfiguration.Property("Units") .IsRequired(); + + orderItemConfiguration.Property("PictureUrl") + .IsRequired(false); } void ConfigureOrderStatus(EntityTypeBuilder orderStatusConfiguration) diff --git a/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs b/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs index 2854e42e1..c9fdb28a6 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs @@ -48,7 +48,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor public async Task FindAsync(string identity) { var buyer = await _context.Buyers - .Include(b => b.Payments) + .Include(b => b.PaymentMethods) .Where(b => b.FullName == identity) .SingleOrDefaultAsync(); From 80f223ec4230e2fb3c3630892cbac2938893d021 Mon Sep 17 00:00:00 2001 From: Unai Zorrilla Castro Date: Fri, 27 Jan 2017 11:39:30 +0100 Subject: [PATCH 3/6] fix unsaved file on vs --- .../Ordering/Ordering.API/Application/Queries/OrderQueries.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs b/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs index ed3e58c8d..844d36630 100644 --- a/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs +++ b/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs @@ -28,11 +28,10 @@ var result = await connection.QueryAsync( @"select o.[Id] as ordernumber,o.OrderDate as date, os.Name as status, oi.ProductName as productname, oi.Units as units, oi.UnitPrice as unitprice, oi.PictureUrl as pictureurl, - oa.Street as street, oa.City as city, oa.Country as country, oa.State as state, oa.ZipCode as zipcode + o.Street as street, o.City as city, o.Country as country, o.State as state, o.ZipCode as zipcode FROM ordering.Orders o LEFT JOIN ordering.Orderitems oi ON o.Id = oi.orderid LEFT JOIN ordering.orderstatus os on o.StatusId = os.Id - LEFT JOIN ordering.address oa on o.ShippingAddressId = oa.Id WHERE o.Id=@id" , new { id } ); From c29b783d935acd4aee07c2806c31c365dfdecb60 Mon Sep 17 00:00:00 2001 From: "PLAINCONCEPTS\\ccanizares" Date: Mon, 30 Jan 2017 11:35:16 +0100 Subject: [PATCH 4/6] rename identity project --- build-images.ps1 | 2 +- eShopOnContainers-ServicesAndWebApps.sln | 2 +- eShopOnContainers.sln | 102 +++++++++--------- .../.bowerrc | 0 .../AppSettings.cs | 0 .../Configuration/Config.cs | 2 +- .../Controllers/AccountController.cs | 6 +- .../Controllers/ConsentController.cs | 4 +- .../Controllers/HomeController.cs | 2 +- .../Data/ApplicationContextSeed.cs | 4 +- .../Data/ApplicationDbContext.cs | 4 +- .../20161019122215_Init_Scheme.Designer.cs | 2 +- .../Migrations/20161019122215_Init_Scheme.cs | 0 .../20161020101725_extendProfile.Designer.cs | 2 +- .../20161020101725_extendProfile.cs | 0 .../ApplicationDbContextModelSnapshot.cs | 2 +- .../Dockerfile | 2 +- .../Identity.API.xproj} | 4 +- .../AccountViewModels/ConsentInputModel.cs | 2 +- .../AccountViewModels/ConsentViewModel.cs | 2 +- .../ExternalLoginConfirmationViewModel.cs | 2 +- .../ForgotPasswordViewModel.cs | 2 +- .../AccountViewModels/LoggedOutViewModel.cs | 2 +- .../AccountViewModels/LoginViewModel.cs | 2 +- .../AccountViewModels/LogoutViewModel.cs | 2 +- .../AccountViewModels/RegisterViewModel.cs | 2 +- .../ResetPasswordViewModel.cs | 2 +- .../AccountViewModels/SendCodeViewModel.cs | 2 +- .../AccountViewModels/VerifyCodeViewModel.cs | 2 +- .../AccountViewModels/_LoginViewModel.cs | 2 +- .../Models/ApplicationUser.cs | 2 +- .../Models/ErrorViewModel.cs | 0 .../AddPhoneNumberViewModel.cs | 2 +- .../ChangePasswordViewModel.cs | 2 +- .../ConfigureTwoFactorViewModel.cs | 2 +- .../ManageViewModels/FactorViewModel.cs | 2 +- .../Models/ManageViewModels/IndexViewModel.cs | 2 +- .../ManageViewModels/ManageLoginsViewModel.cs | 2 +- .../ManageViewModels/RemoveLoginViewModel.cs | 2 +- .../ManageViewModels/SetPasswordViewModel.cs | 2 +- .../VerifyPhoneNumberViewModel.cs | 2 +- .../Program.cs | 0 .../Properties/launchSettings.json | 0 .../README.md | 0 .../Services/EFLoginService.cs | 4 +- .../Services/IEmailSender.cs | 2 +- .../Services/ILoginService.cs | 2 +- .../Services/IRedirectService.cs | 2 +- .../Services/ISmsSender.cs | 2 +- .../Services/MessageServices.cs | 2 +- .../Services/ProfileService.cs | 4 +- .../Services/RedirectService.cs | 2 +- .../Startup.cs | 8 +- .../Views/Account/LoggedOut.cshtml | 2 +- .../Views/Account/Login.cshtml | 2 +- .../Views/Account/Logout.cshtml | 2 +- .../Views/Account/Redirecting.cshtml | 0 .../Views/Account/Register.cshtml | 2 +- .../Views/Consent/Index.cshtml | 2 +- .../Views/Consent/_ScopeListItem.cshtml | 2 +- .../Views/Home/About.cshtml | 0 .../Views/Home/Contact.cshtml | 0 .../Views/Home/Index.cshtml | 0 .../Views/Shared/Error.cshtml | 0 .../Views/Shared/_Layout.cshtml | 0 .../Views/Shared/_LoginPartial.cshtml | 2 +- .../Shared/_ValidationScriptsPartial.cshtml | 0 .../Views/Shared/_ValidationSummary.cshtml | 0 .../Views/_ViewImports.cshtml | 0 .../Views/_ViewStart.cshtml | 0 .../appsettings.json | 0 .../bower.json | 0 .../bundleconfig.json | 0 .../docker-compose.yml | 0 .../project.json | 0 .../web.config | 0 .../wwwroot/_references.js | 0 .../wwwroot/css/site.css | 0 .../wwwroot/css/site.less | 0 .../wwwroot/css/site.min.css | 0 .../wwwroot/favicon.ico | Bin .../wwwroot/fonts/Montserrat-Bold.eot | Bin .../wwwroot/fonts/Montserrat-Bold.svg | 0 .../wwwroot/fonts/Montserrat-Bold.ttf | Bin .../wwwroot/fonts/Montserrat-Bold.woff | Bin .../wwwroot/fonts/Montserrat-Bold.woff2 | Bin .../wwwroot/fonts/Montserrat-Regular.eot | Bin .../wwwroot/fonts/Montserrat-Regular.svg | 0 .../wwwroot/fonts/Montserrat-Regular.ttf | Bin .../wwwroot/fonts/Montserrat-Regular.woff | Bin .../wwwroot/fonts/Montserrat-Regular.woff2 | Bin .../wwwroot/icon.jpg | Bin .../wwwroot/icon.png | Bin .../wwwroot/images/arrow-down.png | Bin .../wwwroot/images/arrow-right.svg | 0 .../wwwroot/images/banner1.svg | 0 .../wwwroot/images/banner2.svg | 0 .../wwwroot/images/banner3.svg | 0 .../wwwroot/images/banner4.svg | 0 .../wwwroot/images/brand.PNG | Bin .../wwwroot/images/brand_dark.PNG | Bin .../wwwroot/images/cart.png | Bin .../wwwroot/images/logout.PNG | Bin .../wwwroot/images/main_banner.png | Bin .../wwwroot/images/main_banner_text.png | Bin .../wwwroot/images/main_banner_text.svg | 0 .../wwwroot/images/my_orders.PNG | Bin .../wwwroot/images/refresh.svg | 0 .../wwwroot/js/site.js | 0 .../wwwroot/js/site.min.js | 0 .../wwwroot/lib/bootstrap/.bower.json | 0 .../wwwroot/lib/bootstrap/LICENSE | 0 .../wwwroot/lib/bootstrap/css/bootstrap.css | 0 .../lib/bootstrap/css/bootstrap.css.map | 0 .../lib/bootstrap/css/bootstrap.min.css | 0 .../bootstrap/dist/css/bootstrap-theme.css | 0 .../dist/css/bootstrap-theme.css.map | 0 .../dist/css/bootstrap-theme.min.css | 0 .../dist/css/bootstrap-theme.min.css.map | 0 .../lib/bootstrap/dist/css/bootstrap.css | 0 .../lib/bootstrap/dist/css/bootstrap.css.map | 0 .../lib/bootstrap/dist/css/bootstrap.min.css | 0 .../bootstrap/dist/css/bootstrap.min.css.map | 0 .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin .../lib/bootstrap/dist/js/bootstrap.js | 0 .../lib/bootstrap/dist/js/bootstrap.min.js | 0 .../wwwroot/lib/bootstrap/dist/js/npm.js | 0 .../fonts/glyphicons-halflings-regular.eot | Bin .../fonts/glyphicons-halflings-regular.svg | 0 .../fonts/glyphicons-halflings-regular.ttf | Bin .../fonts/glyphicons-halflings-regular.woff | Bin .../fonts/glyphicons-halflings-regular.woff2 | Bin .../wwwroot/lib/bootstrap/js/bootstrap.js | 0 .../wwwroot/lib/bootstrap/js/bootstrap.min.js | 0 .../jquery-validation-unobtrusive/.bower.json | 0 .../jquery.validate.unobtrusive.js | 0 .../jquery.validate.unobtrusive.min.js | 0 .../wwwroot/lib/jquery-validation/.bower.json | 0 .../wwwroot/lib/jquery-validation/LICENSE.md | 0 .../dist/additional-methods.js | 0 .../dist/additional-methods.min.js | 0 .../jquery-validation/dist/jquery.validate.js | 0 .../dist/jquery.validate.min.js | 0 .../wwwroot/lib/jquery/.bower.json | 0 .../wwwroot/lib/jquery/LICENSE.txt | 0 .../wwwroot/lib/jquery/dist/jquery.js | 0 .../wwwroot/lib/jquery/dist/jquery.min.js | 0 .../wwwroot/lib/jquery/dist/jquery.min.map | 0 .../wwwroot/lib/jquery/jquery.js | 0 .../wwwroot/lib/jquery/jquery.min.js | 0 .../wwwroot/lib/jquery/jquery.min.map | 0 .../Application/NewOrderCommandHandlerTest.cs | 3 +- 156 files changed, 115 insertions(+), 114 deletions(-) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/.bowerrc (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/AppSettings.cs (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Configuration/Config.cs (98%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Controllers/AccountController.cs (98%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Controllers/ConsentController.cs (97%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Controllers/HomeController.cs (97%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Data/ApplicationContextSeed.cs (96%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Data/ApplicationDbContext.cs (90%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Data/Migrations/20161019122215_Init_Scheme.Designer.cs (99%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Data/Migrations/20161019122215_Init_Scheme.cs (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Data/Migrations/20161020101725_extendProfile.Designer.cs (99%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Data/Migrations/20161020101725_extendProfile.cs (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Data/Migrations/ApplicationDbContextModelSnapshot.cs (99%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Dockerfile (65%) rename src/Services/Identity/{eShopOnContainers.Identity/eShopOnContainers.Identity.xproj => Identity.API/Identity.API.xproj} (94%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/ConsentInputModel.cs (88%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/ConsentViewModel.cs (97%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs (82%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/ForgotPasswordViewModel.cs (82%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/LoggedOutViewModel.cs (86%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/LoginViewModel.cs (90%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/LogoutViewModel.cs (81%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/RegisterViewModel.cs (93%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/ResetPasswordViewModel.cs (92%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/SendCodeViewModel.cs (86%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/VerifyCodeViewModel.cs (90%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/AccountViewModels/_LoginViewModel.cs (90%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ApplicationUser.cs (96%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ErrorViewModel.cs (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/AddPhoneNumberViewModel.cs (84%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/ChangePasswordViewModel.cs (93%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs (84%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/FactorViewModel.cs (76%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/IndexViewModel.cs (87%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/ManageLoginsViewModel.cs (86%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/RemoveLoginViewModel.cs (83%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/SetPasswordViewModel.cs (92%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs (86%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Program.cs (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Properties/launchSettings.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/README.md (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/EFLoginService.cs (91%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/IEmailSender.cs (83%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/ILoginService.cs (86%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/IRedirectService.cs (82%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/ISmsSender.cs (81%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/MessageServices.cs (94%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/ProfileService.cs (98%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Services/RedirectService.cs (95%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Startup.cs (96%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Account/LoggedOut.cshtml (86%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Account/Login.cshtml (97%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Account/Logout.cshtml (87%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Account/Redirecting.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Account/Register.cshtml (98%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Consent/Index.cshtml (97%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Consent/_ScopeListItem.cshtml (91%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Home/About.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Home/Contact.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Home/Index.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Shared/Error.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Shared/_Layout.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Shared/_LoginPartial.cshtml (95%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Shared/_ValidationScriptsPartial.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/Shared/_ValidationSummary.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/_ViewImports.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/Views/_ViewStart.cshtml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/appsettings.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/bower.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/bundleconfig.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/docker-compose.yml (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/project.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/web.config (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/_references.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/css/site.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/css/site.less (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/css/site.min.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/favicon.ico (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Bold.eot (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Bold.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Bold.ttf (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Bold.woff (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Bold.woff2 (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Regular.eot (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Regular.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Regular.ttf (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Regular.woff (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/fonts/Montserrat-Regular.woff2 (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/icon.jpg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/icon.png (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/arrow-down.png (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/arrow-right.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/banner1.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/banner2.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/banner3.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/banner4.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/brand.PNG (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/brand_dark.PNG (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/cart.png (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/logout.PNG (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/main_banner.png (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/main_banner_text.png (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/main_banner_text.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/my_orders.PNG (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/images/refresh.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/js/site.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/js/site.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/.bower.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/LICENSE (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/css/bootstrap.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/css/bootstrap.css.map (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/css/bootstrap.min.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap-theme.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap-theme.css.map (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap-theme.min.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap-theme.min.css.map (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap.css.map (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/css/bootstrap.min.css.map (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/js/bootstrap.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/js/bootstrap.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/dist/js/npm.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.eot (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.svg (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.ttf (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/fonts/glyphicons-halflings-regular.woff2 (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/js/bootstrap.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/bootstrap/js/bootstrap.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation-unobtrusive/.bower.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation/.bower.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation/LICENSE.md (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation/dist/additional-methods.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation/dist/additional-methods.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation/dist/jquery.validate.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery-validation/dist/jquery.validate.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/.bower.json (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/LICENSE.txt (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/dist/jquery.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/dist/jquery.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/dist/jquery.min.map (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/jquery.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/jquery.min.js (100%) rename src/Services/Identity/{eShopOnContainers.Identity => Identity.API}/wwwroot/lib/jquery/jquery.min.map (100%) diff --git a/build-images.ps1 b/build-images.ps1 index e04cf8ba4..d498bb89d 100644 --- a/build-images.ps1 +++ b/build-images.ps1 @@ -30,7 +30,7 @@ dotnet build $webSPAPathToJson dotnet publish $webSPAPathToJson -o $webSPAPathToPub # *** identitySvc image *** -$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json" +$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\Identity.API\project.json" Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow $identitySvcPathToPub = $scriptPath + "\pub\identity" Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow diff --git a/eShopOnContainers-ServicesAndWebApps.sln b/eShopOnContainers-ServicesAndWebApps.sln index 1cfe02204..264a8d6b5 100644 --- a/eShopOnContainers-ServicesAndWebApps.sln +++ b/eShopOnContainers-ServicesAndWebApps.sln @@ -47,7 +47,7 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "UnitTest", "test\Services\U EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{24CD3B53-141E-4A07-9B0D-796641E1CF78}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "eShopOnContainers.Identity", "src\Services\Identity\eShopOnContainers.Identity\eShopOnContainers.Identity.xproj", "{A579E108-5445-403D-A407-339AC4D1611B}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Identity.API", "src\Services\Identity\eShopOnContainers.Identity\Identity.API.xproj", "{A579E108-5445-403D-A407-339AC4D1611B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/eShopOnContainers.sln b/eShopOnContainers.sln index 53013c1cb..cda4a14d8 100644 --- a/eShopOnContainers.sln +++ b/eShopOnContainers.sln @@ -65,8 +65,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Ordering.Infrastructure", " EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Identity", "Identity", "{02DF7FEE-C302-433D-A6CD-237A2569F236}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "eShopOnContainers.Identity", "src\Services\Identity\eShopOnContainers.Identity\eShopOnContainers.Identity.xproj", "{A579E108-5445-403D-A407-339AC4D1611B}" -EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "FunctionalTests", "test\Services\FunctionalTests\FunctionalTests.xproj", "{621E7211-58D0-45FD-9600-1CB490BD930E}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.UITests", "src\Mobile\eShopOnContainers\eShopOnContainers.UITests\eShopOnContainers.UITests.csproj", "{E3B18084-842C-4B80-8E4A-A7E588EC3137}" @@ -75,6 +73,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eShopOnContainers.Core", "s EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "UnitTest", "test\Services\UnitTest\UnitTest.xproj", "{7796F5D8-31FC-45A4-B673-19DE5BA194CF}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Identity.API", "src\Services\Identity\Identity.API\Identity.API.xproj", "{A579E108-5445-403D-A407-339AC4D1611B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Ad-Hoc|Any CPU = Ad-Hoc|Any CPU @@ -716,54 +716,6 @@ Global {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x64.Build.0 = Release|Any CPU {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.ActiveCfg = Release|Any CPU {95F1F07C-4D92-4742-BD07-E5B805AAB651}.Release|x86.Build.0 = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x64.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x86.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|Any CPU.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|ARM.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|ARM.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhone.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhone.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x64.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x64.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x86.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x86.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|ARM.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|ARM.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhone.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x64.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x64.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x86.ActiveCfg = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x86.Build.0 = Debug|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|Any CPU.Build.0 = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|ARM.ActiveCfg = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|ARM.Build.0 = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhone.ActiveCfg = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhone.Build.0 = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|x64.ActiveCfg = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|x64.Build.0 = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|x86.ActiveCfg = Release|Any CPU - {A579E108-5445-403D-A407-339AC4D1611B}.Release|x86.Build.0 = Release|Any CPU {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU {621E7211-58D0-45FD-9600-1CB490BD930E}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU @@ -956,6 +908,54 @@ Global {7796F5D8-31FC-45A4-B673-19DE5BA194CF}.Release|x64.Build.0 = Release|Any CPU {7796F5D8-31FC-45A4-B673-19DE5BA194CF}.Release|x86.ActiveCfg = Release|Any CPU {7796F5D8-31FC-45A4-B673-19DE5BA194CF}.Release|x86.Build.0 = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x64.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Ad-Hoc|x86.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|Any CPU.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|ARM.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|ARM.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhone.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhone.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x64.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x64.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x86.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.AppStore|x86.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|ARM.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|ARM.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhone.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x64.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x64.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x86.ActiveCfg = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Debug|x86.Build.0 = Debug|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|Any CPU.Build.0 = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|ARM.ActiveCfg = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|ARM.Build.0 = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhone.ActiveCfg = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhone.Build.0 = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|x64.ActiveCfg = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|x64.Build.0 = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|x86.ActiveCfg = Release|Any CPU + {A579E108-5445-403D-A407-339AC4D1611B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -986,10 +986,10 @@ Global {B68C2B56-7581-46AE-B55D-D25DDFD3BFE3} = {B7B1D395-4E06-4036-BE86-C216756B9367} {95F1F07C-4D92-4742-BD07-E5B805AAB651} = {0BD0DB92-2D98-44D9-9AC0-C59186D59B0B} {02DF7FEE-C302-433D-A6CD-237A2569F236} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8} - {A579E108-5445-403D-A407-339AC4D1611B} = {02DF7FEE-C302-433D-A6CD-237A2569F236} {621E7211-58D0-45FD-9600-1CB490BD930E} = {EF0337F2-ED00-4643-89FD-EE10863F1870} {E3B18084-842C-4B80-8E4A-A7E588EC3137} = {B7B1D395-4E06-4036-BE86-C216756B9367} {67F9D3A8-F71E-4428-913F-C37AE82CDB24} = {778289CA-31F7-4464-8C2A-612EE846F8A7} {7796F5D8-31FC-45A4-B673-19DE5BA194CF} = {EF0337F2-ED00-4643-89FD-EE10863F1870} + {A579E108-5445-403D-A407-339AC4D1611B} = {02DF7FEE-C302-433D-A6CD-237A2569F236} EndGlobalSection EndGlobal diff --git a/src/Services/Identity/eShopOnContainers.Identity/.bowerrc b/src/Services/Identity/Identity.API/.bowerrc similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/.bowerrc rename to src/Services/Identity/Identity.API/.bowerrc diff --git a/src/Services/Identity/eShopOnContainers.Identity/AppSettings.cs b/src/Services/Identity/Identity.API/AppSettings.cs similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/AppSettings.cs rename to src/Services/Identity/Identity.API/AppSettings.cs diff --git a/src/Services/Identity/eShopOnContainers.Identity/Configuration/Config.cs b/src/Services/Identity/Identity.API/Configuration/Config.cs similarity index 98% rename from src/Services/Identity/eShopOnContainers.Identity/Configuration/Config.cs rename to src/Services/Identity/Identity.API/Configuration/Config.cs index ee0c9b5e8..764320096 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Configuration/Config.cs +++ b/src/Services/Identity/Identity.API/Configuration/Config.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Options; using System.Collections.Generic; -namespace eShopOnContainers.Identity.Configuration +namespace Identity.API.Configuration { public class Config { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Controllers/AccountController.cs b/src/Services/Identity/Identity.API/Controllers/AccountController.cs similarity index 98% rename from src/Services/Identity/eShopOnContainers.Identity/Controllers/AccountController.cs rename to src/Services/Identity/Identity.API/Controllers/AccountController.cs index 39b33bd4c..c4747602f 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Controllers/AccountController.cs +++ b/src/Services/Identity/Identity.API/Controllers/AccountController.cs @@ -16,11 +16,11 @@ using System.Text.Encodings.Web; using System.Threading.Tasks; using IdentityServer4.Models; using IdentityServer4.Stores; -using eShopOnContainers.Identity.Services; -using eShopOnContainers.Identity.Models; +using Identity.API.Services; +using Identity.API.Models; using Microsoft.Extensions.Logging; using Microsoft.AspNetCore.Authorization; -using eShopOnContainers.Identity.Models.AccountViewModels; +using Identity.API.Models.AccountViewModels; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Authentication; diff --git a/src/Services/Identity/eShopOnContainers.Identity/Controllers/ConsentController.cs b/src/Services/Identity/Identity.API/Controllers/ConsentController.cs similarity index 97% rename from src/Services/Identity/eShopOnContainers.Identity/Controllers/ConsentController.cs rename to src/Services/Identity/Identity.API/Controllers/ConsentController.cs index f9c37cdf0..ab954f779 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Controllers/ConsentController.cs +++ b/src/Services/Identity/Identity.API/Controllers/ConsentController.cs @@ -10,8 +10,8 @@ using System.Threading.Tasks; using IdentityServer4.Models; using IdentityServer4.Stores; using IdentityServer4.Quickstart.UI.Models; -using eShopOnContainers.Identity.Models.AccountViewModels; -using eShopOnContainers.Identity.Services; +using Identity.API.Models.AccountViewModels; +using Identity.API.Services; namespace IdentityServer4.Quickstart.UI.Controllers { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Controllers/HomeController.cs b/src/Services/Identity/Identity.API/Controllers/HomeController.cs similarity index 97% rename from src/Services/Identity/eShopOnContainers.Identity/Controllers/HomeController.cs rename to src/Services/Identity/Identity.API/Controllers/HomeController.cs index 3e68ee5d3..9fbc8b190 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Controllers/HomeController.cs +++ b/src/Services/Identity/Identity.API/Controllers/HomeController.cs @@ -3,7 +3,7 @@ using eShopOnContainers.Identity; -using eShopOnContainers.Identity.Services; +using Identity.API.Services; using IdentityServer4.Quickstart.UI.Models; using IdentityServer4.Services; using Microsoft.AspNetCore.Mvc; diff --git a/src/Services/Identity/eShopOnContainers.Identity/Data/ApplicationContextSeed.cs b/src/Services/Identity/Identity.API/Data/ApplicationContextSeed.cs similarity index 96% rename from src/Services/Identity/eShopOnContainers.Identity/Data/ApplicationContextSeed.cs rename to src/Services/Identity/Identity.API/Data/ApplicationContextSeed.cs index 8a413c139..cf8ae612f 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Data/ApplicationContextSeed.cs +++ b/src/Services/Identity/Identity.API/Data/ApplicationContextSeed.cs @@ -3,8 +3,8 @@ using AspNetCore.Identity; using EntityFrameworkCore; using Extensions.Logging; - using global::eShopOnContainers.Identity.Data; - using global::eShopOnContainers.Identity.Models; + using global::Identity.API.Data; + using global::Identity.API.Models; using Microsoft.AspNetCore.Builder; using System; using System.Collections.Generic; diff --git a/src/Services/Identity/eShopOnContainers.Identity/Data/ApplicationDbContext.cs b/src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs similarity index 90% rename from src/Services/Identity/eShopOnContainers.Identity/Data/ApplicationDbContext.cs rename to src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs index 954cdb906..ddbe7bbfd 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Data/ApplicationDbContext.cs +++ b/src/Services/Identity/Identity.API/Data/ApplicationDbContext.cs @@ -4,9 +4,9 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; -using eShopOnContainers.Identity.Models; +using Identity.API.Models; -namespace eShopOnContainers.Identity.Data +namespace Identity.API.Data { public class ApplicationDbContext : IdentityDbContext { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161019122215_Init_Scheme.Designer.cs b/src/Services/Identity/Identity.API/Data/Migrations/20161019122215_Init_Scheme.Designer.cs similarity index 99% rename from src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161019122215_Init_Scheme.Designer.cs rename to src/Services/Identity/Identity.API/Data/Migrations/20161019122215_Init_Scheme.Designer.cs index e5a0802ab..af45c0320 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161019122215_Init_Scheme.Designer.cs +++ b/src/Services/Identity/Identity.API/Data/Migrations/20161019122215_Init_Scheme.Designer.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using eShopOnContainers.Identity.Data; +using Identity.API.Data; namespace WebMVC.Migrations { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161019122215_Init_Scheme.cs b/src/Services/Identity/Identity.API/Data/Migrations/20161019122215_Init_Scheme.cs similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161019122215_Init_Scheme.cs rename to src/Services/Identity/Identity.API/Data/Migrations/20161019122215_Init_Scheme.cs diff --git a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161020101725_extendProfile.Designer.cs b/src/Services/Identity/Identity.API/Data/Migrations/20161020101725_extendProfile.Designer.cs similarity index 99% rename from src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161020101725_extendProfile.Designer.cs rename to src/Services/Identity/Identity.API/Data/Migrations/20161020101725_extendProfile.Designer.cs index 316a7b55a..ac483149b 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161020101725_extendProfile.Designer.cs +++ b/src/Services/Identity/Identity.API/Data/Migrations/20161020101725_extendProfile.Designer.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using eShopOnContainers.Identity.Data; +using Identity.API.Data; namespace WebMVC.Migrations { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161020101725_extendProfile.cs b/src/Services/Identity/Identity.API/Data/Migrations/20161020101725_extendProfile.cs similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/20161020101725_extendProfile.cs rename to src/Services/Identity/Identity.API/Data/Migrations/20161020101725_extendProfile.cs diff --git a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Services/Identity/Identity.API/Data/Migrations/ApplicationDbContextModelSnapshot.cs similarity index 99% rename from src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/ApplicationDbContextModelSnapshot.cs rename to src/Services/Identity/Identity.API/Data/Migrations/ApplicationDbContextModelSnapshot.cs index 6904bdbef..01bc906b0 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/src/Services/Identity/Identity.API/Data/Migrations/ApplicationDbContextModelSnapshot.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using eShopOnContainers.Identity.Data; +using Identity.API.Data; namespace WebMVC.Migrations { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Dockerfile b/src/Services/Identity/Identity.API/Dockerfile similarity index 65% rename from src/Services/Identity/eShopOnContainers.Identity/Dockerfile rename to src/Services/Identity/Identity.API/Dockerfile index d08c2afad..38dda0129 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Dockerfile +++ b/src/Services/Identity/Identity.API/Dockerfile @@ -1,5 +1,5 @@ FROM microsoft/aspnetcore:1.0.1 -ENTRYPOINT ["dotnet", "eShopOnContainers.Identity.dll"] +ENTRYPOINT ["dotnet", "Identity.API.dll"] ARG source=. WORKDIR /app ENV ASPNETCORE_URLS http://*:5105 diff --git a/src/Services/Identity/eShopOnContainers.Identity/eShopOnContainers.Identity.xproj b/src/Services/Identity/Identity.API/Identity.API.xproj similarity index 94% rename from src/Services/Identity/eShopOnContainers.Identity/eShopOnContainers.Identity.xproj rename to src/Services/Identity/Identity.API/Identity.API.xproj index 6a72253f3..c767e3c0b 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/eShopOnContainers.Identity.xproj +++ b/src/Services/Identity/Identity.API/Identity.API.xproj @@ -7,7 +7,7 @@ a579e108-5445-403d-a407-339ac4d1611b - eShopOnContainers.Identity + Identity.API .\obj .\bin\ v4.6 @@ -20,4 +20,4 @@ - + \ No newline at end of file diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ConsentInputModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentInputModel.cs similarity index 88% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ConsentInputModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentInputModel.cs index 033488e49..89a2d90e7 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ConsentInputModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentInputModel.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class ConsentInputModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ConsentViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentViewModel.cs similarity index 97% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ConsentViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentViewModel.cs index 3b9eb0891..07124587c 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ConsentViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentViewModel.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.Linq; using IdentityServer4.Models; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class ConsentViewModel : ConsentInputModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs similarity index 82% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs index 30f982a19..526f320ba 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class ExternalLoginConfirmationViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ForgotPasswordViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/ForgotPasswordViewModel.cs similarity index 82% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ForgotPasswordViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/ForgotPasswordViewModel.cs index 903b83a27..fd00ca55f 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ForgotPasswordViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/ForgotPasswordViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class ForgotPasswordViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LoggedOutViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/LoggedOutViewModel.cs similarity index 86% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LoggedOutViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/LoggedOutViewModel.cs index 535710b3b..d78c9e984 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LoggedOutViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/LoggedOutViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class LoggedOutViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LoginViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/LoginViewModel.cs similarity index 90% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LoginViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/LoginViewModel.cs index 6e82f0315..edb29a8d2 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LoginViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/LoginViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class LoginViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LogoutViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/LogoutViewModel.cs similarity index 81% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LogoutViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/LogoutViewModel.cs index 15c0a5e0c..fd5153288 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/LogoutViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/LogoutViewModel.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class LogoutViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/RegisterViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/RegisterViewModel.cs similarity index 93% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/RegisterViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/RegisterViewModel.cs index 31dcb8acb..c84c1478d 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/RegisterViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/RegisterViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class RegisterViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ResetPasswordViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/ResetPasswordViewModel.cs similarity index 92% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ResetPasswordViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/ResetPasswordViewModel.cs index dfc66df17..a90c4ca64 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/ResetPasswordViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/ResetPasswordViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class ResetPasswordViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/SendCodeViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/SendCodeViewModel.cs similarity index 86% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/SendCodeViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/SendCodeViewModel.cs index 3c74a16fd..b5efaed34 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/SendCodeViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/SendCodeViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Rendering; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class SendCodeViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/VerifyCodeViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/VerifyCodeViewModel.cs similarity index 90% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/VerifyCodeViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/VerifyCodeViewModel.cs index 36bd23ef2..f0a18d663 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/VerifyCodeViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/VerifyCodeViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { public class VerifyCodeViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/_LoginViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/_LoginViewModel.cs similarity index 90% rename from src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/_LoginViewModel.cs rename to src/Services/Identity/Identity.API/Models/AccountViewModels/_LoginViewModel.cs index 9c4505147..63290cb8a 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/AccountViewModels/_LoginViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/_LoginViewModel.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; -namespace eShopOnContainers.Identity.Models.AccountViewModels +namespace Identity.API.Models.AccountViewModels { //public class _LoginViewModel : LoginViewModel //{ diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ApplicationUser.cs b/src/Services/Identity/Identity.API/Models/ApplicationUser.cs similarity index 96% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ApplicationUser.cs rename to src/Services/Identity/Identity.API/Models/ApplicationUser.cs index 5d009b718..b520c333b 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ApplicationUser.cs +++ b/src/Services/Identity/Identity.API/Models/ApplicationUser.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using System.ComponentModel.DataAnnotations; -namespace eShopOnContainers.Identity.Models +namespace Identity.API.Models { // Add profile data for application users by adding properties to the ApplicationUser class public class ApplicationUser : IdentityUser diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ErrorViewModel.cs b/src/Services/Identity/Identity.API/Models/ErrorViewModel.cs similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ErrorViewModel.cs rename to src/Services/Identity/Identity.API/Models/ErrorViewModel.cs diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/AddPhoneNumberViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/AddPhoneNumberViewModel.cs similarity index 84% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/AddPhoneNumberViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/AddPhoneNumberViewModel.cs index 535a66f5e..ada4b8a03 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/AddPhoneNumberViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/AddPhoneNumberViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class AddPhoneNumberViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ChangePasswordViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/ChangePasswordViewModel.cs similarity index 93% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ChangePasswordViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/ChangePasswordViewModel.cs index 967374c42..b0df1b2af 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ChangePasswordViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/ChangePasswordViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class ChangePasswordViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs similarity index 84% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs index 548bf4623..5ed3b2925 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Rendering; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class ConfigureTwoFactorViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/FactorViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/FactorViewModel.cs similarity index 76% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/FactorViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/FactorViewModel.cs index 71b5da71e..92eccf504 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/FactorViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/FactorViewModel.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class FactorViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/IndexViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/IndexViewModel.cs similarity index 87% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/IndexViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/IndexViewModel.cs index d7c16d8b9..f6e5b6874 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/IndexViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/IndexViewModel.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class IndexViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ManageLoginsViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/ManageLoginsViewModel.cs similarity index 86% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ManageLoginsViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/ManageLoginsViewModel.cs index 21c3dbaf2..1238585cd 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/ManageLoginsViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/ManageLoginsViewModel.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Http.Authentication; using Microsoft.AspNetCore.Identity; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class ManageLoginsViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/RemoveLoginViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/RemoveLoginViewModel.cs similarity index 83% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/RemoveLoginViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/RemoveLoginViewModel.cs index a5686b1f5..546f0b1e8 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/RemoveLoginViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/RemoveLoginViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class RemoveLoginViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/SetPasswordViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/SetPasswordViewModel.cs similarity index 92% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/SetPasswordViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/SetPasswordViewModel.cs index 720f4d15a..d824afc94 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/SetPasswordViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/SetPasswordViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class SetPasswordViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs similarity index 86% rename from src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs rename to src/Services/Identity/Identity.API/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs index 31c3e5fe6..af7105a2e 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs @@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Models.ManageViewModels +namespace Identity.API.Models.ManageViewModels { public class VerifyPhoneNumberViewModel { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Program.cs b/src/Services/Identity/Identity.API/Program.cs similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/Program.cs rename to src/Services/Identity/Identity.API/Program.cs diff --git a/src/Services/Identity/eShopOnContainers.Identity/Properties/launchSettings.json b/src/Services/Identity/Identity.API/Properties/launchSettings.json similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/Properties/launchSettings.json rename to src/Services/Identity/Identity.API/Properties/launchSettings.json diff --git a/src/Services/Identity/eShopOnContainers.Identity/README.md b/src/Services/Identity/Identity.API/README.md similarity index 100% rename from src/Services/Identity/eShopOnContainers.Identity/README.md rename to src/Services/Identity/Identity.API/README.md diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/EFLoginService.cs b/src/Services/Identity/Identity.API/Services/EFLoginService.cs similarity index 91% rename from src/Services/Identity/eShopOnContainers.Identity/Services/EFLoginService.cs rename to src/Services/Identity/Identity.API/Services/EFLoginService.cs index d0f2532f6..e1c2fe52e 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/EFLoginService.cs +++ b/src/Services/Identity/Identity.API/Services/EFLoginService.cs @@ -1,11 +1,11 @@ -using eShopOnContainers.Identity.Models; +using Identity.API.Models; using Microsoft.AspNetCore.Identity; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { public class EFLoginService : ILoginService { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/IEmailSender.cs b/src/Services/Identity/Identity.API/Services/IEmailSender.cs similarity index 83% rename from src/Services/Identity/eShopOnContainers.Identity/Services/IEmailSender.cs rename to src/Services/Identity/Identity.API/Services/IEmailSender.cs index 7634270d8..2259641f8 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/IEmailSender.cs +++ b/src/Services/Identity/Identity.API/Services/IEmailSender.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { public interface IEmailSender { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/ILoginService.cs b/src/Services/Identity/Identity.API/Services/ILoginService.cs similarity index 86% rename from src/Services/Identity/eShopOnContainers.Identity/Services/ILoginService.cs rename to src/Services/Identity/Identity.API/Services/ILoginService.cs index 398102adb..5915b42ee 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/ILoginService.cs +++ b/src/Services/Identity/Identity.API/Services/ILoginService.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { public interface ILoginService { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/IRedirectService.cs b/src/Services/Identity/Identity.API/Services/IRedirectService.cs similarity index 82% rename from src/Services/Identity/eShopOnContainers.Identity/Services/IRedirectService.cs rename to src/Services/Identity/Identity.API/Services/IRedirectService.cs index 20982460b..9dd277e2d 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/IRedirectService.cs +++ b/src/Services/Identity/Identity.API/Services/IRedirectService.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { public interface IRedirectService { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/ISmsSender.cs b/src/Services/Identity/Identity.API/Services/ISmsSender.cs similarity index 81% rename from src/Services/Identity/eShopOnContainers.Identity/Services/ISmsSender.cs rename to src/Services/Identity/Identity.API/Services/ISmsSender.cs index 95d626d64..5c6bd2aae 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/ISmsSender.cs +++ b/src/Services/Identity/Identity.API/Services/ISmsSender.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { public interface ISmsSender { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/MessageServices.cs b/src/Services/Identity/Identity.API/Services/MessageServices.cs similarity index 94% rename from src/Services/Identity/eShopOnContainers.Identity/Services/MessageServices.cs rename to src/Services/Identity/Identity.API/Services/MessageServices.cs index 65604979a..d9898cba4 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/MessageServices.cs +++ b/src/Services/Identity/Identity.API/Services/MessageServices.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { // This class is used by the application to send Email and SMS // when you turn on two-factor authentication in ASP.NET Identity. diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/ProfileService.cs b/src/Services/Identity/Identity.API/Services/ProfileService.cs similarity index 98% rename from src/Services/Identity/eShopOnContainers.Identity/Services/ProfileService.cs rename to src/Services/Identity/Identity.API/Services/ProfileService.cs index 79a419382..1d7e548bb 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/ProfileService.cs +++ b/src/Services/Identity/Identity.API/Services/ProfileService.cs @@ -5,11 +5,11 @@ using System.Linq; using System.Threading.Tasks; using IdentityServer4.Models; using Microsoft.AspNetCore.Identity; -using eShopOnContainers.Identity.Models; +using Identity.API.Models; using System.Security.Claims; using IdentityModel; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { public class ProfileService : IProfileService { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Services/RedirectService.cs b/src/Services/Identity/Identity.API/Services/RedirectService.cs similarity index 95% rename from src/Services/Identity/eShopOnContainers.Identity/Services/RedirectService.cs rename to src/Services/Identity/Identity.API/Services/RedirectService.cs index d38ad9d38..440272d39 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Services/RedirectService.cs +++ b/src/Services/Identity/Identity.API/Services/RedirectService.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; -namespace eShopOnContainers.Identity.Services +namespace Identity.API.Services { public class RedirectService : IRedirectService { diff --git a/src/Services/Identity/eShopOnContainers.Identity/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs similarity index 96% rename from src/Services/Identity/eShopOnContainers.Identity/Startup.cs rename to src/Services/Identity/Identity.API/Startup.cs index f132cd3c8..d29459395 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -9,10 +9,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using eShopOnContainers.Identity.Data; -using eShopOnContainers.Identity.Models; -using eShopOnContainers.Identity.Services; -using eShopOnContainers.Identity.Configuration; +using Identity.API.Data; +using Identity.API.Models; +using Identity.API.Services; +using Identity.API.Configuration; using IdentityServer4.Services; using System.Threading; using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; diff --git a/src/Services/Identity/eShopOnContainers.Identity/Views/Account/LoggedOut.cshtml b/src/Services/Identity/Identity.API/Views/Account/LoggedOut.cshtml similarity index 86% rename from src/Services/Identity/eShopOnContainers.Identity/Views/Account/LoggedOut.cshtml rename to src/Services/Identity/Identity.API/Views/Account/LoggedOut.cshtml index 11886a1b0..ea6fdbfbc 100644 --- a/src/Services/Identity/eShopOnContainers.Identity/Views/Account/LoggedOut.cshtml +++ b/src/Services/Identity/Identity.API/Views/Account/LoggedOut.cshtml @@ -1,4 +1,4 @@ -@model eShopOnContainers.Identity.Models.AccountViewModels.LoggedOutViewModel +@model Identity.API.Models.AccountViewModels.LoggedOutViewModel