├── PackagesManagement ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Home │ │ ├── Privacy.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _CookieConsentPartial.cshtml │ │ ├── _ValidationScriptsPartial.cshtml │ │ └── _Layout.cshtml │ ├── Account │ │ └── Login.cshtml │ └── ManagePackages │ │ ├── Index.cshtml │ │ └── Edit.cshtml ├── Tools │ ├── ICommand.cs │ ├── IQuery.cs │ ├── ICommandHandler.cs │ ├── IEventHandler.cs │ ├── EventTrigger.cs │ ├── EventMediator.cs │ └── EventDIExtensions.cs ├── wwwroot │ ├── favicon.ico │ ├── js │ │ └── site.js │ ├── lib │ │ ├── jquery-validation-unobtrusive │ │ │ ├── LICENSE.txt │ │ │ ├── jquery.validate.unobtrusive.min.js │ │ │ └── jquery.validate.unobtrusive.js │ │ ├── jquery-validation │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.min.js │ │ │ │ └── jquery.validate.min.js │ │ ├── bootstrap │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ └── css │ │ │ │ ├── bootstrap-reboot.min.css │ │ │ │ └── bootstrap-reboot.css │ │ └── jquery │ │ │ └── LICENSE.txt │ └── css │ │ └── site.css ├── appsettings.Development.json ├── Models │ ├── ErrorViewModel.cs │ └── Account │ │ └── LoginViewModel.cs ├── Queries │ ├── IDestinationListQuery.cs │ ├── IPackagesListQuery.cs │ ├── DestinationListQuery.cs │ └── PackagesListQuery.cs ├── appsettings.json ├── Commands │ ├── DeletePackageCommand.cs │ ├── CreatePackageCommand.cs │ └── UpdatePackageCommand.cs ├── PackagesManagement.csproj ├── Properties │ └── launchSettings.json ├── Handlers │ ├── PackageDeleteEventHandler.cs │ ├── CreatePackageCommandHandler.cs │ ├── PackagePriceChangedEventHandler.cs │ ├── DeletePackageCommandHandler.cs │ └── UpdatePackageCommandHandler.cs ├── Controllers │ ├── HomeController.cs │ ├── ManagePackagesController.cs │ └── AccountController.cs ├── Program.cs └── Startup.cs ├── PackagesManagementDomain ├── Tools │ ├── IEventNotification.cs │ ├── IRepository.cs │ ├── IUnitOfWork.cs │ ├── IEventMediator.cs │ ├── IEntity.cs │ ├── RepositoryExtensions.cs │ └── Entity.cs ├── Aggregates │ ├── IDestination.cs │ ├── IPackageEvent.cs │ └── IPackage.cs ├── PackagesManagementDomain.csproj ├── IRepositories │ ├── IDestinationRepository.cs │ ├── IPackageRepository.cs │ └── IPackageEventRepository.cs ├── DTOs │ └── IPackageFullEditDTO.cs └── Events │ ├── PackageDeleteEvent.cs │ └── PackagePriceChangedEvent.cs ├── PackagesManagementDB ├── Models │ ├── PackageEvent.cs │ ├── Destination.cs │ └── Package.cs ├── Properties │ └── launchSettings.json ├── Repositories │ ├── DestinationRepository.cs │ ├── PackageEventRepository.cs │ └── PackageRepository.cs ├── PackagesManagementDB.csproj ├── MainDbContext.cs ├── Extensions │ └── DBExtensions.cs └── Migrations │ ├── MainDBContextModelSnapshot.cs │ ├── 20190803103812_Initial.Designer.cs │ └── 20190803103812_Initial.cs ├── PackagesManagementTest ├── PackagesManagementTest.csproj └── ManagePackagesControllerTests.cs ├── .gitattributes ├── PackagesManagement.sln └── .gitignore /PackagesManagement/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } -------------------------------------------------------------------------------- /PackagesManagement/Tools/ICommand.cs: -------------------------------------------------------------------------------- 1 | namespace DDD.ApplicationLayer 2 | { 3 | public interface ICommand 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /PackagesManagement/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nirzaf/PackagesManagementWithUnitTests/HEAD/PackagesManagement/wwwroot/favicon.ico -------------------------------------------------------------------------------- /PackagesManagement/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using PackagesManagement 2 | @using PackagesManagement.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -------------------------------------------------------------------------------- /PackagesManagement/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |
Use this page to detail your site's privacy policy.
-------------------------------------------------------------------------------- /PackagesManagement/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /PackagesManagementDomain/Tools/IEventNotification.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | namespace DDD.DomainLayer 6 | { 7 | public interface IEventNotification 8 | { 9 | } 10 | } -------------------------------------------------------------------------------- /PackagesManagement/Tools/IQuery.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace DDD.ApplicationLayer 7 | { 8 | public interface IQuery 9 | { 10 | } 11 | } -------------------------------------------------------------------------------- /PackagesManagement/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. -------------------------------------------------------------------------------- /PackagesManagementDomain/Tools/IRepository.cs: -------------------------------------------------------------------------------- 1 | namespace DDD.DomainLayer 2 | { 3 | public interface IRepository 4 | { 5 | } 6 | 7 | public interface IRepositoryLearn about building Web apps with ASP.NET Core.
8 |
12 | Request ID: @Model.RequestId
13 |
18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |
20 |21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |
-------------------------------------------------------------------------------- /PackagesManagement/Tools/EventMediator.cs: -------------------------------------------------------------------------------- 1 | using DDD.DomainLayer; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace DDD.ApplicationLayer 8 | { 9 | public class EventMediator : IEventMediator 10 | { 11 | private IServiceProvider services; 12 | 13 | public EventMediator(IServiceProvider services) 14 | { 15 | this.services = services; 16 | } 17 | 18 | public async Task TriggerEvents(IEnumerable| Delete | 14 |Edit | 15 |Destination | 16 |Name | 17 |Duration/days | 18 |Price | 19 |Availble from | 20 |Availble to | 21 | 22 |
|---|---|---|---|---|---|---|---|
| 29 | 32 | delete 33 | 34 | | 35 |36 | 39 | edit 40 | 41 | | 42 |43 | @package.DestinationName 44 | | 45 |46 | @package.Name 47 | | 48 |49 | @package.DurationInDays 50 | | 51 |52 | @package.Price 53 | | 54 |55 | @(package.StartValidityDate.HasValue ? 56 | package.StartValidityDate.Value.ToString("d") 57 | : string.Empty) 58 | | 59 |60 | @(package.EndValidityDate.HasValue ? 61 | package.EndValidityDate.Value.ToString("d") 62 | : string.Empty) 63 | | 64 | 65 |