Upload project.
This commit is contained in:
1 parent
251cec2dac
commit
15556e92aa
196 files changed
+86759
No files matched your search
@@ -0,0 +1,490 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/dotnetcore,aspnetcore,visualstudio
|
||||
# Edit at https://www.gitignore.io/?templates=dotnetcore,aspnetcore,visualstudio
|
||||
|
||||
### ASPNETCore ###
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/
|
||||
|
||||
### DotnetCore ###
|
||||
# .NET Core build folders
|
||||
/bin
|
||||
/obj
|
||||
|
||||
# Common node modules locations
|
||||
/node_modules
|
||||
/wwwroot/node_modules
|
||||
|
||||
|
||||
### VisualStudio ###
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
|
||||
# NUnit
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_h.h
|
||||
*.iobj
|
||||
*.ipdb
|
||||
*_wpftmp.csproj
|
||||
|
||||
# Chutzpah Test files
|
||||
|
||||
# Visual C++ cache files
|
||||
|
||||
# Visual Studio profiler
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
|
||||
# TeamCity is a build add-in
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Visual Studio code coverage results
|
||||
|
||||
# NCrunch
|
||||
|
||||
# MightyMoose
|
||||
|
||||
# Web workbench (sass)
|
||||
|
||||
# Installshield output folder
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
|
||||
# Click-Once directory
|
||||
|
||||
# Publish Web Output
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
|
||||
# NuGet Packages
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
|
||||
# Windows Store app package directories and files
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
|
||||
# RIA/Silverlight projects
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
|
||||
# Visual Studio 6 build log
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
|
||||
# Paket dependency manager
|
||||
|
||||
# FAKE - F# Make
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# End of https://www.gitignore.io/api/dotnetcore,aspnetcore,visualstudio
|
||||
@@ -0,0 +1,5 @@
|
||||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim
|
||||
COPY stock/ /app
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
ENTRYPOINT ["dotnet", "ThAmCo.Stock.dll"]
|
||||
@@ -0,0 +1,701 @@
|
||||
using System.Collections;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ThAmCo.Stock.Controllers;
|
||||
using ThAmCo.Stock.Data;
|
||||
using ThAmCo.Stock.Data.StockContext;
|
||||
using ThAmCo.Stock.Models.Dto;
|
||||
using Moq;
|
||||
using System.Net.Http;
|
||||
using Moq.Protected;
|
||||
using System.Threading;
|
||||
using Newtonsoft.Json;
|
||||
using System.Text;
|
||||
using ThAmCo.Stock.Models.ViewModel;
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace ThAmCo.Stock.Tests.Controllers
|
||||
{
|
||||
[TestClass]
|
||||
public class StockControllerTests
|
||||
{
|
||||
private static class Data
|
||||
{
|
||||
public static List<ProductStock> ProductStocks() => new List<ProductStock>
|
||||
{
|
||||
new ProductStock { Id = 1, Stock = 10, PriceId = 1, ProductId = 436 },
|
||||
new ProductStock { Id = 2, Stock = 0, PriceId = 3, ProductId = 326 },
|
||||
new ProductStock { Id = 3, Stock = 4, PriceId = 4, ProductId = 273 },
|
||||
new ProductStock { Id = 4, Stock = 43, PriceId = 6, ProductId = 456 },
|
||||
new ProductStock { Id = 5, Stock = 2, PriceId = 7, ProductId = 32 },
|
||||
new ProductStock { Id = 6, Stock = 14, PriceId = 8, ProductId = 33 },
|
||||
new ProductStock { Id = 7, Stock = 1, PriceId = 9, ProductId = 21 }
|
||||
};
|
||||
|
||||
public static List<Price> Prices() => new List<Price>
|
||||
{
|
||||
new Price { Id = 1, ProductStockId = 1, ProductPrice = 8.99 },
|
||||
new Price { Id = 2, ProductStockId = 2, ProductPrice = 24.99 },
|
||||
new Price { Id = 3, ProductStockId = 2, ProductPrice = 19.99 },
|
||||
new Price { Id = 4, ProductStockId = 3, ProductPrice = 54.56 },
|
||||
new Price { Id = 5, ProductStockId = 4, ProductPrice = 73.00 },
|
||||
new Price { Id = 6, ProductStockId = 4, ProductPrice = 29.99 },
|
||||
new Price { Id = 7, ProductStockId = 5, ProductPrice = 13.65 },
|
||||
new Price { Id = 8, ProductStockId = 6, ProductPrice = 3.99 },
|
||||
new Price { Id = 9, ProductStockId = 7, ProductPrice = 5.67}
|
||||
};
|
||||
|
||||
public static List<ProductStockDto> ProductStockDtos() => new List<ProductStockDto>
|
||||
{
|
||||
new ProductStockDto { ProductStock = ProductStocks()[0], Price = Prices()[0] },
|
||||
new ProductStockDto { ProductStock = ProductStocks()[1], Price = Prices()[2] },
|
||||
new ProductStockDto { ProductStock = ProductStocks()[2], Price = Prices()[3] },
|
||||
new ProductStockDto { ProductStock = ProductStocks()[3], Price = Prices()[5] },
|
||||
new ProductStockDto { ProductStock = ProductStocks()[4], Price = Prices()[6] },
|
||||
new ProductStockDto { ProductStock = ProductStocks()[5], Price = Prices()[7] },
|
||||
new ProductStockDto { ProductStock = ProductStocks()[6], Price = Prices()[8] }
|
||||
};
|
||||
|
||||
public static List<VendorProductDto> VendorProducts() => new List<VendorProductDto>
|
||||
{
|
||||
new VendorProductDto { Id = 1, Ean = "Sample Ean 1", CategoryId = 3, CategoryName = "Sample Category Name 1", BrandId = 5, BrandName = "Sample Brand Name 1", Name = "Sample Name 1", Description = "Sample Description 1", Price = 9.1, InStock = true, ExpectedRestock = null },
|
||||
new VendorProductDto { Id = 2, Ean = "Sample Ean 2", CategoryId = 4, CategoryName = "Sample Category Name 2", BrandId = 6, BrandName = "Sample Brand Name 2", Name = "Sample Name 2", Description = "Sample Description 2", Price = 8.16, InStock = true, ExpectedRestock = null },
|
||||
new VendorProductDto { Id = 3, Ean = "Sample Ean 3", CategoryId = 5, CategoryName = "Sample Category Name 3", BrandId = 7, BrandName = "Sample Brand Name 3", Name = "Sample Name 3", Description = "Sample Description 3", Price = 1.9, InStock = true, ExpectedRestock = null },
|
||||
new VendorProductDto { Id = 4, Ean = "Sample Ean 4", CategoryId = 3, CategoryName = "Sample Category Name 4", BrandId = 5, BrandName = "Sample Brand Name 4", Name = "Sample Name 4", Description = "Sample Description 4", Price = 23.21, InStock = true, ExpectedRestock = null }
|
||||
};
|
||||
}
|
||||
|
||||
private const int OutOfBoundsId = 8;
|
||||
private const int NegativeId = -1;
|
||||
|
||||
private Mock<HttpMessageHandler> CreateHttpMock(HttpResponseMessage expected)
|
||||
{
|
||||
var mock = new Mock<HttpMessageHandler>(MockBehavior.Strict);
|
||||
mock.Protected()
|
||||
.Setup<Task<HttpResponseMessage>>(
|
||||
"SendAsync",
|
||||
ItExpr.IsAny<HttpRequestMessage>(),
|
||||
ItExpr.IsAny<CancellationToken>())
|
||||
.ReturnsAsync(expected)
|
||||
.Verifiable();
|
||||
return mock;
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetAll_AllValid_AllReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
|
||||
var result = await controller.ProductStocks();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as OkObjectResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var enumerableResult = objectResult.Value as IEnumerable<ProductStockDto>;
|
||||
Assert.IsNotNull(enumerableResult);
|
||||
var listResult = enumerableResult.ToList();
|
||||
foreach (var p in listResult)
|
||||
{
|
||||
Assert.AreEqual(p.Price.Date, Data.Prices()[p.Price.Id - 1].Date);
|
||||
Assert.AreEqual(p.Price.Id, Data.Prices()[p.Price.Id - 1].Id);
|
||||
Assert.AreEqual(p.Price.ProductPrice, Data.Prices()[p.Price.Id - 1].ProductPrice);
|
||||
Assert.AreEqual(p.Price.ProductStockId, Data.Prices()[p.Price.Id - 1].ProductStockId);
|
||||
|
||||
Assert.AreEqual(p.ProductStock.Id, Data.ProductStocks()[p.ProductStock.Id - 1].Id);
|
||||
Assert.AreEqual(p.ProductStock.Stock, Data.ProductStocks()[p.ProductStock.Id - 1].Stock);
|
||||
Assert.AreEqual(p.ProductStock.PriceId, Data.ProductStocks()[p.ProductStock.Id - 1].PriceId);
|
||||
Assert.AreEqual(p.ProductStock.ProductId, Data.ProductStocks()[p.ProductStock.Id - 1].ProductId);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetAll_EmptyModel_EmptyListReturned()
|
||||
{
|
||||
var context = new MockStockContext(new List<ProductStock>(), new List<Price>(), null);
|
||||
var controller = new StockController(context, null);
|
||||
|
||||
var result = await controller.ProductStocks();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as OkObjectResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var enumerableResult = objectResult.Value as IEnumerable<ProductStockDto>;
|
||||
Assert.IsNotNull(enumerableResult);
|
||||
var listResult = enumerableResult.ToList();
|
||||
Assert.AreEqual(listResult.Count, 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetDetails_ValidIdPassed_CorrectAndValidObjectReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = 2;
|
||||
|
||||
var result = await controller.Details(id);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as OkObjectResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var returnedResult = objectResult.Value as ProductStockDetailsDto;
|
||||
Assert.IsNotNull(returnedResult);
|
||||
|
||||
Assert.AreEqual(returnedResult.ProductID, Data.ProductStocks()[id - 1].ProductId);
|
||||
Assert.AreEqual(returnedResult.Price, Data.Prices().FirstOrDefault( p => p.Id == Data.ProductStocks()[id - 1].PriceId)?.ProductPrice);
|
||||
Assert.AreEqual(returnedResult.Stock, Data.ProductStocks()[id - 1].Stock);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetDetails_OutOfBoundsPositiveId_NotFoundReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = OutOfBoundsId;
|
||||
|
||||
var result = await controller.Details(id);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GetDetails_OutOfBoundsNegativeId_NotFoundReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = NegativeId;
|
||||
|
||||
var result = await controller.Details(id);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task PriceHistory_ValidIdPassed_CorrectAndValidObjectReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = 1;
|
||||
|
||||
var result = await controller.PriceHistory(id);
|
||||
var validPrices = Data.Prices().Where(p => p.ProductStockId == id).ToList();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as OkObjectResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var returnedResult = objectResult.Value as ProductStockPricingHistoryDto;
|
||||
Assert.IsNotNull(returnedResult);
|
||||
|
||||
Assert.AreEqual(returnedResult.ProductID, Data.ProductStocks()[id - 1].ProductId);
|
||||
Assert.AreEqual(returnedResult.Stock, Data.ProductStocks()[id - 1].Stock);
|
||||
Assert.AreEqual(returnedResult.Prices.Count, validPrices.Count);
|
||||
foreach (var prices in returnedResult.Prices)
|
||||
{
|
||||
Assert.AreEqual(prices.Id, validPrices.FirstOrDefault(p => p.Id == prices.Id)?.Id);
|
||||
Assert.AreEqual(prices.Date, validPrices.FirstOrDefault(p => p.Id == prices.Id)?.Date);
|
||||
Assert.AreEqual(prices.ProductPrice, validPrices.FirstOrDefault(p => p.Id == prices.Id)?.ProductPrice);
|
||||
Assert.AreEqual(prices.ProductStockId, validPrices.FirstOrDefault(p => p.Id == prices.Id)?.ProductStockId);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task PriceHistory_OutOfBoundsPositiveId_NotFoundReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = OutOfBoundsId;
|
||||
|
||||
var result = await controller.PriceHistory(id);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task PriceHistory_OutOfBoundsNegativeId_NotFoundReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = NegativeId;
|
||||
|
||||
var result = await controller.PriceHistory(id);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result.Result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Low_ValidCountPassedLowerThanDefault_CorrectAndValidObjectReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int count = 4;
|
||||
|
||||
var result = controller.Low(count);
|
||||
var expectedResult = Data.ProductStockDtos().OrderBy(ps => ps.ProductStock.Stock).Take(count).ToList();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var priceResult = result.Result as ViewResult;
|
||||
Assert.IsNotNull(priceResult);
|
||||
var objectResult = priceResult.Model as IEnumerable<ProductStockDto>;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var returnedListResult = objectResult.ToList();
|
||||
Assert.AreEqual(returnedListResult.Count, count);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Assert.AreEqual(returnedListResult[i].Price.Date, expectedResult[i].Price.Date);
|
||||
Assert.AreEqual(returnedListResult[i].Price.Id, expectedResult[i].Price.Id);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductPrice, expectedResult[i].Price.ProductPrice);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductStockId, expectedResult[i].Price.ProductStockId);
|
||||
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Id, expectedResult[i].ProductStock.Id);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Stock, expectedResult[i].ProductStock.Stock);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.PriceId, expectedResult[i].ProductStock.PriceId);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.ProductId, expectedResult[i].ProductStock.ProductId);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Low_ValidCountPassedHigherThanDefault_CorrectAndValidObjectReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int count = 6;
|
||||
|
||||
var result = controller.Low(count);
|
||||
var expectedResult = Data.ProductStockDtos().OrderBy(ps => ps.ProductStock.Stock).Take(count).ToList();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var priceResult = result.Result as ViewResult;
|
||||
Assert.IsNotNull(priceResult);
|
||||
var objectResult = priceResult.Model as IEnumerable<ProductStockDto>;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var returnedListResult = objectResult.ToList();
|
||||
Assert.AreEqual(returnedListResult.Count, count);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Assert.AreEqual(returnedListResult[i].Price.Date, expectedResult[i].Price.Date);
|
||||
Assert.AreEqual(returnedListResult[i].Price.Id, expectedResult[i].Price.Id);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductPrice, expectedResult[i].Price.ProductPrice);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductStockId, expectedResult[i].Price.ProductStockId);
|
||||
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Id, expectedResult[i].ProductStock.Id);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Stock, expectedResult[i].ProductStock.Stock);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.PriceId, expectedResult[i].ProductStock.PriceId);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.ProductId, expectedResult[i].ProductStock.ProductId);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Low_NullValuePassed_DefaultAmountCorrectAndValidObjectsReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int count = 5;
|
||||
|
||||
var result = controller.Low(null);
|
||||
var expectedResult = Data.ProductStockDtos().OrderBy(ps => ps.ProductStock.Stock).Take(count).ToList();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var priceResult = result.Result as ViewResult;
|
||||
Assert.IsNotNull(priceResult);
|
||||
var objectResult = priceResult.Model as IEnumerable<ProductStockDto>;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var returnedListResult = objectResult.ToList();
|
||||
Assert.AreEqual(returnedListResult.Count, count);
|
||||
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Assert.AreEqual(returnedListResult[i].Price.Date, expectedResult[i].Price.Date);
|
||||
Assert.AreEqual(returnedListResult[i].Price.Id, expectedResult[i].Price.Id);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductPrice, expectedResult[i].Price.ProductPrice);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductStockId, expectedResult[i].Price.ProductStockId);
|
||||
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Id, expectedResult[i].ProductStock.Id);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Stock, expectedResult[i].ProductStock.Stock);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.PriceId, expectedResult[i].ProductStock.PriceId);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.ProductId, expectedResult[i].ProductStock.ProductId);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Low_OutOfBoundsCountPassed_AllValuesReturnedCorrectly()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int count = OutOfBoundsId;
|
||||
|
||||
var result = controller.Low(OutOfBoundsId);
|
||||
var expectedResult = Data.ProductStockDtos().OrderBy(ps => ps.ProductStock.Stock).Take(count).ToList();
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var priceResult = result.Result as ViewResult;
|
||||
Assert.IsNotNull(priceResult);
|
||||
var objectResult = priceResult.Model as IEnumerable<ProductStockDto>;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var returnedListResult = objectResult.ToList();
|
||||
Assert.AreEqual(returnedListResult.Count, expectedResult.Count);
|
||||
|
||||
for (int i = 0; i < expectedResult.Count; i++)
|
||||
{
|
||||
Assert.AreEqual(returnedListResult[i].Price.Date, expectedResult[i].Price.Date);
|
||||
Assert.AreEqual(returnedListResult[i].Price.Id, expectedResult[i].Price.Id);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductPrice, expectedResult[i].Price.ProductPrice);
|
||||
Assert.AreEqual(returnedListResult[i].Price.ProductStockId, expectedResult[i].Price.ProductStockId);
|
||||
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Id, expectedResult[i].ProductStock.Id);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.Stock, expectedResult[i].ProductStock.Stock);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.PriceId, expectedResult[i].ProductStock.PriceId);
|
||||
Assert.AreEqual(returnedListResult[i].ProductStock.ProductId, expectedResult[i].ProductStock.ProductId);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void Low_OutOfBoundsNegativePassed_NotFoundReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int count = NegativeId;
|
||||
|
||||
var result = controller.Low(count);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var priceResult = result.Result as NotFoundResult;
|
||||
Assert.IsNotNull(priceResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void GETAdjustCost_ValidIdPassed_CorrectDataReturnedToView()
|
||||
{
|
||||
const int id = 2;
|
||||
var expectedHttpResponse = new ProductDto { Id = id, Name = "NameTest", Description = "DescriptionTest" };
|
||||
var expectedJson = JsonConvert.SerializeObject(expectedHttpResponse);
|
||||
var expectedResponse = new HttpResponseMessage
|
||||
{
|
||||
StatusCode = System.Net.HttpStatusCode.OK,
|
||||
Content = new StringContent(expectedJson,
|
||||
Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
var httpClient = new HttpClient(CreateHttpMock(expectedResponse).Object);
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null) { HttpClient = httpClient };
|
||||
|
||||
var expectedResult = Data.ProductStockDtos().FirstOrDefault(psd => psd.ProductStock.Id == id);
|
||||
var result = controller.AdjustCost(id);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var adjustResult = result.Result.Result as ViewResult;
|
||||
Assert.IsNotNull(adjustResult);
|
||||
var adjustProductStock = adjustResult.Model as AdjustCostViewModel;
|
||||
Assert.IsNotNull(adjustProductStock);
|
||||
|
||||
Assert.AreEqual(expectedResult.ProductStock.Id, adjustProductStock.Id);
|
||||
Assert.AreEqual(expectedResult.Price.ProductPrice, adjustProductStock.Cost);
|
||||
Assert.AreEqual(expectedHttpResponse.Name, adjustProductStock.Name);
|
||||
Assert.AreEqual(expectedHttpResponse.Description, adjustProductStock.Description);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task GETAdjustCost_InvalidIdPassed_NotFoundReturned()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
|
||||
var resultOutOfBounds = await controller.AdjustCost(OutOfBoundsId);
|
||||
var resultNegative = await controller.AdjustCost(NegativeId);
|
||||
|
||||
Assert.IsNotNull(resultOutOfBounds);
|
||||
var objectResultOutOfBounds = resultOutOfBounds.Result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResultOutOfBounds);
|
||||
|
||||
Assert.IsNotNull(resultNegative);
|
||||
var objectResultNegative = resultNegative.Result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResultNegative);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task POSTAdjustCost_ValidIdAndCostPassed_PriceAddedToDatabaseAndPricePointerChanged()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = 2;
|
||||
const double price = 4.32;
|
||||
|
||||
var previous = Data.ProductStockDtos().FirstOrDefault(ps => ps.ProductStock.Id == id);
|
||||
var expected = previous;
|
||||
expected.Price = new Price { Id = 10, ProductPrice = price, ProductStockId = expected.ProductStock.Id };
|
||||
expected.ProductStock.PriceId = 10;
|
||||
var result = await controller.AdjustCost(id, price);
|
||||
var after = await context.GetProductStockAsync(id);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var okResult = result as OkResult;
|
||||
Assert.IsNotNull(okResult);
|
||||
Assert.AreEqual(previous.ProductStock.Id, after.ProductStock.Id); //Just check Id to make sure the correct product is returned.
|
||||
Assert.AreEqual(expected.Price.Id, after.Price.Id);
|
||||
Assert.AreEqual(expected.Price.ProductPrice, after.Price.ProductPrice);
|
||||
Assert.AreEqual(expected.Price.ProductStockId, after.Price.ProductStockId);
|
||||
Assert.AreEqual(expected.ProductStock.PriceId, after.ProductStock.PriceId);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task POSTAdjustCost_OutOfBoundsAndNegativeIdPassed_ReturnNotFound()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const double price = 4.32;
|
||||
|
||||
var resultOutOfBounds = await controller.AdjustCost(OutOfBoundsId, price);
|
||||
var resultNegative = await controller.AdjustCost(NegativeId, price);
|
||||
|
||||
Assert.IsNotNull(resultOutOfBounds);
|
||||
var objectResultOutOfBounds = resultOutOfBounds as NotFoundResult;
|
||||
Assert.IsNotNull(objectResultOutOfBounds);
|
||||
|
||||
Assert.IsNotNull(resultNegative);
|
||||
var objectResultNegative = resultNegative as NotFoundResult;
|
||||
Assert.IsNotNull(objectResultNegative);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task POSTAdjustCost_NegativeCostPassed_ReturnBadRequest()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = 2;
|
||||
const double price = -4.32;
|
||||
|
||||
var result = await controller.AdjustCost(id, price);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as BadRequestResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task POSTAdjustCost_ZeroCostPassed_ReturnBadRequest()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = 2;
|
||||
const double price = 0;
|
||||
|
||||
var result = await controller.AdjustCost(id, price);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as BadRequestResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task VendorProducts_ValidSupplierPassed_ReturnAllSupplierProducts()
|
||||
{
|
||||
var expectedHttpResponse = Data.VendorProducts();
|
||||
var expectedJson = JsonConvert.SerializeObject(expectedHttpResponse);
|
||||
var expectedResponse = new HttpResponseMessage
|
||||
{
|
||||
StatusCode = System.Net.HttpStatusCode.OK,
|
||||
Content = new StringContent(expectedJson,
|
||||
Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
var httpClient = new HttpClient(CreateHttpMock(expectedResponse).Object);
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null) { HttpClient = httpClient };
|
||||
const string supplier = "undercutters";
|
||||
|
||||
var expected = Data.VendorProducts();
|
||||
var result = await controller.VendorProducts(supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as ViewResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var viewResult = objectResult.Model as VendorProductIndexModel;
|
||||
Assert.IsNotNull(viewResult);
|
||||
var productsResult = viewResult.Products.ToList();
|
||||
Assert.IsNotNull(productsResult);
|
||||
|
||||
Assert.AreEqual(expected.Count, productsResult.Count);
|
||||
for (int i = 0; i < expected.Count; i++)
|
||||
{
|
||||
Assert.AreEqual(expected[i].Id, productsResult[i].Id);
|
||||
Assert.AreEqual(expected[i].BrandId, productsResult[i].BrandId);
|
||||
Assert.AreEqual(expected[i].BrandName, productsResult[i].BrandName);
|
||||
Assert.AreEqual(expected[i].CategoryId, productsResult[i].CategoryId);
|
||||
Assert.AreEqual(expected[i].CategoryName, productsResult[i].CategoryName);
|
||||
Assert.AreEqual(expected[i].Description, productsResult[i].Description);
|
||||
Assert.AreEqual(expected[i].Ean, productsResult[i].Ean);
|
||||
Assert.AreEqual(expected[i].ExpectedRestock, productsResult[i].ExpectedRestock);
|
||||
Assert.AreEqual(expected[i].InStock, productsResult[i].InStock);
|
||||
Assert.AreEqual(expected[i].Name, productsResult[i].Name);
|
||||
Assert.AreEqual(expected[i].Price, productsResult[i].Price);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task VendorProducts_NullSupplierPassed_ReturnNotFound()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const string supplier = null;
|
||||
|
||||
var result = await controller.VendorProducts(supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task VendorProducts_EmtpySupplierPassed_ReturnNotFound()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const string supplier = "";
|
||||
|
||||
var result = await controller.VendorProducts(supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OrderRequest_ValidIdAndSupplierPassed_ReturnCorrectAndValidModel()
|
||||
{
|
||||
const int id = 2;
|
||||
const string supplier = "undercutters";
|
||||
var expectedHttpResponse = Data.VendorProducts().FirstOrDefault(vp => vp.Id == id);
|
||||
var expectedJson = JsonConvert.SerializeObject(expectedHttpResponse);
|
||||
var expectedResponse = new HttpResponseMessage
|
||||
{
|
||||
StatusCode = System.Net.HttpStatusCode.OK,
|
||||
Content = new StringContent(expectedJson,
|
||||
Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
var httpClient = new HttpClient(CreateHttpMock(expectedResponse).Object);
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null) { HttpClient = httpClient };
|
||||
|
||||
var expected = expectedHttpResponse;
|
||||
var result = await controller.OrderRequest(id, supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as ViewResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
var viewResult = objectResult.Model as OrderRequestModel;
|
||||
Assert.IsNotNull(viewResult);
|
||||
|
||||
Assert.AreEqual(id, viewResult.Id);
|
||||
Assert.AreEqual(expected.Name, viewResult.Name);
|
||||
Assert.AreEqual(expected.Id, viewResult.Id);
|
||||
Assert.AreEqual(supplier, viewResult.Supplier);
|
||||
Assert.AreEqual(expected.Description, viewResult.Description);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OrderRequest_IncorrectProductReturned_ReturnInternalServerError()
|
||||
{
|
||||
const int id = 2;
|
||||
const string supplier = "undercutters";
|
||||
var expectedHttpResponse = Data.VendorProducts().FirstOrDefault(vp => vp.Id == id + 1);
|
||||
var expectedJson = JsonConvert.SerializeObject(expectedHttpResponse);
|
||||
var expectedResponse = new HttpResponseMessage
|
||||
{
|
||||
StatusCode = System.Net.HttpStatusCode.OK,
|
||||
Content = new StringContent(expectedJson,
|
||||
Encoding.UTF8,
|
||||
"application/json")
|
||||
};
|
||||
var httpClient = new HttpClient(CreateHttpMock(expectedResponse).Object);
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null) { HttpClient = httpClient };
|
||||
|
||||
var result = await controller.OrderRequest(id, supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as StatusCodeResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
Assert.AreEqual(objectResult.StatusCode, StatusCodes.Status500InternalServerError);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OrderRequest_EmtpySupplierPassed_ReturnNotFound()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = 2;
|
||||
const string supplier = "";
|
||||
|
||||
var result = await controller.OrderRequest(id, supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OrderRequest_ZeroIdPassed_ReturnNotFound()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = 0;
|
||||
const string supplier = "undercutters";
|
||||
|
||||
var result = await controller.OrderRequest(id, supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OrderRequest_NegativeIdPassed_ReturnNotFound()
|
||||
{
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null);
|
||||
const int id = NegativeId;
|
||||
const string supplier = "undercutters";
|
||||
|
||||
var result = await controller.OrderRequest(id, supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task OrderRequest_OutOfBoundsIdPassed_ReturnNotFound()
|
||||
{
|
||||
const int id = 10000;
|
||||
const string supplier = "undercutters";
|
||||
var expectedResponse = new HttpResponseMessage
|
||||
{
|
||||
StatusCode = System.Net.HttpStatusCode.NotFound
|
||||
};
|
||||
var httpClient = new HttpClient(CreateHttpMock(expectedResponse).Object);
|
||||
var context = new MockStockContext(Data.ProductStocks(), Data.Prices(), null);
|
||||
var controller = new StockController(context, null) { HttpClient = httpClient };
|
||||
|
||||
var result = await controller.OrderRequest(id, supplier);
|
||||
|
||||
Assert.IsNotNull(result);
|
||||
var objectResult = result as NotFoundResult;
|
||||
Assert.IsNotNull(objectResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IdentityModel" Version="4.1.1" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="1.4.0" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="1.4.0" />
|
||||
<PackageReference Include="Moq" Version="4.13.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ThAmCo.Stock\ThAmCo.Stock.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.29102.190
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThAmCo.Stock", "ThAmCo.Stock\ThAmCo.Stock.csproj", "{776C190D-23ED-411F-992E-856EA29F03C3}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ThAmCo.Stock.Tests", "ThAmCo.Stock.Tests\ThAmCo.Stock.Tests.csproj", "{CC10B86C-AA9A-47F9-B8FD-6F9D619A9FC7}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{776C190D-23ED-411F-992E-856EA29F03C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{776C190D-23ED-411F-992E-856EA29F03C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{776C190D-23ED-411F-992E-856EA29F03C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{776C190D-23ED-411F-992E-856EA29F03C3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{CC10B86C-AA9A-47F9-B8FD-6F9D619A9FC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{CC10B86C-AA9A-47F9-B8FD-6F9D619A9FC7}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{CC10B86C-AA9A-47F9-B8FD-6F9D619A9FC7}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{CC10B86C-AA9A-47F9-B8FD-6F9D619A9FC7}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {945DEC89-A282-495A-8477-B670C0CE64D0}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
using IdentityModel.Client;
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ThAmCo.Stock.Models;
|
||||
|
||||
namespace ThAmCo.Stock.Controllers
|
||||
{
|
||||
public class AccountController : Controller
|
||||
{
|
||||
private readonly IHttpClientFactory _clientFactory;
|
||||
|
||||
public AccountController(IHttpClientFactory clientFactory)
|
||||
{
|
||||
_clientFactory = clientFactory;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> Login()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Login([FromForm] LoginModel model)
|
||||
{
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
|
||||
var disco = await client.GetDiscoveryDocumentAsync("https://localhost:43389");
|
||||
var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest
|
||||
{
|
||||
Address = disco.TokenEndpoint,
|
||||
ClientId = "my_web_app",
|
||||
ClientSecret = "secret",
|
||||
|
||||
UserName = model.Email,
|
||||
Password = model.Password
|
||||
});
|
||||
|
||||
if (tokenResponse.IsError)
|
||||
return View();
|
||||
|
||||
var userInfoResponse = await client.GetUserInfoAsync(new UserInfoRequest
|
||||
{
|
||||
Address = disco.UserInfoEndpoint,
|
||||
Token = tokenResponse.AccessToken
|
||||
});
|
||||
|
||||
if (userInfoResponse.IsError)
|
||||
return View();
|
||||
|
||||
var claimsIdentity = new ClaimsIdentity(userInfoResponse.Claims, "Cookies");
|
||||
var claimsPrincipal = new ClaimsPrincipal(claimsIdentity);
|
||||
|
||||
var tokensToStore = new AuthenticationToken[]
|
||||
{
|
||||
new AuthenticationToken { Name = "access_token", Value = tokenResponse.AccessToken }
|
||||
};
|
||||
var authProperties = new AuthenticationProperties();
|
||||
authProperties.StoreTokens(tokensToStore);
|
||||
|
||||
await HttpContext.SignInAsync("Cookies", claimsPrincipal, authProperties);
|
||||
|
||||
return LocalRedirect("/");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public async Task<IActionResult> Logout()
|
||||
{
|
||||
await HttpContext.SignOutAsync("Cookies");
|
||||
return LocalRedirect("/");
|
||||
}
|
||||
|
||||
[Authorize]
|
||||
public IActionResult Authed()
|
||||
{
|
||||
return Ok("Authed");
|
||||
}
|
||||
|
||||
[Authorize(Policy = "StaffOnly")]
|
||||
public IActionResult StaffAuthed()
|
||||
{
|
||||
return Ok("Authed");
|
||||
}
|
||||
|
||||
public IActionResult AccessDenied()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
private HttpClient GetHttpClient(string s)
|
||||
{
|
||||
return _clientFactory.CreateClient(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using ThAmCo.Stock.Models;
|
||||
|
||||
namespace ThAmCo.Stock.Controllers
|
||||
{
|
||||
[Authorize(Policy = "StaffOnly")]
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Privacy()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ThAmCo.Stock.Data;
|
||||
using ThAmCo.Stock.Data.StockContext;
|
||||
using ThAmCo.Stock.Models.Dto;
|
||||
using ThAmCo.Stock.Models.ViewModel;
|
||||
|
||||
namespace ThAmCo.Stock.Controllers
|
||||
{
|
||||
[Route("[controller]")]
|
||||
[Controller]
|
||||
public class OldStockController : Controller
|
||||
{
|
||||
private readonly IStockContext _context;
|
||||
private readonly IHttpClientFactory _clientFactory;
|
||||
|
||||
public OldStockController(IStockContext context, IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_context = context;
|
||||
_clientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
// GET: api/Stock
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<IEnumerable<ProductStockDto>>> GetProductStock()
|
||||
{
|
||||
return Ok(await _context.GetAll());
|
||||
}
|
||||
|
||||
// GET: api/Stock/5
|
||||
[HttpGet("{id}")]
|
||||
public async Task<ActionResult<ProductStockDetailsDto>> Details(int id)
|
||||
{
|
||||
if (id < 0)
|
||||
return NotFound();
|
||||
|
||||
var productStock = await _context.GetProductStockAsync(id);
|
||||
|
||||
if (productStock == null)
|
||||
return NotFound();
|
||||
|
||||
return Ok(new ProductStockDetailsDto
|
||||
{
|
||||
ProductID = productStock.ProductStock.ProductId,
|
||||
Stock = productStock.ProductStock.Stock,
|
||||
Price = productStock.Price.ProductPrice
|
||||
});
|
||||
}
|
||||
|
||||
[HttpGet("PriceHistory/{id}")]
|
||||
public async Task<ActionResult<ProductStockPricingHistoryDto>> PriceHistory(int id)
|
||||
{
|
||||
if (id < 0)
|
||||
return NotFound();
|
||||
|
||||
var productStock = await _context.GetProductStockAsync(id);
|
||||
|
||||
if (productStock == null)
|
||||
return NotFound();
|
||||
|
||||
var productPrices = _context.GetAllPrices().Result.Where(p => p.ProductStockId == productStock.ProductStock.PriceId).ToList();
|
||||
|
||||
var productDetails = new ProductStockPricingHistoryDto
|
||||
{
|
||||
ProductID = productStock.ProductStock.ProductId,
|
||||
Stock = productStock.ProductStock.Stock,
|
||||
Prices = productPrices
|
||||
};
|
||||
|
||||
return Ok(productDetails);
|
||||
}
|
||||
|
||||
// PUT: api/Stock/5
|
||||
[HttpPut("{id}")]
|
||||
public async Task<IActionResult> PutProductStock(int id, ProductStock productStock)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
/*if (id != productStock.Id)
|
||||
return BadRequest();
|
||||
|
||||
_context.Entry(productStock).State = EntityState.Modified;
|
||||
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!ProductStockExists(id))
|
||||
return NotFound();
|
||||
throw;
|
||||
}
|
||||
|
||||
return NoContent();*/
|
||||
}
|
||||
|
||||
// POST: api/Stock
|
||||
[HttpPost]
|
||||
public async Task<ActionResult<ProductStock>> PostProductStock(ProductStock productStock)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
/*_context.ProductStocks.Add(productStock);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return CreatedAtAction("GetProductStock", new { id = productStock.Id }, productStock);*/
|
||||
}
|
||||
|
||||
// DELETE: api/Stock/5
|
||||
[HttpDelete("{id}")]
|
||||
public async Task<ActionResult<ProductStock>> DeleteProductStock(int id)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
/*var productStock = await _context.ProductStocks.FindAsync(id);
|
||||
if (productStock == null)
|
||||
return NotFound();
|
||||
|
||||
_context.ProductStocks.Remove(productStock);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return productStock;*/
|
||||
}
|
||||
|
||||
[HttpGet("low/{count}")]
|
||||
public ActionResult<IEnumerable<ProductStockDto>> Low(int? count)
|
||||
{
|
||||
if (count != null && count < 0)
|
||||
return NotFound(); //0 is technically valid, since the request would want 0. below 0 would be an invalid request.
|
||||
|
||||
var listToCount = _context.GetAll().Result.OrderBy(ps => ps.ProductStock.Stock).Take(count ?? 5).ToList();
|
||||
|
||||
return View(listToCount);
|
||||
}
|
||||
|
||||
[HttpGet("AdjustCost/{id}")]
|
||||
public async Task<ActionResult<ProductStockDto>> AdjustCost(int id)
|
||||
{
|
||||
var productPrice = await _context.GetProductStockAsync(id);
|
||||
if (productPrice == null)
|
||||
return NotFound();
|
||||
return View(new AdjustCostViewModel { Id = productPrice.ProductStock.Id, Cost = productPrice.Price.ProductPrice });
|
||||
}
|
||||
|
||||
[HttpPost("AdjustCost")]
|
||||
public async Task<ActionResult> AdjustCost(int id, double cost)
|
||||
{
|
||||
var productStock = _context.GetProductStockAsync(id).Result;
|
||||
|
||||
if (productStock == null)
|
||||
return NotFound();
|
||||
|
||||
var price = _context.AddPriceAsync(new Price { ProductPrice = cost, ProductStockId = id, Date = DateTime.Now });
|
||||
|
||||
productStock.ProductStock.PriceId = price.Id;
|
||||
_context.UpdateProductStockAsync(productStock.ProductStock);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
private bool ProductStockExists(int id)
|
||||
{
|
||||
return _context.GetAll().Result.Any(e => e.ProductStock.Id == id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,440 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Newtonsoft.Json;
|
||||
using ThAmCo.Stock.Data;
|
||||
using ThAmCo.Stock.Data.StockContext;
|
||||
using ThAmCo.Stock.Models.Dto;
|
||||
using ThAmCo.Stock.Models.ViewModel;
|
||||
|
||||
namespace ThAmCo.Stock.Controllers
|
||||
{
|
||||
[Authorize(Policy = "StaffOnly")]
|
||||
public class StockController : Controller
|
||||
{
|
||||
private readonly IStockContext _context;
|
||||
private readonly IHttpClientFactory _clientFactory;
|
||||
|
||||
public HttpClient HttpClient { get; set; }
|
||||
|
||||
public StockController(IStockContext context, IHttpClientFactory httpClientFactory)
|
||||
{
|
||||
_context = context;
|
||||
_clientFactory = httpClientFactory;
|
||||
}
|
||||
|
||||
// GET: Stock
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(_context.GetAll().Result.ToList());
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
// GET: Stock/Details/5
|
||||
public async Task<ActionResult<ProductStockDetailsDto>> Details(int id)
|
||||
{
|
||||
if (id < 0)
|
||||
return NotFound();
|
||||
|
||||
var productStock = await _context.GetProductStockAsync(id);
|
||||
|
||||
if (productStock == null)
|
||||
return NotFound();
|
||||
|
||||
return Ok(new ProductStockDetailsDto
|
||||
{
|
||||
ProductID = productStock.ProductStock.ProductId,
|
||||
Stock = productStock.ProductStock.Stock,
|
||||
Price = productStock.Price.ProductPrice
|
||||
});
|
||||
}
|
||||
|
||||
// GET: Stock/Create
|
||||
public IActionResult Create()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: Stock/Create
|
||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Create([Bind("Id,ProductId,Stock,PriceId")] ProductStock productStock)
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
//_context.AddProductStockAsync(productStock);
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
return View(productStock);
|
||||
}
|
||||
|
||||
// GET: Stock/Edit/5
|
||||
public async Task<IActionResult> Edit(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var productStock = await _context.GetProductStockAsync(id ?? 1);
|
||||
if (productStock == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
return View(productStock);
|
||||
}
|
||||
|
||||
// POST: Stock/Edit/5
|
||||
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
|
||||
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
|
||||
[HttpPost]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> Edit(int id, [Bind("Id,ProductId,Stock,PriceId")] ProductStock productStock)
|
||||
{
|
||||
if (id != productStock.Id)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
try
|
||||
{
|
||||
_context.UpdateProductStockAsync(productStock);
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
if (!ProductStockExists(productStock.Id))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
return View(productStock);
|
||||
}
|
||||
|
||||
// GET: Stock/Delete/5
|
||||
public async Task<IActionResult> Delete(int? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
var productStock = await _context.GetProductStockAsync(id ?? 1);
|
||||
if (productStock == null)
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return View(productStock);
|
||||
}
|
||||
|
||||
// POST: Stock/Delete/5
|
||||
[HttpPost, ActionName("Delete")]
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(int id)
|
||||
{
|
||||
/*var productStock = await _context.ProductStocks.FindAsync(id);
|
||||
_context.ProductStocks.Remove(productStock);
|
||||
await _context.SaveChangesAsync();*/
|
||||
return RedirectToAction(nameof(Index));
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
public async Task<ActionResult<IEnumerable<ProductStockDto>>> ProductStocks()
|
||||
{
|
||||
return Ok(await _context.GetAll());
|
||||
}
|
||||
|
||||
public async Task<ActionResult<ProductStockPricingHistoryDto>> PriceHistory(int id)
|
||||
{
|
||||
if (id < 0)
|
||||
return NotFound();
|
||||
|
||||
var productStock = await _context.GetProductStockAsync(id);
|
||||
|
||||
if (productStock == null)
|
||||
return NotFound();
|
||||
|
||||
var productPrices = _context.GetAllPrices().Result.Where(p => p.ProductStockId == productStock.ProductStock.PriceId).ToList();
|
||||
|
||||
var productDetails = new ProductStockPricingHistoryDto
|
||||
{
|
||||
ProductID = productStock.ProductStock.ProductId,
|
||||
Stock = productStock.ProductStock.Stock,
|
||||
Prices = productPrices
|
||||
};
|
||||
|
||||
return Ok(productDetails);
|
||||
}
|
||||
|
||||
public ActionResult<IEnumerable<ProductStockDto>> Low(int? count)
|
||||
{
|
||||
if (count != null && count < 0)
|
||||
return NotFound(); //0 is technically valid, since the request would want 0. below 0 would be an invalid request.
|
||||
|
||||
var listToCount = _context.GetAll().Result.OrderBy(ps => ps.ProductStock.Stock).Take(count ?? 5).ToList();
|
||||
|
||||
return View(listToCount);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<AdjustCostViewModel>> AdjustCost(int id)
|
||||
{
|
||||
var productPrice = await _context.GetProductStockAsync(id);
|
||||
|
||||
if (productPrice == null)
|
||||
return NotFound();
|
||||
|
||||
AdjustCostViewModel objectResponse;
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
|
||||
var response = await client.GetAsync("https://localhost:44375/products/getProduct/" + id);
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
var objectResult = await response.Content.ReadAsAsync<ProductDto>();
|
||||
if (objectResult == null)
|
||||
return NotFound();
|
||||
objectResponse = new AdjustCostViewModel
|
||||
{
|
||||
Id = productPrice.ProductStock.Id,
|
||||
Cost = productPrice.Price.ProductPrice,
|
||||
Name = objectResult.Name,
|
||||
Description = objectResult.Description
|
||||
};
|
||||
}
|
||||
else return NotFound();
|
||||
|
||||
return View(objectResponse);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> AdjustCost(int id, double cost)
|
||||
{
|
||||
var productStock = await _context.GetProductStockAsync(id);
|
||||
|
||||
if (productStock == null)
|
||||
return NotFound();
|
||||
if (cost <= 0)
|
||||
return BadRequest();
|
||||
|
||||
var price = _context.AddPriceAsync(new Price { ProductPrice = cost, ProductStockId = id, Date = DateTime.Now });
|
||||
|
||||
productStock.ProductStock.PriceId = price.Id;
|
||||
_context.UpdateProductStockAsync(productStock.ProductStock);
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> VendorProducts(string supplier)
|
||||
{
|
||||
var vendorProducts = new VendorProductIndexModel
|
||||
{
|
||||
Vendor = supplier
|
||||
};
|
||||
|
||||
HttpResponseMessage response = null;
|
||||
|
||||
var url = GetURLForSupplier(supplier);
|
||||
if (url == null)
|
||||
return NotFound();
|
||||
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
|
||||
response = await client.GetAsync(url + "product");
|
||||
|
||||
if (response?.IsSuccessStatusCode == true)
|
||||
{
|
||||
var objectResult = await response.Content.ReadAsAsync<List<VendorProductDto>>();
|
||||
if (objectResult == null)
|
||||
goto View;
|
||||
vendorProducts.Products = objectResult;
|
||||
}
|
||||
else return NotFound();
|
||||
|
||||
View:
|
||||
return View(vendorProducts);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> OrderRequest(int id, string supplier = null)
|
||||
{
|
||||
if (id <= 0)
|
||||
return NotFound();
|
||||
|
||||
var url = GetURLForSupplier(supplier);
|
||||
if (url == null)
|
||||
return NotFound();
|
||||
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
|
||||
HttpResponseMessage response = null;
|
||||
response = await client.GetAsync(url + "product/" + id);
|
||||
|
||||
if (response?.IsSuccessStatusCode == true)
|
||||
{
|
||||
var objectResult = await response.Content.ReadAsAsync<VendorProductDto>();
|
||||
|
||||
if (objectResult == null)
|
||||
return NotFound();
|
||||
if (objectResult.Id != id)
|
||||
return new StatusCodeResult(StatusCodes.Status500InternalServerError);
|
||||
|
||||
return View(new OrderRequestModel { Id = id, Name = objectResult.Name, Description = objectResult.Description, Supplier = supplier });
|
||||
}
|
||||
else return NotFound();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> OrderRequestSubmitted(int id, string supplier, int quantity)
|
||||
{
|
||||
var orderRequest = new OrderRequest
|
||||
{
|
||||
Quantity = quantity,
|
||||
Supplier = supplier,
|
||||
SubmittedTime = DateTime.Now,
|
||||
Approved = false,
|
||||
ApprovedTime = null,
|
||||
Deleted = false
|
||||
};
|
||||
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
|
||||
var url = GetURLForSupplier(supplier);
|
||||
if (url == null)
|
||||
return NotFound();
|
||||
|
||||
HttpResponseMessage response = null;
|
||||
|
||||
response = await client.GetAsync(url + "product/" + id);
|
||||
|
||||
if (response?.IsSuccessStatusCode == true)
|
||||
{
|
||||
var objectResult = await response.Content.ReadAsAsync<VendorProductDto>();
|
||||
if (objectResult == null)
|
||||
return NotFound();
|
||||
orderRequest.ProductId = objectResult.Id;
|
||||
orderRequest.Price = objectResult.Price * quantity;
|
||||
|
||||
_context.AddOrderRequest(orderRequest);
|
||||
|
||||
return RedirectToAction(nameof(VendorProducts), new { supplier });
|
||||
}
|
||||
else return NotFound();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> OrderRequests()
|
||||
{
|
||||
return View(_context.GetAllOrderRequests().Result.Where(or => !or.Approved).ToList());
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<ActionResult> OrderRequestReview(int id)
|
||||
{
|
||||
var orderRequest = _context.GetOrderRequest(id).Result;
|
||||
if (orderRequest == null)
|
||||
return NotFound();
|
||||
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
client.DefaultRequestHeaders.Accept.ParseAdd("application/json");
|
||||
|
||||
var url = GetURLForSupplier(orderRequest.Supplier);
|
||||
if (url == null)
|
||||
return NotFound();
|
||||
|
||||
HttpResponseMessage response = null;
|
||||
|
||||
response = await client.GetAsync(url + "product/" + orderRequest.ProductId);
|
||||
|
||||
if (response?.IsSuccessStatusCode == true)
|
||||
{
|
||||
var objectResult = await response.Content.ReadAsAsync<VendorProductDto>();
|
||||
if (objectResult == null)
|
||||
return NotFound();
|
||||
|
||||
//Update order details incase service changes prices.
|
||||
if (orderRequest.Price != objectResult.Price * orderRequest.Quantity)
|
||||
{
|
||||
orderRequest.Price = objectResult.Price * orderRequest.Quantity;
|
||||
_context.UpdateOrderRequest(orderRequest);
|
||||
}
|
||||
|
||||
var reviewModel = new OrderRequestReviewModel
|
||||
{
|
||||
Id = orderRequest.Id,
|
||||
Name = objectResult.Name,
|
||||
Description = objectResult.Description,
|
||||
Price = orderRequest.Price,
|
||||
Quantity = orderRequest.Quantity,
|
||||
Supplier = orderRequest.Supplier
|
||||
};
|
||||
|
||||
return View(reviewModel);
|
||||
}
|
||||
else return NotFound();
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> OrderRequestApproved(int id)
|
||||
{
|
||||
var orderRequest = _context.GetOrderRequest(id).Result;
|
||||
if (orderRequest == null)
|
||||
return NotFound();
|
||||
var orderDto = new ProductOrderPostDto
|
||||
{
|
||||
AccountName = "sample string 1",
|
||||
CardNumber = "sample string 2",
|
||||
ProductId = orderRequest.ProductId,
|
||||
Quantity = orderRequest.Quantity
|
||||
};
|
||||
|
||||
var client = GetHttpClient("StandardRequest");
|
||||
var result = await client.PostAsJsonAsync(GetURLForSupplier(orderRequest.Supplier) + "order", orderDto);
|
||||
if (result.IsSuccessStatusCode)
|
||||
{
|
||||
_context.ApproveOrderRequest(id);
|
||||
return Ok(result.Content);
|
||||
//return RedirectToAction(nameof(OrderRequests));
|
||||
}
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
private bool ProductStockExists(int id)
|
||||
{
|
||||
return _context.GetAll().Result.Any(e => e.ProductStock.Id == id);
|
||||
}
|
||||
|
||||
private HttpClient GetHttpClient(string s)
|
||||
{
|
||||
if (_clientFactory == null && HttpClient != null) return HttpClient;
|
||||
|
||||
return _clientFactory.CreateClient(s);
|
||||
}
|
||||
|
||||
private string GetURLForSupplier(string s)
|
||||
{
|
||||
if (s == "undercutters") return "http://undercutters.azurewebsites.net/api/";
|
||||
else if (s == "dodgydealers") return "http://dodgydealers.azurewebsites.net/api/";
|
||||
else return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockDbContext))]
|
||||
[Migration("20191205144118_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<DateTime>("Date");
|
||||
|
||||
b.Property<double>("ProductPrice");
|
||||
|
||||
b.Property<int>("ProductStockId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prices");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 9.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 8.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 17.989999999999998,
|
||||
ProductStockId = 2
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("PriceId");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Stock");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProductStocks");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
PriceId = 2,
|
||||
ProductId = 1,
|
||||
Stock = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
PriceId = 3,
|
||||
ProductId = 2,
|
||||
Stock = 42
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Prices",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
ProductStockId = table.Column<int>(nullable: false),
|
||||
ProductPrice = table.Column<double>(nullable: false),
|
||||
Date = table.Column<DateTime>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Prices", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ProductStocks",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
ProductId = table.Column<int>(nullable: false),
|
||||
Stock = table.Column<int>(nullable: false),
|
||||
PriceId = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ProductStocks", x => x.Id);
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "Prices",
|
||||
columns: new[] { "Id", "Date", "ProductPrice", "ProductStockId" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 9.9900000000000002, 1 },
|
||||
{ 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 8.9900000000000002, 1 },
|
||||
{ 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 17.989999999999998, 2 }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "ProductStocks",
|
||||
columns: new[] { "Id", "PriceId", "ProductId", "Stock" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 1, 2, 1, 4 },
|
||||
{ 2, 3, 2, 42 }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Prices");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "ProductStocks");
|
||||
}
|
||||
}
|
||||
}
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockDbContext))]
|
||||
[Migration("20191218210759_TestDataProducts")]
|
||||
partial class TestDataProducts
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<DateTime>("Date");
|
||||
|
||||
b.Property<double>("ProductPrice");
|
||||
|
||||
b.Property<int>("ProductStockId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prices");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 9.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 8.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 17.989999999999998,
|
||||
ProductStockId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 23.0,
|
||||
ProductStockId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 2.9900000000000002,
|
||||
ProductStockId = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 49.630000000000003,
|
||||
ProductStockId = 5
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 4.5599999999999996,
|
||||
ProductStockId = 6
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 8,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 10.01,
|
||||
ProductStockId = 7
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("PriceId");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Stock");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProductStocks");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
PriceId = 2,
|
||||
ProductId = 1,
|
||||
Stock = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
PriceId = 3,
|
||||
ProductId = 2,
|
||||
Stock = 42
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
PriceId = 4,
|
||||
ProductId = 3,
|
||||
Stock = 32
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
PriceId = 5,
|
||||
ProductId = 4,
|
||||
Stock = 13
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
PriceId = 6,
|
||||
ProductId = 5,
|
||||
Stock = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
PriceId = 7,
|
||||
ProductId = 6,
|
||||
Stock = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
PriceId = 8,
|
||||
ProductId = 7,
|
||||
Stock = 49
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
public partial class TestDataProducts : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.InsertData(
|
||||
table: "Prices",
|
||||
columns: new[] { "Id", "Date", "ProductPrice", "ProductStockId" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 4, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 23.0, 3 },
|
||||
{ 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 2.9900000000000002, 4 },
|
||||
{ 6, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 49.630000000000003, 5 },
|
||||
{ 7, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 4.5599999999999996, 6 },
|
||||
{ 8, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), 10.01, 7 }
|
||||
});
|
||||
|
||||
migrationBuilder.InsertData(
|
||||
table: "ProductStocks",
|
||||
columns: new[] { "Id", "PriceId", "ProductId", "Stock" },
|
||||
values: new object[,]
|
||||
{
|
||||
{ 3, 4, 3, 32 },
|
||||
{ 4, 5, 4, 13 },
|
||||
{ 5, 6, 5, 0 },
|
||||
{ 6, 7, 6, 1 },
|
||||
{ 7, 8, 7, 49 }
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Prices",
|
||||
keyColumn: "Id",
|
||||
keyValue: 4);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Prices",
|
||||
keyColumn: "Id",
|
||||
keyValue: 5);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Prices",
|
||||
keyColumn: "Id",
|
||||
keyValue: 6);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Prices",
|
||||
keyColumn: "Id",
|
||||
keyValue: 7);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "Prices",
|
||||
keyColumn: "Id",
|
||||
keyValue: 8);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductStocks",
|
||||
keyColumn: "Id",
|
||||
keyValue: 3);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductStocks",
|
||||
keyColumn: "Id",
|
||||
keyValue: 4);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductStocks",
|
||||
keyColumn: "Id",
|
||||
keyValue: 5);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductStocks",
|
||||
keyColumn: "Id",
|
||||
keyValue: 6);
|
||||
|
||||
migrationBuilder.DeleteData(
|
||||
table: "ProductStocks",
|
||||
keyColumn: "Id",
|
||||
keyValue: 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockDbContext))]
|
||||
[Migration("20200102001637_AddBaseOrderRequests")]
|
||||
partial class AddBaseOrderRequests
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Approved");
|
||||
|
||||
b.Property<DateTime>("ApprovedTime");
|
||||
|
||||
b.Property<bool>("Deleted");
|
||||
|
||||
b.Property<double>("Price");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Quantity");
|
||||
|
||||
b.Property<DateTime>("SubmittedTime");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("OrderRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<DateTime>("Date");
|
||||
|
||||
b.Property<double>("ProductPrice");
|
||||
|
||||
b.Property<int>("ProductStockId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prices");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 9.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 8.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 17.989999999999998,
|
||||
ProductStockId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 23.0,
|
||||
ProductStockId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 2.9900000000000002,
|
||||
ProductStockId = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 49.630000000000003,
|
||||
ProductStockId = 5
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 4.5599999999999996,
|
||||
ProductStockId = 6
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 8,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 10.01,
|
||||
ProductStockId = 7
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("PriceId");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Stock");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProductStocks");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
PriceId = 2,
|
||||
ProductId = 1,
|
||||
Stock = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
PriceId = 3,
|
||||
ProductId = 2,
|
||||
Stock = 42
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
PriceId = 4,
|
||||
ProductId = 3,
|
||||
Stock = 32
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
PriceId = 5,
|
||||
ProductId = 4,
|
||||
Stock = 13
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
PriceId = 6,
|
||||
ProductId = 5,
|
||||
Stock = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
PriceId = 7,
|
||||
ProductId = 6,
|
||||
Stock = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
PriceId = 8,
|
||||
ProductId = 7,
|
||||
Stock = 49
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
public partial class AddBaseOrderRequests : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "OrderRequests",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
|
||||
ProductId = table.Column<int>(nullable: false),
|
||||
Quantity = table.Column<int>(nullable: false),
|
||||
Price = table.Column<double>(nullable: false),
|
||||
SubmittedTime = table.Column<DateTime>(nullable: false),
|
||||
Approved = table.Column<bool>(nullable: false),
|
||||
ApprovedTime = table.Column<DateTime>(nullable: false),
|
||||
Deleted = table.Column<bool>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_OrderRequests", x => x.Id);
|
||||
});
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "OrderRequests");
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+194
@@ -0,0 +1,194 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockDbContext))]
|
||||
[Migration("20200102011301_MakeApprovedDateNullable")]
|
||||
partial class MakeApprovedDateNullable
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Approved");
|
||||
|
||||
b.Property<DateTime?>("ApprovedTime");
|
||||
|
||||
b.Property<bool>("Deleted");
|
||||
|
||||
b.Property<double>("Price");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Quantity");
|
||||
|
||||
b.Property<DateTime>("SubmittedTime");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("OrderRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<DateTime>("Date");
|
||||
|
||||
b.Property<double>("ProductPrice");
|
||||
|
||||
b.Property<int>("ProductStockId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prices");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 9.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 8.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 17.989999999999998,
|
||||
ProductStockId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 23.0,
|
||||
ProductStockId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 2.9900000000000002,
|
||||
ProductStockId = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 49.630000000000003,
|
||||
ProductStockId = 5
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 4.5599999999999996,
|
||||
ProductStockId = 6
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 8,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 10.01,
|
||||
ProductStockId = 7
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("PriceId");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Stock");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProductStocks");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
PriceId = 2,
|
||||
ProductId = 1,
|
||||
Stock = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
PriceId = 3,
|
||||
ProductId = 2,
|
||||
Stock = 42
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
PriceId = 4,
|
||||
ProductId = 3,
|
||||
Stock = 32
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
PriceId = 5,
|
||||
ProductId = 4,
|
||||
Stock = 13
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
PriceId = 6,
|
||||
ProductId = 5,
|
||||
Stock = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
PriceId = 7,
|
||||
ProductId = 6,
|
||||
Stock = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
PriceId = 8,
|
||||
ProductId = 7,
|
||||
Stock = 49
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
public partial class MakeApprovedDateNullable : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "ApprovedTime",
|
||||
table: "OrderRequests",
|
||||
nullable: true,
|
||||
oldClrType: typeof(DateTime));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "ApprovedTime",
|
||||
table: "OrderRequests",
|
||||
nullable: false,
|
||||
oldClrType: typeof(DateTime),
|
||||
oldNullable: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+196
@@ -0,0 +1,196 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockDbContext))]
|
||||
[Migration("20200102172432_AddSupplierToOrderRequest")]
|
||||
partial class AddSupplierToOrderRequest
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Approved");
|
||||
|
||||
b.Property<DateTime?>("ApprovedTime");
|
||||
|
||||
b.Property<bool>("Deleted");
|
||||
|
||||
b.Property<double>("Price");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Quantity");
|
||||
|
||||
b.Property<DateTime>("SubmittedTime");
|
||||
|
||||
b.Property<string>("Supplier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("OrderRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<DateTime>("Date");
|
||||
|
||||
b.Property<double>("ProductPrice");
|
||||
|
||||
b.Property<int>("ProductStockId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prices");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 9.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 8.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 17.989999999999998,
|
||||
ProductStockId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 23.0,
|
||||
ProductStockId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 2.9900000000000002,
|
||||
ProductStockId = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 49.630000000000003,
|
||||
ProductStockId = 5
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 4.5599999999999996,
|
||||
ProductStockId = 6
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 8,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 10.01,
|
||||
ProductStockId = 7
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("PriceId");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Stock");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProductStocks");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
PriceId = 2,
|
||||
ProductId = 1,
|
||||
Stock = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
PriceId = 3,
|
||||
ProductId = 2,
|
||||
Stock = 42
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
PriceId = 4,
|
||||
ProductId = 3,
|
||||
Stock = 32
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
PriceId = 5,
|
||||
ProductId = 4,
|
||||
Stock = 13
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
PriceId = 6,
|
||||
ProductId = 5,
|
||||
Stock = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
PriceId = 7,
|
||||
ProductId = 6,
|
||||
Stock = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
PriceId = 8,
|
||||
ProductId = 7,
|
||||
Stock = 49
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
public partial class AddSupplierToOrderRequest : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Supplier",
|
||||
table: "OrderRequests",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Supplier",
|
||||
table: "OrderRequests");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Data.Migrations
|
||||
{
|
||||
[DbContext(typeof(StockDbContext))]
|
||||
partial class StockDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128)
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.OrderRequest", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<bool>("Approved");
|
||||
|
||||
b.Property<DateTime?>("ApprovedTime");
|
||||
|
||||
b.Property<bool>("Deleted");
|
||||
|
||||
b.Property<double>("Price");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Quantity");
|
||||
|
||||
b.Property<DateTime>("SubmittedTime");
|
||||
|
||||
b.Property<string>("Supplier");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("OrderRequests");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.Price", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<DateTime>("Date");
|
||||
|
||||
b.Property<double>("ProductPrice");
|
||||
|
||||
b.Property<int>("ProductStockId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Prices");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 9.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 8.9900000000000002,
|
||||
ProductStockId = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 17.989999999999998,
|
||||
ProductStockId = 2
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 23.0,
|
||||
ProductStockId = 3
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 2.9900000000000002,
|
||||
ProductStockId = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 49.630000000000003,
|
||||
ProductStockId = 5
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 4.5599999999999996,
|
||||
ProductStockId = 6
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 8,
|
||||
Date = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
|
||||
ProductPrice = 10.01,
|
||||
ProductStockId = 7
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ThAmCo.Stock.Data.ProductStock", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
|
||||
|
||||
b.Property<int>("PriceId");
|
||||
|
||||
b.Property<int>("ProductId");
|
||||
|
||||
b.Property<int>("Stock");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("ProductStocks");
|
||||
|
||||
b.HasData(
|
||||
new
|
||||
{
|
||||
Id = 1,
|
||||
PriceId = 2,
|
||||
ProductId = 1,
|
||||
Stock = 4
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 2,
|
||||
PriceId = 3,
|
||||
ProductId = 2,
|
||||
Stock = 42
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 3,
|
||||
PriceId = 4,
|
||||
ProductId = 3,
|
||||
Stock = 32
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 4,
|
||||
PriceId = 5,
|
||||
ProductId = 4,
|
||||
Stock = 13
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 5,
|
||||
PriceId = 6,
|
||||
ProductId = 5,
|
||||
Stock = 0
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 6,
|
||||
PriceId = 7,
|
||||
ProductId = 6,
|
||||
Stock = 1
|
||||
},
|
||||
new
|
||||
{
|
||||
Id = 7,
|
||||
PriceId = 8,
|
||||
ProductId = 7,
|
||||
Stock = 49
|
||||
});
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace ThAmCo.Stock.Data
|
||||
{
|
||||
public class OrderRequest
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public string Supplier { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public double Price { get; set; }
|
||||
public DateTime SubmittedTime { get; set; }
|
||||
public bool Approved { get; set; }
|
||||
public DateTime? ApprovedTime { get; set; }
|
||||
public bool Deleted { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Stock.Data
|
||||
{
|
||||
public class Price
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ProductStockId { get; set; }
|
||||
public double ProductPrice { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Stock.Data
|
||||
{
|
||||
public class ProductStock
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public int Stock { get; set; }
|
||||
public int PriceId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using ThAmCo.Stock.Models.Dto;
|
||||
|
||||
namespace ThAmCo.Stock.Data.StockContext
|
||||
{
|
||||
public interface IStockContext
|
||||
{
|
||||
Task<IEnumerable<ProductStockDto>> GetAll();
|
||||
Task<IEnumerable<Price>> GetAllPrices();
|
||||
Task<ProductStockDto> GetProductStockAsync(int id);
|
||||
Task<IEnumerable<OrderRequest>> GetAllOrderRequests();
|
||||
Task<OrderRequest> GetOrderRequest(int id);
|
||||
void AddProductStockAsync();
|
||||
Price AddPriceAsync(Price price);
|
||||
void AddOrderRequest(OrderRequest order);
|
||||
void UpdateProductStockAsync(ProductStock productStock);
|
||||
void UpdateOrderRequest(OrderRequest orderRequest);
|
||||
void ApproveOrderRequest(int id);
|
||||
void SaveAndUpdateContext();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ThAmCo.Stock.Models.Dto;
|
||||
|
||||
namespace ThAmCo.Stock.Data.StockContext
|
||||
{
|
||||
public class MockStockContext : IStockContext
|
||||
{
|
||||
private readonly List<ProductStock> _productStocks;
|
||||
private readonly List<Price> _prices;
|
||||
private readonly List<OrderRequest> _orderRequests;
|
||||
|
||||
public MockStockContext(List<ProductStock> productStocks, List<Price> prices, List<OrderRequest> orderRequests)
|
||||
{
|
||||
_productStocks = productStocks;
|
||||
_prices = prices;
|
||||
_orderRequests = orderRequests;
|
||||
}
|
||||
|
||||
public Task<IEnumerable<ProductStockDto>> GetAll()
|
||||
{
|
||||
var productStocks = new List<ProductStockDto>();
|
||||
//Janky List handling; Not linked so have to do this...
|
||||
foreach (var p in _productStocks)
|
||||
{
|
||||
productStocks.Add(new ProductStockDto
|
||||
{
|
||||
ProductStock = p,
|
||||
Price = _prices.FirstOrDefault(price => price.Id == p.PriceId)
|
||||
});
|
||||
}
|
||||
|
||||
return Task.FromResult(productStocks.AsEnumerable());
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Price>> GetAllPrices()
|
||||
{
|
||||
return Task.FromResult(_prices.AsEnumerable());
|
||||
}
|
||||
|
||||
public Task<ProductStockDto> GetProductStockAsync(int id)
|
||||
{
|
||||
var prod = _productStocks.FirstOrDefault(p => p.Id == id);
|
||||
|
||||
if (prod == null)
|
||||
return Task.FromResult<ProductStockDto>(null);
|
||||
|
||||
return Task.FromResult(new ProductStockDto
|
||||
{
|
||||
ProductStock = prod,
|
||||
Price = _prices.FirstOrDefault(p => p.Id == prod.PriceId)
|
||||
});
|
||||
}
|
||||
|
||||
public Task<IEnumerable<OrderRequest>> GetAllOrderRequests()
|
||||
{
|
||||
return Task.FromResult(_orderRequests.AsEnumerable());
|
||||
}
|
||||
|
||||
public Task<OrderRequest> GetOrderRequest(int id)
|
||||
{
|
||||
return Task.FromResult(_orderRequests.FirstOrDefault(or => or.Id == id));
|
||||
}
|
||||
|
||||
public void AddProductStockAsync()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public Price AddPriceAsync(Price price)
|
||||
{
|
||||
price.Id = _prices.OrderByDescending(p => p.Id).First().Id + 1;
|
||||
_prices.Add(price);
|
||||
return price;
|
||||
}
|
||||
|
||||
public void AddOrderRequest(OrderRequest order)
|
||||
{
|
||||
_orderRequests.Add(order);
|
||||
}
|
||||
|
||||
public void UpdateProductStockAsync(ProductStock productStock)
|
||||
{
|
||||
var update = _productStocks.FirstOrDefault(p => p.Id == productStock.Id);
|
||||
if (update != null && productStock != null)
|
||||
update.Id = productStock.Id;
|
||||
}
|
||||
|
||||
public void UpdateOrderRequest(OrderRequest orderRequest)
|
||||
{
|
||||
var update = _orderRequests.FirstOrDefault(or => or.Id == orderRequest.Id);
|
||||
if (update != null)
|
||||
update = orderRequest;
|
||||
}
|
||||
|
||||
public void ApproveOrderRequest(int id)
|
||||
{
|
||||
var approve = _orderRequests.FirstOrDefault(or => or.Id == id);
|
||||
if (approve != null)
|
||||
{
|
||||
approve.Approved = true;
|
||||
approve.ApprovedTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveAndUpdateContext()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using ThAmCo.Stock.Models.Dto;
|
||||
|
||||
namespace ThAmCo.Stock.Data.StockContext
|
||||
{
|
||||
public class StockContext : IStockContext
|
||||
{
|
||||
private readonly StockDbContext _context;
|
||||
|
||||
public StockContext(StockDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<ProductStockDto>> GetAll()
|
||||
{
|
||||
var productStocks = new List<ProductStockDto>();
|
||||
//Janky Database handling; Not linked so have to do this...
|
||||
foreach (var p in _context.ProductStocks)
|
||||
{
|
||||
productStocks.Add(new ProductStockDto
|
||||
{
|
||||
ProductStock = p,
|
||||
Price = await _context.Prices.FirstOrDefaultAsync(price => price.Id == p.PriceId)
|
||||
});
|
||||
}
|
||||
|
||||
return productStocks;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Price>> GetAllPrices()
|
||||
{
|
||||
return await _context.Prices.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<ProductStockDto> GetProductStockAsync(int id)
|
||||
{
|
||||
var prod = await _context.ProductStocks.FirstOrDefaultAsync(p => p.Id == id);
|
||||
return new ProductStockDto
|
||||
{
|
||||
ProductStock = prod,
|
||||
Price = await _context.Prices.FirstOrDefaultAsync(p => p.Id == prod.PriceId)
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<OrderRequest>> GetAllOrderRequests()
|
||||
{
|
||||
return await _context.OrderRequests.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<OrderRequest> GetOrderRequest(int id)
|
||||
{
|
||||
return await _context.OrderRequests.FirstOrDefaultAsync(or => or.Id == id);
|
||||
}
|
||||
|
||||
public void AddProductStockAsync()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
|
||||
public Price AddPriceAsync(Price price)
|
||||
{
|
||||
_context.Add(price);
|
||||
_context.SaveChanges();
|
||||
return price;
|
||||
}
|
||||
|
||||
public void AddOrderRequest(OrderRequest order)
|
||||
{
|
||||
_context.Add(order);
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
public void UpdateProductStockAsync(ProductStock productStock)
|
||||
{
|
||||
_context.Update(productStock);
|
||||
SaveAndUpdateContext();
|
||||
}
|
||||
|
||||
public void UpdateOrderRequest(OrderRequest orderRequest)
|
||||
{
|
||||
_context.Update(orderRequest);
|
||||
_context.SaveChanges();
|
||||
}
|
||||
|
||||
public void ApproveOrderRequest(int id)
|
||||
{
|
||||
var productStock = GetOrderRequest(id).Result;
|
||||
if (productStock == null) return;
|
||||
productStock.Approved = true;
|
||||
productStock.ApprovedTime = DateTime.Now;
|
||||
_context.Update(productStock);
|
||||
}
|
||||
|
||||
public void SaveAndUpdateContext()
|
||||
{
|
||||
_context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Stock.Data
|
||||
{
|
||||
public class StockDbContext : DbContext
|
||||
{
|
||||
public DbSet<Price> Prices { get; set; }
|
||||
public DbSet<ProductStock> ProductStocks { get; set; }
|
||||
|
||||
public DbSet<OrderRequest> OrderRequests { get; set; }
|
||||
|
||||
private IHostingEnvironment HostEnv { get; }
|
||||
|
||||
public StockDbContext(DbContextOptions<StockDbContext> options, IHostingEnvironment env) : base(options)
|
||||
{
|
||||
HostEnv = env;
|
||||
}
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder builder)
|
||||
{
|
||||
base.OnConfiguring(builder);
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder builder)
|
||||
{
|
||||
base.OnModelCreating(builder);
|
||||
|
||||
builder.Entity<Price>()
|
||||
.HasKey(p => p.Id);
|
||||
|
||||
builder.Entity<ProductStock>()
|
||||
.HasKey(ps => ps.Id);
|
||||
|
||||
builder.Entity<OrderRequest>()
|
||||
.HasKey(or => or.Id);
|
||||
|
||||
if (HostEnv != null && HostEnv.IsDevelopment())
|
||||
{
|
||||
builder.Entity<ProductStock>()
|
||||
.HasData(
|
||||
new ProductStock { Id = 1, ProductId = 1, PriceId = 2, Stock = 4 },
|
||||
new ProductStock { Id = 2, ProductId = 2, PriceId = 3, Stock = 42 },
|
||||
new ProductStock { Id = 3, ProductId = 3, PriceId = 4, Stock = 32 },
|
||||
new ProductStock { Id = 4, ProductId = 4, PriceId = 5, Stock = 13},
|
||||
new ProductStock { Id = 5, ProductId = 5, PriceId = 6, Stock = 0},
|
||||
new ProductStock { Id = 6, ProductId = 6, PriceId = 7, Stock = 1},
|
||||
new ProductStock { Id = 7, ProductId = 7, PriceId = 8, Stock = 49}
|
||||
);
|
||||
|
||||
builder.Entity<Price>()
|
||||
.HasData(
|
||||
new Price { Id = 1, ProductStockId = 1, ProductPrice = 9.99 },
|
||||
new Price { Id = 2, ProductStockId = 1, ProductPrice = 8.99 },
|
||||
new Price { Id = 3, ProductStockId = 2, ProductPrice = 17.99 },
|
||||
new Price { Id = 4, ProductStockId = 3, ProductPrice = 23.00},
|
||||
new Price { Id = 5, ProductStockId = 4, ProductPrice = 2.99},
|
||||
new Price { Id = 6, ProductStockId = 5, ProductPrice = 49.63},
|
||||
new Price { Id = 7, ProductStockId = 6, ProductPrice = 4.56},
|
||||
new Price { Id = 8, ProductStockId = 7, ProductPrice = 10.01}
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Stock.Models.Dto
|
||||
{
|
||||
public class ProductDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace ThAmCo.Stock.Models.Dto
|
||||
{
|
||||
public class ProductOrderDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string AccountName { get; set; }
|
||||
public string CardNumber { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public DateTime? When { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
public string ProductEan { get; set; }
|
||||
public double TotalPrice { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ThAmCo.Stock.Models.Dto
|
||||
{
|
||||
public class ProductOrderPostDto
|
||||
{
|
||||
public string AccountName { get; set; }
|
||||
public string CardNumber { get; set; }
|
||||
public int ProductId { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Stock.Models.Dto
|
||||
{
|
||||
public class ProductStockDetailsDto
|
||||
{
|
||||
public int ProductID { get; set; }
|
||||
public int Stock { get; set; }
|
||||
public double Price { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Models.Dto
|
||||
{
|
||||
public class ProductStockDto
|
||||
{
|
||||
public ProductStock ProductStock { get; set; }
|
||||
public Price Price { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock.Models.Dto
|
||||
{
|
||||
public class ProductStockPricingHistoryDto
|
||||
{
|
||||
public int ProductID { get; set; }
|
||||
public int Stock { get; set; }
|
||||
public List<Price> Prices { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
|
||||
namespace ThAmCo.Stock.Models.Dto
|
||||
{
|
||||
public class VendorProductDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Ean { get; set; }
|
||||
public int CategoryId { get; set; }
|
||||
public string CategoryName { get; set; }
|
||||
public int BrandId { get; set; }
|
||||
public string BrandName { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public double Price { get; set; }
|
||||
public bool InStock { get; set; }
|
||||
public DateTime? ExpectedRestock { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
|
||||
namespace ThAmCo.Stock.Models
|
||||
{
|
||||
public class ErrorViewModel
|
||||
{
|
||||
public string RequestId { get; set; }
|
||||
|
||||
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ThAmCo.Stock.Models
|
||||
{
|
||||
public class LoginModel
|
||||
{
|
||||
public string Email { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ThAmCo.Stock.Models.ViewModel
|
||||
{
|
||||
public class AdjustCostViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public double Cost { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ThAmCo.Stock.Models.ViewModel
|
||||
{
|
||||
public class OrderRequestModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Supplier { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace ThAmCo.Stock.Models.ViewModel
|
||||
{
|
||||
public class OrderRequestReviewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public int Quantity { get; set; }
|
||||
public double Price { get; set; }
|
||||
public string Supplier { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System.Collections.Generic;
|
||||
using ThAmCo.Stock.Models.Dto;
|
||||
|
||||
namespace ThAmCo.Stock.Models.ViewModel
|
||||
{
|
||||
public class VendorProductIndexModel
|
||||
{
|
||||
public IEnumerable<VendorProductDto> Products { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Vendor { get; set; }
|
||||
public int? BrandId { get; set; }
|
||||
public int? CategoryId { get; set; }
|
||||
public double? PriceLow { get; set; }
|
||||
public double? PriceHigh { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using ThAmCo.Stock.Data;
|
||||
|
||||
namespace ThAmCo.Stock
|
||||
{
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
var host = CreateWebHostBuilder(args).Build();
|
||||
|
||||
using (var scope = host.Services.CreateScope())
|
||||
{
|
||||
var services = scope.ServiceProvider;
|
||||
var env = services.GetRequiredService<IHostingEnvironment>();
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
var context = services.GetRequiredService<StockDbContext>();
|
||||
context.Database.EnsureDeleted();
|
||||
context.Database.Migrate();
|
||||
}
|
||||
}
|
||||
|
||||
host.Run();
|
||||
}
|
||||
|
||||
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
|
||||
WebHost.CreateDefaultBuilder(args)
|
||||
.UseStartup<Startup>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:63264",
|
||||
"sslPort": 44385
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"ThAmCo.Stock": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Polly;
|
||||
using ThAmCo.Stock.Data;
|
||||
using ThAmCo.Stock.Data.StockContext;
|
||||
|
||||
namespace ThAmCo.Stock
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IConfiguration configuration)
|
||||
{
|
||||
Configuration = configuration;
|
||||
}
|
||||
|
||||
public IConfiguration Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
services.Configure<CookiePolicyOptions>(options =>
|
||||
{
|
||||
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
|
||||
options.CheckConsentNeeded = context => true;
|
||||
options.MinimumSameSitePolicy = SameSiteMode.None;
|
||||
});
|
||||
|
||||
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
|
||||
|
||||
services.AddDbContext<StockDbContext>(options => options.UseSqlServer(
|
||||
Configuration.GetConnectionString("ProductsSqlConnection"), optionsBuilder =>
|
||||
optionsBuilder.EnableRetryOnFailure(3, TimeSpan.FromSeconds(10), null)
|
||||
));
|
||||
|
||||
services.AddAuthentication("Cookies")
|
||||
.AddCookie("Cookies");
|
||||
|
||||
services.AddAuthorization(options =>
|
||||
{
|
||||
options.AddPolicy("StaffOnly", builder =>
|
||||
{
|
||||
builder.RequireClaim("role", "Staff");
|
||||
});
|
||||
});
|
||||
|
||||
services.AddHttpClient("StandardRequest")
|
||||
.AddTransientHttpErrorPolicy(p =>
|
||||
p.OrResult(msg => msg.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
.WaitAndRetryAsync(3, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))))
|
||||
.AddTransientHttpErrorPolicy(p =>
|
||||
p.CircuitBreakerAsync(5, TimeSpan.FromSeconds(30)));
|
||||
|
||||
services.AddScoped<IStockContext, StockContext>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
|
||||
{
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
else
|
||||
{
|
||||
app.UseExceptionHandler("/Home/Error");
|
||||
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
|
||||
app.UseHsts();
|
||||
}
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
app.UseStaticFiles();
|
||||
app.UseCookiePolicy();
|
||||
|
||||
app.UseMvc(routes =>
|
||||
{
|
||||
routes.MapRoute(
|
||||
name: "default",
|
||||
template: "{controller=Home}/{action=Index}/{id?}");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp2.2</TargetFramework>
|
||||
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Data\Migrations\20200102172314_AddSupplierToOrderRequest.cs" />
|
||||
<Compile Remove="Data\Migrations\20200102172314_AddSupplierToOrderRequest.Designer.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="IdentityModel" Version="4.1.1" />
|
||||
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.6" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.App" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="2.2.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.4" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "AccessDenied";
|
||||
}
|
||||
|
||||
<h1>AccessDenied</h1><br />
|
||||
|
||||
Access to page has been denied.
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
@{
|
||||
ViewData["Title"] = "Login";
|
||||
}
|
||||
|
||||
<h1>Login</h1>
|
||||
|
||||
<form asp-action="Login">
|
||||
<div class="form-group">
|
||||
<label for="emailInput">Username</label>
|
||||
<input type="email" name="email" class="form-control" placeholder="Enter email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="passwordInput">Password</label>
|
||||
<input type="password" name="password" class="form-control" placeholder="Password">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</form>
|
||||
@@ -0,0 +1,21 @@
|
||||
@{
|
||||
ViewData["Title"] = "Admin Page";
|
||||
}
|
||||
|
||||
<div class="text-center">
|
||||
<h1 class="display-4">Welcome</h1>
|
||||
<form action="stock/low">
|
||||
Product Count:
|
||||
<input type="number" name="count" value="5" min="1">
|
||||
<input type="submit" class="btn btn-danger" value="Low Stock">
|
||||
</form>
|
||||
<br />
|
||||
<br />
|
||||
<a class="btn btn-primary" href="/stock/index" role="button">View Stocks</a>
|
||||
<br />
|
||||
<br />
|
||||
<a class="btn btn-primary" href="/stock/vendorproducts/supplier?=undercutters" role="button">Vendor Products</a>
|
||||
<br />
|
||||
<br />
|
||||
<a class="btn btn-primary" href="/stock/orderrequests" role="button">Order Requests</a>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
@using Microsoft.AspNetCore.Http.Features
|
||||
|
||||
@{
|
||||
var consentFeature = Context.Features.Get<ITrackingConsentFeature>();
|
||||
var showBanner = !consentFeature?.CanTrack ?? false;
|
||||
var cookieString = consentFeature?.CreateConsentCookie();
|
||||
}
|
||||
|
||||
@if (showBanner)
|
||||
{
|
||||
<div id="cookieConsent" class="alert alert-info alert-dismissible fade show" role="alert">
|
||||
Use this space to summarize your privacy and cookie use policy. <a asp-area="" asp-controller="Home" asp-action="Privacy">Learn More</a>.
|
||||
<button type="button" class="accept-policy close" data-dismiss="alert" aria-label="Close" data-cookie-string="@cookieString">
|
||||
<span aria-hidden="true">Accept</span>
|
||||
</button>
|
||||
</div>
|
||||
<script>
|
||||
(function () {
|
||||
var button = document.querySelector("#cookieConsent button[data-cookie-string]");
|
||||
button.addEventListener("click", function (event) {
|
||||
document.cookie = button.dataset.cookieString;
|
||||
}, false);
|
||||
})();
|
||||
</script>
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - ThAmCo</title>
|
||||
|
||||
<environment include="Development">
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.css" />
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
|
||||
asp-fallback-href="~/lib/bootstrap/dist/css/bootstrap.min.css"
|
||||
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T"/>
|
||||
</environment>
|
||||
<link rel="stylesheet" href="~/css/site.css" />
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
||||
<div class="container">
|
||||
<a class="navbar-brand">ThAmCo</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
|
||||
<ul class="navbar-nav flex-grow-1">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="https://localhost:44375">Products</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">Stock</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Login">Login</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" asp-area="" asp-controller="Account" asp-action="Logout">Logout</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="container">
|
||||
<partial name="_CookieConsentPartial" />
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2019 - ThAmCo.Stock - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery/dist/jquery.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"
|
||||
asp-fallback-src="~/lib/jquery/dist/jquery.min.js"
|
||||
asp-fallback-test="window.jQuery"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=">
|
||||
</script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.fn && window.jQuery.fn.modal"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha384-xrRywqdh3PHs8keKZN+8zzc5TX0GRTLCcmivcbNJWm2rs5C8PRhcEn3czEjhAO9o">
|
||||
</script>
|
||||
</environment>
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
|
||||
@RenderSection("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
<environment include="Development">
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"></script>
|
||||
</environment>
|
||||
<environment exclude="Development">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.17.0/jquery.validate.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation/dist/jquery.validate.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-F6h55Qw6sweK+t7SiOJX+2bpSAa3b/fnlrVCJvmEj1A=">
|
||||
</script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.11/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
|
||||
asp-fallback-test="window.jQuery && window.jQuery.validator && window.jQuery.validator.unobtrusive"
|
||||
crossorigin="anonymous"
|
||||
integrity="sha256-9GycpJnliUjJDVDqP0UEu/bsm9U+3dnQUH8+3W10vkY=">
|
||||
</script>
|
||||
</environment>
|
||||
@@ -0,0 +1,30 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.AdjustCostViewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Adjust Cost";
|
||||
}
|
||||
|
||||
<h1>Adjust Cost</h1>
|
||||
|
||||
<h4>Cost</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@Html.LabelFor(m => m.Name) :
|
||||
@Html.DisplayFor(m => m.Name)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Description) :
|
||||
@Html.DisplayFor(m => m.Description)
|
||||
<form asp-action="AdjustCost">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="Cost" class="control-label"></label>
|
||||
<input asp-for="Cost" class="form-control" />
|
||||
<span asp-validation-for="Cost" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Adjust" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,43 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h1>Create</h1>
|
||||
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Create">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="ProductId" class="control-label"></label>
|
||||
<input asp-for="ProductId" class="form-control" />
|
||||
<span asp-validation-for="ProductId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Stock" class="control-label"></label>
|
||||
<input asp-for="Stock" class="form-control" />
|
||||
<span asp-validation-for="Stock" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PriceId" class="control-label"></label>
|
||||
<input asp-for="PriceId" class="form-control" />
|
||||
<span asp-validation-for="PriceId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Create" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h1>Delete</h1>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.ProductId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.ProductId)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Stock)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Stock)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.PriceId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.PriceId)
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="submit" value="Delete" class="btn btn-danger" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,36 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h1>Details</h1>
|
||||
|
||||
<div>
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<dl class="row">
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.ProductId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.ProductId)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.Stock)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.Stock)
|
||||
</dd>
|
||||
<dt class = "col-sm-2">
|
||||
@Html.DisplayNameFor(model => model.PriceId)
|
||||
</dt>
|
||||
<dd class = "col-sm-10">
|
||||
@Html.DisplayFor(model => model.PriceId)
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
@model ThAmCo.Stock.Data.ProductStock
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h1>Edit</h1>
|
||||
|
||||
<h4>ProductStock</h4>
|
||||
<hr />
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<form asp-action="Edit">
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="ProductId" class="control-label"></label>
|
||||
<input asp-for="ProductId" class="form-control" />
|
||||
<span asp-validation-for="ProductId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Stock" class="control-label"></label>
|
||||
<input asp-for="Stock" class="form-control" />
|
||||
<span asp-validation-for="Stock" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="PriceId" class="control-label"></label>
|
||||
<input asp-for="PriceId" class="form-control" />
|
||||
<span asp-validation-for="PriceId" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Save" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@section Scripts {
|
||||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
@model IEnumerable<ThAmCo.Stock.Models.Dto.ProductStockDto>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ProductStock.ProductId)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ProductStock.Stock)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.ProductStock.PriceId)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.ProductId)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.Stock)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.PriceId)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.ProductStock.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.ProductStock.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.ProductStock.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,54 @@
|
||||
@model IEnumerable<ThAmCo.Stock.Models.Dto.ProductStockDto>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Low Stock Products";
|
||||
}
|
||||
|
||||
<h1>Products with Low Stock</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().ProductStock.ProductId)
|
||||
</th>
|
||||
<th>
|
||||
Sale Price
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().ProductStock.Stock)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@{ int i = 1; }
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => i)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.ProductId)
|
||||
</td>
|
||||
<td>
|
||||
£@Html.DisplayFor(modelItem => item.Price.ProductPrice)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductStock.Stock)
|
||||
</td>
|
||||
<td>
|
||||
<form asp-action="VendorProducts">
|
||||
<input type="hidden" asp-for="@item.ProductStock.ProductId" />
|
||||
<input type="submit" value="Order" class="btn btn-primary" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@Html.Display(i++.ToString())
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,31 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.OrderRequestModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Order Request";
|
||||
}
|
||||
|
||||
<h1>OrderRequest</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@Html.LabelFor(m => m.Name) :
|
||||
@Html.DisplayFor(m => m.Name)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Description) :
|
||||
@Html.DisplayFor(m => m.Description)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Supplier) :
|
||||
@Html.DisplayFor(m => m.Supplier)
|
||||
<form asp-action="OrderRequestSubmitted">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<input type="hidden" asp-for="Supplier" />
|
||||
<div class="form-group">
|
||||
<label class="control-label">Quantity</label>
|
||||
<input type="number" name="quantity" class="form-control" min="1" value="1" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Request Order" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.OrderRequestReviewModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Order Request Review";
|
||||
}
|
||||
|
||||
<h1>Review Order Request from: @(Model.Supplier)</h1>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
@Html.LabelFor(m => m.Name) :
|
||||
@Html.DisplayFor(m => m.Name)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Description) :
|
||||
@Html.DisplayFor(m => m.Description)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Supplier) :
|
||||
@Html.DisplayFor(m => m.Supplier)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Quantity) :
|
||||
@Html.DisplayFor(m => m.Quantity)
|
||||
<br />
|
||||
@Html.LabelFor(m => m.Price) :
|
||||
£@Html.DisplayFor(m => m.Price)
|
||||
<form asp-action="OrderRequestApproved">
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<input type="submit" value="Approve Order" class="btn btn-primary" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,49 @@
|
||||
@model IEnumerable<ThAmCo.Stock.Data.OrderRequest>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Order Requests (" + Model.Count() + ")";
|
||||
}
|
||||
|
||||
<h1>Order Requests</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().ProductId)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().SubmittedTime)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Quantity)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.FirstOrDefault().Price)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.ProductId)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.SubmittedTime)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Quantity)
|
||||
</td>
|
||||
<td>
|
||||
£@Html.DisplayFor(modelItem => item.Price)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="OrderRequestReview" asp-route-id="@item.Id">Review</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,61 @@
|
||||
@model ThAmCo.Stock.Models.ViewModel.VendorProductIndexModel
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Vendor Product Index";
|
||||
}
|
||||
|
||||
<h1>Index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Name)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Description)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().Price)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().BrandName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().CategoryName)
|
||||
</th>
|
||||
<th>
|
||||
@Html.DisplayNameFor(model => model.Products.FirstOrDefault().InStock)
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var item in Model.Products)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Name)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Description)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.Price)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.BrandName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayFor(modelItem => item.CategoryName)
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="OrderRequest" asp-route-id="@item.Id" asp-route-supplier="@Model.Vendor">Order</a>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -0,0 +1,3 @@
|
||||
@using ThAmCo.Stock
|
||||
@using ThAmCo.Stock.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Information",
|
||||
"Microsoft": "Information"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Warning"
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"ProductsSqlConnection": "Server=(localdb)\\mssqllocaldb;Database=Stock;Trusted_Connection=True;MultipleActiveResultSets=true"
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
for details on configuring this project to bundle and minify static web assets. */
|
||||
|
||||
a.navbar-brand {
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
/* Sticky footer styles
|
||||
-------------------------------------------------- */
|
||||
html {
|
||||
font-size: 14px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.border-top {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.box-shadow {
|
||||
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
button.accept-policy {
|
||||
font-size: 1rem;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* Sticky footer styles
|
||||
-------------------------------------------------- */
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
/* Margin bottom by footer height */
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
/* Set the fixed height of the footer here */
|
||||
height: 60px;
|
||||
line-height: 60px; /* Vertically center the text there */
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
@@ -0,0 +1,4 @@
|
||||
// Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
// for details on configuring this project to bundle and minify static web assets.
|
||||
|
||||
// Write your JavaScript code.
|
||||
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2011-2018 Twitter, Inc.
|
||||
Copyright (c) 2011-2018 The Bootstrap Authors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
+3719
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../scss/bootstrap-grid.scss","bootstrap-grid.css","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/_variables.scss","../../scss/mixins/_grid-framework.scss","../../scss/utilities/_display.scss","../../scss/utilities/_flex.scss","../../scss/utilities/_spacing.scss"],"names":[],"mappings":"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 truncated
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap Grid v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/html{box-sizing:border-box;-ms-overflow-style:scrollbar}*,::after,::before{box-sizing:inherit}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:100%}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}Line truncated
|
||||
/*# sourceMappingURL=bootstrap-grid.min.css.map */
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../scss/bootstrap-grid.scss","dist/css/bootstrap-grid.css","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/mixins/_grid-framework.scss","../../scss/utilities/_display.scss","../../scss/utilities/_flex.scss","../../scss/utilities/_spacing.scss"],"names":[],"mappings":"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 truncated
|
||||
+331
@@ -0,0 +1,331 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: sans-serif;
|
||||
line-height: 1.15;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
|
||||
display: block;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.5;
|
||||
color: #212529;
|
||||
text-align: left;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
[tabindex="-1"]:focus {
|
||||
outline: 0 !important;
|
||||
}
|
||||
|
||||
hr {
|
||||
box-sizing: content-box;
|
||||
height: 0;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
p {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
abbr[title],
|
||||
abbr[data-original-title] {
|
||||
text-decoration: underline;
|
||||
-webkit-text-decoration: underline dotted;
|
||||
text-decoration: underline dotted;
|
||||
cursor: help;
|
||||
border-bottom: 0;
|
||||
-webkit-text-decoration-skip-ink: none;
|
||||
text-decoration-skip-ink: none;
|
||||
}
|
||||
|
||||
address {
|
||||
margin-bottom: 1rem;
|
||||
font-style: normal;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
ol,
|
||||
ul,
|
||||
dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
ol ol,
|
||||
ul ul,
|
||||
ol ul,
|
||||
ul ol {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-bottom: .5rem;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
b,
|
||||
strong {
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
sub,
|
||||
sup {
|
||||
position: relative;
|
||||
font-size: 75%;
|
||||
line-height: 0;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
sub {
|
||||
bottom: -.25em;
|
||||
}
|
||||
|
||||
sup {
|
||||
top: -.5em;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #0056b3;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]) {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:not([href]):not([tabindex]):focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp {
|
||||
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
figure {
|
||||
margin: 0 0 1rem;
|
||||
}
|
||||
|
||||
img {
|
||||
vertical-align: middle;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
svg {
|
||||
overflow: hidden;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
caption {
|
||||
padding-top: 0.75rem;
|
||||
padding-bottom: 0.75rem;
|
||||
color: #6c757d;
|
||||
text-align: left;
|
||||
caption-side: bottom;
|
||||
}
|
||||
|
||||
th {
|
||||
text-align: inherit;
|
||||
}
|
||||
|
||||
label {
|
||||
display: inline-block;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
outline: 1px dotted;
|
||||
outline: 5px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
input,
|
||||
button,
|
||||
select,
|
||||
optgroup,
|
||||
textarea {
|
||||
margin: 0;
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
button,
|
||||
input {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
button,
|
||||
select {
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
select {
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
button,
|
||||
[type="button"],
|
||||
[type="reset"],
|
||||
[type="submit"] {
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
button:not(:disabled),
|
||||
[type="button"]:not(:disabled),
|
||||
[type="reset"]:not(:disabled),
|
||||
[type="submit"]:not(:disabled) {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
[type="reset"]::-moz-focus-inner,
|
||||
[type="submit"]::-moz-focus-inner {
|
||||
padding: 0;
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
input[type="radio"],
|
||||
input[type="checkbox"] {
|
||||
box-sizing: border-box;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
input[type="date"],
|
||||
input[type="time"],
|
||||
input[type="datetime-local"],
|
||||
input[type="month"] {
|
||||
-webkit-appearance: listbox;
|
||||
}
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
fieldset {
|
||||
min-width: 0;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
legend {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 0;
|
||||
margin-bottom: .5rem;
|
||||
font-size: 1.5rem;
|
||||
line-height: inherit;
|
||||
color: inherit;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
[type="search"] {
|
||||
outline-offset: -2px;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
font: inherit;
|
||||
-webkit-appearance: button;
|
||||
}
|
||||
|
||||
output {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
/*# sourceMappingURL=bootstrap-reboot.css.map */
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../scss/bootstrap-reboot.scss","bootstrap-reboot.css","../../scss/_reboot.scss","../../scss/_variables.scss","../../scss/vendor/_rfs.scss","../../scss/mixins/_hover.scss"],"names":[],"mappings":"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","file":"bootstrap-reboot.css","sourcesContent":["/*!\n * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 The Bootstrap Authors\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)\n */\n\n@import \"functions\";\n@import \"variables\";\n@import \"mixins\";\n@import \"reboot\";\n","/*!\n * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 The Bootstrap Authors\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)\n */\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\nhtml {\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\narticle, aside, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-size: 1rem;\n font-weight: 400;\n line-height: 1.5;\n color: #212529;\n text-align: left;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: 0.5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n text-decoration-skip-ink: none;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: 700;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n Line truncated
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
/*!
|
||||
* Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)
|
||||
*/*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}
|
||||
/*# sourceMappingURL=bootstrap-reboot.min.css.map */
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../scss/bootstrap-reboot.scss","../../scss/_reboot.scss","dist/css/bootstrap-reboot.css","../../scss/vendor/_rfs.scss","bootstrap-reboot.css","../../scss/mixins/_hover.scss"],"names":[],"mappings":"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","sourcesContent":["/*!\n * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/)\n * Copyright 2011-2019 The Bootstrap Authors\n * Copyright 2011-2019 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md)\n */\n\n@import \"functions\";\n@import \"variables\";\n@import \"mixins\";\n@import \"reboot\";\n","// stylelint-disable at-rule-no-vendor-prefix, declaration-no-important, selector-no-qualifying-type, property-no-vendor-prefix\n\n// Reboot\n//\n// Normalization of HTML elements, manually forked from Normalize.css to remove\n// styles targeting irrelevant browsers while applying new styles.\n//\n// Normalize is licensed MIT. https://github.com/necolas/normalize.css\n\n\n// Document\n//\n// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.\n// 2. Change the default font family in all browsers.\n// 3. Correct the line height in all browsers.\n// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.\n// 5. Change the default tap highlight to be completely transparent in iOS.\n\n*,\n*::before,\n*::after {\n box-sizing: border-box; // 1\n}\n\nhtml {\n font-family: sans-serif; // 2\n line-height: 1.15; // 3\n -webkit-text-size-adjust: 100%; // 4\n -webkit-tap-highlight-color: rgba($black, 0); // 5\n}\n\n// Shim for \"new\" HTML5 structural elements to display correctly (IE10, older browsers)\n// TODO: remove in v5\n// stylelint-disable-next-line selector-list-comma-newline-after\narticle, aside, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\n// Body\n//\n// 1. Remove the margin in all browsers.\n// 2. As a best practice, apply a default `background-color`.\n// 3. Set an explicit initial text-align value so that we can later use\n// the `inherit` value on things like `<th>` elements.\n\nbody {\n margin: 0; // 1\n font-family: $font-family-base;\n @include font-size($font-size-base);\n font-weight: $font-weight-base;\n line-height: $line-height-base;\n color: $body-color;\n text-align: left; // 3\n background-color: $body-bg; // 2\n}\n\n// Suppress the focus outline on elements that cannot be accessed via keyboard.\n// This prevents an unwanted focus outline from appearing around elements that\n// might still respond to pointer events.\n//\n// Credit: https://github.com/suitcss/base\n[tabindex=\"-1\"]:focus {\n outline: 0 !important;\n}\n\n\n// Content grouping\n//\n// 1. Add the correct box sizing in Firefox.\n// 2. Show the overflow in Edge and IE.\n\nhr {\n box-sizing: cLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../scss/bootstrap.scss","bootstrap.css","../../scss/_root.scss","../../scss/_reboot.scss","../../scss/_variables.scss","../../scss/vendor/_rfs.scss","../../scss/mixins/_hover.scss","../../scss/_type.scss","../../scss/mixins/_lists.scss","../../scss/_images.scss","../../scss/mixins/_image.scss","../../scss/mixins/_border-radius.scss","../../scss/_code.scss","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/mixins/_grid-framework.scss","../../scss/_tables.scss","../../scss/mixins/_table-row.scss","../../scss/_functions.scss","../../scss/_forms.scss","../../scss/mixins/_transition.scss","../../scss/mixins/_forms.scss","../../scss/mixins/_gradients.scss","../../scss/_buttons.scss","../../scss/mixins/_buttons.scss","../../scss/_transitions.scss","../../scss/_dropdown.scss","../../scss/mixins/_caret.scss","../../scss/mixins/_nav-divider.scss","../../scss/_button-group.scss","../../scss/_input-group.scss","../../scss/_custom-forms.scss","../../scss/_nav.scss","../../scss/_navbar.scss","../../scss/_card.scss","../../scss/_breadcrumb.scss","../../scss/_pagination.scss","../../scss/mixins/_pagination.scss","../../scss/_badge.scss","../../scss/mixins/_badge.scss","../../scss/_jumbotron.scss","../../scss/_alert.scss","../../scss/mixins/_alert.scss","../../scss/_progress.scss","../../scss/_media.scss","../../scss/_list-group.scss","../../scss/mixins/_list-group.scss","../../scss/_close.scss","../../scss/_toasts.scss","../../scss/_modal.scss","../../scss/_tooltip.scss","../../scss/mixins/_reset-text.scss","../../scss/_popover.scss","../../scss/_carousel.scss","../../scss/mixins/_clearfix.scss","../../scss/_spinners.scss","../../scss/utilities/_align.scss","../../scss/mixins/_background-variant.scss","../../scss/utilities/_background.scss","../../scss/utilities/_borders.scss","../../scss/utilities/_display.scss","../../scss/utilities/_embed.scss","../../scss/utilities/_flex.scss","../../scss/utilities/_float.scss","../../scss/utilities/_overflow.scss","../../scss/utilities/_position.scss","../../scss/utilities/_screenreaders.scss","../../scss/mixins/_screen-reader.scss","../../scss/utilities/_shadows.scss","../../scss/utilities/_sizing.scss","../../scss/utilities/_stretched-link.scss","../../scss/utilities/_spacing.scss","../../scss/utilities/_text.scss","../../scss/mixins/_text-truncate.scss","../../scss/mixins/_text-emphasis.scss","../../scss/mixins/_text-hide.scss","../../scss/utilities/_visibility.scss","../../scss/_print.scss"],"names":[],"mappings":"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 truncated
|
||||
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors
|
||||
* Copyright 2011-2019 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,Line truncated
|
||||
/*# sourceMappingURL=bootstrap.min.css.map */
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../scss/bootstrap.scss","../../scss/_root.scss","../../scss/_reboot.scss","dist/css/bootstrap.css","../../scss/vendor/_rfs.scss","bootstrap.css","../../scss/mixins/_hover.scss","../../scss/_type.scss","../../scss/mixins/_lists.scss","../../scss/_images.scss","../../scss/mixins/_image.scss","../../scss/mixins/_border-radius.scss","../../scss/_code.scss","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/mixins/_grid-framework.scss","../../scss/_tables.scss","../../scss/mixins/_table-row.scss","../../scss/_forms.scss","../../scss/mixins/_transition.scss","../../scss/mixins/_forms.scss","../../scss/mixins/_gradients.scss","../../scss/_buttons.scss","../../scss/mixins/_buttons.scss","../../scss/_transitions.scss","../../scss/_dropdown.scss","../../scss/mixins/_caret.scss","../../scss/mixins/_nav-divider.scss","../../scss/_button-group.scss","../../scss/_input-group.scss","../../scss/_custom-forms.scss","../../scss/_nav.scss","../../scss/_navbar.scss","../../scss/_card.scss","../../scss/_breadcrumb.scss","../../scss/_pagination.scss","../../scss/mixins/_pagination.scss","../../scss/_badge.scss","../../scss/mixins/_badge.scss","../../scss/_jumbotron.scss","../../scss/_alert.scss","../../scss/mixins/_alert.scss","../../scss/_progress.scss","../../scss/_media.scss","../../scss/_list-group.scss","../../scss/mixins/_list-group.scss","../../scss/_close.scss","../../scss/_toasts.scss","../../scss/_modal.scss","../../scss/_tooltip.scss","../../scss/mixins/_reset-text.scss","../../scss/_popover.scss","../../scss/_carousel.scss","../../scss/mixins/_clearfix.scss","../../scss/_spinners.scss","../../scss/utilities/_align.scss","../../scss/mixins/_background-variant.scss","../../scss/utilities/_background.scss","../../scss/utilities/_borders.scss","../../scss/utilities/_display.scss","../../scss/utilities/_embed.scss","../../scss/utilities/_flex.scss","../../scss/utilities/_float.scss","../../scss/utilities/_overflow.scss","../../scss/utilities/_position.scss","../../scss/utilities/_screenreaders.scss","../../scss/mixins/_screen-reader.scss","../../scss/utilities/_shadows.scss","../../scss/utilities/_sizing.scss","../../scss/utilities/_stretched-link.scss","../../scss/utilities/_spacing.scss","../../scss/utilities/_text.scss","../../scss/mixins/_text-truncate.scss","../../scss/mixins/_text-emphasis.scss","../../scss/mixins/_text-hide.scss","../../scss/utilities/_visibility.scss","../../scss/_print.scss"],"names":[],"mappings":"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 truncated
|
||||
+7013
File diff suppressed because it is too large.
Load diff
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bootstrap.bundle.js","sources":["../../js/src/util.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/carousel.js","../../js/src/collapse.js","../../node_modules/popper.js/dist/esm/popper.js","../../js/src/dropdown.js","../../js/src/modal.js","../../js/src/tools/sanitizer.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/toast.js","../../js/src/index.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\nconst TRANSITION_END = 'transitionend'\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nfunction toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\nfunction getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined // eslint-disable-line no-undefined\n }\n }\n}\n\nfunction transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n}\n\nfunction setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (err) {\n return null\n }\n },\n\n getTransitionDurationFromElement(element) {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let transitionDuration = $(element).css('transition-duration')\n let transitionDelay = $(element).css('transition-delay')\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END)\n },\n\n // TODO: Remove in v5\n supportsTransitionEnd() {\n return Boolean(TRANSITION_END)\n },\n\n isElement(obj) {\n return (obj[0] || obj).nodeType\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && Util.isElement(value)\n ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n },\n\n findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n Line truncated
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],e):e((t=t||self).bootstrap={},t.jQuery)}(this,function(t,p){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}p=p&&p.hasOwnProperty("default")?p.default:p;var e="transitionend";function n(t){var e=this,n=!1;return p(this).one(m.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||m.triggerTransitionEnd(e)},t),this}var m={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=p(t).css("transition-duration"),n=p(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){p(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&m.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?m.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};p.fn.emulateTransitionEnd=n,p.event.special[m.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(p(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=p.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},u="alert",f="fade",d="show",g=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){p.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=m.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=p(t).closest("."+u)[0]),n},t._triggerCloseEvent=function(t){var e=p.Event(h.CLOSE);return p(t).trigger(e),e},t._removeElement=function(e){var n=this;if(p(e).removeClass(d),p(e).hasClass(f)){var t=m.getTransitionDurationFromElement(e);p(e).one(m.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){p(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=p(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();p(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',g._handleDismiss(new g)),p.fn[o]=g._jQueryInterface,p.fn[o].Constructor=g,p.fn[o].noConflict=function(){return p.fn[o]=c,g._jQueryInterface};var _="button",v="bs.button",y="."+v,E=".data-api",b=p.fn[_],w="active",C="btn",T="focus",S='[data-toggle^="button"]',D='[data-toggle="buttons"]',I='input:not([type="hidden"])',A=".active",O=".btn",N={CLICK_DATA_API:"click"+y+E,FOCUS_BLUR_DATA_API:"focus"+y+E+" blur"+y+E},k=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=p(this._element).closest(D)[0];if(n){var i=this._element.querySelector(I);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(w))t=!1;else{var o=n.querySelector(A);o&&p(o).removeClass(w)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(w),p(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!this._element.classLLine truncated
|
||||
//# sourceMappingURL=bootstrap.bundle.min.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../js/src/util.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/carousel.js","../../js/src/collapse.js","../../node_modules/popper.js/dist/esm/popper.js","../../js/src/dropdown.js","../../js/src/modal.js","../../js/src/tools/sanitizer.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/toast.js","../../js/src/index.js"],"names":["TRANSITION_END","transitionEndEmulator","duration","_this","this","called","$","one","Util","setTimeout","triggerTransitionEnd","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","hrefAttr","trim","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","transitionDelay","floatTransitionDuration","parseFloat","floatTransitionDelay","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","obj","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","call","expectedTypes","value","valueType","toString","match","toLowerCase","RegExp","test","Error","toUpperCase","findShadowRoot","documentElement","attachShadow","getRootNode","ShadowRoot","parentNode","root","fn","emulateTransitionEnd","event","special","bindType","delegateType","handle","target","is","handleObj","handler","apply","arguments","NAME","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","Event","CLOSE","CLOSED","CLICK_DATA_API","ClassName","Alert","_element","close","rootElement","_getRootElement","_triggerCloseEvent","isDefaultPrevented","_removeElement","dispose","removeData","parent","closest","closeEvent","removeClass","hasClass","_destroyElement","detach","remove","_jQueryInterface","each","$element","data","_handleDismiss","alertInstance","preventDefault","on","Constructor","noConflict","DATA_API_KEY","Selector","FOCUS_BLUR_DATA_API","Button","toggle","triggerChangeEvent","addAriaPressed","input","type","checked","classList","contains","activeElement","hasAttribute","focus","setAttribute","toggleClass","button","Default","interval","keyboard","slide","pause","wrap","touch","DefaultType","Direction","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHSTART","TOUCHMOVE","TOUCHEND","POINTERDOWN","POINTERUP","DRAG_START","LOAD_DATA_API","PointerType","TOUCH","PEN","Carousel","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","touchStartX","touchDeltaX","_config","_getConfig","_indicatorsElement","_touchSupported","navigator","maxTouchPoints","_pointerEvent","window","PointerEvent","MSPointerEvent","_addEventListeners","next","_slide","nextWhenVisible","hidden","prev","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","direction","off","_objectSpread","_handleSwipe","absDeltax","abs","_this2","_keydown","_addTouchEventListeners","_this3","start","originalEvent","pointerType","clientX","touches","end","clearTimeout","querySelectorAll","e","add","tagName","which","slice","indexOf","_getItemByDirection","isNextDirection","isPrevDirection","lastItemIndex","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","_setActiveIndicatorElement","indicators","nextIndicator","children","addClass","directionalClassName","orderClassName","_this4","activeElementIndex","nextElement","nextElementIndex","isCycling","slidEvent","nextElementInterval","parseInt","defaultInterval","action","TypeError","ride","_dataApiClickHandler","slideIndex","carousels","i","len","$carousel","SHOW","SHOWN","HIDE","HIDDEN","Dimension","Collapse","_isTransitioning","_triggerArray","id","toggleList","elem","filterElement","filter","foundElem","_selector","push","_parent","_getParent","_addAriaAndCollapsedClass","hide","show","actives","activesData","not","startEvent","dimension","_getDimension","style","attr","setTransitioning","scrollSize","getBoundingClientRect","triggerArrayLength","isTransitioning","jquery","_getTargetFromElement","triggerArray","isOpen","$this","currentTarget","$trigger","selectors","$target","isBrowser","longerTimeoutBrowsers","timeoutDuration","userAgent","debounce","Promise","resolve","then","scheduled","isFunction","functionToCheck","getStyleComputedProperty","ownerDocument","defaultView","getComputedStyle","getParentNode","nodeName","host","getScrollParent","body","_getStyleComputedProp","overflow","overflowX","overflowY","isIE11","MSInputMethodContext","documentMode","isIE10","isIE","version","getOffsetParent","noOffsetParent","offsetParent","nextElementSibling","getRoot","node","findCommonOffsetParent","element1","element2","order","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","range","createRange","setStart","setEnd","commonAncestorContainer","firstElementChild","element1root","getScroll","upperSide","undefined","html","scrollingElement","getBordersSize","styles","axiLine truncated
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bootstrap.js","sources":["../../js/src/util.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/carousel.js","../../js/src/collapse.js","../../js/src/dropdown.js","../../js/src/modal.js","../../js/src/tools/sanitizer.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/toast.js","../../js/src/index.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.3.1): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport $ from 'jquery'\n\n/**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\nconst TRANSITION_END = 'transitionend'\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nfunction toType(obj) {\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\nfunction getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle(event) {\n if ($(event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params\n }\n return undefined // eslint-disable-line no-undefined\n }\n }\n}\n\nfunction transitionEndEmulator(duration) {\n let called = false\n\n $(this).one(Util.TRANSITION_END, () => {\n called = true\n })\n\n setTimeout(() => {\n if (!called) {\n Util.triggerTransitionEnd(this)\n }\n }, duration)\n\n return this\n}\n\nfunction setTransitionEndSupport() {\n $.fn.emulateTransitionEnd = transitionEndEmulator\n $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst Util = {\n\n TRANSITION_END: 'bsTransitionEnd',\n\n getUID(prefix) {\n do {\n // eslint-disable-next-line no-bitwise\n prefix += ~~(Math.random() * MAX_UID) // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix))\n return prefix\n },\n\n getSelectorFromElement(element) {\n let selector = element.getAttribute('data-target')\n\n if (!selector || selector === '#') {\n const hrefAttr = element.getAttribute('href')\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''\n }\n\n try {\n return document.querySelector(selector) ? selector : null\n } catch (err) {\n return null\n }\n },\n\n getTransitionDurationFromElement(element) {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let transitionDuration = $(element).css('transition-duration')\n let transitionDelay = $(element).css('transition-delay')\n\n const floatTransitionDuration = parseFloat(transitionDuration)\n const floatTransitionDelay = parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n },\n\n reflow(element) {\n return element.offsetHeight\n },\n\n triggerTransitionEnd(element) {\n $(element).trigger(TRANSITION_END)\n },\n\n // TODO: Remove in v5\n supportsTransitionEnd() {\n return Boolean(TRANSITION_END)\n },\n\n isElement(obj) {\n return (obj[0] || obj).nodeType\n },\n\n typeCheckConfig(componentName, config, configTypes) {\n for (const property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && Util.isElement(value)\n ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(\n `${componentName.toUpperCase()}: ` +\n `Option \"${property}\" provided type \"${valueType}\" ` +\n `but expected type \"${expectedTypes}\".`)\n }\n }\n }\n },\n\n findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root insLine truncated
|
||||
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* Bootstrap v4.3.1 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e((t=t||self).bootstrap={},t.jQuery,t.Popper)}(this,function(t,g,u){"use strict";function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function s(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t}function l(o){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},e=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(e=e.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.forEach(function(t){var e,n,i;e=o,i=r[n=t],n in e?Object.defineProperty(e,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[n]=i})}return o}g=g&&g.hasOwnProperty("default")?g.default:g,u=u&&u.hasOwnProperty("default")?u.default:u;var e="transitionend";function n(t){var e=this,n=!1;return g(this).one(_.TRANSITION_END,function(){n=!0}),setTimeout(function(){n||_.triggerTransitionEnd(e)},t),this}var _={TRANSITION_END:"bsTransitionEnd",getUID:function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},getSelectorFromElement:function(t){var e=t.getAttribute("data-target");if(!e||"#"===e){var n=t.getAttribute("href");e=n&&"#"!==n?n.trim():""}try{return document.querySelector(e)?e:null}catch(t){return null}},getTransitionDurationFromElement:function(t){if(!t)return 0;var e=g(t).css("transition-duration"),n=g(t).css("transition-delay"),i=parseFloat(e),o=parseFloat(n);return i||o?(e=e.split(",")[0],n=n.split(",")[0],1e3*(parseFloat(e)+parseFloat(n))):0},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(t){g(t).trigger(e)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=n[i],r=e[i],s=r&&_.isElement(r)?"element":(a=r,{}.toString.call(a).match(/\s([a-z]+)/i)[1].toLowerCase());if(!new RegExp(o).test(s))throw new Error(t.toUpperCase()+': Option "'+i+'" provided type "'+s+'" but expected type "'+o+'".')}var a},findShadowRoot:function(t){if(!document.documentElement.attachShadow)return null;if("function"!=typeof t.getRootNode)return t instanceof ShadowRoot?t:t.parentNode?_.findShadowRoot(t.parentNode):null;var e=t.getRootNode();return e instanceof ShadowRoot?e:null}};g.fn.emulateTransitionEnd=n,g.event.special[_.TRANSITION_END]={bindType:e,delegateType:e,handle:function(t){if(g(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var o="alert",r="bs.alert",a="."+r,c=g.fn[o],h={CLOSE:"close"+a,CLOSED:"closed"+a,CLICK_DATA_API:"click"+a+".data-api"},f="alert",d="fade",m="show",p=function(){function i(t){this._element=t}var t=i.prototype;return t.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},t.dispose=function(){g.removeData(this._element,r),this._element=null},t._getRootElement=function(t){var e=_.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=g(t).closest("."+f)[0]),n},t._triggerCloseEvent=function(t){var e=g.Event(h.CLOSE);return g(t).trigger(e),e},t._removeElement=function(e){var n=this;if(g(e).removeClass(m),g(e).hasClass(d)){var t=_.getTransitionDurationFromElement(e);g(e).one(_.TRANSITION_END,function(t){return n._destroyElement(e,t)}).emulateTransitionEnd(t)}else this._destroyElement(e)},t._destroyElement=function(t){g(t).detach().trigger(h.CLOSED).remove()},i._jQueryInterface=function(n){return this.each(function(){var t=g(this),e=t.data(r);e||(e=new i(this),t.data(r,e)),"close"===n&&e[n](this)})},i._handleDismiss=function(e){return function(t){t&&t.preventDefault(),e.close(this)}},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}}]),i}();g(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),g.fn[o]=p._jQueryInterface,g.fn[o].Constructor=p,g.fn[o].noConflict=function(){return g.fn[o]=c,p._jQueryInterface};var v="button",y="bs.button",E="."+y,C=".data-api",T=g.fn[v],S="active",b="btn",I="focus",D='[data-toggle^="button"]',w='[data-toggle="buttons"]',A='input:not([type="hidden"])',N=".active",O=".btn",k={CLICK_DATA_API:"click"+E+C,FOCUS_BLUR_DATA_API:"focus"+E+C+" blur"+E+C},P=function(){function n(t){this._element=t}var t=n.prototype;return t.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(w)[0];if(n){var i=this._element.querySelector(A);if(i){if("radio"===i.type)if(i.checked&&this._element.classList.contains(S))t=!1;else{var o=n.querySelector(N);o&&g(o).removeClass(S)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!this._element.classList.contains(S),g(i).trigger("chLine truncated
|
||||
//# sourceMappingURL=bootstrap.min.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../js/src/util.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/carousel.js","../../js/src/collapse.js","../../js/src/dropdown.js","../../js/src/modal.js","../../js/src/tools/sanitizer.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/toast.js","../../js/src/index.js"],"names":["TRANSITION_END","transitionEndEmulator","duration","_this","this","called","$","one","Util","setTimeout","triggerTransitionEnd","getUID","prefix","Math","random","document","getElementById","getSelectorFromElement","element","selector","getAttribute","hrefAttr","trim","querySelector","err","getTransitionDurationFromElement","transitionDuration","css","transitionDelay","floatTransitionDuration","parseFloat","floatTransitionDelay","split","reflow","offsetHeight","trigger","supportsTransitionEnd","Boolean","isElement","obj","nodeType","typeCheckConfig","componentName","config","configTypes","property","Object","prototype","hasOwnProperty","call","expectedTypes","value","valueType","toString","match","toLowerCase","RegExp","test","Error","toUpperCase","findShadowRoot","documentElement","attachShadow","getRootNode","ShadowRoot","parentNode","root","fn","emulateTransitionEnd","event","special","bindType","delegateType","handle","target","is","handleObj","handler","apply","arguments","NAME","DATA_KEY","EVENT_KEY","JQUERY_NO_CONFLICT","Event","CLOSE","CLOSED","CLICK_DATA_API","ClassName","Alert","_element","close","rootElement","_getRootElement","_triggerCloseEvent","isDefaultPrevented","_removeElement","dispose","removeData","parent","closest","closeEvent","removeClass","hasClass","_destroyElement","detach","remove","_jQueryInterface","each","$element","data","_handleDismiss","alertInstance","preventDefault","on","Constructor","noConflict","DATA_API_KEY","Selector","FOCUS_BLUR_DATA_API","Button","toggle","triggerChangeEvent","addAriaPressed","input","type","checked","classList","contains","activeElement","hasAttribute","focus","setAttribute","toggleClass","button","Default","interval","keyboard","slide","pause","wrap","touch","DefaultType","Direction","SLIDE","SLID","KEYDOWN","MOUSEENTER","MOUSELEAVE","TOUCHSTART","TOUCHMOVE","TOUCHEND","POINTERDOWN","POINTERUP","DRAG_START","LOAD_DATA_API","PointerType","TOUCH","PEN","Carousel","_items","_interval","_activeElement","_isPaused","_isSliding","touchTimeout","touchStartX","touchDeltaX","_config","_getConfig","_indicatorsElement","_touchSupported","navigator","maxTouchPoints","_pointerEvent","window","PointerEvent","MSPointerEvent","_addEventListeners","next","_slide","nextWhenVisible","hidden","prev","cycle","clearInterval","setInterval","visibilityState","bind","to","index","activeIndex","_getItemIndex","length","direction","off","_objectSpread","_handleSwipe","absDeltax","abs","_this2","_keydown","_addTouchEventListeners","_this3","start","originalEvent","pointerType","clientX","touches","end","clearTimeout","querySelectorAll","e","add","tagName","which","slice","indexOf","_getItemByDirection","isNextDirection","isPrevDirection","lastItemIndex","itemIndex","_triggerSlideEvent","relatedTarget","eventDirectionName","targetIndex","fromIndex","slideEvent","from","_setActiveIndicatorElement","indicators","nextIndicator","children","addClass","directionalClassName","orderClassName","_this4","activeElementIndex","nextElement","nextElementIndex","isCycling","slidEvent","nextElementInterval","parseInt","defaultInterval","action","TypeError","ride","_dataApiClickHandler","slideIndex","carousels","i","len","$carousel","SHOW","SHOWN","HIDE","HIDDEN","Dimension","Collapse","_isTransitioning","_triggerArray","id","toggleList","elem","filterElement","filter","foundElem","_selector","push","_parent","_getParent","_addAriaAndCollapsedClass","hide","show","actives","activesData","not","startEvent","dimension","_getDimension","style","attr","setTransitioning","scrollSize","getBoundingClientRect","triggerArrayLength","isTransitioning","jquery","_getTargetFromElement","triggerArray","isOpen","$this","currentTarget","$trigger","selectors","$target","REGEXP_KEYDOWN","ARROW_UP_KEYCODE","CLICK","KEYDOWN_DATA_API","KEYUP_DATA_API","AttachmentMap","offset","flip","boundary","reference","display","Dropdown","_popper","_menu","_getMenuElement","_inNavbar","_detectNavbar","disabled","_getParentFromElement","isActive","_clearMenus","showEvent","Popper","referenceElement","_getPopperConfig","body","noop","hideEvent","destroy","update","scheduleUpdate","stopPropagation","constructor","_getPlacement","$parentDropdown","placement","_getOffset","offsets","popperConfig","modifiers","enabled","preventOverflow","boundariesElement","applyStyle","toggles","context","clickEvent","dropdownMenu","_dataApiKeydownHandler","items","backdrop","FOCUSIN","RESIZE","CLICK_DISMISS","KEYDOWN_DISMISS","MOUSEUP_DISMISS","MOUSEDOWN_DISMISS","Modal","_dialog","_backdrop","_isShown","_isBodyOverflowing","_ignoreBackdropClick","_scrolLine truncated
|
||||
@@ -0,0 +1,12 @@
|
||||
Copyright (c) .NET Foundation. All rights reserved.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
||||
these files except in compliance with the License. You may obtain a copy of the
|
||||
License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software distributed
|
||||
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations under the License.
|
||||
Vendored
+432
@@ -0,0 +1,432 @@
|
||||
// Unobtrusive validation support library for jQuery and jQuery Validate
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
// @version v3.2.11
|
||||
|
||||
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
|
||||
/*global document: false, jQuery: false */
|
||||
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// CommonJS-like environments that support module.exports
|
||||
module.exports = factory(require('jquery-validation'));
|
||||
} else {
|
||||
// Browser global
|
||||
jQuery.validator.unobtrusive = factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
var $jQval = $.validator,
|
||||
adapters,
|
||||
data_validation = "unobtrusiveValidation";
|
||||
|
||||
function setValidationValues(options, ruleName, value) {
|
||||
options.rules[ruleName] = value;
|
||||
if (options.message) {
|
||||
options.messages[ruleName] = options.message;
|
||||
}
|
||||
}
|
||||
|
||||
function splitAndTrim(value) {
|
||||
return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g);
|
||||
}
|
||||
|
||||
function escapeAttributeValue(value) {
|
||||
// As mentioned on http://api.jquery.com/category/selectors/
|
||||
return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1");
|
||||
}
|
||||
|
||||
function getModelPrefix(fieldName) {
|
||||
return fieldName.substr(0, fieldName.lastIndexOf(".") + 1);
|
||||
}
|
||||
|
||||
function appendModelPrefix(value, prefix) {
|
||||
if (value.indexOf("*.") === 0) {
|
||||
value = value.replace("*.", prefix);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function onError(error, inputElement) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"),
|
||||
replaceAttrValue = container.attr("data-valmsg-replace"),
|
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null;
|
||||
|
||||
container.removeClass("field-validation-valid").addClass("field-validation-error");
|
||||
error.data("unobtrusiveContainer", container);
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
error.removeClass("input-validation-error").appendTo(container);
|
||||
}
|
||||
else {
|
||||
error.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function onErrors(event, validator) { // 'this' is the form element
|
||||
var container = $(this).find("[data-valmsg-summary=true]"),
|
||||
list = container.find("ul");
|
||||
|
||||
if (list && list.length && validator.errorList.length) {
|
||||
list.empty();
|
||||
container.addClass("validation-summary-errors").removeClass("validation-summary-valid");
|
||||
|
||||
$.each(validator.errorList, function () {
|
||||
$("<li />").html(this.message).appendTo(list);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function onSuccess(error) { // 'this' is the form element
|
||||
var container = error.data("unobtrusiveContainer");
|
||||
|
||||
if (container) {
|
||||
var replaceAttrValue = container.attr("data-valmsg-replace"),
|
||||
replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null;
|
||||
|
||||
container.addClass("field-validation-valid").removeClass("field-validation-error");
|
||||
error.removeData("unobtrusiveContainer");
|
||||
|
||||
if (replace) {
|
||||
container.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onReset(event) { // 'this' is the form element
|
||||
var $form = $(this),
|
||||
key = '__jquery_unobtrusive_validation_form_reset';
|
||||
if ($form.data(key)) {
|
||||
return;
|
||||
}
|
||||
// Set a flag that indicates we're currently resetting the form.
|
||||
$form.data(key, true);
|
||||
try {
|
||||
$form.data("validator").resetForm();
|
||||
} finally {
|
||||
$form.removeData(key);
|
||||
}
|
||||
|
||||
$form.find(".validation-summary-errors")
|
||||
.addClass("validation-summary-valid")
|
||||
.removeClass("validation-summary-errors");
|
||||
$form.find(".field-validation-error")
|
||||
.addClass("field-validation-valid")
|
||||
.removeClass("field-validation-error")
|
||||
.removeData("unobtrusiveContainer")
|
||||
.find(">*") // If we were using valmsg-replace, get the underlying error
|
||||
.removeData("unobtrusiveContainer");
|
||||
}
|
||||
|
||||
function validationInfo(form) {
|
||||
var $form = $(form),
|
||||
result = $form.data(data_validation),
|
||||
onResetProxy = $.proxy(onReset, form),
|
||||
defaultOptions = $jQval.unobtrusive.options || {},
|
||||
execInContext = function (name, args) {
|
||||
var func = defaultOptions[name];
|
||||
func && $.isFunction(func) && func.apply(form, args);
|
||||
};
|
||||
|
||||
if (!result) {
|
||||
result = {
|
||||
options: { // options structure passed to jQuery Validate's validate() method
|
||||
errorClass: defaultOptions.errorClass || "input-validation-error",
|
||||
errorElement: defaultOptions.errorElement || "span",
|
||||
errorPlacement: function () {
|
||||
onError.apply(form, arguments);
|
||||
execInContext("errorPlacement", arguments);
|
||||
},
|
||||
invalidHandler: function () {
|
||||
onErrors.apply(form, arguments);
|
||||
execInContext("invalidHandler", arguments);
|
||||
},
|
||||
messages: {},
|
||||
rules: {},
|
||||
success: function () {
|
||||
onSuccess.apply(form, arguments);
|
||||
execInContext("success", arguments);
|
||||
}
|
||||
},
|
||||
attachValidation: function () {
|
||||
$form
|
||||
.off("reset." + data_validation, onResetProxy)
|
||||
.on("reset." + data_validation, onResetProxy)
|
||||
.validate(this.options);
|
||||
},
|
||||
validate: function () { // a validation function that is called by unobtrusive Ajax
|
||||
$form.validate();
|
||||
return $form.valid();
|
||||
}
|
||||
};
|
||||
$form.data(data_validation, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
$jQval.unobtrusive = {
|
||||
adapters: [],
|
||||
|
||||
parseElement: function (element, skipAttach) {
|
||||
/// <summary>
|
||||
/// Parses a single HTML element for unobtrusive validation attributes.
|
||||
/// </summary>
|
||||
/// <param name="element" domElement="true">The HTML element to be parsed.</param>
|
||||
/// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the
|
||||
/// validation to the form. If parsing just this single element, you should specify true.
|
||||
/// If parsing several elements, you should specify false, and manually attach the validation
|
||||
/// to the form when you are finished. The default is false.</param>
|
||||
var $element = $(element),
|
||||
form = $element.parents("form")[0],
|
||||
valInfo, rules, messages;
|
||||
|
||||
if (!form) { // Cannot do client-side validation without a form
|
||||
return;
|
||||
}
|
||||
|
||||
valInfo = validationInfo(form);
|
||||
valInfo.options.rules[element.name] = rules = {};
|
||||
valInfo.options.messages[element.name] = messages = {};
|
||||
|
||||
$.each(this.adapters, function () {
|
||||
var prefix = "data-val-" + this.name,
|
||||
message = $element.attr(prefix),
|
||||
paramValues = {};
|
||||
|
||||
if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy)
|
||||
prefix += "-";
|
||||
|
||||
$.each(this.params, function () {
|
||||
paramValues[this] = $element.attr(prefix + this);
|
||||
});
|
||||
|
||||
this.adapt({
|
||||
element: element,
|
||||
form: form,
|
||||
message: message,
|
||||
params: paramValues,
|
||||
rules: rules,
|
||||
messages: messages
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$.extend(rules, { "__dummy__": true });
|
||||
|
||||
if (!skipAttach) {
|
||||
valInfo.attachValidation();
|
||||
}
|
||||
},
|
||||
|
||||
parse: function (selector) {
|
||||
/// <summary>
|
||||
/// Parses all the HTML elements in the specified selector. It looks for input elements decorated
|
||||
/// with the [data-val=true] attribute value and enables validation according to the data-val-*
|
||||
/// attribute values.
|
||||
/// </summary>
|
||||
/// <param name="selector" type="String">Any valid jQuery selector.</param>
|
||||
|
||||
// $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one
|
||||
// element with data-val=true
|
||||
var $selector = $(selector),
|
||||
$forms = $selector.parents()
|
||||
.addBack()
|
||||
.filter("form")
|
||||
.add($selector.find("form"))
|
||||
.has("[data-val=true]");
|
||||
|
||||
$selector.find("[data-val=true]").each(function () {
|
||||
$jQval.unobtrusive.parseElement(this, true);
|
||||
});
|
||||
|
||||
$forms.each(function () {
|
||||
var info = validationInfo(this);
|
||||
if (info) {
|
||||
info.attachValidation();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
adapters = $jQval.unobtrusive.adapters;
|
||||
|
||||
adapters.add = function (adapterName, params, fn) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will
|
||||
/// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and
|
||||
/// mmmm is the parameter name).</param>
|
||||
/// <param name="fn" type="Function">The function to call, which adapts the values from the HTML
|
||||
/// attributes into jQuery Validate rules and/or messages.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
if (!fn) { // Called with no params, just a function
|
||||
fn = params;
|
||||
params = [];
|
||||
}
|
||||
this.push({ name: adapterName, params: params, adapt: fn });
|
||||
return this;
|
||||
};
|
||||
|
||||
adapters.addBool = function (adapterName, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has no parameter values.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, true);
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and
|
||||
/// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param>
|
||||
/// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a minimum value.</param>
|
||||
/// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only
|
||||
/// have a maximum value.</param>
|
||||
/// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you
|
||||
/// have both a minimum and maximum value.</param>
|
||||
/// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the minimum value. The default is "min".</param>
|
||||
/// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that
|
||||
/// contains the maximum value. The default is "max".</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) {
|
||||
var min = options.params.min,
|
||||
max = options.params.max;
|
||||
|
||||
if (min && max) {
|
||||
setValidationValues(options, minMaxRuleName, [min, max]);
|
||||
}
|
||||
else if (min) {
|
||||
setValidationValues(options, minRuleName, min);
|
||||
}
|
||||
else if (max) {
|
||||
setValidationValues(options, maxRuleName, max);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
adapters.addSingleVal = function (adapterName, attribute, ruleName) {
|
||||
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where
|
||||
/// the jQuery Validate validation rule has a single value.</summary>
|
||||
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
|
||||
/// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param>
|
||||
/// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value.
|
||||
/// The default is "val".</param>
|
||||
/// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value
|
||||
/// of adapterName will be used instead.</param>
|
||||
/// <returns type="jQuery.validator.unobtrusive.adapters" />
|
||||
return this.add(adapterName, [attribute || "val"], function (options) {
|
||||
setValidationValues(options, ruleName || adapterName, options.params[attribute]);
|
||||
});
|
||||
};
|
||||
|
||||
$jQval.addMethod("__dummy__", function (value, element, params) {
|
||||
return true;
|
||||
});
|
||||
|
||||
$jQval.addMethod("regex", function (value, element, params) {
|
||||
var match;
|
||||
if (this.optional(element)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
match = new RegExp(params).exec(value);
|
||||
return (match && (match.index === 0) && (match[0].length === value.length));
|
||||
});
|
||||
|
||||
$jQval.addMethod("nonalphamin", function (value, element, nonalphamin) {
|
||||
var match;
|
||||
if (nonalphamin) {
|
||||
match = value.match(/\W/g);
|
||||
match = match && match.length >= nonalphamin;
|
||||
}
|
||||
return match;
|
||||
});
|
||||
|
||||
if ($jQval.methods.extension) {
|
||||
adapters.addSingleVal("accept", "mimtype");
|
||||
adapters.addSingleVal("extension", "extension");
|
||||
} else {
|
||||
// for backward compatibility, when the 'extension' validation method does not exist, such as with versions
|
||||
// of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for
|
||||
// validating the extension, and ignore mime-type validations as they are not supported.
|
||||
adapters.addSingleVal("extension", "extension", "accept");
|
||||
}
|
||||
|
||||
adapters.addSingleVal("regex", "pattern");
|
||||
adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
|
||||
adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
|
||||
adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength");
|
||||
adapters.add("equalto", ["other"], function (options) {
|
||||
var prefix = getModelPrefix(options.element.name),
|
||||
other = options.params.other,
|
||||
fullOtherName = appendModelPrefix(other, prefix),
|
||||
element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0];
|
||||
|
||||
setValidationValues(options, "equalTo", element);
|
||||
});
|
||||
adapters.add("required", function (options) {
|
||||
// jQuery Validate equates "required" with "mandatory" for checkbox elements
|
||||
if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") {
|
||||
setValidationValues(options, "required", true);
|
||||
}
|
||||
});
|
||||
adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
|
||||
var value = {
|
||||
url: options.params.url,
|
||||
type: options.params.type || "GET",
|
||||
data: {}
|
||||
},
|
||||
prefix = getModelPrefix(options.element.name);
|
||||
|
||||
$.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) {
|
||||
var paramName = appendModelPrefix(fieldName, prefix);
|
||||
value.data[paramName] = function () {
|
||||
var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']");
|
||||
// For checkboxes and radio buttons, only pick up values from checked fields.
|
||||
if (field.is(":checkbox")) {
|
||||
return field.filter(":checked").val() || field.filter(":hidden").val() || '';
|
||||
}
|
||||
else if (field.is(":radio")) {
|
||||
return field.filter(":checked").val() || '';
|
||||
}
|
||||
return field.val();
|
||||
};
|
||||
});
|
||||
|
||||
setValidationValues(options, "remote", value);
|
||||
});
|
||||
adapters.add("password", ["min", "nonalphamin", "regex"], function (options) {
|
||||
if (options.params.min) {
|
||||
setValidationValues(options, "minlength", options.params.min);
|
||||
}
|
||||
if (options.params.nonalphamin) {
|
||||
setValidationValues(options, "nonalphamin", options.params.nonalphamin);
|
||||
}
|
||||
if (options.params.regex) {
|
||||
setValidationValues(options, "regex", options.params.regex);
|
||||
}
|
||||
});
|
||||
adapters.add("fileextensions", ["extensions"], function (options) {
|
||||
setValidationValues(options, "extension", options.params.extensions);
|
||||
});
|
||||
|
||||
$(function () {
|
||||
$jQval.unobtrusive.parse(document);
|
||||
});
|
||||
|
||||
return $jQval.unobtrusive;
|
||||
}));
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// Unobtrusive validation support library for jQuery and jQuery Validate
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
// @version v3.2.11
|
||||
!function(a){"function"==typeof define&&define.amd?define("jquery.validate.unobtrusive",["jquery-validation"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery-validation")):jQuery.validator.unobtrusive=a(jQuery)}(function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,.\/:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("<li />").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function u(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=f.unobtrusive.options||{},u=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),u("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),u("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),u("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var m,f=a.validator,v="unobtrusiveValidation";return f.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=u(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){f.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=u(this);a&&a.attachValidation()})}},m=f.unobtrusive.adapters,m.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},m.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},m.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},m.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},f.addMethod("__dummy__",function(a,e,n){return!0}),f.addMethod("regex",function(a,e,n){var t;return!!this.optional(e)||(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),f.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),f.methods.extension?(m.addSingleVal("accept","mimtype"),m.addSingleVal("extension","extension")):m.addSingleVal("extension","extension","accept"),m.addSingleVal("regex","pattern"),m.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),m.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),m.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),m.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),m.add("required",function(a){"INPUT"===a.element.tagName.toUpperCase()&&"CHECKBOX"===a.element.type.toUpperCase()||e(a,"required",!0)}),m.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var
Line truncated
|
||||
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
=====================
|
||||
|
||||
Copyright Jörn Zaefferer
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
+1158
File diff suppressed because it is too large.
Load diff
+4
@@ -0,0 +1,4 @@
|
||||
/*! jQuery Validation Plugin - v1.17.0 - 7/29/2017
|
||||
* https://jqueryvalidation.org/
|
||||
* Copyright (c) 2017 Jörn Zaefferer; Licensed MIT */
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g,h="string"==typeof d?d.replace(/\s/g,""):"image/*",i=this.optional(c);if(i)return i;if("file"===a(c).attr("type")&&(h=h.replace(/[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g,"\\$&").replace(/,/g,"|").replace(/\/\*/g,"/.*"),c.files&&c.files.length))for(g=new RegExp(".?("+h+")$","i"),e=0;e<c.files.length;e++)if(f=c.files[e],!f.type.match(g))return!1;return!0},a.validator.format("Please enter a value with a valid mimetype.")),a.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),a.validator.addMethod("bankaccountNL",function(a,b){if(this.optional(b))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(a))return!1;var c,d,e,f=a.replace(/ /g,""),g=0,h=f.length;for(c=0;c<h;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a.toUpperCase())},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a,b){"use strict";function c(a){return a%2===0}if(this.optional(b))return!0;var d,e,f,g,h=new RegExp(/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi),i=a.substring(0,1),j=a.substring(1,8),k=a.substring(8,9),l=0,m=0,n=0;if(9!==a.length||!h.test(a))return!1;for(d=0;d<j.length;d++)e=parseInt(j[d],10),c(d)?(e*=2,n+=e<10?e:e-9):m+=e;return l=m+n,f=(10-l.toString().substr(-1)).toString(),f=parseInt(f,10)>9?"0":f,g="JABCDEFGHI".substr(f,1).toString(),i.match(/[ABEH]/)?k===f:i.match(/[KPQS]/)?k===g:k===f||k===g},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return 10!==c&&11!==c||(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;e<=9;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;e<=10;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcard",function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},"Please enter a valid credit card number."),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:!!(128&d)},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=!!e||c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9Line truncated
|
||||
+1601
File diff suppressed because it is too large.
Load diff
+4
@@ -0,0 +1,4 @@
|
||||
/*! jQuery Validation Plugin - v1.17.0 - 7/29/2017
|
||||
* https://jqueryvalidation.org/
|
||||
* Copyright (c) 2017 Jörn Zaefferer; Licensed MIT */
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!c.settings.submitHandler||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(null!=j&&(!j.form&&j.hasAttribute("contenteditable")&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}}),a.extend(a.expr.pseudos||a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){var c=a(b).val();return null!==c&&!!a.trim(""+c)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),Line truncated
|
||||
@@ -0,0 +1,36 @@
|
||||
Copyright JS Foundation and other contributors, https://js.foundation/
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals. For exact contribution history, see the revision history
|
||||
available at https://github.com/jquery/jquery
|
||||
|
||||
The following license applies to all parts of this software except as
|
||||
documented below:
|
||||
|
||||
====
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
====
|
||||
|
||||
All files located in the node_modules and external directories are
|
||||
externally maintained libraries used by this software which have their
|
||||
own licenses; we recommend you read them, as their terms may differ from
|
||||
the terms above.
|
||||
Loaded 100 of 196 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user