diff --git a/.gitignore b/.gitignore index 8ad2a70..8bb461a 100644 --- a/.gitignore +++ b/.gitignore @@ -354,3 +354,4 @@ MigrationBackup/ GrossesMitaines/GrossesMitainesAPI/Images/* !GrossesMitaines/GrossesMitainesAPI/Images/default.jpg !GrossesMitaines/GrossesMitainesAPI/Images/default_thumbnail.jpg +!GrossesMitaines/GrossesMitainesAPI/Images/$* \ No newline at end of file diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs index 4a999c8..931a949 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs @@ -28,11 +28,11 @@ public class InvoiceController : Controller { #endregion #region Ctor - public InvoiceController(ILogger logger, - InventoryContext context, + public InvoiceController(ILogger logger, + InventoryContext context, DatabaseCacheService cache, SignInManager signInMan, - Microsoft.AspNetCore.Identity.UserManager userMan) { + Microsoft.AspNetCore.Identity.UserManager userMan) { _logger = logger; _context = context; _cache = cache; @@ -50,7 +50,8 @@ public class InvoiceController : Controller { try { // Trouver les rôles de l'utilisateur, assumer non-admin si impossible à trouver. var user = await _userMan.GetUserAsync(_signInMan.Context.User); roles = await _userMan.GetRolesAsync(user); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(10, e.Message); roles = new List(); } @@ -58,10 +59,20 @@ public class InvoiceController : Controller { try { id = _signInMan.Context.User.Identity.GetUserId(); if (all is not null && all == true && roles.Contains("Administrateur")) - return Ok(_context.Invoices.ToList()); - else return Ok(_context.Invoices.Include("ShippingAddress").Where(x => x.LinkedAccount != null && - x.LinkedAccount.Id == id).ToList()); - } catch (Exception e) { + return Ok(_context.Invoices + .Include("ShippingAddress") + .Include(x => x.Products) + .ThenInclude(y => y.Product) + .ToList()); + + else + return Ok(_context.Invoices + .Include("ShippingAddress") + .Include(x => x.Products) + .ThenInclude(y => y.Product) + .Where(x => x.LinkedAccount != null && x.LinkedAccount.Id == id).ToList()); + } + catch (Exception e) { _logger.LogError(10, e.Message); return BadRequest(); } @@ -74,14 +85,16 @@ public class InvoiceController : Controller { try { // Trouver les rôles de l'utilisateur, assumer non-admin si impossible à trouver. roles = await _userMan.GetRolesAsync(await _userMan.GetUserAsync(_signInMan.Context.User)); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(10, e.Message); roles = new List(); } try { inv = _context.Invoices.Where(x => x.Id == id).Include("ShippingAddress").First(); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(10, e.Message); return BadRequest(); } @@ -97,9 +110,9 @@ public class InvoiceController : Controller { public async Task> Post(SendInvoiceModel sinv) { var user = await _userMan.GetUserAsync(_signInMan.Context.User); var prodcom = sinv.ProdQuant; - Dictionary badprods = new(); + Dictionary badprods = new(); List prods; - InvoiceModel inv = new() { + InvoiceModel inv = new() { FirstName = sinv.FirstName, LastName = sinv.LastName, EmailAddress = sinv.EmailAddress, @@ -112,7 +125,7 @@ public class InvoiceController : Controller { x.City == sinv.City && x.Province == sinv.Province && x.Country == sinv.Country) ?? - new() { + new() { CivicNumber = sinv.CivicNumber, Appartment = sinv.Appartment, Street = sinv.Street, @@ -127,7 +140,8 @@ public class InvoiceController : Controller { try { prods = _context.Products.Where(x => sinv.ProdQuant.Select(x => x.Key).Contains(x.Id)).ToList(); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(8, e.Message); return BadRequest(); } @@ -144,20 +158,22 @@ public class InvoiceController : Controller { inventProd.Status = inventProd.Status == ProductModel.States.Clearance ? ProductModel.States.Discontinued : ProductModel.States.BackOrder; - } else inventProd.Quantity -= prod.Value; + } + else inventProd.Quantity -= prod.Value; inventProd.LastSale = DateTime.Now; inventProd.Sales += prod.Value; } if (badprods.Count > 0) // Retour des produits non-achetable avec l'inventaire restant. return BadRequest(badprods.ToArray()); - + try { // Faire les updates dans la BD. _context.Addresses.Add(ad); _context.Invoices.Add(inv); _context.Products.UpdateRange(prods); _context.SaveChanges(); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(8, e.Message); return BadRequest(e.InnerException.Message); } @@ -167,27 +183,29 @@ public class InvoiceController : Controller { } [HttpPost("Cancel/{id}"), Authorize(Roles = "Client, Administrateur")] - public async Task> Cancel(int id) { + public async Task> Cancel(int id) { InvoiceModel inv; IList roles; try { // Trouver la commande. inv = _context.Invoices.Where(x => x.Id == id) .Include("Product").First(); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(8, e.Message); return BadRequest(); } try { // Trouver les rôles de l'utilisateur, assumer non-admin si impossible à trouver. roles = await _userMan.GetRolesAsync(await _userMan.GetUserAsync(_signInMan.Context.User)); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(10, e.Message); roles = new List(); } // Pour ne pas pouvoir arbitrairement annuler la commande d'un autre client en tant que client. - if (!((inv.LinkedAccount is not null && + if (!((inv.LinkedAccount is not null && inv.LinkedAccount.Id == _signInMan.Context.User.Identity.GetUserId()) || roles.Contains("Administrateur"))) return Unauthorized(); @@ -208,12 +226,13 @@ public class InvoiceController : Controller { else prod.Product.Status = ProductModel.States.Available; prod.Product.Quantity = prod.Product.Quantity + prod.Quantity; prod.Product.Sales -= prod.Quantity; - } + } try { _context.Update(inv); _context.SaveChanges(); - } catch (Exception e) { + } + catch (Exception e) { _logger.LogError(8, e.Message); return BadRequest(); } diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs index ab5db2d..1d7a951 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/ProductController.cs @@ -128,7 +128,7 @@ public class ProductController : ControllerBase { #region Internal Methods private async Task SaveImage(IFormFile imageFile) { - string imageName = new String(Path.GetFileNameWithoutExtension(imageFile.FileName).Take(10).ToArray()).Replace(' ', '-'); + string imageName = new String(Path.GetFileNameWithoutExtension(imageFile.FileName).Take(10).ToArray()).Replace(' ', '-').Replace("$",""); imageName = imageName + DateTime.Now.ToString("yymmssfff") + Path.GetExtension(imageFile.FileName); var imagePath = Path.Combine(_hostEnvironment.ContentRootPath, "Images", imageName); @@ -141,10 +141,10 @@ public class ProductController : ControllerBase { private void SaveImageThumbnail(FileStream stream, string imageName) { try { - const float maxSize = 200f; + const float maxSize = 300f; Image image = Image.FromStream(stream); - //Choisi le bon ratio de division pour ne pas dépasser le 200px ni dans height ni dans width + //Choisi le bon ratio de division pour ne pas dépasser le 300px ni dans height ni dans width float ratio = image.Width / (image.Height / maxSize) <= maxSize ? image.Height / maxSize : image.Width / maxSize; Bitmap resize = new Bitmap(image, new Size((int)(image.Width / ratio), (int)(image.Height / ratio))); @@ -158,7 +158,7 @@ public class ProductController : ControllerBase { private void DeleteImages(string imageName) { - if (imageName == "default.jpg" || imageName == "default_thumbnail.jpg") + if (imageName == "default.jpg" || imageName == "default_thumbnail.jpg" || imageName.Contains("$")) return; var files = System.IO.Directory.GetFiles(_hostEnvironment.ContentRootPath + "/Images") diff --git a/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs b/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs index e4a9730..e255338 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Data/InventoryContext.cs @@ -13,224 +13,398 @@ public class InventoryContext : IdentityDbContext { public InventoryContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { - + #region Products // Pour partir la BD. modelBuilder.Entity().HasData(new ProductModel { Id = 1, - Title = $"Ceinture flèchée", - Category = $"Linge", - Description = $"Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Title = @"Ceinture flèchée", + Category = @"Linge", + Description = @"Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", Status = ProductModel.States.Promotion, Price = 85.86M, PromoPrice = 29.99M, Quantity = 1, - ImageName = $"ceintureflechee" + ImageName = @"$ceintureflechee.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 2, - Title = $"Pantoufles du Canadien en Phentex", - Category = $"Linge", - Description = $"Parce que ça sent la coupe!", + Title = @"Pantoufles du Canadien en Phentex", + Category = @"Linge", + Description = @"Parce que ça sent la coupe!", Status = ProductModel.States.Available, Price = 15.64M, PromoPrice = 9.99M, Quantity = 54, - ImageName = $"pantouflesCH" + ImageName = @"$pantouflesCH.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 3, - Title = $"Jean-Luc Mongrain", - Category = $"Homme", - Description = $"On ne lui ferait pas mal, en tout cas!!", + Title = @"Jean-Luc Mongrain", + Category = @"Homme", + Description = @"On ne lui ferait pas mal, en tout cas!!", Status = ProductModel.States.Clearance, Price = 1453.12M, PromoPrice = 999.99M, Quantity = 1, - ImageName = $"jeanlucmongrain" + ImageName = @"$jeanlucmongrain.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 4, - Title = $"T-Shirt", - Category = $"Linge", - Description = $"Tellement simple et comfortable.", + Title = @"T-Shirt", + Category = @"Linge", + Description = @"Tellement simple et comfortable.", Status = ProductModel.States.Available, Price = 12.12M, PromoPrice = 9.99M, Quantity = 143, - ImageName = $"tshirt" + ImageName = @"$tshirt.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 5, - Title = $"Mitaines", - Category = $"Vêtement d'extérieur", - Description = $"Deux pour un!", + Title = @"Mitaines", + Category = @"Vêtement d'extérieur", + Description = @"Deux pour un!", Status = ProductModel.States.Available, Price = 8.18M, PromoPrice = 6.99M, Quantity = 1423, - ImageName = $"mitaines" + ImageName = @"$mitaines.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 6, - Title = $"Foulard", - Category = $"Vêtement d'extérieur", - Description = $"Deux pour un!", + Title = @"Foulard", + Category = @"Vêtement d'extérieur", + Description = @"Deux pour un!", Status = ProductModel.States.Promotion, Price = 10.56M, PromoPrice = 8.99M, Quantity = 14, - ImageName = $"foulard" + ImageName = @"$foulard.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 7, - Title = $"Jock-Strap en phentex", - Category = $"Sous-Vêtement", - Description = $"Pour garder le p'tit bout au chaud.", + Title = @"Jock-Strap en phentex", + Category = @"Sous-Vêtement", + Description = @"Pour garder le p'tit bout au chaud.", Status = ProductModel.States.Promotion, Price = 15.45M, PromoPrice = 12.99M, Quantity = 144, - ImageName = $"kokin" + ImageName = @"$kokin.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 8, - Title = $"Jock-Strap féminin en phentex", - Category = $"Sous-Vêtement", - Description = $"Pour garder l'absence de p'tit bout au chaud.", + Title = @"Jock-Strap féminin en phentex", + Category = @"Sous-Vêtement", + Description = @"Pour garder l'absence de p'tit bout au chaud.", Status = ProductModel.States.Promotion, Price = 15.45M, PromoPrice = 12.99M, Quantity = 224, - ImageName = $"kokin" + ImageName = @"$kokinfemme.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 9, - Title = $"Bibi", - Category = $"Alien", - Description = $"En chiffon.", + Title = @"Bibi", + Category = @"Alien", + Description = @"En chiffon.", Status = ProductModel.States.Clearance, Price = 1045.45M, PromoPrice = 1023.99M, Quantity = 1, - ImageName = $"bibi" + ImageName = @"$bibi.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 10, - Title = $"Tuque en laine", - Category = $"Vêtement d'extérieur", - Description = $"En chiffon.", + Title = @"Tuque en laine", + Category = @"Vêtement d'extérieur", + Description = @"En chiffon.", Status = ProductModel.States.Available, Price = 15.45M, PromoPrice = 12.99M, Quantity = 1, - ImageName = $"tuque" + ImageName = @"$tuque.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 11, - Title = $"Habit de Bonhomme Carnaval", - Category = $"Vêtement d'extérieur", - Description = $"Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Title = @"Habit de Bonhomme Carnaval", + Category = @"Vêtement d'extérieur", + Description = @"Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", Status = ProductModel.States.Promotion, Price = 145.45M, PromoPrice = 123.99M, Quantity = 1, - ImageName = $"bonhomme" + ImageName = @"$bonhomme.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 12, - Title = $"Gauze en phentex", - Category = $"Autre", - Description = $"Pour se pêter la fiole avec style.", + Title = @"Gauze en phentex", + Category = @"Autre", + Description = @"Pour se pêter la fiole avec style.", Status = ProductModel.States.BackOrder, Price = 145.45M, PromoPrice = 123.99M, Quantity = 0, - ImageName = $"gauze" + ImageName = @"$gauze.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 13, - Title = $"Petit Jésus de plâtre", - Category = $"Homme", - Description = $"En chiffon.", + Title = @"Petit Jésus de plâtre", + Category = @"Homme", + Description = @"En chiffon.", Status = ProductModel.States.Clearance, Price = 145.45M, PromoPrice = 123.99M, Quantity = 1, - ImageName = $"jesus" + ImageName = @"$jesus.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 14, - Title = $"VHS de la Guerre des Tuques", - Category = $"Autre", - Description = $"À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Title = @"VHS de la Guerre des Tuques", + Category = @"Autre", + Description = @"À écouter dans l'habit de Bonhomme Carnaval tant que possible.", Status = ProductModel.States.Clearance, Price = 3.45M, PromoPrice = 1.99M, Quantity = 164363, - ImageName = $"vhs" + ImageName = @"$vhs.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 15, - Title = $"Gilet pare-balle en laine", - Category = $"Linge", - Description = $"(N'est pas réellement pare-balle).", + Title = @"Gilet pare-balle en laine", + Category = @"Linge", + Description = @"(N'est pas réellement pare-balle).", Status = ProductModel.States.Clearance, Price = 1435.45M, PromoPrice = 1223.99M, Quantity = 18, - ImageName = $"chandailquetaine" + ImageName = @"$chandailquetaine.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 16, - Title = $"Doudou", - Category = $"Autre", - Description = $"Pour s'éffoirer le nez dedans.", + Title = @"Doudou", + Category = @"Autre", + Description = @"Pour s'éffoirer le nez dedans.", Status = ProductModel.States.Available, Price = 14.45M, PromoPrice = 13.99M, Quantity = 14, - ImageName = $"doudou" + ImageName = @"$doudou.jpg" }); modelBuilder.Entity().HasData(new ProductModel { Id = 17, - Title = $"Mitaines pas de doigts", - Category = $"Vêtements d'extérieur", - Description = $"Pour avoir l'air thug en hiver.", + Title = @"Mitaines pas de doigts", + Category = @"Vêtements d'extérieur", + Description = @"Pour avoir l'air thug en hiver.", Status = ProductModel.States.Available, Price = 9.45M, PromoPrice = 8.99M, Quantity = 16, - ImageName = $"mitaines2" + ImageName = @"$mitaines2.jpg" }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 18, + Title = @"Longues mitaines pas de doigts", + Category = @"Vêtements d'extérieur", + Description = @"Pour avoir plus l'air thug en hiver.", + Status = ProductModel.States.Discontinued, + Price = 10.45M, + PromoPrice = 9.99M, + Quantity = 10, + ImageName = @"$longmitaines.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 19, + Title = @"Pantalons slacks", + Category = @"Linge", + Description = @"Pour les journées bs", + Status = ProductModel.States.BackOrder, + Price = 69.99M, + PromoPrice = 49.99M, + Quantity = 0, + ImageName = @"$pantalon.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 20, + Title = @"Programmer Socks", + Category = @"Linge", + Description = @"Pour commencer à apprendre rust et utiliser linux", + Status = ProductModel.States.Promotion, + Price = 23.50M, + PromoPrice = 19.99M, + Quantity = 3, + ImageName = @"$thighs.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 21, + Title = @"Col-roulé", + Category = @"Linge", + Description = @"Show off que t'habites su'l plateau", + Status = ProductModel.States.Available, + Price = 149.99M, + PromoPrice = 99.99M, + Quantity = 14, + ImageName = @"$plateau.png" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 22, + Title = @"Gros col-roulé", + Category = @"Linge", + Description = @"Ben oui je vais à l'UQAM comment t'as d'viné", + Status = ProductModel.States.Clearance, + Price = 149.99M, + PromoPrice = 99.99M, + Quantity = 4, + ImageName = @"$uqam.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 23, + Title = @"SAQ", + Category = @"Établissement", + Description = @"Oui oui, une SAQ au complete", + Status = ProductModel.States.Available, + Price = 1000000.99M, + PromoPrice = 999999.99M, + Quantity = 1, + ImageName = @"$saq.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 24, + Title = @"Lorem", + Category = @"Texte", + Description = @"Lorem ipsum dolor sit amet, +consectetur adipiscing elit. Vivamus sapien ipsum, +convallis quis justo ac, congue sollicitudin metus. +Vestibulum nec libero nulla. Integer a pretium dolor. +Phasellus vulputate iaculis ligula, sit amet suscipit +diam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat. +Duis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque +egestas sagittis. Etiam vitae ornare ex.", + Status = ProductModel.States.Promotion, + Price = 0.99M, + PromoPrice = 0.69M, + Quantity = 99, + ImageName = @"$lorem.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 25, + Title = @"Bébé de laine", + Category = @"Homme", + Description = @"Quand un vrai coûte trop cher", + Status = ProductModel.States.Available, + Price = 10.99M, + PromoPrice = 5.99M, + Quantity = 15, + ImageName = @"$bebe.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 26, + Title = @"Kit pour bébé", + Category = @"Linge", + Description = @"Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", + Status = ProductModel.States.Clearance, + Price = 39.99M, + PromoPrice = 29.99M, + Quantity = 10, + ImageName = @"$kitbebe.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 27, + Title = @"TORTUE", + Category = @"Linge", + Description = @"Chris Pratt aime ben sauter dessus", + Status = ProductModel.States.Discontinued, + Price = 29.99M, + PromoPrice = 9.99M, + Quantity = 0, + ImageName = @"$koopa.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 28, + Title = @"Patate de laine", + Category = @"Nourriture", + Description = @"*ne pa manger", + Status = ProductModel.States.Available, + Price = 1.99M, + PromoPrice = 0.99M, + Quantity = 58, + ImageName = @"$potato.jpg" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 29, + Title = @"Monke :)", + Category = @"Animal", + Description = @"Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine. +Au sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches. + +Même s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", + Status = ProductModel.States.Available, + Price = 299.99M, + PromoPrice = 99.99M, + Quantity = 58, + ImageName = @"$monke.png" + }); + modelBuilder.Entity().HasData(new ProductModel { + Id = 30, + Title = @"Phat Pikachu", + Category = @"Pokemon", + Description = @"It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone. + +In Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone. + +Pikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve. + +In Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu. + +Pikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots. + +It is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles. + +Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", + Status = ProductModel.States.Discontinued, + Price = 3.99M, + PromoPrice = 2.99M, + Quantity = 69, + ImageName = @"$pika.png" + }); + #endregion + + #region Users // Source: Notre TP Web 4DW. + //RolesID string AdministrateurID = "c9e08b20-d8a5-473f-9f52-572eb23c12af"; string ClientID = "1b7b9c55-c746-493a-a24f-3d5ca937298e"; - string AdminID = "ecf7503a-591c-454e-a824-048e10bd0474"; - InventoryUser admin = new InventoryUser() { + //UsersID + string AdminID = "ecf7503a-591c-454e-a824-048e10bd0474"; + string PaulID = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09"; + + InventoryUser admin = new InventoryUser() { FirstName = "Roger", LastName = "Admin", - NormalizedUserName = "ADMIN", - UserName = "Admin", - Id = AdminID, - NormalizedEmail = "ADMIN@ADMIN.COM", - Email = "admin@admin.com" + NormalizedUserName = "ADMIN", + UserName = "Admin", + Id = AdminID, + NormalizedEmail = "ADMIN@ADMIN.COM", + Email = "admin@admin.com" }; - //admin.Adresses.Add(new AddressModel() { - // CivicNumber = 1234, - // Appartment = "B", - // Street = "Rue Pierre-Falardeau", - // City = "Saint-Chrysostome", - // PostalCode = "H0H0H0", - // Province = "QC", - // Country = "Canada" - //}); - + InventoryUser paul = new InventoryUser() { + FirstName = "Paul", + LastName = "A.", + NormalizedUserName = "PASLA", + UserName = "PasLa", + Id = PaulID, + NormalizedEmail = "PAUL@EXEMPLE.COM", + Email = "paul@exemple.com" + }; + + admin.PasswordHash = new PasswordHasher().HashPassword(admin, "Qwerty123!"); - modelBuilder.Entity().HasData(admin); + paul.PasswordHash = new PasswordHasher().HashPassword(paul, "Qwerty123!"); + modelBuilder.Entity().HasData(admin, paul); modelBuilder.Entity().HasData( new IdentityRole { Id = AdministrateurID, Name = "Administrateur", NormalizedName = "ADMINISTRATEUR" }, @@ -239,8 +413,254 @@ public class InventoryContext : IdentityDbContext { modelBuilder.Entity>().HasData( new IdentityUserRole { RoleId = AdministrateurID, UserId = AdminID }, - new IdentityUserRole { RoleId = ClientID, UserId = AdminID } + new IdentityUserRole { RoleId = ClientID, UserId = AdminID }, + new IdentityUserRole { RoleId = ClientID, UserId = PaulID } ); + #endregion + + #region Addresses + modelBuilder.Entity().HasData( + new { + Id = 1, + CivicNumber = 1234, + Appartment = "B", + Street = "Rue Pierre-Falardeau", + City = "Saint-Chrysostome", + PostalCode = "H0H0H0", + Province = "QC", + Country = "Canada", + InventoryUserId = AdminID, + }, + new { + Id = 2, + CivicNumber = 420, + Street = "Rue MikeWard", + City = "Saint-Jérôme", + PostalCode = "H0H0H0", + Province = "QC", + Country = "Canada", + }, + new { + Id = 3, + CivicNumber = 69, + Appartment = "A", + Street = "Rue PSPP", + City = "Saint-Québec", + PostalCode = "H0H0H0", + Province = "QC", + Country = "Canada", + InventoryUserId = PaulID, + } + ); + #endregion + + + + #region Invoices + modelBuilder.Entity().HasData( + new { + Id = 1, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = AdminID, + PhoneNumber = "111-111-1111", + PurchaseDate = DateTime.Now, + ShippingAddressId = 1, + Status = InvoiceModel.InStates.Confirmed, + }, + new { + Id = 2, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = AdminID, + PhoneNumber = "111-111-1111", + PurchaseDate = DateTime.Now, + ShippingAddressId = 1, + Status = InvoiceModel.InStates.Cancelled, + }, + new { + Id = 3, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = AdminID, + PhoneNumber = "111-111-1111", + PurchaseDate = DateTime.Now, + ShippingAddressId = 1, + Status = InvoiceModel.InStates.Shipping, + }, + new { + Id = 4, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = AdminID, + PhoneNumber = "111-111-1111", + PurchaseDate = DateTime.Now, + ShippingAddressId = 1, + Status = InvoiceModel.InStates.Shipped, + }, + new { + Id = 5, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = AdminID, + PhoneNumber = "111-111-1111", + PurchaseDate = DateTime.Now, + ShippingAddressId = 1, + Status = InvoiceModel.InStates.Returned, + }, + new { + Id = 6, + EmailAddress = "test@admin.com", + FirstName = "Jérémy", + LastName = "Le Petit", + PhoneNumber = "111-111-1111", + PurchaseDate = DateTime.Now, + ShippingAddressId = 2, + Status = InvoiceModel.InStates.Confirmed, + }, + new { + Id = 7, + EmailAddress = "paul@exemple.com", + FirstName = "Paul", + LastName = "A.", + LinkedAccountId = PaulID, + PhoneNumber = "111-111-1111", + PurchaseDate = DateTime.Now, + ShippingAddressId = 3, + Status = InvoiceModel.InStates.Shipping, + } + ); + + modelBuilder.Entity().HasData( + // invoice 1 + new { + Id = 1, + ProductId = 1, + Quantity = (uint)2, + InvoiceModelId = 1 + }, + new { + Id = 2, + ProductId = 4, + Quantity = (uint)5, + InvoiceModelId = 1 + }, + + // invoice 2 + new { + Id = 3, + ProductId = 3, + Quantity = (uint)1, + InvoiceModelId = 2 + }, + new { + Id = 4, + ProductId = 5, + Quantity = (uint)2, + InvoiceModelId = 2 + }, + new { + Id = 5, + ProductId = 7, + Quantity = (uint)1, + InvoiceModelId = 2 + }, + + // invoice 3 + new { + Id = 6, + ProductId = 9, + Quantity = (uint)1, + InvoiceModelId = 3 + }, + new { + Id = 7, + ProductId = 11, + Quantity = (uint)1, + InvoiceModelId = 3 + }, + + // invoice 4 + new { + Id = 8, + ProductId = 14, + Quantity = (uint)1, + InvoiceModelId = 4 + }, + new { + Id = 9, + ProductId = 13, + Quantity = (uint)1, + InvoiceModelId = 4 + }, + new { + Id = 10, + ProductId = 16, + Quantity = (uint)1, + InvoiceModelId = 4 + }, + new { + Id = 11, + ProductId = 24, + Quantity = (uint)25, + InvoiceModelId = 4 + }, + + // invoice 5 + new { + Id = 12, + ProductId = 25, + Quantity = (uint)1, + InvoiceModelId = 5 + }, + new { + Id = 13, + ProductId = 29, + Quantity = (uint)1, + InvoiceModelId = 5 + }, + new { + Id = 14, + ProductId = 30, + Quantity = (uint)1, + InvoiceModelId = 5 + }, + new { + Id = 15, + ProductId = 15, + Quantity = (uint)2, + InvoiceModelId = 5 + }, + + // invoice 6 + new { + Id = 16, + ProductId = 20, + Quantity = (uint)4, + InvoiceModelId = 6 + }, + + // invoice 7 + new { + Id = 17, + ProductId = 1, + Quantity = (uint)1, + InvoiceModelId = 7 + }, + new { + Id = 18, + ProductId = 15, + Quantity = (uint)2, + InvoiceModelId = 7 + } + ); + #endregion + base.OnModelCreating(modelBuilder); } diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bebe.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bebe.jpg new file mode 100644 index 0000000..c15de5e Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bebe.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bebe_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bebe_thumbnail.jpg new file mode 100644 index 0000000..71ab180 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bebe_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bibi.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi.jpg new file mode 100644 index 0000000..4b31c22 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bibi_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi_thumbnail.jpg new file mode 100644 index 0000000..6399f99 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bibi_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme.jpg new file mode 100644 index 0000000..b761fea Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme_thumbnail.jpg new file mode 100644 index 0000000..61e708b Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$bonhomme_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee.jpg new file mode 100644 index 0000000..f54ab91 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee_thumbnail.jpg new file mode 100644 index 0000000..75d41bf Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$ceintureflechee_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine.jpg new file mode 100644 index 0000000..b9dddbb Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine_thumbnail.jpg new file mode 100644 index 0000000..eecb405 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$chandailquetaine_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$doudou.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou.jpg new file mode 100644 index 0000000..847a759 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$doudou_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou_thumbnail.jpg new file mode 100644 index 0000000..1004374 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$doudou_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$foulard.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard.jpg new file mode 100644 index 0000000..eb05020 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$foulard_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard_thumbnail.jpg new file mode 100644 index 0000000..3a6f6eb Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$foulard_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$gauze.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze.jpg new file mode 100644 index 0000000..50b5b0b Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$gauze_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze_thumbnail.jpg new file mode 100644 index 0000000..abb9730 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$gauze_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain.jpg new file mode 100644 index 0000000..dd994ab Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain_thumbnail.jpg new file mode 100644 index 0000000..7dcbaa5 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jeanlucmongrain_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jesus.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus.jpg new file mode 100644 index 0000000..7edb81a Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$jesus_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus_thumbnail.jpg new file mode 100644 index 0000000..0ef45c7 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$jesus_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kitbebe.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kitbebe.jpg new file mode 100644 index 0000000..dac6d2e Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kitbebe.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kitbebe_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kitbebe_thumbnail.jpg new file mode 100644 index 0000000..e5812f0 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kitbebe_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokin.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin.jpg new file mode 100644 index 0000000..35bd3b5 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokin_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin_thumbnail.jpg new file mode 100644 index 0000000..1af0d78 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokin_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme.jpg new file mode 100644 index 0000000..4e35add Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme_thumbnail.jpg new file mode 100644 index 0000000..e20d193 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$kokinfemme_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$koopa.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$koopa.jpg new file mode 100644 index 0000000..74cbd63 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$koopa.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$koopa_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$koopa_thumbnail.jpg new file mode 100644 index 0000000..f12bfc8 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$koopa_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$longmitaines.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$longmitaines.jpg new file mode 100644 index 0000000..30ee6dd Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$longmitaines.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$longmitaines_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$longmitaines_thumbnail.jpg new file mode 100644 index 0000000..15b136a Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$longmitaines_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$lorem.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$lorem.jpg new file mode 100644 index 0000000..9a54c4f Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$lorem.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$lorem_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$lorem_thumbnail.jpg new file mode 100644 index 0000000..a6c488e Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$lorem_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines.jpg new file mode 100644 index 0000000..8d3877e Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2.jpg new file mode 100644 index 0000000..a0bd7ca Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2_thumbnail.jpg new file mode 100644 index 0000000..f3abead Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines2_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines_thumbnail.jpg new file mode 100644 index 0000000..bbb65a2 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$mitaines_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$monke.png b/GrossesMitaines/GrossesMitainesAPI/Images/$monke.png new file mode 100644 index 0000000..81f1c98 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$monke.png differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$monke_thumbnail.png b/GrossesMitaines/GrossesMitainesAPI/Images/$monke_thumbnail.png new file mode 100644 index 0000000..074e1d3 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$monke_thumbnail.png differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pantalon.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$pantalon.jpg new file mode 100644 index 0000000..0825907 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pantalon.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pantalon_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$pantalon_thumbnail.jpg new file mode 100644 index 0000000..f9b3dd3 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pantalon_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH.jpg new file mode 100644 index 0000000..9560f9b Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH_thumbnail.jpg new file mode 100644 index 0000000..84d0786 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pantouflesCH_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pika.png b/GrossesMitaines/GrossesMitainesAPI/Images/$pika.png new file mode 100644 index 0000000..b45b6c4 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pika.png differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$pika_thumbnail.png b/GrossesMitaines/GrossesMitainesAPI/Images/$pika_thumbnail.png new file mode 100644 index 0000000..7030882 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$pika_thumbnail.png differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$plateau.png b/GrossesMitaines/GrossesMitainesAPI/Images/$plateau.png new file mode 100644 index 0000000..e0431aa Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$plateau.png differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$plateau_thumbnail.png b/GrossesMitaines/GrossesMitainesAPI/Images/$plateau_thumbnail.png new file mode 100644 index 0000000..c499a79 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$plateau_thumbnail.png differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$potato.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$potato.jpg new file mode 100644 index 0000000..a92020b Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$potato.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$potato_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$potato_thumbnail.jpg new file mode 100644 index 0000000..3284707 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$potato_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$saq.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$saq.jpg new file mode 100644 index 0000000..38f1f59 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$saq.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$saq_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$saq_thumbnail.jpg new file mode 100644 index 0000000..b546ba4 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$saq_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$thighs.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$thighs.jpg new file mode 100644 index 0000000..03741ee Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$thighs.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$thighs_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$thighs_thumbnail.jpg new file mode 100644 index 0000000..3cf4219 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$thighs_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt.jpg new file mode 100644 index 0000000..04c9107 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt_thumbnail.jpg new file mode 100644 index 0000000..6bb3b37 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tshirt_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tuque.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque.jpg new file mode 100644 index 0000000..4d7ef67 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$tuque_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque_thumbnail.jpg new file mode 100644 index 0000000..215fda5 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$tuque_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$uqam.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$uqam.jpg new file mode 100644 index 0000000..78f86ad Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$uqam.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$uqam_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$uqam_thumbnail.jpg new file mode 100644 index 0000000..652499f Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$uqam_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$vhs.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs.jpg new file mode 100644 index 0000000..f8c1592 Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Images/$vhs_thumbnail.jpg b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs_thumbnail.jpg new file mode 100644 index 0000000..a1ed9cd Binary files /dev/null and b/GrossesMitaines/GrossesMitainesAPI/Images/$vhs_thumbnail.jpg differ diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.Designer.cs new file mode 100644 index 0000000..33742ff --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.Designer.cs @@ -0,0 +1,799 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108003942_new seed")] + partial class newseed + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "81c3c0a1-e7f1-47ff-a08d-550563cf729b", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEIgKKr5wiFRKUkGoYTMm88Q4a0weHaJya+yZ37ql6FZBiws3UA0aLgVsl/DKWtiqTw==", + PhoneNumberConfirmed = false, + SecurityStamp = "c4cff2f9-f6a1-45ca-b43f-a2792211bfdf", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "aa9cf131-5db2-4812-b869-12adabaf5ac1", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "a1e6c5dc-1922-4d6d-9386-17636378a41a", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.cs new file mode 100644 index 0000000..f90b907 --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108003942_new seed.cs @@ -0,0 +1,295 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class newseed : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "a1e6c5dc-1922-4d6d-9386-17636378a41a"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "aa9cf131-5db2-4812-b869-12adabaf5ac1"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "81c3c0a1-e7f1-47ff-a08d-550563cf729b", "AQAAAAEAACcQAAAAEIgKKr5wiFRKUkGoYTMm88Q4a0weHaJya+yZ37ql6FZBiws3UA0aLgVsl/DKWtiqTw==", "c4cff2f9-f6a1-45ca-b43f-a2792211bfdf" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "$ceintureflechee"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "$pantouflesCH"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "$jeanlucmongrain"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "$tshirt"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "$mitaines"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "$foulard"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "$kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "$kokinfemme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "$bibi"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "$tuque"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "$bonhomme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "$gauze"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "$jesus"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "$vhs"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "$chandailquetaine"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "$doudou"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "$mitaines2"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "ea9b728b-01ce-41db-a0b8-267b641c38c8"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "9708e256-7f72-43a3-9981-3d46a496efef"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "6ecf4a66-157e-4a5c-a6ba-84c0d8df9d8f", "AQAAAAEAACcQAAAAELk80UgvLbSDu3xg805PHJkdcTaFrtU/wZOBkOdJFw9ji5gpPe6G3lTu2FF1ysj7eg==", "eb2a7531-4487-4a67-9601-adfc03a601cf" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "ceintureflechee"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "pantouflesCH"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "jeanlucmongrain"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "tshirt"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "mitaines"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "foulard"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "bibi"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "tuque"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "bonhomme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "gauze"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "jesus"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "vhs"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "chandailquetaine"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "doudou"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "mitaines2"); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.Designer.cs new file mode 100644 index 0000000..36d7dbb --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.Designer.cs @@ -0,0 +1,799 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108004541_extensionToImageNames")] + partial class extensionToImageNames + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "c4a97f53-d33a-4519-8a19-5969d3bc9bcd", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEBs7/uxC6IlFe5ejK2fO17fQZxxto/+RBqdFxDTdRQCdlLBhDsvzq06I9aEH1W4FFA==", + PhoneNumberConfirmed = false, + SecurityStamp = "f5dedfca-bbc4-423f-aae7-37670bc7294f", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee.jpg", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH.jpg", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain.jpg", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt.jpg", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines.jpg", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard.jpg", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi.jpg", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs.jpg", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine.jpg", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou.jpg", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2.jpg", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "ca8c4d2d-a900-499a-8469-99b6f0499b9d", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "7d36b38e-ae6a-457e-bfd0-62fc0c1d8fc5", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.cs new file mode 100644 index 0000000..6e60669 --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108004541_extensionToImageNames.cs @@ -0,0 +1,295 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class extensionToImageNames : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "7d36b38e-ae6a-457e-bfd0-62fc0c1d8fc5"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "ca8c4d2d-a900-499a-8469-99b6f0499b9d"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "c4a97f53-d33a-4519-8a19-5969d3bc9bcd", "AQAAAAEAACcQAAAAEBs7/uxC6IlFe5ejK2fO17fQZxxto/+RBqdFxDTdRQCdlLBhDsvzq06I9aEH1W4FFA==", "f5dedfca-bbc4-423f-aae7-37670bc7294f" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "$ceintureflechee.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "$pantouflesCH.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "$jeanlucmongrain.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "$tshirt.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "$mitaines.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "$foulard.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "$kokin.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "$kokinfemme.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "$bibi.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "$tuque.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "$bonhomme.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "$gauze.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "$jesus.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "$vhs.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "$chandailquetaine.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "$doudou.jpg"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "$mitaines2.jpg"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "a1e6c5dc-1922-4d6d-9386-17636378a41a"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "aa9cf131-5db2-4812-b869-12adabaf5ac1"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "81c3c0a1-e7f1-47ff-a08d-550563cf729b", "AQAAAAEAACcQAAAAEIgKKr5wiFRKUkGoYTMm88Q4a0weHaJya+yZ37ql6FZBiws3UA0aLgVsl/DKWtiqTw==", "c4cff2f9-f6a1-45ca-b43f-a2792211bfdf" }); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 1, + column: "ImageName", + value: "$ceintureflechee"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 2, + column: "ImageName", + value: "$pantouflesCH"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 3, + column: "ImageName", + value: "$jeanlucmongrain"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 4, + column: "ImageName", + value: "$tshirt"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 5, + column: "ImageName", + value: "$mitaines"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 6, + column: "ImageName", + value: "$foulard"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 7, + column: "ImageName", + value: "$kokin"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 8, + column: "ImageName", + value: "$kokinfemme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 9, + column: "ImageName", + value: "$bibi"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 10, + column: "ImageName", + value: "$tuque"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 11, + column: "ImageName", + value: "$bonhomme"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 12, + column: "ImageName", + value: "$gauze"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 13, + column: "ImageName", + value: "$jesus"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 14, + column: "ImageName", + value: "$vhs"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 15, + column: "ImageName", + value: "$chandailquetaine"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 16, + column: "ImageName", + value: "$doudou"); + + migrationBuilder.UpdateData( + table: "Products", + keyColumn: "Id", + keyValue: 17, + column: "ImageName", + value: "$mitaines2"); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108012813_30produits.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108012813_30produits.Designer.cs new file mode 100644 index 0000000..ef9fedc --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108012813_30produits.Designer.cs @@ -0,0 +1,981 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108012813_30produits")] + partial class _30produits + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "381655f0-b7d5-49c2-b87a-a6e8b563c8b7", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEBIJf5ELMYpuvPzwGaeS/3/QXeZZvHDGX4kA/mHpGQ0hJ8FYIFV986Y+30S75yupRg==", + PhoneNumberConfirmed = false, + SecurityStamp = "6976eccd-d011-4d96-8ceb-0aefe9454da7", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee.jpg", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH.jpg", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain.jpg", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt.jpg", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines.jpg", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard.jpg", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi.jpg", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs.jpg", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine.jpg", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou.jpg", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2.jpg", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }, + new + { + Id = 18, + Category = "Vêtements d'extérieur", + Description = "Pour avoir plus l'air thug en hiver.", + Hits = 0L, + ImageName = "$longmitaines.jpg", + Price = 10.45m, + PromoPrice = 9.99m, + Quantity = 10L, + Sales = 0L, + Status = 5, + Title = "Longues mitaines pas de doigts" + }, + new + { + Id = 19, + Category = "Linge", + Description = "Pour les journées bs", + Hits = 0L, + ImageName = "$pantalon.jpg", + Price = 69.99m, + PromoPrice = 49.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Pantalons slacks" + }, + new + { + Id = 20, + Category = "Linge", + Description = "Pour commencer à apprendre rust et utiliser linux", + Hits = 0L, + ImageName = "$thighs.jpg", + Price = 23.50m, + PromoPrice = 19.99m, + Quantity = 3L, + Sales = 0L, + Status = 4, + Title = "Programmer Socks" + }, + new + { + Id = 21, + Category = "Linge", + Description = "Show off que t'habites su'l plateau", + Hits = 0L, + ImageName = "$plateau.png", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Col-roulé" + }, + new + { + Id = 22, + Category = "Linge", + Description = "Ben oui je vais à l'UQAM comment t'as d'viné", + Hits = 0L, + ImageName = "$uqam.jpg", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 4L, + Sales = 0L, + Status = 3, + Title = "Gros col-roulé" + }, + new + { + Id = 23, + Category = "Établissement", + Description = "Oui oui, une SAQ au complete", + Hits = 0L, + ImageName = "$saq.jpg", + Price = 1000000.99m, + PromoPrice = 999999.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "SAQ" + }, + new + { + Id = 24, + Category = "Texte", + Description = "Lorem ipsum dolor sit amet, \r\nconsectetur adipiscing elit. Vivamus sapien ipsum, \r\nconvallis quis justo ac, congue sollicitudin metus. \r\nVestibulum nec libero nulla. Integer a pretium dolor. \r\nPhasellus vulputate iaculis ligula, sit amet suscipit \r\ndiam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.\r\nDuis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque\r\negestas sagittis. Etiam vitae ornare ex.", + Hits = 0L, + ImageName = "$lorem.jpg", + Price = 0.99m, + PromoPrice = 0.69m, + Quantity = 99L, + Sales = 0L, + Status = 4, + Title = "Lorem" + }, + new + { + Id = 25, + Category = "Homme", + Description = "Quand un vrai coûte trop cher", + Hits = 0L, + ImageName = "$bebe.jpg", + Price = 10.99m, + PromoPrice = 5.99m, + Quantity = 15L, + Sales = 0L, + Status = 0, + Title = "Bébé de laine" + }, + new + { + Id = 26, + Category = "Linge", + Description = "Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", + Hits = 0L, + ImageName = "$kitbebe.jpg", + Price = 39.99m, + PromoPrice = 29.99m, + Quantity = 10L, + Sales = 0L, + Status = 3, + Title = "Kit pour bébé" + }, + new + { + Id = 27, + Category = "Linge", + Description = "Chris Pratt aime ben sauter dessus", + Hits = 0L, + ImageName = "$koopa.jpg", + Price = 29.99m, + PromoPrice = 9.99m, + Quantity = 0L, + Sales = 0L, + Status = 5, + Title = "TORTUE" + }, + new + { + Id = 28, + Category = "Nourriture", + Description = "*ne pa manger", + Hits = 0L, + ImageName = "$potato.jpg", + Price = 1.99m, + PromoPrice = 0.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Patate de laine" + }, + new + { + Id = 29, + Category = "Animal", + Description = "Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.\r\n\r\nAu sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.\r\n\r\nMême s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", + Hits = 0L, + ImageName = "$monke.png", + Price = 299.99m, + PromoPrice = 99.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Monke :)" + }, + new + { + Id = 30, + Category = "Pokemon", + Description = "It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.\r\n\r\nIn Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.\r\n\r\nPikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.\r\n\r\nIn Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.\r\n\r\nPikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.\r\n\r\nIt is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.\r\n\r\nPikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", + Hits = 0L, + ImageName = "$pika.png", + Price = 3.99m, + PromoPrice = 2.99m, + Quantity = 69L, + Sales = 0L, + Status = 5, + Title = "Phat Pikachu" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "d78f5f64-28da-4a3e-b3e9-807d96ba6757", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "1c7a32ec-3bac-416a-9092-e8617bf63da4", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108012813_30produits.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108012813_30produits.cs new file mode 100644 index 0000000..dbdf55f --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108012813_30produits.cs @@ -0,0 +1,142 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class _30produits : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "1c7a32ec-3bac-416a-9092-e8617bf63da4"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "d78f5f64-28da-4a3e-b3e9-807d96ba6757"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "381655f0-b7d5-49c2-b87a-a6e8b563c8b7", "AQAAAAEAACcQAAAAEBIJf5ELMYpuvPzwGaeS/3/QXeZZvHDGX4kA/mHpGQ0hJ8FYIFV986Y+30S75yupRg==", "6976eccd-d011-4d96-8ceb-0aefe9454da7" }); + + migrationBuilder.InsertData( + table: "Products", + columns: new[] { "Id", "Category", "Description", "Hits", "ImageName", "LastHit", "LastSale", "Price", "PromoPrice", "Quantity", "Sales", "Status", "Title" }, + values: new object[,] + { + { 18, "Vêtements d'extérieur", "Pour avoir plus l'air thug en hiver.", 0L, "$longmitaines.jpg", null, null, 10.45m, 9.99m, 10L, 0L, 5, "Longues mitaines pas de doigts" }, + { 19, "Linge", "Pour les journées bs", 0L, "$pantalon.jpg", null, null, 69.99m, 49.99m, 0L, 0L, 1, "Pantalons slacks" }, + { 20, "Linge", "Pour commencer à apprendre rust et utiliser linux", 0L, "$thighs.jpg", null, null, 23.50m, 19.99m, 3L, 0L, 4, "Programmer Socks" }, + { 21, "Linge", "Show off que t'habites su'l plateau", 0L, "$plateau.png", null, null, 149.99m, 99.99m, 14L, 0L, 0, "Col-roulé" }, + { 22, "Linge", "Ben oui je vais à l'UQAM comment t'as d'viné", 0L, "$uqam.jpg", null, null, 149.99m, 99.99m, 4L, 0L, 3, "Gros col-roulé" }, + { 23, "Établissement", "Oui oui, une SAQ au complete", 0L, "$saq.jpg", null, null, 1000000.99m, 999999.99m, 1L, 0L, 0, "SAQ" }, + { 24, "Texte", "Lorem ipsum dolor sit amet, \r\nconsectetur adipiscing elit. Vivamus sapien ipsum, \r\nconvallis quis justo ac, congue sollicitudin metus. \r\nVestibulum nec libero nulla. Integer a pretium dolor. \r\nPhasellus vulputate iaculis ligula, sit amet suscipit \r\ndiam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.\r\nDuis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque\r\negestas sagittis. Etiam vitae ornare ex.", 0L, "$lorem.jpg", null, null, 0.99m, 0.69m, 99L, 0L, 4, "Lorem" }, + { 25, "Homme", "Quand un vrai coûte trop cher", 0L, "$bebe.jpg", null, null, 10.99m, 5.99m, 15L, 0L, 0, "Bébé de laine" }, + { 26, "Linge", "Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", 0L, "$kitbebe.jpg", null, null, 39.99m, 29.99m, 10L, 0L, 3, "Kit pour bébé" }, + { 27, "Linge", "Chris Pratt aime ben sauter dessus", 0L, "$koopa.jpg", null, null, 29.99m, 9.99m, 0L, 0L, 5, "TORTUE" }, + { 28, "Nourriture", "*ne pa manger", 0L, "$potato.jpg", null, null, 1.99m, 0.99m, 58L, 0L, 0, "Patate de laine" }, + { 29, "Animal", "Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.\r\n\r\nAu sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.\r\n\r\nMême s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", 0L, "$monke.png", null, null, 299.99m, 99.99m, 58L, 0L, 0, "Monke :)" }, + { 30, "Pokemon", "It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.\r\n\r\nIn Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.\r\n\r\nPikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.\r\n\r\nIn Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.\r\n\r\nPikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.\r\n\r\nIt is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.\r\n\r\nPikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", 0L, "$pika.png", null, null, 3.99m, 2.99m, 69L, 0L, 5, "Phat Pikachu" } + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 18); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 19); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 20); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 21); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 22); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 23); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 24); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 25); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 26); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 27); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 28); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 29); + + migrationBuilder.DeleteData( + table: "Products", + keyColumn: "Id", + keyValue: 30); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "7d36b38e-ae6a-457e-bfd0-62fc0c1d8fc5"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "ca8c4d2d-a900-499a-8469-99b6f0499b9d"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "c4a97f53-d33a-4519-8a19-5969d3bc9bcd", "AQAAAAEAACcQAAAAEBs7/uxC6IlFe5ejK2fO17fQZxxto/+RBqdFxDTdRQCdlLBhDsvzq06I9aEH1W4FFA==", "f5dedfca-bbc4-423f-aae7-37670bc7294f" }); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108022705_address.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108022705_address.Designer.cs new file mode 100644 index 0000000..cf1967e --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108022705_address.Designer.cs @@ -0,0 +1,995 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108022705_address")] + partial class address + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "037567cb-829a-4e64-aeff-77f9c18425b5", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEE/NtmY1fEUixw6DTC/uv+7yv+2Na/85xzU7pJgB5Ll7UZUmcUZxuVLcgYkb9sKPOA==", + PhoneNumberConfirmed = false, + SecurityStamp = "a39900db-f0c6-4a7c-9cee-d8f454dd2516", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + + b.HasData( + new + { + Id = 1, + Appartment = "B", + City = "Saint-Chrysostome", + CivicNumber = 1234, + Country = "Canada", + InventoryUserId = "ecf7503a-591c-454e-a824-048e10bd0474", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue Pierre-Falardeau" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee.jpg", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH.jpg", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain.jpg", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt.jpg", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines.jpg", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard.jpg", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi.jpg", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs.jpg", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine.jpg", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou.jpg", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2.jpg", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }, + new + { + Id = 18, + Category = "Vêtements d'extérieur", + Description = "Pour avoir plus l'air thug en hiver.", + Hits = 0L, + ImageName = "$longmitaines.jpg", + Price = 10.45m, + PromoPrice = 9.99m, + Quantity = 10L, + Sales = 0L, + Status = 5, + Title = "Longues mitaines pas de doigts" + }, + new + { + Id = 19, + Category = "Linge", + Description = "Pour les journées bs", + Hits = 0L, + ImageName = "$pantalon.jpg", + Price = 69.99m, + PromoPrice = 49.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Pantalons slacks" + }, + new + { + Id = 20, + Category = "Linge", + Description = "Pour commencer à apprendre rust et utiliser linux", + Hits = 0L, + ImageName = "$thighs.jpg", + Price = 23.50m, + PromoPrice = 19.99m, + Quantity = 3L, + Sales = 0L, + Status = 4, + Title = "Programmer Socks" + }, + new + { + Id = 21, + Category = "Linge", + Description = "Show off que t'habites su'l plateau", + Hits = 0L, + ImageName = "$plateau.png", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Col-roulé" + }, + new + { + Id = 22, + Category = "Linge", + Description = "Ben oui je vais à l'UQAM comment t'as d'viné", + Hits = 0L, + ImageName = "$uqam.jpg", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 4L, + Sales = 0L, + Status = 3, + Title = "Gros col-roulé" + }, + new + { + Id = 23, + Category = "Établissement", + Description = "Oui oui, une SAQ au complete", + Hits = 0L, + ImageName = "$saq.jpg", + Price = 1000000.99m, + PromoPrice = 999999.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "SAQ" + }, + new + { + Id = 24, + Category = "Texte", + Description = "Lorem ipsum dolor sit amet, \r\nconsectetur adipiscing elit. Vivamus sapien ipsum, \r\nconvallis quis justo ac, congue sollicitudin metus. \r\nVestibulum nec libero nulla. Integer a pretium dolor. \r\nPhasellus vulputate iaculis ligula, sit amet suscipit \r\ndiam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.\r\nDuis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque\r\negestas sagittis. Etiam vitae ornare ex.", + Hits = 0L, + ImageName = "$lorem.jpg", + Price = 0.99m, + PromoPrice = 0.69m, + Quantity = 99L, + Sales = 0L, + Status = 4, + Title = "Lorem" + }, + new + { + Id = 25, + Category = "Homme", + Description = "Quand un vrai coûte trop cher", + Hits = 0L, + ImageName = "$bebe.jpg", + Price = 10.99m, + PromoPrice = 5.99m, + Quantity = 15L, + Sales = 0L, + Status = 0, + Title = "Bébé de laine" + }, + new + { + Id = 26, + Category = "Linge", + Description = "Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", + Hits = 0L, + ImageName = "$kitbebe.jpg", + Price = 39.99m, + PromoPrice = 29.99m, + Quantity = 10L, + Sales = 0L, + Status = 3, + Title = "Kit pour bébé" + }, + new + { + Id = 27, + Category = "Linge", + Description = "Chris Pratt aime ben sauter dessus", + Hits = 0L, + ImageName = "$koopa.jpg", + Price = 29.99m, + PromoPrice = 9.99m, + Quantity = 0L, + Sales = 0L, + Status = 5, + Title = "TORTUE" + }, + new + { + Id = 28, + Category = "Nourriture", + Description = "*ne pa manger", + Hits = 0L, + ImageName = "$potato.jpg", + Price = 1.99m, + PromoPrice = 0.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Patate de laine" + }, + new + { + Id = 29, + Category = "Animal", + Description = "Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.\r\n\r\nAu sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.\r\n\r\nMême s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", + Hits = 0L, + ImageName = "$monke.png", + Price = 299.99m, + PromoPrice = 99.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Monke :)" + }, + new + { + Id = 30, + Category = "Pokemon", + Description = "It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.\r\n\r\nIn Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.\r\n\r\nPikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.\r\n\r\nIn Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.\r\n\r\nPikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.\r\n\r\nIt is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.\r\n\r\nPikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", + Hits = 0L, + ImageName = "$pika.png", + Price = 3.99m, + PromoPrice = 2.99m, + Quantity = 69L, + Sales = 0L, + Status = 5, + Title = "Phat Pikachu" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "0c71a591-3978-4682-b1d9-50f1940c0c18", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "7ee11485-e950-4e5f-bcc3-93d087323121", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108022705_address.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108022705_address.cs new file mode 100644 index 0000000..225795c --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108022705_address.cs @@ -0,0 +1,67 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class address : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "Addresses", + columns: new[] { "Id", "Appartment", "City", "CivicNumber", "Country", "InventoryUserId", "PostalCode", "Province", "Street" }, + values: new object[] { 1, "B", "Saint-Chrysostome", 1234, "Canada", "ecf7503a-591c-454e-a824-048e10bd0474", "H0H0H0", "QC", "Rue Pierre-Falardeau" }); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "7ee11485-e950-4e5f-bcc3-93d087323121"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "0c71a591-3978-4682-b1d9-50f1940c0c18"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "037567cb-829a-4e64-aeff-77f9c18425b5", "AQAAAAEAACcQAAAAEE/NtmY1fEUixw6DTC/uv+7yv+2Na/85xzU7pJgB5Ll7UZUmcUZxuVLcgYkb9sKPOA==", "a39900db-f0c6-4a7c-9cee-d8f454dd2516" }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "Addresses", + keyColumn: "Id", + keyValue: 1); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "1c7a32ec-3bac-416a-9092-e8617bf63da4"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "d78f5f64-28da-4a3e-b3e9-807d96ba6757"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "381655f0-b7d5-49c2-b87a-a6e8b563c8b7", "AQAAAAEAACcQAAAAEBIJf5ELMYpuvPzwGaeS/3/QXeZZvHDGX4kA/mHpGQ0hJ8FYIFV986Y+30S75yupRg==", "6976eccd-d011-4d96-8ceb-0aefe9454da7" }); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108030828_invoices.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108030828_invoices.Designer.cs new file mode 100644 index 0000000..50c7f1a --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108030828_invoices.Designer.cs @@ -0,0 +1,1164 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108030828_invoices")] + partial class invoices + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "55f4780c-49dd-44ea-b566-30d058c0005b", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEK/n6j8ui+ZivXKUi2Lv6Jr7wXBJQdOdXawkvVDBlr4Rnxc7DxsuWwaaX5vN3YSjmQ==", + PhoneNumberConfirmed = false, + SecurityStamp = "e3f2e569-fb52-49af-b9bc-10bf8df2b778", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + + b.HasData( + new + { + Id = 1, + Appartment = "B", + City = "Saint-Chrysostome", + CivicNumber = 1234, + Country = "Canada", + InventoryUserId = "ecf7503a-591c-454e-a824-048e10bd0474", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue Pierre-Falardeau" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + + b.HasData( + new + { + Id = 1, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1206), + ShippingAddressId = 1, + Status = 0 + }, + new + { + Id = 2, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1244), + ShippingAddressId = 1, + Status = 1 + }, + new + { + Id = 3, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1247), + ShippingAddressId = 1, + Status = 3 + }, + new + { + Id = 4, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1249), + ShippingAddressId = 1, + Status = 4 + }, + new + { + Id = 5, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1251), + ShippingAddressId = 1, + Status = 5 + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + + b.HasData( + new + { + Id = 1, + InvoiceModelId = 1, + ProductId = 1, + Quantity = 2L + }, + new + { + Id = 2, + InvoiceModelId = 1, + ProductId = 4, + Quantity = 5L + }, + new + { + Id = 3, + InvoiceModelId = 2, + ProductId = 3, + Quantity = 1L + }, + new + { + Id = 4, + InvoiceModelId = 2, + ProductId = 5, + Quantity = 2L + }, + new + { + Id = 5, + InvoiceModelId = 2, + ProductId = 7, + Quantity = 1L + }, + new + { + Id = 6, + InvoiceModelId = 3, + ProductId = 9, + Quantity = 1L + }, + new + { + Id = 7, + InvoiceModelId = 3, + ProductId = 11, + Quantity = 1L + }, + new + { + Id = 8, + InvoiceModelId = 4, + ProductId = 14, + Quantity = 1L + }, + new + { + Id = 9, + InvoiceModelId = 4, + ProductId = 13, + Quantity = 1L + }, + new + { + Id = 10, + InvoiceModelId = 4, + ProductId = 16, + Quantity = 1L + }, + new + { + Id = 11, + InvoiceModelId = 4, + ProductId = 24, + Quantity = 25L + }, + new + { + Id = 12, + InvoiceModelId = 5, + ProductId = 25, + Quantity = 1L + }, + new + { + Id = 13, + InvoiceModelId = 5, + ProductId = 29, + Quantity = 1L + }, + new + { + Id = 14, + InvoiceModelId = 5, + ProductId = 30, + Quantity = 1L + }, + new + { + Id = 15, + InvoiceModelId = 5, + ProductId = 15, + Quantity = 2L + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee.jpg", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH.jpg", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain.jpg", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt.jpg", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines.jpg", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard.jpg", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi.jpg", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs.jpg", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine.jpg", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou.jpg", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2.jpg", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }, + new + { + Id = 18, + Category = "Vêtements d'extérieur", + Description = "Pour avoir plus l'air thug en hiver.", + Hits = 0L, + ImageName = "$longmitaines.jpg", + Price = 10.45m, + PromoPrice = 9.99m, + Quantity = 10L, + Sales = 0L, + Status = 5, + Title = "Longues mitaines pas de doigts" + }, + new + { + Id = 19, + Category = "Linge", + Description = "Pour les journées bs", + Hits = 0L, + ImageName = "$pantalon.jpg", + Price = 69.99m, + PromoPrice = 49.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Pantalons slacks" + }, + new + { + Id = 20, + Category = "Linge", + Description = "Pour commencer à apprendre rust et utiliser linux", + Hits = 0L, + ImageName = "$thighs.jpg", + Price = 23.50m, + PromoPrice = 19.99m, + Quantity = 3L, + Sales = 0L, + Status = 4, + Title = "Programmer Socks" + }, + new + { + Id = 21, + Category = "Linge", + Description = "Show off que t'habites su'l plateau", + Hits = 0L, + ImageName = "$plateau.png", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Col-roulé" + }, + new + { + Id = 22, + Category = "Linge", + Description = "Ben oui je vais à l'UQAM comment t'as d'viné", + Hits = 0L, + ImageName = "$uqam.jpg", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 4L, + Sales = 0L, + Status = 3, + Title = "Gros col-roulé" + }, + new + { + Id = 23, + Category = "Établissement", + Description = "Oui oui, une SAQ au complete", + Hits = 0L, + ImageName = "$saq.jpg", + Price = 1000000.99m, + PromoPrice = 999999.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "SAQ" + }, + new + { + Id = 24, + Category = "Texte", + Description = "Lorem ipsum dolor sit amet, \r\nconsectetur adipiscing elit. Vivamus sapien ipsum, \r\nconvallis quis justo ac, congue sollicitudin metus. \r\nVestibulum nec libero nulla. Integer a pretium dolor. \r\nPhasellus vulputate iaculis ligula, sit amet suscipit \r\ndiam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.\r\nDuis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque\r\negestas sagittis. Etiam vitae ornare ex.", + Hits = 0L, + ImageName = "$lorem.jpg", + Price = 0.99m, + PromoPrice = 0.69m, + Quantity = 99L, + Sales = 0L, + Status = 4, + Title = "Lorem" + }, + new + { + Id = 25, + Category = "Homme", + Description = "Quand un vrai coûte trop cher", + Hits = 0L, + ImageName = "$bebe.jpg", + Price = 10.99m, + PromoPrice = 5.99m, + Quantity = 15L, + Sales = 0L, + Status = 0, + Title = "Bébé de laine" + }, + new + { + Id = 26, + Category = "Linge", + Description = "Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", + Hits = 0L, + ImageName = "$kitbebe.jpg", + Price = 39.99m, + PromoPrice = 29.99m, + Quantity = 10L, + Sales = 0L, + Status = 3, + Title = "Kit pour bébé" + }, + new + { + Id = 27, + Category = "Linge", + Description = "Chris Pratt aime ben sauter dessus", + Hits = 0L, + ImageName = "$koopa.jpg", + Price = 29.99m, + PromoPrice = 9.99m, + Quantity = 0L, + Sales = 0L, + Status = 5, + Title = "TORTUE" + }, + new + { + Id = 28, + Category = "Nourriture", + Description = "*ne pa manger", + Hits = 0L, + ImageName = "$potato.jpg", + Price = 1.99m, + PromoPrice = 0.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Patate de laine" + }, + new + { + Id = 29, + Category = "Animal", + Description = "Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.\r\n\r\nAu sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.\r\n\r\nMême s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", + Hits = 0L, + ImageName = "$monke.png", + Price = 299.99m, + PromoPrice = 99.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Monke :)" + }, + new + { + Id = 30, + Category = "Pokemon", + Description = "It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.\r\n\r\nIn Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.\r\n\r\nPikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.\r\n\r\nIn Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.\r\n\r\nPikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.\r\n\r\nIt is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.\r\n\r\nPikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", + Hits = 0L, + ImageName = "$pika.png", + Price = 3.99m, + PromoPrice = 2.99m, + Quantity = 69L, + Sales = 0L, + Status = 5, + Title = "Phat Pikachu" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "3b41186e-cc4b-49c0-b172-4c2b9be614d2", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "664e61a9-f77d-46ee-805c-98084e8b2fcb", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108030828_invoices.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108030828_invoices.cs new file mode 100644 index 0000000..b270c2e --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108030828_invoices.cs @@ -0,0 +1,192 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class invoices : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "664e61a9-f77d-46ee-805c-98084e8b2fcb"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "3b41186e-cc4b-49c0-b172-4c2b9be614d2"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "55f4780c-49dd-44ea-b566-30d058c0005b", "AQAAAAEAACcQAAAAEK/n6j8ui+ZivXKUi2Lv6Jr7wXBJQdOdXawkvVDBlr4Rnxc7DxsuWwaaX5vN3YSjmQ==", "e3f2e569-fb52-49af-b9bc-10bf8df2b778" }); + + migrationBuilder.InsertData( + table: "Invoices", + columns: new[] { "Id", "EmailAddress", "FirstName", "LastName", "LinkedAccountId", "PhoneNumber", "PurchaseDate", "ShippingAddressId", "Status" }, + values: new object[,] + { + { 1, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", "111-111-1111", new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1206), 1, 0 }, + { 2, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", "111-111-1111", new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1244), 1, 1 }, + { 3, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", "111-111-1111", new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1247), 1, 3 }, + { 4, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", "111-111-1111", new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1249), 1, 4 }, + { 5, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", "111-111-1111", new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1251), 1, 5 } + }); + + migrationBuilder.InsertData( + table: "ProductInvoice", + columns: new[] { "Id", "InvoiceModelId", "ProductId", "Quantity" }, + values: new object[,] + { + { 1, 1, 1, 2L }, + { 2, 1, 4, 5L }, + { 3, 2, 3, 1L }, + { 4, 2, 5, 2L }, + { 5, 2, 7, 1L }, + { 6, 3, 9, 1L }, + { 7, 3, 11, 1L }, + { 8, 4, 14, 1L }, + { 9, 4, 13, 1L }, + { 10, 4, 16, 1L }, + { 11, 4, 24, 25L }, + { 12, 5, 25, 1L }, + { 13, 5, 29, 1L }, + { 14, 5, 30, 1L }, + { 15, 5, 15, 2L } + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 1); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 2); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 4); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 5); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 6); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 7); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 8); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 9); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 10); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 11); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 12); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 13); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 14); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 15); + + migrationBuilder.DeleteData( + table: "Invoices", + keyColumn: "Id", + keyValue: 1); + + migrationBuilder.DeleteData( + table: "Invoices", + keyColumn: "Id", + keyValue: 2); + + migrationBuilder.DeleteData( + table: "Invoices", + keyColumn: "Id", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "Invoices", + keyColumn: "Id", + keyValue: 4); + + migrationBuilder.DeleteData( + table: "Invoices", + keyColumn: "Id", + keyValue: 5); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "7ee11485-e950-4e5f-bcc3-93d087323121"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "0c71a591-3978-4682-b1d9-50f1940c0c18"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "037567cb-829a-4e64-aeff-77f9c18425b5", "AQAAAAEAACcQAAAAEE/NtmY1fEUixw6DTC/uv+7yv+2Na/85xzU7pJgB5Ll7UZUmcUZxuVLcgYkb9sKPOA==", "a39900db-f0c6-4a7c-9cee-d8f454dd2516" }); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108033526_nonUserInvoice.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108033526_nonUserInvoice.Designer.cs new file mode 100644 index 0000000..00b5826 --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108033526_nonUserInvoice.Designer.cs @@ -0,0 +1,1192 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108033526_nonUserInvoice")] + partial class nonUserInvoice + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "af3a641d-8fe8-45c3-8e36-fdfbef10659a", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEL/k0+c61dX1YPgqHrr6wmVSZNJzoqveJzr8IxjVSSL3W+GSsqOXft+hVLXozCnqVg==", + PhoneNumberConfirmed = false, + SecurityStamp = "8ac35276-f8dc-4de4-826f-ea2996e09f2c", + TwoFactorEnabled = false, + UserName = "Admin" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + + b.HasData( + new + { + Id = 1, + Appartment = "B", + City = "Saint-Chrysostome", + CivicNumber = 1234, + Country = "Canada", + InventoryUserId = "ecf7503a-591c-454e-a824-048e10bd0474", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue Pierre-Falardeau" + }, + new + { + Id = 2, + City = "Saint-Jérôme", + CivicNumber = 420, + Country = "Canada", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue MikeWard" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + + b.HasData( + new + { + Id = 1, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6619), + ShippingAddressId = 1, + Status = 0 + }, + new + { + Id = 2, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6655), + ShippingAddressId = 1, + Status = 1 + }, + new + { + Id = 3, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6658), + ShippingAddressId = 1, + Status = 3 + }, + new + { + Id = 4, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6659), + ShippingAddressId = 1, + Status = 4 + }, + new + { + Id = 5, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6661), + ShippingAddressId = 1, + Status = 5 + }, + new + { + Id = 6, + EmailAddress = "test@admin.com", + FirstName = "Jérémy", + LastName = "Le Petit", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6663), + ShippingAddressId = 2, + Status = 0 + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + + b.HasData( + new + { + Id = 1, + InvoiceModelId = 1, + ProductId = 1, + Quantity = 2L + }, + new + { + Id = 2, + InvoiceModelId = 1, + ProductId = 4, + Quantity = 5L + }, + new + { + Id = 3, + InvoiceModelId = 2, + ProductId = 3, + Quantity = 1L + }, + new + { + Id = 4, + InvoiceModelId = 2, + ProductId = 5, + Quantity = 2L + }, + new + { + Id = 5, + InvoiceModelId = 2, + ProductId = 7, + Quantity = 1L + }, + new + { + Id = 6, + InvoiceModelId = 3, + ProductId = 9, + Quantity = 1L + }, + new + { + Id = 7, + InvoiceModelId = 3, + ProductId = 11, + Quantity = 1L + }, + new + { + Id = 8, + InvoiceModelId = 4, + ProductId = 14, + Quantity = 1L + }, + new + { + Id = 9, + InvoiceModelId = 4, + ProductId = 13, + Quantity = 1L + }, + new + { + Id = 10, + InvoiceModelId = 4, + ProductId = 16, + Quantity = 1L + }, + new + { + Id = 11, + InvoiceModelId = 4, + ProductId = 24, + Quantity = 25L + }, + new + { + Id = 12, + InvoiceModelId = 5, + ProductId = 25, + Quantity = 1L + }, + new + { + Id = 13, + InvoiceModelId = 5, + ProductId = 29, + Quantity = 1L + }, + new + { + Id = 14, + InvoiceModelId = 5, + ProductId = 30, + Quantity = 1L + }, + new + { + Id = 15, + InvoiceModelId = 5, + ProductId = 15, + Quantity = 2L + }, + new + { + Id = 16, + InvoiceModelId = 6, + ProductId = 20, + Quantity = 4L + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee.jpg", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH.jpg", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain.jpg", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt.jpg", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines.jpg", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard.jpg", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi.jpg", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs.jpg", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine.jpg", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou.jpg", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2.jpg", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }, + new + { + Id = 18, + Category = "Vêtements d'extérieur", + Description = "Pour avoir plus l'air thug en hiver.", + Hits = 0L, + ImageName = "$longmitaines.jpg", + Price = 10.45m, + PromoPrice = 9.99m, + Quantity = 10L, + Sales = 0L, + Status = 5, + Title = "Longues mitaines pas de doigts" + }, + new + { + Id = 19, + Category = "Linge", + Description = "Pour les journées bs", + Hits = 0L, + ImageName = "$pantalon.jpg", + Price = 69.99m, + PromoPrice = 49.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Pantalons slacks" + }, + new + { + Id = 20, + Category = "Linge", + Description = "Pour commencer à apprendre rust et utiliser linux", + Hits = 0L, + ImageName = "$thighs.jpg", + Price = 23.50m, + PromoPrice = 19.99m, + Quantity = 3L, + Sales = 0L, + Status = 4, + Title = "Programmer Socks" + }, + new + { + Id = 21, + Category = "Linge", + Description = "Show off que t'habites su'l plateau", + Hits = 0L, + ImageName = "$plateau.png", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Col-roulé" + }, + new + { + Id = 22, + Category = "Linge", + Description = "Ben oui je vais à l'UQAM comment t'as d'viné", + Hits = 0L, + ImageName = "$uqam.jpg", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 4L, + Sales = 0L, + Status = 3, + Title = "Gros col-roulé" + }, + new + { + Id = 23, + Category = "Établissement", + Description = "Oui oui, une SAQ au complete", + Hits = 0L, + ImageName = "$saq.jpg", + Price = 1000000.99m, + PromoPrice = 999999.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "SAQ" + }, + new + { + Id = 24, + Category = "Texte", + Description = "Lorem ipsum dolor sit amet, \r\nconsectetur adipiscing elit. Vivamus sapien ipsum, \r\nconvallis quis justo ac, congue sollicitudin metus. \r\nVestibulum nec libero nulla. Integer a pretium dolor. \r\nPhasellus vulputate iaculis ligula, sit amet suscipit \r\ndiam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.\r\nDuis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque\r\negestas sagittis. Etiam vitae ornare ex.", + Hits = 0L, + ImageName = "$lorem.jpg", + Price = 0.99m, + PromoPrice = 0.69m, + Quantity = 99L, + Sales = 0L, + Status = 4, + Title = "Lorem" + }, + new + { + Id = 25, + Category = "Homme", + Description = "Quand un vrai coûte trop cher", + Hits = 0L, + ImageName = "$bebe.jpg", + Price = 10.99m, + PromoPrice = 5.99m, + Quantity = 15L, + Sales = 0L, + Status = 0, + Title = "Bébé de laine" + }, + new + { + Id = 26, + Category = "Linge", + Description = "Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", + Hits = 0L, + ImageName = "$kitbebe.jpg", + Price = 39.99m, + PromoPrice = 29.99m, + Quantity = 10L, + Sales = 0L, + Status = 3, + Title = "Kit pour bébé" + }, + new + { + Id = 27, + Category = "Linge", + Description = "Chris Pratt aime ben sauter dessus", + Hits = 0L, + ImageName = "$koopa.jpg", + Price = 29.99m, + PromoPrice = 9.99m, + Quantity = 0L, + Sales = 0L, + Status = 5, + Title = "TORTUE" + }, + new + { + Id = 28, + Category = "Nourriture", + Description = "*ne pa manger", + Hits = 0L, + ImageName = "$potato.jpg", + Price = 1.99m, + PromoPrice = 0.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Patate de laine" + }, + new + { + Id = 29, + Category = "Animal", + Description = "Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.\r\n\r\nAu sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.\r\n\r\nMême s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", + Hits = 0L, + ImageName = "$monke.png", + Price = 299.99m, + PromoPrice = 99.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Monke :)" + }, + new + { + Id = 30, + Category = "Pokemon", + Description = "It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.\r\n\r\nIn Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.\r\n\r\nPikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.\r\n\r\nIn Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.\r\n\r\nPikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.\r\n\r\nIt is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.\r\n\r\nPikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", + Hits = 0L, + ImageName = "$pika.png", + Price = 3.99m, + PromoPrice = 2.99m, + Quantity = 69L, + Sales = 0L, + Status = 5, + Title = "Phat Pikachu" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "e5b77c04-830f-4c19-ad44-6c9e5a508efb", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "8b05058e-1c97-4021-a485-6987e774c877", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108033526_nonUserInvoice.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108033526_nonUserInvoice.cs new file mode 100644 index 0000000..19fad20 --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108033526_nonUserInvoice.cs @@ -0,0 +1,158 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class nonUserInvoice : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.InsertData( + table: "Addresses", + columns: new[] { "Id", "Appartment", "City", "CivicNumber", "Country", "InventoryUserId", "PostalCode", "Province", "Street" }, + values: new object[] { 2, null, "Saint-Jérôme", 420, "Canada", null, "H0H0H0", "QC", "Rue MikeWard" }); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "8b05058e-1c97-4021-a485-6987e774c877"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "e5b77c04-830f-4c19-ad44-6c9e5a508efb"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "af3a641d-8fe8-45c3-8e36-fdfbef10659a", "AQAAAAEAACcQAAAAEL/k0+c61dX1YPgqHrr6wmVSZNJzoqveJzr8IxjVSSL3W+GSsqOXft+hVLXozCnqVg==", "8ac35276-f8dc-4de4-826f-ea2996e09f2c" }); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 1, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6619)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 2, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6655)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 3, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6658)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 4, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6659)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 5, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6661)); + + migrationBuilder.InsertData( + table: "Invoices", + columns: new[] { "Id", "EmailAddress", "FirstName", "LastName", "LinkedAccountId", "PhoneNumber", "PurchaseDate", "ShippingAddressId", "Status" }, + values: new object[] { 6, "test@admin.com", "Jérémy", "Le Petit", null, "111-111-1111", new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6663), 2, 0 }); + + migrationBuilder.InsertData( + table: "ProductInvoice", + columns: new[] { "Id", "InvoiceModelId", "ProductId", "Quantity" }, + values: new object[] { 16, 6, 20, 4L }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 16); + + migrationBuilder.DeleteData( + table: "Invoices", + keyColumn: "Id", + keyValue: 6); + + migrationBuilder.DeleteData( + table: "Addresses", + keyColumn: "Id", + keyValue: 2); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "664e61a9-f77d-46ee-805c-98084e8b2fcb"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "3b41186e-cc4b-49c0-b172-4c2b9be614d2"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "55f4780c-49dd-44ea-b566-30d058c0005b", "AQAAAAEAACcQAAAAEK/n6j8ui+ZivXKUi2Lv6Jr7wXBJQdOdXawkvVDBlr4Rnxc7DxsuWwaaX5vN3YSjmQ==", "e3f2e569-fb52-49af-b9bc-10bf8df2b778" }); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 1, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1206)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 2, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1244)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 3, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1247)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 4, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1249)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 5, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 8, 27, 792, DateTimeKind.Local).AddTicks(1251)); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108034952_invoiceClient.Designer.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108034952_invoiceClient.Designer.cs new file mode 100644 index 0000000..493c24a --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108034952_invoiceClient.Designer.cs @@ -0,0 +1,1253 @@ +// +using System; +using GrossesMitainesAPI.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + [DbContext(typeof(InventoryContext))] + [Migration("20221108034952_invoiceClient")] + partial class invoiceClient + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LockoutEnabled") + .HasColumnType("bit"); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PasswordHash") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumber") + .HasColumnType("nvarchar(max)"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("bit"); + + b.Property("SecurityStamp") + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorEnabled") + .HasColumnType("bit"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex") + .HasFilter("[NormalizedUserName] IS NOT NULL"); + + b.ToTable("AspNetUsers", (string)null); + + b.HasData( + new + { + Id = "ecf7503a-591c-454e-a824-048e10bd0474", + AccessFailedCount = 0, + ConcurrencyStamp = "d6f87641-e92e-44f6-a26c-3539ccc0b374", + Email = "admin@admin.com", + EmailConfirmed = false, + FirstName = "Roger", + LastName = "Admin", + LockoutEnabled = false, + NormalizedEmail = "ADMIN@ADMIN.COM", + NormalizedUserName = "ADMIN", + PasswordHash = "AQAAAAEAACcQAAAAEGleiGV7pLvmGVcR9JU/Yc8Oo/+8CGFU2ZDvWJnonvm5/XbCOHsIwWHvAB3GCpiZJA==", + PhoneNumberConfirmed = false, + SecurityStamp = "719b228c-6b86-4193-b994-365aaf1d19fc", + TwoFactorEnabled = false, + UserName = "Admin" + }, + new + { + Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + AccessFailedCount = 0, + ConcurrencyStamp = "989931b3-2a7b-44db-8e22-308d2270442c", + Email = "paul@exemple.com", + EmailConfirmed = false, + FirstName = "Paul", + LastName = "A.", + LockoutEnabled = false, + NormalizedEmail = "PAUL@EXEMPLE.COM", + NormalizedUserName = "PASLA", + PasswordHash = "AQAAAAEAACcQAAAAEPffpp6X7ztCzWieTbiRInK5P/1AZx6Pdy1tUbTQS5GXLWGcZzhqlzaB8QGlwkJzDw==", + PhoneNumberConfirmed = false, + SecurityStamp = "6bbc335f-1307-40eb-8533-694a608937de", + TwoFactorEnabled = false, + UserName = "PasLa" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Appartment") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("CivicNumber") + .HasColumnType("int"); + + b.Property("Country") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("InventoryUserId") + .HasColumnType("nvarchar(450)"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Province") + .IsRequired() + .HasMaxLength(3) + .HasColumnType("nvarchar(3)"); + + b.Property("Street") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("InventoryUserId"); + + b.ToTable("Addresses"); + + b.HasData( + new + { + Id = 1, + Appartment = "B", + City = "Saint-Chrysostome", + CivicNumber = 1234, + Country = "Canada", + InventoryUserId = "ecf7503a-591c-454e-a824-048e10bd0474", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue Pierre-Falardeau" + }, + new + { + Id = 2, + City = "Saint-Jérôme", + CivicNumber = 420, + Country = "Canada", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue MikeWard" + }, + new + { + Id = 3, + Appartment = "A", + City = "Saint-Québec", + CivicNumber = 69, + Country = "Canada", + InventoryUserId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue PSPP" + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("EmailAddress") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("nvarchar(30)"); + + b.Property("LinkedAccountId") + .HasColumnType("nvarchar(450)"); + + b.Property("PhoneNumber") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PurchaseDate") + .HasColumnType("datetime2"); + + b.Property("ShippingAddressId") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("LinkedAccountId"); + + b.HasIndex("ShippingAddressId"); + + b.ToTable("Invoices"); + + b.HasData( + new + { + Id = 1, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9693), + ShippingAddressId = 1, + Status = 0 + }, + new + { + Id = 2, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9731), + ShippingAddressId = 1, + Status = 1 + }, + new + { + Id = 3, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9733), + ShippingAddressId = 1, + Status = 3 + }, + new + { + Id = 4, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9735), + ShippingAddressId = 1, + Status = 4 + }, + new + { + Id = 5, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9736), + ShippingAddressId = 1, + Status = 5 + }, + new + { + Id = 6, + EmailAddress = "test@admin.com", + FirstName = "Jérémy", + LastName = "Le Petit", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9738), + ShippingAddressId = 2, + Status = 0 + }, + new + { + Id = 7, + EmailAddress = "paul@exemple.com", + FirstName = "Paul", + LastName = "A.", + LinkedAccountId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9740), + ShippingAddressId = 3, + Status = 3 + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("InvoiceModelId") + .HasColumnType("int"); + + b.Property("ProductId") + .HasColumnType("int"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("InvoiceModelId"); + + b.HasIndex("ProductId"); + + b.ToTable("ProductInvoice"); + + b.HasData( + new + { + Id = 1, + InvoiceModelId = 1, + ProductId = 1, + Quantity = 2L + }, + new + { + Id = 2, + InvoiceModelId = 1, + ProductId = 4, + Quantity = 5L + }, + new + { + Id = 3, + InvoiceModelId = 2, + ProductId = 3, + Quantity = 1L + }, + new + { + Id = 4, + InvoiceModelId = 2, + ProductId = 5, + Quantity = 2L + }, + new + { + Id = 5, + InvoiceModelId = 2, + ProductId = 7, + Quantity = 1L + }, + new + { + Id = 6, + InvoiceModelId = 3, + ProductId = 9, + Quantity = 1L + }, + new + { + Id = 7, + InvoiceModelId = 3, + ProductId = 11, + Quantity = 1L + }, + new + { + Id = 8, + InvoiceModelId = 4, + ProductId = 14, + Quantity = 1L + }, + new + { + Id = 9, + InvoiceModelId = 4, + ProductId = 13, + Quantity = 1L + }, + new + { + Id = 10, + InvoiceModelId = 4, + ProductId = 16, + Quantity = 1L + }, + new + { + Id = 11, + InvoiceModelId = 4, + ProductId = 24, + Quantity = 25L + }, + new + { + Id = 12, + InvoiceModelId = 5, + ProductId = 25, + Quantity = 1L + }, + new + { + Id = 13, + InvoiceModelId = 5, + ProductId = 29, + Quantity = 1L + }, + new + { + Id = 14, + InvoiceModelId = 5, + ProductId = 30, + Quantity = 1L + }, + new + { + Id = 15, + InvoiceModelId = 5, + ProductId = 15, + Quantity = 2L + }, + new + { + Id = 16, + InvoiceModelId = 6, + ProductId = 20, + Quantity = 4L + }, + new + { + Id = 17, + InvoiceModelId = 7, + ProductId = 1, + Quantity = 1L + }, + new + { + Id = 18, + InvoiceModelId = 7, + ProductId = 15, + Quantity = 2L + }); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Category") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Hits") + .HasColumnType("bigint"); + + b.Property("ImageName") + .HasColumnType("nvarchar(max)"); + + b.Property("LastHit") + .HasColumnType("datetime2"); + + b.Property("LastSale") + .HasColumnType("datetime2"); + + b.Property("Price") + .HasColumnType("decimal(18,2)"); + + b.Property("PromoPrice") + .HasColumnType("decimal(18,2)"); + + b.Property("Quantity") + .HasColumnType("bigint"); + + b.Property("Sales") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.ToTable("Products"); + + b.HasData( + new + { + Id = 1, + Category = "Linge", + Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", + Hits = 0L, + ImageName = "$ceintureflechee.jpg", + Price = 85.86m, + PromoPrice = 29.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Ceinture flèchée" + }, + new + { + Id = 2, + Category = "Linge", + Description = "Parce que ça sent la coupe!", + Hits = 0L, + ImageName = "$pantouflesCH.jpg", + Price = 15.64m, + PromoPrice = 9.99m, + Quantity = 54L, + Sales = 0L, + Status = 0, + Title = "Pantoufles du Canadien en Phentex" + }, + new + { + Id = 3, + Category = "Homme", + Description = "On ne lui ferait pas mal, en tout cas!!", + Hits = 0L, + ImageName = "$jeanlucmongrain.jpg", + Price = 1453.12m, + PromoPrice = 999.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Jean-Luc Mongrain" + }, + new + { + Id = 4, + Category = "Linge", + Description = "Tellement simple et comfortable.", + Hits = 0L, + ImageName = "$tshirt.jpg", + Price = 12.12m, + PromoPrice = 9.99m, + Quantity = 143L, + Sales = 0L, + Status = 0, + Title = "T-Shirt" + }, + new + { + Id = 5, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$mitaines.jpg", + Price = 8.18m, + PromoPrice = 6.99m, + Quantity = 1423L, + Sales = 0L, + Status = 0, + Title = "Mitaines" + }, + new + { + Id = 6, + Category = "Vêtement d'extérieur", + Description = "Deux pour un!", + Hits = 0L, + ImageName = "$foulard.jpg", + Price = 10.56m, + PromoPrice = 8.99m, + Quantity = 14L, + Sales = 0L, + Status = 4, + Title = "Foulard" + }, + new + { + Id = 7, + Category = "Sous-Vêtement", + Description = "Pour garder le p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokin.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 144L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap en phentex" + }, + new + { + Id = 8, + Category = "Sous-Vêtement", + Description = "Pour garder l'absence de p'tit bout au chaud.", + Hits = 0L, + ImageName = "$kokinfemme.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 224L, + Sales = 0L, + Status = 4, + Title = "Jock-Strap féminin en phentex" + }, + new + { + Id = 9, + Category = "Alien", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$bibi.jpg", + Price = 1045.45m, + PromoPrice = 1023.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Bibi" + }, + new + { + Id = 10, + Category = "Vêtement d'extérieur", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$tuque.jpg", + Price = 15.45m, + PromoPrice = 12.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "Tuque en laine" + }, + new + { + Id = 11, + Category = "Vêtement d'extérieur", + Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", + Hits = 0L, + ImageName = "$bonhomme.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 4, + Title = "Habit de Bonhomme Carnaval" + }, + new + { + Id = 12, + Category = "Autre", + Description = "Pour se pêter la fiole avec style.", + Hits = 0L, + ImageName = "$gauze.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Gauze en phentex" + }, + new + { + Id = 13, + Category = "Homme", + Description = "En chiffon.", + Hits = 0L, + ImageName = "$jesus.jpg", + Price = 145.45m, + PromoPrice = 123.99m, + Quantity = 1L, + Sales = 0L, + Status = 3, + Title = "Petit Jésus de plâtre" + }, + new + { + Id = 14, + Category = "Autre", + Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", + Hits = 0L, + ImageName = "$vhs.jpg", + Price = 3.45m, + PromoPrice = 1.99m, + Quantity = 164363L, + Sales = 0L, + Status = 3, + Title = "VHS de la Guerre des Tuques" + }, + new + { + Id = 15, + Category = "Linge", + Description = "(N'est pas réellement pare-balle).", + Hits = 0L, + ImageName = "$chandailquetaine.jpg", + Price = 1435.45m, + PromoPrice = 1223.99m, + Quantity = 18L, + Sales = 0L, + Status = 3, + Title = "Gilet pare-balle en laine" + }, + new + { + Id = 16, + Category = "Autre", + Description = "Pour s'éffoirer le nez dedans.", + Hits = 0L, + ImageName = "$doudou.jpg", + Price = 14.45m, + PromoPrice = 13.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Doudou" + }, + new + { + Id = 17, + Category = "Vêtements d'extérieur", + Description = "Pour avoir l'air thug en hiver.", + Hits = 0L, + ImageName = "$mitaines2.jpg", + Price = 9.45m, + PromoPrice = 8.99m, + Quantity = 16L, + Sales = 0L, + Status = 0, + Title = "Mitaines pas de doigts" + }, + new + { + Id = 18, + Category = "Vêtements d'extérieur", + Description = "Pour avoir plus l'air thug en hiver.", + Hits = 0L, + ImageName = "$longmitaines.jpg", + Price = 10.45m, + PromoPrice = 9.99m, + Quantity = 10L, + Sales = 0L, + Status = 5, + Title = "Longues mitaines pas de doigts" + }, + new + { + Id = 19, + Category = "Linge", + Description = "Pour les journées bs", + Hits = 0L, + ImageName = "$pantalon.jpg", + Price = 69.99m, + PromoPrice = 49.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Pantalons slacks" + }, + new + { + Id = 20, + Category = "Linge", + Description = "Pour commencer à apprendre rust et utiliser linux", + Hits = 0L, + ImageName = "$thighs.jpg", + Price = 23.50m, + PromoPrice = 19.99m, + Quantity = 3L, + Sales = 0L, + Status = 4, + Title = "Programmer Socks" + }, + new + { + Id = 21, + Category = "Linge", + Description = "Show off que t'habites su'l plateau", + Hits = 0L, + ImageName = "$plateau.png", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Col-roulé" + }, + new + { + Id = 22, + Category = "Linge", + Description = "Ben oui je vais à l'UQAM comment t'as d'viné", + Hits = 0L, + ImageName = "$uqam.jpg", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 4L, + Sales = 0L, + Status = 3, + Title = "Gros col-roulé" + }, + new + { + Id = 23, + Category = "Établissement", + Description = "Oui oui, une SAQ au complete", + Hits = 0L, + ImageName = "$saq.jpg", + Price = 1000000.99m, + PromoPrice = 999999.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "SAQ" + }, + new + { + Id = 24, + Category = "Texte", + Description = "Lorem ipsum dolor sit amet, \r\nconsectetur adipiscing elit. Vivamus sapien ipsum, \r\nconvallis quis justo ac, congue sollicitudin metus. \r\nVestibulum nec libero nulla. Integer a pretium dolor. \r\nPhasellus vulputate iaculis ligula, sit amet suscipit \r\ndiam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.\r\nDuis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque\r\negestas sagittis. Etiam vitae ornare ex.", + Hits = 0L, + ImageName = "$lorem.jpg", + Price = 0.99m, + PromoPrice = 0.69m, + Quantity = 99L, + Sales = 0L, + Status = 4, + Title = "Lorem" + }, + new + { + Id = 25, + Category = "Homme", + Description = "Quand un vrai coûte trop cher", + Hits = 0L, + ImageName = "$bebe.jpg", + Price = 10.99m, + PromoPrice = 5.99m, + Quantity = 15L, + Sales = 0L, + Status = 0, + Title = "Bébé de laine" + }, + new + { + Id = 26, + Category = "Linge", + Description = "Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", + Hits = 0L, + ImageName = "$kitbebe.jpg", + Price = 39.99m, + PromoPrice = 29.99m, + Quantity = 10L, + Sales = 0L, + Status = 3, + Title = "Kit pour bébé" + }, + new + { + Id = 27, + Category = "Linge", + Description = "Chris Pratt aime ben sauter dessus", + Hits = 0L, + ImageName = "$koopa.jpg", + Price = 29.99m, + PromoPrice = 9.99m, + Quantity = 0L, + Sales = 0L, + Status = 5, + Title = "TORTUE" + }, + new + { + Id = 28, + Category = "Nourriture", + Description = "*ne pa manger", + Hits = 0L, + ImageName = "$potato.jpg", + Price = 1.99m, + PromoPrice = 0.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Patate de laine" + }, + new + { + Id = 29, + Category = "Animal", + Description = "Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.\r\n\r\nAu sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.\r\n\r\nMême s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", + Hits = 0L, + ImageName = "$monke.png", + Price = 299.99m, + PromoPrice = 99.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Monke :)" + }, + new + { + Id = 30, + Category = "Pokemon", + Description = "It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.\r\n\r\nIn Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.\r\n\r\nPikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.\r\n\r\nIn Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.\r\n\r\nPikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.\r\n\r\nIt is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.\r\n\r\nPikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", + Hits = 0L, + ImageName = "$pika.png", + Price = 3.99m, + PromoPrice = 2.99m, + Quantity = 69L, + Sales = 0L, + Status = 5, + Title = "Phat Pikachu" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("nvarchar(450)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex") + .HasFilter("[NormalizedName] IS NOT NULL"); + + b.ToTable("AspNetRoles", (string)null); + + b.HasData( + new + { + Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", + ConcurrencyStamp = "b110abae-bf70-453d-93d4-a3b0d74f9491", + Name = "Administrateur", + NormalizedName = "ADMINISTRATEUR" + }, + new + { + Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", + ConcurrencyStamp = "31012aa2-ebcf-493a-bc1c-2066d47dd333", + Name = "Client", + NormalizedName = "CLIENT" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ClaimType") + .HasColumnType("nvarchar(max)"); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(450)"); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("RoleId") + .HasColumnType("nvarchar(450)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + + b.HasData( + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "c9e08b20-d8a5-473f-9f52-572eb23c12af" + }, + new + { + UserId = "ecf7503a-591c-454e-a824-048e10bd0474", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }, + new + { + UserId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("nvarchar(450)"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(450)"); + + b.Property("Name") + .HasColumnType("nvarchar(450)"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.AddressModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany("Adresses") + .HasForeignKey("InventoryUserId"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount") + .WithMany() + .HasForeignKey("LinkedAccountId"); + + b.HasOne("GrossesMitainesAPI.Models.AddressModel", "ShippingAddress") + .WithMany() + .HasForeignKey("ShippingAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("LinkedAccount"); + + b.Navigation("ShippingAddress"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => + { + b.HasOne("GrossesMitainesAPI.Models.InvoiceModel", null) + .WithMany("Products") + .HasForeignKey("InvoiceModelId"); + + b.HasOne("GrossesMitainesAPI.Models.ProductModel", "Product") + .WithMany() + .HasForeignKey("ProductId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Product"); + }); + + 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", 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("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("GrossesMitainesAPI.Data.InventoryUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => + { + b.Navigation("Adresses"); + }); + + modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => + { + b.Navigation("Products"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108034952_invoiceClient.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108034952_invoiceClient.cs new file mode 100644 index 0000000..85bfda7 --- /dev/null +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/20221108034952_invoiceClient.cs @@ -0,0 +1,202 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace GrossesMitainesAPI.Migrations +{ + public partial class invoiceClient : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "31012aa2-ebcf-493a-bc1c-2066d47dd333"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "b110abae-bf70-453d-93d4-a3b0d74f9491"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "d6f87641-e92e-44f6-a26c-3539ccc0b374", "AQAAAAEAACcQAAAAEGleiGV7pLvmGVcR9JU/Yc8Oo/+8CGFU2ZDvWJnonvm5/XbCOHsIwWHvAB3GCpiZJA==", "719b228c-6b86-4193-b994-365aaf1d19fc" }); + + migrationBuilder.InsertData( + table: "AspNetUsers", + columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "FirstName", "LastName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" }, + values: new object[] { "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", 0, "989931b3-2a7b-44db-8e22-308d2270442c", "paul@exemple.com", false, "Paul", "A.", false, null, "PAUL@EXEMPLE.COM", "PASLA", "AQAAAAEAACcQAAAAEPffpp6X7ztCzWieTbiRInK5P/1AZx6Pdy1tUbTQS5GXLWGcZzhqlzaB8QGlwkJzDw==", null, false, "6bbc335f-1307-40eb-8533-694a608937de", false, "PasLa" }); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 1, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9693)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 2, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9731)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 3, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9733)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 4, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9735)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 5, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9736)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 6, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9738)); + + migrationBuilder.InsertData( + table: "Addresses", + columns: new[] { "Id", "Appartment", "City", "CivicNumber", "Country", "InventoryUserId", "PostalCode", "Province", "Street" }, + values: new object[] { 3, "A", "Saint-Québec", 69, "Canada", "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", "H0H0H0", "QC", "Rue PSPP" }); + + migrationBuilder.InsertData( + table: "AspNetUserRoles", + columns: new[] { "RoleId", "UserId" }, + values: new object[] { "1b7b9c55-c746-493a-a24f-3d5ca937298e", "af9178c8-1a02-4ff8-bc0a-c8248dad6e09" }); + + migrationBuilder.InsertData( + table: "Invoices", + columns: new[] { "Id", "EmailAddress", "FirstName", "LastName", "LinkedAccountId", "PhoneNumber", "PurchaseDate", "ShippingAddressId", "Status" }, + values: new object[] { 7, "paul@exemple.com", "Paul", "A.", "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", "111-111-1111", new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9740), 3, 3 }); + + migrationBuilder.InsertData( + table: "ProductInvoice", + columns: new[] { "Id", "InvoiceModelId", "ProductId", "Quantity" }, + values: new object[] { 17, 7, 1, 1L }); + + migrationBuilder.InsertData( + table: "ProductInvoice", + columns: new[] { "Id", "InvoiceModelId", "ProductId", "Quantity" }, + values: new object[] { 18, 7, 15, 2L }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DeleteData( + table: "AspNetUserRoles", + keyColumns: new[] { "RoleId", "UserId" }, + keyValues: new object[] { "1b7b9c55-c746-493a-a24f-3d5ca937298e", "af9178c8-1a02-4ff8-bc0a-c8248dad6e09" }); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 17); + + migrationBuilder.DeleteData( + table: "ProductInvoice", + keyColumn: "Id", + keyValue: 18); + + migrationBuilder.DeleteData( + table: "Invoices", + keyColumn: "Id", + keyValue: 7); + + migrationBuilder.DeleteData( + table: "Addresses", + keyColumn: "Id", + keyValue: 3); + + migrationBuilder.DeleteData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "af9178c8-1a02-4ff8-bc0a-c8248dad6e09"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "1b7b9c55-c746-493a-a24f-3d5ca937298e", + column: "ConcurrencyStamp", + value: "8b05058e-1c97-4021-a485-6987e774c877"); + + migrationBuilder.UpdateData( + table: "AspNetRoles", + keyColumn: "Id", + keyValue: "c9e08b20-d8a5-473f-9f52-572eb23c12af", + column: "ConcurrencyStamp", + value: "e5b77c04-830f-4c19-ad44-6c9e5a508efb"); + + migrationBuilder.UpdateData( + table: "AspNetUsers", + keyColumn: "Id", + keyValue: "ecf7503a-591c-454e-a824-048e10bd0474", + columns: new[] { "ConcurrencyStamp", "PasswordHash", "SecurityStamp" }, + values: new object[] { "af3a641d-8fe8-45c3-8e36-fdfbef10659a", "AQAAAAEAACcQAAAAEL/k0+c61dX1YPgqHrr6wmVSZNJzoqveJzr8IxjVSSL3W+GSsqOXft+hVLXozCnqVg==", "8ac35276-f8dc-4de4-826f-ea2996e09f2c" }); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 1, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6619)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 2, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6655)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 3, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6658)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 4, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6659)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 5, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6661)); + + migrationBuilder.UpdateData( + table: "Invoices", + keyColumn: "Id", + keyValue: 6, + column: "PurchaseDate", + value: new DateTime(2022, 11, 7, 22, 35, 25, 783, DateTimeKind.Local).AddTicks(6663)); + } + } +} diff --git a/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs b/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs index 676fd81..b5a415f 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Migrations/InventoryContextModelSnapshot.cs @@ -101,7 +101,7 @@ namespace GrossesMitainesAPI.Migrations { Id = "ecf7503a-591c-454e-a824-048e10bd0474", AccessFailedCount = 0, - ConcurrencyStamp = "6ecf4a66-157e-4a5c-a6ba-84c0d8df9d8f", + ConcurrencyStamp = "d6f87641-e92e-44f6-a26c-3539ccc0b374", Email = "admin@admin.com", EmailConfirmed = false, FirstName = "Roger", @@ -109,11 +109,29 @@ namespace GrossesMitainesAPI.Migrations LockoutEnabled = false, NormalizedEmail = "ADMIN@ADMIN.COM", NormalizedUserName = "ADMIN", - PasswordHash = "AQAAAAEAACcQAAAAELk80UgvLbSDu3xg805PHJkdcTaFrtU/wZOBkOdJFw9ji5gpPe6G3lTu2FF1ysj7eg==", + PasswordHash = "AQAAAAEAACcQAAAAEGleiGV7pLvmGVcR9JU/Yc8Oo/+8CGFU2ZDvWJnonvm5/XbCOHsIwWHvAB3GCpiZJA==", PhoneNumberConfirmed = false, - SecurityStamp = "eb2a7531-4487-4a67-9601-adfc03a601cf", + SecurityStamp = "719b228c-6b86-4193-b994-365aaf1d19fc", TwoFactorEnabled = false, UserName = "Admin" + }, + new + { + Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + AccessFailedCount = 0, + ConcurrencyStamp = "989931b3-2a7b-44db-8e22-308d2270442c", + Email = "paul@exemple.com", + EmailConfirmed = false, + FirstName = "Paul", + LastName = "A.", + LockoutEnabled = false, + NormalizedEmail = "PAUL@EXEMPLE.COM", + NormalizedUserName = "PASLA", + PasswordHash = "AQAAAAEAACcQAAAAEPffpp6X7ztCzWieTbiRInK5P/1AZx6Pdy1tUbTQS5GXLWGcZzhqlzaB8QGlwkJzDw==", + PhoneNumberConfirmed = false, + SecurityStamp = "6bbc335f-1307-40eb-8533-694a608937de", + TwoFactorEnabled = false, + UserName = "PasLa" }); }); @@ -163,6 +181,42 @@ namespace GrossesMitainesAPI.Migrations b.HasIndex("InventoryUserId"); b.ToTable("Addresses"); + + b.HasData( + new + { + Id = 1, + Appartment = "B", + City = "Saint-Chrysostome", + CivicNumber = 1234, + Country = "Canada", + InventoryUserId = "ecf7503a-591c-454e-a824-048e10bd0474", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue Pierre-Falardeau" + }, + new + { + Id = 2, + City = "Saint-Jérôme", + CivicNumber = 420, + Country = "Canada", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue MikeWard" + }, + new + { + Id = 3, + Appartment = "A", + City = "Saint-Québec", + CivicNumber = 69, + Country = "Canada", + InventoryUserId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + PostalCode = "H0H0H0", + Province = "QC", + Street = "Rue PSPP" + }); }); modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b => @@ -210,6 +264,91 @@ namespace GrossesMitainesAPI.Migrations b.HasIndex("ShippingAddressId"); b.ToTable("Invoices"); + + b.HasData( + new + { + Id = 1, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9693), + ShippingAddressId = 1, + Status = 0 + }, + new + { + Id = 2, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9731), + ShippingAddressId = 1, + Status = 1 + }, + new + { + Id = 3, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9733), + ShippingAddressId = 1, + Status = 3 + }, + new + { + Id = 4, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9735), + ShippingAddressId = 1, + Status = 4 + }, + new + { + Id = 5, + EmailAddress = "admin@admin.com", + FirstName = "Roger", + LastName = "Admin", + LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9736), + ShippingAddressId = 1, + Status = 5 + }, + new + { + Id = 6, + EmailAddress = "test@admin.com", + FirstName = "Jérémy", + LastName = "Le Petit", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9738), + ShippingAddressId = 2, + Status = 0 + }, + new + { + Id = 7, + EmailAddress = "paul@exemple.com", + FirstName = "Paul", + LastName = "A.", + LinkedAccountId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + PhoneNumber = "111-111-1111", + PurchaseDate = new DateTime(2022, 11, 7, 22, 49, 52, 210, DateTimeKind.Local).AddTicks(9740), + ShippingAddressId = 3, + Status = 3 + }); }); modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel+ProductInvoice", b => @@ -236,6 +375,134 @@ namespace GrossesMitainesAPI.Migrations b.HasIndex("ProductId"); b.ToTable("ProductInvoice"); + + b.HasData( + new + { + Id = 1, + InvoiceModelId = 1, + ProductId = 1, + Quantity = 2L + }, + new + { + Id = 2, + InvoiceModelId = 1, + ProductId = 4, + Quantity = 5L + }, + new + { + Id = 3, + InvoiceModelId = 2, + ProductId = 3, + Quantity = 1L + }, + new + { + Id = 4, + InvoiceModelId = 2, + ProductId = 5, + Quantity = 2L + }, + new + { + Id = 5, + InvoiceModelId = 2, + ProductId = 7, + Quantity = 1L + }, + new + { + Id = 6, + InvoiceModelId = 3, + ProductId = 9, + Quantity = 1L + }, + new + { + Id = 7, + InvoiceModelId = 3, + ProductId = 11, + Quantity = 1L + }, + new + { + Id = 8, + InvoiceModelId = 4, + ProductId = 14, + Quantity = 1L + }, + new + { + Id = 9, + InvoiceModelId = 4, + ProductId = 13, + Quantity = 1L + }, + new + { + Id = 10, + InvoiceModelId = 4, + ProductId = 16, + Quantity = 1L + }, + new + { + Id = 11, + InvoiceModelId = 4, + ProductId = 24, + Quantity = 25L + }, + new + { + Id = 12, + InvoiceModelId = 5, + ProductId = 25, + Quantity = 1L + }, + new + { + Id = 13, + InvoiceModelId = 5, + ProductId = 29, + Quantity = 1L + }, + new + { + Id = 14, + InvoiceModelId = 5, + ProductId = 30, + Quantity = 1L + }, + new + { + Id = 15, + InvoiceModelId = 5, + ProductId = 15, + Quantity = 2L + }, + new + { + Id = 16, + InvoiceModelId = 6, + ProductId = 20, + Quantity = 4L + }, + new + { + Id = 17, + InvoiceModelId = 7, + ProductId = 1, + Quantity = 1L + }, + new + { + Id = 18, + InvoiceModelId = 7, + ProductId = 15, + Quantity = 2L + }); }); modelBuilder.Entity("GrossesMitainesAPI.Models.ProductModel", b => @@ -297,7 +564,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "Pour faire votre propre bonhomme de 1837, comme dans le bon vieux temps.", Hits = 0L, - ImageName = "ceintureflechee", + ImageName = "$ceintureflechee.jpg", Price = 85.86m, PromoPrice = 29.99m, Quantity = 1L, @@ -311,7 +578,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "Parce que ça sent la coupe!", Hits = 0L, - ImageName = "pantouflesCH", + ImageName = "$pantouflesCH.jpg", Price = 15.64m, PromoPrice = 9.99m, Quantity = 54L, @@ -325,7 +592,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Homme", Description = "On ne lui ferait pas mal, en tout cas!!", Hits = 0L, - ImageName = "jeanlucmongrain", + ImageName = "$jeanlucmongrain.jpg", Price = 1453.12m, PromoPrice = 999.99m, Quantity = 1L, @@ -339,7 +606,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "Tellement simple et comfortable.", Hits = 0L, - ImageName = "tshirt", + ImageName = "$tshirt.jpg", Price = 12.12m, PromoPrice = 9.99m, Quantity = 143L, @@ -353,7 +620,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "Deux pour un!", Hits = 0L, - ImageName = "mitaines", + ImageName = "$mitaines.jpg", Price = 8.18m, PromoPrice = 6.99m, Quantity = 1423L, @@ -367,7 +634,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "Deux pour un!", Hits = 0L, - ImageName = "foulard", + ImageName = "$foulard.jpg", Price = 10.56m, PromoPrice = 8.99m, Quantity = 14L, @@ -381,7 +648,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Sous-Vêtement", Description = "Pour garder le p'tit bout au chaud.", Hits = 0L, - ImageName = "kokin", + ImageName = "$kokin.jpg", Price = 15.45m, PromoPrice = 12.99m, Quantity = 144L, @@ -395,7 +662,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Sous-Vêtement", Description = "Pour garder l'absence de p'tit bout au chaud.", Hits = 0L, - ImageName = "kokin", + ImageName = "$kokinfemme.jpg", Price = 15.45m, PromoPrice = 12.99m, Quantity = 224L, @@ -409,7 +676,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Alien", Description = "En chiffon.", Hits = 0L, - ImageName = "bibi", + ImageName = "$bibi.jpg", Price = 1045.45m, PromoPrice = 1023.99m, Quantity = 1L, @@ -423,7 +690,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "En chiffon.", Hits = 0L, - ImageName = "tuque", + ImageName = "$tuque.jpg", Price = 15.45m, PromoPrice = 12.99m, Quantity = 1L, @@ -437,7 +704,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtement d'extérieur", Description = "Pour se faire taper dessus avec une poêle à frire tout en restant au chaud.", Hits = 0L, - ImageName = "bonhomme", + ImageName = "$bonhomme.jpg", Price = 145.45m, PromoPrice = 123.99m, Quantity = 1L, @@ -451,7 +718,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Autre", Description = "Pour se pêter la fiole avec style.", Hits = 0L, - ImageName = "gauze", + ImageName = "$gauze.jpg", Price = 145.45m, PromoPrice = 123.99m, Quantity = 0L, @@ -465,7 +732,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Homme", Description = "En chiffon.", Hits = 0L, - ImageName = "jesus", + ImageName = "$jesus.jpg", Price = 145.45m, PromoPrice = 123.99m, Quantity = 1L, @@ -479,7 +746,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Autre", Description = "À écouter dans l'habit de Bonhomme Carnaval tant que possible.", Hits = 0L, - ImageName = "vhs", + ImageName = "$vhs.jpg", Price = 3.45m, PromoPrice = 1.99m, Quantity = 164363L, @@ -493,7 +760,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Linge", Description = "(N'est pas réellement pare-balle).", Hits = 0L, - ImageName = "chandailquetaine", + ImageName = "$chandailquetaine.jpg", Price = 1435.45m, PromoPrice = 1223.99m, Quantity = 18L, @@ -507,7 +774,7 @@ namespace GrossesMitainesAPI.Migrations Category = "Autre", Description = "Pour s'éffoirer le nez dedans.", Hits = 0L, - ImageName = "doudou", + ImageName = "$doudou.jpg", Price = 14.45m, PromoPrice = 13.99m, Quantity = 14L, @@ -521,13 +788,195 @@ namespace GrossesMitainesAPI.Migrations Category = "Vêtements d'extérieur", Description = "Pour avoir l'air thug en hiver.", Hits = 0L, - ImageName = "mitaines2", + ImageName = "$mitaines2.jpg", Price = 9.45m, PromoPrice = 8.99m, Quantity = 16L, Sales = 0L, Status = 0, Title = "Mitaines pas de doigts" + }, + new + { + Id = 18, + Category = "Vêtements d'extérieur", + Description = "Pour avoir plus l'air thug en hiver.", + Hits = 0L, + ImageName = "$longmitaines.jpg", + Price = 10.45m, + PromoPrice = 9.99m, + Quantity = 10L, + Sales = 0L, + Status = 5, + Title = "Longues mitaines pas de doigts" + }, + new + { + Id = 19, + Category = "Linge", + Description = "Pour les journées bs", + Hits = 0L, + ImageName = "$pantalon.jpg", + Price = 69.99m, + PromoPrice = 49.99m, + Quantity = 0L, + Sales = 0L, + Status = 1, + Title = "Pantalons slacks" + }, + new + { + Id = 20, + Category = "Linge", + Description = "Pour commencer à apprendre rust et utiliser linux", + Hits = 0L, + ImageName = "$thighs.jpg", + Price = 23.50m, + PromoPrice = 19.99m, + Quantity = 3L, + Sales = 0L, + Status = 4, + Title = "Programmer Socks" + }, + new + { + Id = 21, + Category = "Linge", + Description = "Show off que t'habites su'l plateau", + Hits = 0L, + ImageName = "$plateau.png", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 14L, + Sales = 0L, + Status = 0, + Title = "Col-roulé" + }, + new + { + Id = 22, + Category = "Linge", + Description = "Ben oui je vais à l'UQAM comment t'as d'viné", + Hits = 0L, + ImageName = "$uqam.jpg", + Price = 149.99m, + PromoPrice = 99.99m, + Quantity = 4L, + Sales = 0L, + Status = 3, + Title = "Gros col-roulé" + }, + new + { + Id = 23, + Category = "Établissement", + Description = "Oui oui, une SAQ au complete", + Hits = 0L, + ImageName = "$saq.jpg", + Price = 1000000.99m, + PromoPrice = 999999.99m, + Quantity = 1L, + Sales = 0L, + Status = 0, + Title = "SAQ" + }, + new + { + Id = 24, + Category = "Texte", + Description = "Lorem ipsum dolor sit amet, \r\nconsectetur adipiscing elit. Vivamus sapien ipsum, \r\nconvallis quis justo ac, congue sollicitudin metus. \r\nVestibulum nec libero nulla. Integer a pretium dolor. \r\nPhasellus vulputate iaculis ligula, sit amet suscipit \r\ndiam condimentum eu. Suspendisse blandit ipsum sed porttitor volutpat.\r\nDuis iaculis mauris a dapibus bibendum. Integer sollicitudin nunc et neque\r\negestas sagittis. Etiam vitae ornare ex.", + Hits = 0L, + ImageName = "$lorem.jpg", + Price = 0.99m, + PromoPrice = 0.69m, + Quantity = 99L, + Sales = 0L, + Status = 4, + Title = "Lorem" + }, + new + { + Id = 25, + Category = "Homme", + Description = "Quand un vrai coûte trop cher", + Hits = 0L, + ImageName = "$bebe.jpg", + Price = 10.99m, + PromoPrice = 5.99m, + Quantity = 15L, + Sales = 0L, + Status = 0, + Title = "Bébé de laine" + }, + new + { + Id = 26, + Category = "Linge", + Description = "Un beau petit kit pas cher quand vous avez oublié le cadeau pour le shower qui s'en vient", + Hits = 0L, + ImageName = "$kitbebe.jpg", + Price = 39.99m, + PromoPrice = 29.99m, + Quantity = 10L, + Sales = 0L, + Status = 3, + Title = "Kit pour bébé" + }, + new + { + Id = 27, + Category = "Linge", + Description = "Chris Pratt aime ben sauter dessus", + Hits = 0L, + ImageName = "$koopa.jpg", + Price = 29.99m, + PromoPrice = 9.99m, + Quantity = 0L, + Sales = 0L, + Status = 5, + Title = "TORTUE" + }, + new + { + Id = 28, + Category = "Nourriture", + Description = "*ne pa manger", + Hits = 0L, + ImageName = "$potato.jpg", + Price = 1.99m, + PromoPrice = 0.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Patate de laine" + }, + new + { + Id = 29, + Category = "Animal", + Description = "Les singes sont des mammifères de l'ordre des primates, généralement arboricoles, à la face souvent glabre et caractérisés par un encéphale développé et de longs membres terminés par des doigts. Bien que leur ressemblance avec l'Homme ait toujours frappé les esprits, la science a mis de nombreux siècles à prouver le lien étroit qui existe entre ceux-ci et l'espèce humaine.\r\n\r\nAu sein des primates, les singes forment un infra-ordre monophylétique, si l'on y inclut le genre Homo, nommé Simiiformes et qui se divise entre les Platyrhiniens (singes du Nouveau Monde : Amérique centrale et méridionale) et les Catarhiniens (singes de l'Ancien Monde : Afrique et Asie tropicales). Ces derniers comprennent les hominoïdes, également appelés « grands singes », dont fait partie Homo sapiens et ses ancêtres les plus proches.\r\n\r\nMême s'il ne fait plus de doute aujourd'hui que « l'Homme est un singe comme les autres », l'expression est majoritairement utilisée pour parler des animaux sauvages, et évoque un référentiel culturel, littéraire et artistique qui exclut l'espèce humaine.", + Hits = 0L, + ImageName = "$monke.png", + Price = 299.99m, + PromoPrice = 99.99m, + Quantity = 58L, + Sales = 0L, + Status = 0, + Title = "Monke :)" + }, + new + { + Id = 30, + Category = "Pokemon", + Description = "It evolves from Pichu when leveled up with high friendship and evolves into Raichu when exposed to a Thunder Stone.\r\n\r\nIn Alola, Pikachu will evolve into Alolan Raichu when exposed to a Thunder Stone.\r\n\r\nPikachu has a Gigantamax form. Pikachu with the Gigantamax Factor cannot evolve.\r\n\r\nIn Pokémon Yellow, the starter Pikachu will refuse to evolve into Raichu unless it is traded and evolved on another save file. In Pokémon: Let's Go, Pikachu!, the player's starter Pikachu also will not evolve, but cannot be traded to become a Raichu.\r\n\r\nPikachu is popularly known as the mascot of the Pokémon franchise and one of Nintendo's major mascots.\r\n\r\nIt is also the game mascot and starter Pokémon of Pokémon Yellow and Let's Go, Pikachu!. It has made numerous appearances on the boxes of spin-off titles.\r\n\r\nPikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumble World.", + Hits = 0L, + ImageName = "$pika.png", + Price = 3.99m, + PromoPrice = 2.99m, + Quantity = 69L, + Sales = 0L, + Status = 5, + Title = "Phat Pikachu" }); }); @@ -561,14 +1010,14 @@ namespace GrossesMitainesAPI.Migrations new { Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", - ConcurrencyStamp = "9708e256-7f72-43a3-9981-3d46a496efef", + ConcurrencyStamp = "b110abae-bf70-453d-93d4-a3b0d74f9491", Name = "Administrateur", NormalizedName = "ADMINISTRATEUR" }, new { Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", - ConcurrencyStamp = "ea9b728b-01ce-41db-a0b8-267b641c38c8", + ConcurrencyStamp = "31012aa2-ebcf-493a-bc1c-2066d47dd333", Name = "Client", NormalizedName = "CLIENT" }); @@ -670,6 +1119,11 @@ namespace GrossesMitainesAPI.Migrations { UserId = "ecf7503a-591c-454e-a824-048e10bd0474", RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" + }, + new + { + UserId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", + RoleId = "1b7b9c55-c746-493a-a24f-3d5ca937298e" }); }); diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/App.js b/GrossesMitaines/grosses-mitaines-ui/src/components/App.js index 761558d..be50418 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/components/App.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/App.js @@ -11,6 +11,7 @@ import Login from "../pages/Login"; import Logout from "../pages/Logout"; import Register from "../pages/Register"; import Formulaire from "../pages/Formulaire"; +import MyInvoices from "../pages/MyInvoices"; import { useState, useEffect } from "react"; import React from 'react'; import { useCookies } from 'react-cookie'; @@ -47,6 +48,7 @@ const App = () => { }/> }/> }/> + }/> diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js new file mode 100644 index 0000000..3b940da --- /dev/null +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceItem.js @@ -0,0 +1,12 @@ +const InvoiceItem = (invoice) => { + + return ( + <> +
+
+ + ); + +} + +export default InvoiceItem; \ No newline at end of file diff --git a/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js new file mode 100644 index 0000000..f4e2ec8 --- /dev/null +++ b/GrossesMitaines/grosses-mitaines-ui/src/components/InvoiceList.js @@ -0,0 +1,15 @@ +import InvoiceItem from "./InvoiceItem"; + +const InvoiceList = ({ invoices }) => { + return ( + <> + {invoices.map((invoice) => { + + })} + + ); +} + +export default InvoiceList; \ No newline at end of file diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js new file mode 100644 index 0000000..ab961fb --- /dev/null +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js @@ -0,0 +1,35 @@ +import { useEffect } from "react"; +import { useState } from "react"; +import InvoiceList from "../components/InvoiceList"; + +const MyInvoices = () => { + + const [invoices, setInvoices] = useState([]); + + useEffect(() => { + fetch(`https://localhost:7292/api/Invoice`, { + method: 'GET', + mode: 'cors', + credentials: 'include' + }).then(async (response) => { + if (response.ok) { + var json = await response.json(); + console.log(json); + setInvoices(json); + } + else{ + console.log("Erreur lors de la requête des invoices"); + } + }); + }, []); + + return ( + <> + + + ); +} + +export default MyInvoices \ No newline at end of file diff --git a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css index d6e1e9f..551e596 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css +++ b/GrossesMitaines/grosses-mitaines-ui/src/stylesheets/site.css @@ -255,6 +255,7 @@ a { margin-left: auto; height: 50%; width: auto; + max-width: 95%; } .item-info {