Ajout client au seed (paul@exemple.com Qwerty123!)

This commit is contained in:
Victor Turgeon
2022-11-07 22:50:41 -05:00
parent a3537c0a0f
commit 53551ea846
4 changed files with 1582 additions and 14 deletions

View File

@@ -373,9 +373,13 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
#region Users
// Source: Notre TP Web 4DW.
//RolesID
string AdministrateurID = "c9e08b20-d8a5-473f-9f52-572eb23c12af";
string ClientID = "1b7b9c55-c746-493a-a24f-3d5ca937298e";
//UsersID
string AdminID = "ecf7503a-591c-454e-a824-048e10bd0474";
string PaulID = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09";
InventoryUser admin = new InventoryUser() {
FirstName = "Roger",
@@ -387,9 +391,20 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
Email = "admin@admin.com"
};
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<InventoryUser>().HashPassword(admin, "Qwerty123!");
modelBuilder.Entity<InventoryUser>().HasData(admin);
paul.PasswordHash = new PasswordHasher<InventoryUser>().HashPassword(paul, "Qwerty123!");
modelBuilder.Entity<InventoryUser>().HasData(admin, paul);
modelBuilder.Entity<IdentityRole>().HasData(
new IdentityRole { Id = AdministrateurID, Name = "Administrateur", NormalizedName = "ADMINISTRATEUR" },
@@ -398,7 +413,8 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
modelBuilder.Entity<IdentityUserRole<string>>().HasData(
new IdentityUserRole<string> { RoleId = AdministrateurID, UserId = AdminID },
new IdentityUserRole<string> { RoleId = ClientID, UserId = AdminID }
new IdentityUserRole<string> { RoleId = ClientID, UserId = AdminID },
new IdentityUserRole<string> { RoleId = ClientID, UserId = PaulID }
);
#endregion
@@ -423,6 +439,17 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
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
@@ -495,7 +522,18 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
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<InvoiceModel.ProductInvoice>().HasData(
@@ -605,6 +643,20 @@ Pikachu is also the starter Pokémon of Pokémon Rumble Blast and Pokémon Rumbl
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