diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..add57be
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+bin/
+obj/
+/packages/
+riderModule.iml
+/_ReSharper.Caches/
\ No newline at end of file
diff --git a/.idea/.idea.TRPZ_PrintService/.idea/contentModel.xml b/.idea/.idea.TRPZ_PrintService/.idea/contentModel.xml
new file mode 100644
index 0000000..f0481eb
--- /dev/null
+++ b/.idea/.idea.TRPZ_PrintService/.idea/contentModel.xml
@@ -0,0 +1,153 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.TRPZ_PrintService/.idea/indexLayout.xml b/.idea/.idea.TRPZ_PrintService/.idea/indexLayout.xml
new file mode 100644
index 0000000..27ba142
--- /dev/null
+++ b/.idea/.idea.TRPZ_PrintService/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.TRPZ_PrintService/.idea/modules.xml b/.idea/.idea.TRPZ_PrintService/.idea/modules.xml
new file mode 100644
index 0000000..6acf3c9
--- /dev/null
+++ b/.idea/.idea.TRPZ_PrintService/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.TRPZ_PrintService/.idea/projectSettingsUpdater.xml b/.idea/.idea.TRPZ_PrintService/.idea/projectSettingsUpdater.xml
new file mode 100644
index 0000000..4bb9f4d
--- /dev/null
+++ b/.idea/.idea.TRPZ_PrintService/.idea/projectSettingsUpdater.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.TRPZ_PrintService/.idea/vcs.xml b/.idea/.idea.TRPZ_PrintService/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/.idea.TRPZ_PrintService/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.TRPZ_PrintService/.idea/workspace.xml b/.idea/.idea.TRPZ_PrintService/.idea/workspace.xml
new file mode 100644
index 0000000..ab0b455
--- /dev/null
+++ b/.idea/.idea.TRPZ_PrintService/.idea/workspace.xml
@@ -0,0 +1,245 @@
+
+
+
+ TRPZ_PrintService/TRPZ_PrintService.csproj
+ WebApplication1/WebApplication1.csproj
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1608588651375
+
+
+ 1608588651375
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.vs/TRPZ_PrintService/DesignTimeBuild/.dtbcache.v2 b/.vs/TRPZ_PrintService/DesignTimeBuild/.dtbcache.v2
new file mode 100644
index 0000000..f3bfebc
Binary files /dev/null and b/.vs/TRPZ_PrintService/DesignTimeBuild/.dtbcache.v2 differ
diff --git a/.vs/TRPZ_PrintService/config/applicationhost.config b/.vs/TRPZ_PrintService/config/applicationhost.config
new file mode 100644
index 0000000..0c68ff2
--- /dev/null
+++ b/.vs/TRPZ_PrintService/config/applicationhost.config
@@ -0,0 +1,973 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.vs/TRPZ_PrintService/v16/.suo b/.vs/TRPZ_PrintService/v16/.suo
new file mode 100644
index 0000000..12bb1ef
Binary files /dev/null and b/.vs/TRPZ_PrintService/v16/.suo differ
diff --git a/TRPZ_PrintService.sln b/TRPZ_PrintService.sln
new file mode 100644
index 0000000..17332da
--- /dev/null
+++ b/TRPZ_PrintService.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30626.31
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TRPZ_PrintService", "TRPZ_PrintService\TRPZ_PrintService.csproj", "{40020E3B-323C-4B84-B355-575927B62D06}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {40020E3B-323C-4B84-B355-575927B62D06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {40020E3B-323C-4B84-B355-575927B62D06}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {40020E3B-323C-4B84-B355-575927B62D06}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {40020E3B-323C-4B84-B355-575927B62D06}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {7AD47F4B-50AE-4A82-9571-0DB27316780C}
+ EndGlobalSection
+EndGlobal
diff --git a/TRPZ_PrintService/Areas/Identity/IdentityHostingStartup.cs b/TRPZ_PrintService/Areas/Identity/IdentityHostingStartup.cs
new file mode 100644
index 0000000..981df67
--- /dev/null
+++ b/TRPZ_PrintService/Areas/Identity/IdentityHostingStartup.cs
@@ -0,0 +1,31 @@
+using System;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Identity.UI;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using TRPZ_PrintService.Areas.Identity.Data;
+using TRPZ_PrintService.Data;
+
+[assembly: HostingStartup(typeof(TRPZ_PrintService.Areas.Identity.IdentityHostingStartup))]
+namespace TRPZ_PrintService.Areas.Identity
+{
+ public class IdentityHostingStartup : IHostingStartup
+ {
+ public void Configure(IWebHostBuilder builder)
+ {
+ builder.ConfigureServices((context, services) => {
+ services.AddDbContext(options =>
+ options.UseNpgsql(
+ "Host=localhost;Port=5432;Database=printdb;Username=printuser;Password=printpasswd"));
+
+ services.AddDefaultIdentity(options =>
+ {
+ // options.SignIn.RequireConfirmedAccount = true;
+ })
+ .AddEntityFrameworkStores();
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Areas/Identity/Pages/Account/Register.cshtml b/TRPZ_PrintService/Areas/Identity/Pages/Account/Register.cshtml
new file mode 100644
index 0000000..a9d33bd
--- /dev/null
+++ b/TRPZ_PrintService/Areas/Identity/Pages/Account/Register.cshtml
@@ -0,0 +1,47 @@
+@page
+@model RegisterModel
+@{
+ ViewData["Title"] = "Register";
+}
+
+@ViewData["Title"]
+
+
+
+@section Scripts {
+
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Areas/Identity/Pages/Account/Register.cshtml.cs b/TRPZ_PrintService/Areas/Identity/Pages/Account/Register.cshtml.cs
new file mode 100644
index 0000000..a123b0d
--- /dev/null
+++ b/TRPZ_PrintService/Areas/Identity/Pages/Account/Register.cshtml.cs
@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Linq;
+using System.Text;
+using System.Text.Encodings.Web;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Authentication;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Identity.UI.Services;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc.RazorPages;
+using Microsoft.AspNetCore.WebUtilities;
+using Microsoft.Extensions.Logging;
+using TRPZ_PrintService.Areas.Identity.Data;
+
+namespace TRPZ_PrintService.Areas.Identity.Pages.Account
+{
+ [AllowAnonymous]
+ public class RegisterModel : PageModel
+ {
+ private readonly SignInManager _signInManager;
+ private readonly UserManager _userManager;
+ private readonly ILogger _logger;
+ private readonly IEmailSender _emailSender;
+
+ public RegisterModel(
+ UserManager userManager,
+ SignInManager signInManager,
+ ILogger logger,
+ IEmailSender emailSender)
+ {
+ _userManager = userManager;
+ _signInManager = signInManager;
+ _logger = logger;
+ _emailSender = emailSender;
+ }
+
+ [BindProperty]
+ public InputModel Input { get; set; }
+
+ public string ReturnUrl { get; set; }
+
+ public IList ExternalLogins { get; set; }
+
+ public class InputModel
+ {
+ [Required]
+ [DataType(DataType.Text)]
+ [Display(Name = "First name")]
+ public string FirstName { get; set; }
+
+ [Required]
+ [DataType(DataType.Text)]
+ [Display(Name = "Last name")]
+ public string LastName { get; set; }
+
+ [Required]
+ [EmailAddress]
+ [Display(Name = "Email")]
+ public string Email { get; set; }
+
+ [Required]
+ [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
+ [DataType(DataType.Password)]
+ [Display(Name = "Password")]
+ public string Password { get; set; }
+
+ [DataType(DataType.Password)]
+ [Display(Name = "Confirm password")]
+ [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
+ public string ConfirmPassword { get; set; }
+
+ }
+
+ public async Task OnGetAsync(string returnUrl = null)
+ {
+ ReturnUrl = returnUrl;
+ ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
+ }
+
+ public async Task OnPostAsync(string returnUrl = null)
+ {
+ returnUrl ??= Url.Content("~/");
+ ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
+ if (ModelState.IsValid)
+ {
+ var user = new TRPZ_PrintServiceUser
+ {
+ UserName = Input.Email,
+ Email = Input.Email,
+ FirstName = Input.FirstName,
+ LastName = Input.LastName
+ };
+ var result = await _userManager.CreateAsync(user, Input.Password);
+ if (result.Succeeded)
+ {
+ _logger.LogInformation("User created a new account with password.");
+
+ var code = await _userManager.GenerateEmailConfirmationTokenAsync(user);
+ code = WebEncoders.Base64UrlEncode(Encoding.UTF8.GetBytes(code));
+ var callbackUrl = Url.Page(
+ "/Account/ConfirmEmail",
+ pageHandler: null,
+ values: new { area = "Identity", userId = user.Id, code = code, returnUrl = returnUrl },
+ protocol: Request.Scheme);
+
+ await _emailSender.SendEmailAsync(Input.Email, "Confirm your email",
+ $"Please confirm your account by clicking here.");
+
+ if (_userManager.Options.SignIn.RequireConfirmedAccount)
+ {
+ return RedirectToPage("RegisterConfirmation", new { email = Input.Email, returnUrl = returnUrl });
+ }
+ else
+ {
+ await _signInManager.SignInAsync(user, isPersistent: false);
+ return LocalRedirect(returnUrl);
+ }
+ }
+ foreach (var error in result.Errors)
+ {
+ ModelState.AddModelError(string.Empty, error.Description);
+ }
+ }
+
+ // If we got this far, something failed, redisplay form
+ return Page();
+ }
+ }
+}
diff --git a/TRPZ_PrintService/Areas/Identity/Pages/Account/_ViewImports.cshtml b/TRPZ_PrintService/Areas/Identity/Pages/Account/_ViewImports.cshtml
new file mode 100644
index 0000000..db54f8a
--- /dev/null
+++ b/TRPZ_PrintService/Areas/Identity/Pages/Account/_ViewImports.cshtml
@@ -0,0 +1 @@
+@using TRPZ_PrintService.Areas.Identity.Pages.Account
\ No newline at end of file
diff --git a/TRPZ_PrintService/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml b/TRPZ_PrintService/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml
new file mode 100644
index 0000000..bacc0ae
--- /dev/null
+++ b/TRPZ_PrintService/Areas/Identity/Pages/_ValidationScriptsPartial.cshtml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
diff --git a/TRPZ_PrintService/Areas/Identity/Pages/_ViewImports.cshtml b/TRPZ_PrintService/Areas/Identity/Pages/_ViewImports.cshtml
new file mode 100644
index 0000000..365cf57
--- /dev/null
+++ b/TRPZ_PrintService/Areas/Identity/Pages/_ViewImports.cshtml
@@ -0,0 +1,5 @@
+@using Microsoft.AspNetCore.Identity
+@using TRPZ_PrintService.Areas.Identity
+@using TRPZ_PrintService.Areas.Identity.Pages
+@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
+@using TRPZ_PrintService.Areas.Identity.Data
diff --git a/TRPZ_PrintService/Areas/Identity/Pages/_ViewStart.cshtml b/TRPZ_PrintService/Areas/Identity/Pages/_ViewStart.cshtml
new file mode 100644
index 0000000..55cd025
--- /dev/null
+++ b/TRPZ_PrintService/Areas/Identity/Pages/_ViewStart.cshtml
@@ -0,0 +1,4 @@
+
+@{
+ Layout = "/Pages/Shared/_Layout.cshtml";
+}
diff --git a/TRPZ_PrintService/Data/Client.cs b/TRPZ_PrintService/Data/Client.cs
new file mode 100644
index 0000000..b1306d3
--- /dev/null
+++ b/TRPZ_PrintService/Data/Client.cs
@@ -0,0 +1,15 @@
+using System.Collections.Generic;
+using TRPZ_PrintService.Areas.Identity.Data;
+
+namespace TRPZ_PrintService.Data
+{
+ public class Client : TRPZ_PrintServiceUser
+ {
+ public List Orders { get; set; }
+
+ public Client()
+ {
+ Orders = new List();
+ }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/Manager.cs b/TRPZ_PrintService/Data/Manager.cs
new file mode 100644
index 0000000..c25359f
--- /dev/null
+++ b/TRPZ_PrintService/Data/Manager.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using TRPZ_PrintService.Areas.Identity.Data;
+
+namespace TRPZ_PrintService.Data
+{
+ public class Manager : TRPZ_PrintServiceUser
+ {
+ public String Type { get; set; }
+ public List ModelsInOrders { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/Material.cs b/TRPZ_PrintService/Data/Material.cs
new file mode 100644
index 0000000..310d5de
--- /dev/null
+++ b/TRPZ_PrintService/Data/Material.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Data.SqlTypes;
+
+namespace TRPZ_PrintService.Data
+{
+ public class Material
+ {
+ public int MaterialId { get; set; }
+
+ [Required] public String Name { get; set; }
+ public String Description { get; set; }
+ public int Price { get; set; }
+
+ public List ModelsInOrders { get; set; }
+
+ //TODO read about validation https://docs.microsoft.com/en-us/ef/ef6/saving/validation
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/Model3D.cs b/TRPZ_PrintService/Data/Model3D.cs
new file mode 100644
index 0000000..361b187
--- /dev/null
+++ b/TRPZ_PrintService/Data/Model3D.cs
@@ -0,0 +1,11 @@
+using System;
+
+namespace TRPZ_PrintService.Data
+{
+ public class Model3D
+ {
+ public int Model3DId { get; set; }
+ public String FilePath { get; set; }
+ public String Description { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/ModelInOrder.cs b/TRPZ_PrintService/Data/ModelInOrder.cs
new file mode 100644
index 0000000..96b9658
--- /dev/null
+++ b/TRPZ_PrintService/Data/ModelInOrder.cs
@@ -0,0 +1,31 @@
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace TRPZ_PrintService.Data
+{
+ public class ModelInOrder
+ {
+ public int ModelInOrderId { get; set; }
+ public double Scale { get; set; }
+ public bool HasSolubleSupports { get; set; } //restricts usage only on multi-material printers
+ public int PriceTotal { get; set; }
+
+ public Order Order { get; set; }
+ public ModelSettings ModelSettings { get; set; }
+ public Material Material { get; set; }
+ public PostProcessing PostProcessing { get; set; }
+ public Manager Manager { get; set; }
+ public Printer Printer { get; set; }
+ public Model3D Model { get; set; }
+
+ public ModelInOrder()
+ {
+ Scale = 1;
+ }
+
+ public override string ToString()
+ {
+ return Model.Description;
+ }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/ModelSettings.cs b/TRPZ_PrintService/Data/ModelSettings.cs
new file mode 100644
index 0000000..5b49225
--- /dev/null
+++ b/TRPZ_PrintService/Data/ModelSettings.cs
@@ -0,0 +1,12 @@
+namespace TRPZ_PrintService.Data
+{
+ public class ModelSettings
+ {
+ public int ModelSettingsId { get; set; }
+ public int InfillPercentage { get; set; }
+ public int NozzleDiameter { get; set; }
+ public int LayerHeight { get; set; }
+
+ private ModelInOrder ModelInOrder { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/Order.cs b/TRPZ_PrintService/Data/Order.cs
new file mode 100644
index 0000000..0e5b79d
--- /dev/null
+++ b/TRPZ_PrintService/Data/Order.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace TRPZ_PrintService.Data
+{
+ public class Order
+ {
+ public int OrderId { get; set; }
+ public DateTime Timestamp { get; set; }
+ public TimeSpan TotalPrintTime { get; set; }
+ public bool IsSent { get; set; }
+ public bool IsConfirmed { get; set; }
+ public bool IsFinished { get; set; }
+
+ public Client Client { get; set; }
+ public PromoCode PromoCode { get; set; }
+
+ public List Models { get; set; }
+
+ public Order()
+ {
+ Models = new List();
+ }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/PostProcessing.cs b/TRPZ_PrintService/Data/PostProcessing.cs
new file mode 100644
index 0000000..27d5bac
--- /dev/null
+++ b/TRPZ_PrintService/Data/PostProcessing.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+
+namespace TRPZ_PrintService.Data
+{
+ public class PostProcessing
+ {
+ public int PostProcessingId { get; set; }
+ public String Name { get; set; }
+ public String Description { get; set; }
+ public int Price { get; set; }
+
+ public List ModelsInOrders { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/Printer.cs b/TRPZ_PrintService/Data/Printer.cs
new file mode 100644
index 0000000..62e553a
--- /dev/null
+++ b/TRPZ_PrintService/Data/Printer.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Drawing;
+
+namespace TRPZ_PrintService.Data
+{
+ public class Printer
+ {
+ public int PrinterId { get; set; }
+ public String Name { get; set; }
+ public String Description { get; set; }
+ public int ExtruderCount { get; set; }
+ public int MaxTemp { get; set; }
+ public int BuildPlateLength { get; set; }
+ public int BuildPlateWidth { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/PromoCode.cs b/TRPZ_PrintService/Data/PromoCode.cs
new file mode 100644
index 0000000..58fb348
--- /dev/null
+++ b/TRPZ_PrintService/Data/PromoCode.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+
+namespace TRPZ_PrintService.Data
+{
+ public class PromoCode
+ {
+ public int PromoCodeId { get; set; }
+ public DateTime Issue { get; set; }
+ public DateTime ActiveTo { get; set; }
+ public int Count { get; set; } //0 - unlimited
+ public int Discount { get; set; }
+
+ public List Orders { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Data/TRPZ_PrintServiceContext.cs b/TRPZ_PrintService/Data/TRPZ_PrintServiceContext.cs
new file mode 100644
index 0000000..8ab5a19
--- /dev/null
+++ b/TRPZ_PrintService/Data/TRPZ_PrintServiceContext.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using TRPZ_PrintService.Data;
+using Microsoft.AspNetCore.Identity;
+using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore;
+using TRPZ_PrintService.Areas.Identity.Data;
+
+namespace TRPZ_PrintService.Data
+{
+ public class TRPZ_PrintServiceContext : IdentityDbContext
+ {
+
+ public DbSet Clients { get; set; }
+ // public DbSet Managers { get; set; }
+ public DbSet Materials { get; set; }
+ public DbSet Models3D { get; set; }
+ public DbSet ModelsInOrders { get; set; }
+ public DbSet ModelsSettings { get; set; }
+ public DbSet Orders { get; set; }
+ public DbSet PostProcessings { get; set; }
+ public DbSet Printers { get; set; }
+ public DbSet PromoCodes { get; set; }
+
+ public TRPZ_PrintServiceContext(DbContextOptions options)
+ : base(options)
+ {
+ }
+
+ protected override void OnModelCreating(ModelBuilder modelBuilder)
+ {
+ base.OnModelCreating(modelBuilder);
+ modelBuilder.Entity().Property(mio => mio.Scale).HasDefaultValue(1);
+ }
+ }
+}
diff --git a/TRPZ_PrintService/Data/TRPZ_PrintServiceUser.cs b/TRPZ_PrintService/Data/TRPZ_PrintServiceUser.cs
new file mode 100644
index 0000000..00eeca6
--- /dev/null
+++ b/TRPZ_PrintService/Data/TRPZ_PrintServiceUser.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Identity;
+
+namespace TRPZ_PrintService.Areas.Identity.Data
+{
+ // Add profile data for application users by adding properties to the TRPZ_PrintServiceUser class
+ public class TRPZ_PrintServiceUser : IdentityUser
+ {
+ [PersonalData] public string FirstName { get; set; }
+ [PersonalData] public string LastName { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/TRPZ_PrintService/Migrations/20201221233548_Initial1.Designer.cs b/TRPZ_PrintService/Migrations/20201221233548_Initial1.Designer.cs
new file mode 100644
index 0000000..adea192
--- /dev/null
+++ b/TRPZ_PrintService/Migrations/20201221233548_Initial1.Designer.cs
@@ -0,0 +1,590 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using TRPZ_PrintService.Data;
+
+namespace TRPZ_PrintService.Migrations
+{
+ [DbContext(typeof(TRPZ_PrintServiceContext))]
+ [Migration("20201221233548_Initial1")]
+ partial class Initial1
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .UseIdentityByDefaultColumns()
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.1");
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("ProviderKey")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("text");
+
+ b.Property("LoginProvider")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Name")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Areas.Identity.Data.TRPZ_PrintServiceUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("integer");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property("Discriminator")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("FirstName")
+ .HasColumnType("text");
+
+ b.Property("LastName")
+ .HasColumnType("text");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("PasswordHash")
+ .HasColumnType("text");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("text");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("text");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers");
+
+ b.HasDiscriminator("Discriminator").HasValue("TRPZ_PrintServiceUser");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Material", b =>
+ {
+ b.Property("MaterialId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Price")
+ .HasColumnType("integer");
+
+ b.HasKey("MaterialId");
+
+ b.ToTable("Materials");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Model3D", b =>
+ {
+ b.Property("Model3DId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("FilePath")
+ .HasColumnType("text");
+
+ b.HasKey("Model3DId");
+
+ b.ToTable("Models3D");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.ModelInOrder", b =>
+ {
+ b.Property("ModelInOrderId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("HasSolubleSupports")
+ .HasColumnType("boolean");
+
+ b.Property("MaterialId")
+ .HasColumnType("integer");
+
+ b.Property("Model3DId")
+ .HasColumnType("integer");
+
+ b.Property("ModelSettingsId")
+ .HasColumnType("integer");
+
+ b.Property("OrderId")
+ .HasColumnType("integer");
+
+ b.Property("PostProcessingId")
+ .HasColumnType("integer");
+
+ b.Property("PriceTotal")
+ .HasColumnType("integer");
+
+ b.Property("PrinterId")
+ .HasColumnType("integer");
+
+ b.Property("Scale")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("double precision")
+ .HasDefaultValue(1.0);
+
+ b.HasKey("ModelInOrderId");
+
+ b.HasIndex("MaterialId");
+
+ b.HasIndex("Model3DId");
+
+ b.HasIndex("ModelSettingsId");
+
+ b.HasIndex("OrderId");
+
+ b.HasIndex("PostProcessingId");
+
+ b.HasIndex("PrinterId");
+
+ b.ToTable("ModelsInOrders");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.ModelSettings", b =>
+ {
+ b.Property("ModelSettingsId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("InfillPercentage")
+ .HasColumnType("integer");
+
+ b.Property("LayerHeight")
+ .HasColumnType("integer");
+
+ b.Property("NozzleDiameter")
+ .HasColumnType("integer");
+
+ b.HasKey("ModelSettingsId");
+
+ b.ToTable("ModelsSettings");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Order", b =>
+ {
+ b.Property("OrderId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("ClientId")
+ .HasColumnType("text");
+
+ b.Property("PromoCodeId")
+ .HasColumnType("integer");
+
+ b.Property("Timestamp")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("TotalPrintTime")
+ .HasColumnType("interval");
+
+ b.HasKey("OrderId");
+
+ b.HasIndex("ClientId");
+
+ b.HasIndex("PromoCodeId");
+
+ b.ToTable("Orders");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.PostProcessing", b =>
+ {
+ b.Property("PostProcessingId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.Property("Price")
+ .HasColumnType("integer");
+
+ b.HasKey("PostProcessingId");
+
+ b.ToTable("PostProcessings");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Printer", b =>
+ {
+ b.Property("PrinterId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("BuildPlateLength")
+ .HasColumnType("integer");
+
+ b.Property("BuildPlateWidth")
+ .HasColumnType("integer");
+
+ b.Property("Description")
+ .HasColumnType("text");
+
+ b.Property("ExtruderCount")
+ .HasColumnType("integer");
+
+ b.Property("MaxTemp")
+ .HasColumnType("integer");
+
+ b.Property("Name")
+ .HasColumnType("text");
+
+ b.HasKey("PrinterId");
+
+ b.ToTable("Printers");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.PromoCode", b =>
+ {
+ b.Property("PromoCodeId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("ActiveTo")
+ .HasColumnType("timestamp without time zone");
+
+ b.Property("Count")
+ .HasColumnType("integer");
+
+ b.Property("Discount")
+ .HasColumnType("integer");
+
+ b.Property("Issue")
+ .HasColumnType("timestamp without time zone");
+
+ b.HasKey("PromoCodeId");
+
+ b.ToTable("PromoCodes");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Client", b =>
+ {
+ b.HasBaseType("TRPZ_PrintService.Areas.Identity.Data.TRPZ_PrintServiceUser");
+
+ b.HasDiscriminator().HasValue("Client");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("TRPZ_PrintService.Areas.Identity.Data.TRPZ_PrintServiceUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("TRPZ_PrintService.Areas.Identity.Data.TRPZ_PrintServiceUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("TRPZ_PrintService.Areas.Identity.Data.TRPZ_PrintServiceUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.HasOne("TRPZ_PrintService.Areas.Identity.Data.TRPZ_PrintServiceUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.ModelInOrder", b =>
+ {
+ b.HasOne("TRPZ_PrintService.Data.Material", "Material")
+ .WithMany("ModelsInOrders")
+ .HasForeignKey("MaterialId");
+
+ b.HasOne("TRPZ_PrintService.Data.Model3D", "Model")
+ .WithMany()
+ .HasForeignKey("Model3DId");
+
+ b.HasOne("TRPZ_PrintService.Data.ModelSettings", "ModelSettings")
+ .WithMany()
+ .HasForeignKey("ModelSettingsId");
+
+ b.HasOne("TRPZ_PrintService.Data.Order", "Order")
+ .WithMany("Models")
+ .HasForeignKey("OrderId");
+
+ b.HasOne("TRPZ_PrintService.Data.PostProcessing", "PostProcessing")
+ .WithMany("ModelsInOrders")
+ .HasForeignKey("PostProcessingId");
+
+ b.HasOne("TRPZ_PrintService.Data.Printer", "Printer")
+ .WithMany()
+ .HasForeignKey("PrinterId");
+
+ b.Navigation("Material");
+
+ b.Navigation("Model");
+
+ b.Navigation("ModelSettings");
+
+ b.Navigation("Order");
+
+ b.Navigation("PostProcessing");
+
+ b.Navigation("Printer");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Order", b =>
+ {
+ b.HasOne("TRPZ_PrintService.Data.Client", "Client")
+ .WithMany("Orders")
+ .HasForeignKey("ClientId");
+
+ b.HasOne("TRPZ_PrintService.Data.PromoCode", "PromoCode")
+ .WithMany("Orders")
+ .HasForeignKey("PromoCodeId");
+
+ b.Navigation("Client");
+
+ b.Navigation("PromoCode");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Material", b =>
+ {
+ b.Navigation("ModelsInOrders");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Order", b =>
+ {
+ b.Navigation("Models");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.PostProcessing", b =>
+ {
+ b.Navigation("ModelsInOrders");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.PromoCode", b =>
+ {
+ b.Navigation("Orders");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Client", b =>
+ {
+ b.Navigation("Orders");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/TRPZ_PrintService/Migrations/20201221233548_Initial1.cs b/TRPZ_PrintService/Migrations/20201221233548_Initial1.cs
new file mode 100644
index 0000000..7969787
--- /dev/null
+++ b/TRPZ_PrintService/Migrations/20201221233548_Initial1.cs
@@ -0,0 +1,463 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+namespace TRPZ_PrintService.Migrations
+{
+ public partial class Initial1 : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "AspNetRoles",
+ columns: table => new
+ {
+ Id = table.Column(type: "text", nullable: false),
+ Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
+ NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
+ ConcurrencyStamp = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetRoles", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUsers",
+ columns: table => new
+ {
+ Id = table.Column(type: "text", nullable: false),
+ FirstName = table.Column(type: "text", nullable: true),
+ LastName = table.Column(type: "text", nullable: true),
+ Discriminator = table.Column(type: "text", nullable: false),
+ UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
+ NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
+ Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
+ NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
+ EmailConfirmed = table.Column(type: "boolean", nullable: false),
+ PasswordHash = table.Column(type: "text", nullable: true),
+ SecurityStamp = table.Column(type: "text", nullable: true),
+ ConcurrencyStamp = table.Column(type: "text", nullable: true),
+ PhoneNumber = table.Column(type: "text", nullable: true),
+ PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false),
+ TwoFactorEnabled = table.Column(type: "boolean", nullable: false),
+ LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true),
+ LockoutEnabled = table.Column(type: "boolean", nullable: false),
+ AccessFailedCount = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUsers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Materials",
+ columns: table => new
+ {
+ MaterialId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Name = table.Column(type: "text", nullable: false),
+ Description = table.Column(type: "text", nullable: true),
+ Price = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Materials", x => x.MaterialId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Models3D",
+ columns: table => new
+ {
+ Model3DId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ FilePath = table.Column(type: "text", nullable: true),
+ Description = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Models3D", x => x.Model3DId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ModelsSettings",
+ columns: table => new
+ {
+ ModelSettingsId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ InfillPercentage = table.Column(type: "integer", nullable: false),
+ NozzleDiameter = table.Column(type: "integer", nullable: false),
+ LayerHeight = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ModelsSettings", x => x.ModelSettingsId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "PostProcessings",
+ columns: table => new
+ {
+ PostProcessingId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Name = table.Column(type: "text", nullable: true),
+ Description = table.Column(type: "text", nullable: true),
+ Price = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_PostProcessings", x => x.PostProcessingId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Printers",
+ columns: table => new
+ {
+ PrinterId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Name = table.Column(type: "text", nullable: true),
+ Description = table.Column(type: "text", nullable: true),
+ ExtruderCount = table.Column(type: "integer", nullable: false),
+ MaxTemp = table.Column(type: "integer", nullable: false),
+ BuildPlateLength = table.Column(type: "integer", nullable: false),
+ BuildPlateWidth = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Printers", x => x.PrinterId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "PromoCodes",
+ columns: table => new
+ {
+ PromoCodeId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Issue = table.Column(type: "timestamp without time zone", nullable: false),
+ ActiveTo = table.Column(type: "timestamp without time zone", nullable: false),
+ Count = table.Column(type: "integer", nullable: false),
+ Discount = table.Column(type: "integer", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_PromoCodes", x => x.PromoCodeId);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetRoleClaims",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ RoleId = table.Column(type: "text", nullable: false),
+ ClaimType = table.Column(type: "text", nullable: true),
+ ClaimValue = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AspNetRoles",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserClaims",
+ columns: table => new
+ {
+ Id = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ UserId = table.Column(type: "text", nullable: false),
+ ClaimType = table.Column(type: "text", nullable: true),
+ ClaimValue = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AspNetUserClaims_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserLogins",
+ columns: table => new
+ {
+ LoginProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
+ ProviderKey = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
+ ProviderDisplayName = table.Column(type: "text", nullable: true),
+ UserId = table.Column(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
+ table.ForeignKey(
+ name: "FK_AspNetUserLogins_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserRoles",
+ columns: table => new
+ {
+ UserId = table.Column(type: "text", nullable: false),
+ RoleId = table.Column(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
+ table.ForeignKey(
+ name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AspNetRoles",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_AspNetUserRoles_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserTokens",
+ columns: table => new
+ {
+ UserId = table.Column(type: "text", nullable: false),
+ LoginProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
+ Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
+ Value = table.Column(type: "text", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
+ table.ForeignKey(
+ name: "FK_AspNetUserTokens_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Orders",
+ columns: table => new
+ {
+ OrderId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Timestamp = table.Column(type: "timestamp without time zone", nullable: false),
+ TotalPrintTime = table.Column(type: "interval", nullable: false),
+ ClientId = table.Column(type: "text", nullable: true),
+ PromoCodeId = table.Column(type: "integer", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Orders", x => x.OrderId);
+ table.ForeignKey(
+ name: "FK_Orders_AspNetUsers_ClientId",
+ column: x => x.ClientId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Orders_PromoCodes_PromoCodeId",
+ column: x => x.PromoCodeId,
+ principalTable: "PromoCodes",
+ principalColumn: "PromoCodeId",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "ModelsInOrders",
+ columns: table => new
+ {
+ ModelInOrderId = table.Column(type: "integer", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ Scale = table.Column(type: "double precision", nullable: false, defaultValue: 1.0),
+ HasSolubleSupports = table.Column(type: "boolean", nullable: false),
+ PriceTotal = table.Column(type: "integer", nullable: false),
+ OrderId = table.Column(type: "integer", nullable: true),
+ ModelSettingsId = table.Column(type: "integer", nullable: true),
+ MaterialId = table.Column(type: "integer", nullable: true),
+ PostProcessingId = table.Column(type: "integer", nullable: true),
+ PrinterId = table.Column(type: "integer", nullable: true),
+ Model3DId = table.Column(type: "integer", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_ModelsInOrders", x => x.ModelInOrderId);
+ table.ForeignKey(
+ name: "FK_ModelsInOrders_Materials_MaterialId",
+ column: x => x.MaterialId,
+ principalTable: "Materials",
+ principalColumn: "MaterialId",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_ModelsInOrders_Models3D_Model3DId",
+ column: x => x.Model3DId,
+ principalTable: "Models3D",
+ principalColumn: "Model3DId",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_ModelsInOrders_ModelsSettings_ModelSettingsId",
+ column: x => x.ModelSettingsId,
+ principalTable: "ModelsSettings",
+ principalColumn: "ModelSettingsId",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_ModelsInOrders_Orders_OrderId",
+ column: x => x.OrderId,
+ principalTable: "Orders",
+ principalColumn: "OrderId",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_ModelsInOrders_PostProcessings_PostProcessingId",
+ column: x => x.PostProcessingId,
+ principalTable: "PostProcessings",
+ principalColumn: "PostProcessingId",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_ModelsInOrders_Printers_PrinterId",
+ column: x => x.PrinterId,
+ principalTable: "Printers",
+ principalColumn: "PrinterId",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AspNetRoleClaims_RoleId",
+ table: "AspNetRoleClaims",
+ column: "RoleId");
+
+ migrationBuilder.CreateIndex(
+ name: "RoleNameIndex",
+ table: "AspNetRoles",
+ column: "NormalizedName",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AspNetUserClaims_UserId",
+ table: "AspNetUserClaims",
+ column: "UserId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AspNetUserLogins_UserId",
+ table: "AspNetUserLogins",
+ column: "UserId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_AspNetUserRoles_RoleId",
+ table: "AspNetUserRoles",
+ column: "RoleId");
+
+ migrationBuilder.CreateIndex(
+ name: "EmailIndex",
+ table: "AspNetUsers",
+ column: "NormalizedEmail");
+
+ migrationBuilder.CreateIndex(
+ name: "UserNameIndex",
+ table: "AspNetUsers",
+ column: "NormalizedUserName",
+ unique: true);
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ModelsInOrders_MaterialId",
+ table: "ModelsInOrders",
+ column: "MaterialId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ModelsInOrders_Model3DId",
+ table: "ModelsInOrders",
+ column: "Model3DId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ModelsInOrders_ModelSettingsId",
+ table: "ModelsInOrders",
+ column: "ModelSettingsId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ModelsInOrders_OrderId",
+ table: "ModelsInOrders",
+ column: "OrderId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ModelsInOrders_PostProcessingId",
+ table: "ModelsInOrders",
+ column: "PostProcessingId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_ModelsInOrders_PrinterId",
+ table: "ModelsInOrders",
+ column: "PrinterId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Orders_ClientId",
+ table: "Orders",
+ column: "ClientId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Orders_PromoCodeId",
+ table: "Orders",
+ column: "PromoCodeId");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "AspNetRoleClaims");
+
+ migrationBuilder.DropTable(
+ name: "AspNetUserClaims");
+
+ migrationBuilder.DropTable(
+ name: "AspNetUserLogins");
+
+ migrationBuilder.DropTable(
+ name: "AspNetUserRoles");
+
+ migrationBuilder.DropTable(
+ name: "AspNetUserTokens");
+
+ migrationBuilder.DropTable(
+ name: "ModelsInOrders");
+
+ migrationBuilder.DropTable(
+ name: "AspNetRoles");
+
+ migrationBuilder.DropTable(
+ name: "Materials");
+
+ migrationBuilder.DropTable(
+ name: "Models3D");
+
+ migrationBuilder.DropTable(
+ name: "ModelsSettings");
+
+ migrationBuilder.DropTable(
+ name: "Orders");
+
+ migrationBuilder.DropTable(
+ name: "PostProcessings");
+
+ migrationBuilder.DropTable(
+ name: "Printers");
+
+ migrationBuilder.DropTable(
+ name: "AspNetUsers");
+
+ migrationBuilder.DropTable(
+ name: "PromoCodes");
+ }
+ }
+}
diff --git a/TRPZ_PrintService/Migrations/20201221233859_Initial2.Designer.cs b/TRPZ_PrintService/Migrations/20201221233859_Initial2.Designer.cs
new file mode 100644
index 0000000..e20c766
--- /dev/null
+++ b/TRPZ_PrintService/Migrations/20201221233859_Initial2.Designer.cs
@@ -0,0 +1,616 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+using TRPZ_PrintService.Data;
+
+namespace TRPZ_PrintService.Migrations
+{
+ [DbContext(typeof(TRPZ_PrintServiceContext))]
+ [Migration("20201221233859_Initial2")]
+ partial class Initial2
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .UseIdentityByDefaultColumns()
+ .HasAnnotation("Relational:MaxIdentifierLength", 63)
+ .HasAnnotation("ProductVersion", "5.0.1");
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property("ClaimType")
+ .HasColumnType("text");
+
+ b.Property("ClaimValue")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("ProviderKey")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("text");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("text");
+
+ b.Property("RoleId")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("text");
+
+ b.Property("LoginProvider")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Name")
+ .HasMaxLength(128)
+ .HasColumnType("character varying(128)");
+
+ b.Property("Value")
+ .HasColumnType("text");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Areas.Identity.Data.TRPZ_PrintServiceUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("text");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("integer");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("text");
+
+ b.Property("Discriminator")
+ .IsRequired()
+ .HasColumnType("text");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("FirstName")
+ .HasColumnType("text");
+
+ b.Property("LastName")
+ .HasColumnType("text");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("timestamp with time zone");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.Property("PasswordHash")
+ .HasColumnType("text");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("text");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("boolean");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("text");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("boolean");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("character varying(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers");
+
+ b.HasDiscriminator("Discriminator").HasValue("TRPZ_PrintServiceUser");
+ });
+
+ modelBuilder.Entity("TRPZ_PrintService.Data.Material", b =>
+ {
+ b.Property("MaterialId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("integer")
+ .UseIdentityByDefaultColumn();
+
+ b.Property