Merge branch 'react-version' of https://github.com/MarcEricMartel/420-5DW-HY-TP into react-version
This commit is contained in:
commit
ef70c2b453
@ -70,6 +70,7 @@ public class InvoiceController : Controller {
|
|||||||
.Include(x => x.ShippingAddress)
|
.Include(x => x.ShippingAddress)
|
||||||
.Include(x => x.LinkedAccount)
|
.Include(x => x.LinkedAccount)
|
||||||
.Include(x => x.Payment)
|
.Include(x => x.Payment)
|
||||||
|
.ThenInclude(x => x.BillingAddress)
|
||||||
.Include(x => x.Products)
|
.Include(x => x.Products)
|
||||||
.ThenInclude(y => y.Product)
|
.ThenInclude(y => y.Product)
|
||||||
.ToList());
|
.ToList());
|
||||||
@ -77,6 +78,7 @@ public class InvoiceController : Controller {
|
|||||||
.Include(x => x.ShippingAddress)
|
.Include(x => x.ShippingAddress)
|
||||||
.Include(x => x.LinkedAccount)
|
.Include(x => x.LinkedAccount)
|
||||||
.Include(x => x.Payment)
|
.Include(x => x.Payment)
|
||||||
|
.ThenInclude(x => x.BillingAddress)
|
||||||
.Include(x => x.Products)
|
.Include(x => x.Products)
|
||||||
.ThenInclude(y => y.Product)
|
.ThenInclude(y => y.Product)
|
||||||
.Where(x => x.LinkedAccount != null && x.LinkedAccount.Id == id).ToList());
|
.Where(x => x.LinkedAccount != null && x.LinkedAccount.Id == id).ToList());
|
||||||
@ -99,7 +101,9 @@ public class InvoiceController : Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
inv = _context.Invoices.Where(x => x.Id == id).Include("ShippingAddress").Include(x => x.Payment).First();
|
inv = _context.Invoices.Where(x => x.Id == id).Include("ShippingAddress")
|
||||||
|
.Include(x => x.Payment)
|
||||||
|
.ThenInclude(x => x.BillingAddress).First();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
_logger.LogError(10, e.Message);
|
_logger.LogError(10, e.Message);
|
||||||
return BadRequest();
|
return BadRequest();
|
||||||
@ -164,9 +168,17 @@ public class InvoiceController : Controller {
|
|||||||
|
|
||||||
// Charges!
|
// Charges!
|
||||||
StripeConfiguration.ApiKey = _stripeOptions.Value.SecretKey;
|
StripeConfiguration.ApiKey = _stripeOptions.Value.SecretKey;
|
||||||
ChargesModel chr;
|
AddressModel bill = new() {
|
||||||
|
CivicNumber = sinv.BillCivicNumber,
|
||||||
|
Street = sinv.BillStreet,
|
||||||
|
City = sinv.BillCity,
|
||||||
|
Appartment= sinv.BillAppartment,
|
||||||
|
Country= sinv.BillCountry,
|
||||||
|
PostalCode= sinv.BillPostalCode,
|
||||||
|
Province= sinv.BillProvince,
|
||||||
|
};
|
||||||
|
|
||||||
chr = new() {
|
ChargesModel chr = new() {
|
||||||
Token = sinv.Token,
|
Token = sinv.Token,
|
||||||
AmountInCents = sinv.AmountInCents,
|
AmountInCents = sinv.AmountInCents,
|
||||||
Name = sinv.Name,
|
Name = sinv.Name,
|
||||||
@ -175,6 +187,7 @@ public class InvoiceController : Controller {
|
|||||||
Description = sinv.Description,
|
Description = sinv.Description,
|
||||||
CurrencyCode = sinv.CurrencyCode,
|
CurrencyCode = sinv.CurrencyCode,
|
||||||
LastFourDigits = sinv.LastFourDigits,
|
LastFourDigits = sinv.LastFourDigits,
|
||||||
|
BillingAddress = bill
|
||||||
};
|
};
|
||||||
|
|
||||||
inv.Payment = chr;
|
inv.Payment = chr;
|
||||||
|
@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|||||||
namespace GrossesMitainesAPI.Migrations
|
namespace GrossesMitainesAPI.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(InventoryContext))]
|
[DbContext(typeof(InventoryContext))]
|
||||||
[Migration("20221212184710_Initial-Db")]
|
[Migration("20221212202643_Initial-Db")]
|
||||||
partial class InitialDb
|
partial class InitialDb
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
@ -104,7 +104,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
{
|
{
|
||||||
Id = "ecf7503a-591c-454e-a824-048e10bd0474",
|
Id = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "2ac18a08-5d70-48e8-9573-320dad586981",
|
ConcurrencyStamp = "88a1532a-3749-409e-8463-7f68f04c2225",
|
||||||
Email = "admin@admin.com",
|
Email = "admin@admin.com",
|
||||||
EmailConfirmed = false,
|
EmailConfirmed = false,
|
||||||
FirstName = "Roger",
|
FirstName = "Roger",
|
||||||
@ -112,10 +112,10 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "ADMIN@ADMIN.COM",
|
NormalizedEmail = "ADMIN@ADMIN.COM",
|
||||||
NormalizedUserName = "ADMIN",
|
NormalizedUserName = "ADMIN",
|
||||||
PasswordHash = "AQAAAAIAAYagAAAAEOGVyf1NmEyY4lQvKgz6hPT/e1tBM6OD+QhgvL+F5cl18hJd3SgTaXr68sG1R+zZ/w==",
|
PasswordHash = "AQAAAAIAAYagAAAAEOixAy1U6YTbU41EkE4Yb3isi7ZhI/6YVpmzsfcy2aC2e7olVRw52N7h+ivBX6nSVg==",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "f5e5a167-cf8a-49d0-a59a-c3bce8edd1b4",
|
SecurityStamp = "f1e4d7cd-ff9b-428c-9bbf-a560e4607775",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "Admin"
|
UserName = "Admin"
|
||||||
},
|
},
|
||||||
@ -123,7 +123,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
{
|
{
|
||||||
Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "e21f342e-e51b-49bc-8e1c-e5e1850cbe7d",
|
ConcurrencyStamp = "12929beb-3cd0-4f28-a965-ecb9d0299c86",
|
||||||
Email = "paul@exemple.com",
|
Email = "paul@exemple.com",
|
||||||
EmailConfirmed = false,
|
EmailConfirmed = false,
|
||||||
FirstName = "Paul",
|
FirstName = "Paul",
|
||||||
@ -131,10 +131,10 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "PAUL@EXEMPLE.COM",
|
NormalizedEmail = "PAUL@EXEMPLE.COM",
|
||||||
NormalizedUserName = "PASLA",
|
NormalizedUserName = "PASLA",
|
||||||
PasswordHash = "AQAAAAIAAYagAAAAEI1VUySaarTQ0fnHErjdFYCdY3RHc0gBsXf7beebl/gIELG9r+negBoOOflW1PlqNw==",
|
PasswordHash = "AQAAAAIAAYagAAAAEN5YIl6BfmRcgns81BzscQa5/UmHzZxkoBraDPod7EFwjxYL0KJCneEimbytwK91lQ==",
|
||||||
PhoneNumber = "222-222-2222",
|
PhoneNumber = "222-222-2222",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "2e2a1e6a-c280-458b-8378-078407c218c5",
|
SecurityStamp = "5a5c5690-7ac8-4cb6-8820-b840f5a0e4f6",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "PasLa"
|
UserName = "PasLa"
|
||||||
});
|
});
|
||||||
@ -235,6 +235,9 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
b.Property<long>("AmountInCents")
|
b.Property<long>("AmountInCents")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<int>("BillingAddressId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<string>("CurrencyCode")
|
b.Property<string>("CurrencyCode")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
@ -265,6 +268,8 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BillingAddressId");
|
||||||
|
|
||||||
b.ToTable("ChargesModel");
|
b.ToTable("ChargesModel");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -328,7 +333,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2559),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7175),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 0
|
Status = 0
|
||||||
},
|
},
|
||||||
@ -340,7 +345,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2620),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7234),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 1
|
Status = 1
|
||||||
},
|
},
|
||||||
@ -352,7 +357,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2622),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7236),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 3
|
Status = 3
|
||||||
},
|
},
|
||||||
@ -364,7 +369,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2624),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7238),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 4
|
Status = 4
|
||||||
},
|
},
|
||||||
@ -376,7 +381,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2626),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7240),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 5
|
Status = 5
|
||||||
},
|
},
|
||||||
@ -387,7 +392,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
FirstName = "Jérémy",
|
FirstName = "Jérémy",
|
||||||
LastName = "Le Petit",
|
LastName = "Le Petit",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2628),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7242),
|
||||||
ShippingAddressId = 2,
|
ShippingAddressId = 2,
|
||||||
Status = 0
|
Status = 0
|
||||||
},
|
},
|
||||||
@ -399,7 +404,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "A.",
|
LastName = "A.",
|
||||||
LinkedAccountId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
LinkedAccountId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2657),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7259),
|
||||||
ShippingAddressId = 3,
|
ShippingAddressId = 3,
|
||||||
Status = 3
|
Status = 3
|
||||||
});
|
});
|
||||||
@ -1205,6 +1210,17 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
.HasForeignKey("InventoryUserId");
|
.HasForeignKey("InventoryUserId");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GrossesMitainesAPI.Models.ChargesModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("GrossesMitainesAPI.Models.AddressModel", "BillingAddress")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("BillingAddressId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("BillingAddress");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount")
|
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount")
|
@ -54,26 +54,6 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
|
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "ChargesModel",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
Id = table.Column<int>(type: "int", nullable: false)
|
|
||||||
.Annotation("SqlServer:Identity", "1, 1"),
|
|
||||||
Token = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
||||||
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
||||||
AmountInCents = table.Column<long>(type: "bigint", nullable: false),
|
|
||||||
CurrencyCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
||||||
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
||||||
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
||||||
Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
||||||
LastFourDigits = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("PK_ChargesModel", x => x.Id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Products",
|
name: "Products",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@ -229,6 +209,33 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
onDelete: ReferentialAction.Cascade);
|
onDelete: ReferentialAction.Cascade);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "ChargesModel",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
Id = table.Column<int>(type: "int", nullable: false)
|
||||||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
||||||
|
Token = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Description = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
AmountInCents = table.Column<long>(type: "bigint", nullable: false),
|
||||||
|
CurrencyCode = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Email = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
Phone = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
LastFourDigits = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
||||||
|
BillingAddressId = table.Column<int>(type: "int", nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("PK_ChargesModel", x => x.Id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "FK_ChargesModel_Addresses_BillingAddressId",
|
||||||
|
column: x => x.BillingAddressId,
|
||||||
|
principalTable: "Addresses",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "Invoices",
|
name: "Invoices",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@ -311,8 +318,8 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "FirstName", "LastName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
|
columns: new[] { "Id", "AccessFailedCount", "ConcurrencyStamp", "Email", "EmailConfirmed", "FirstName", "LastName", "LockoutEnabled", "LockoutEnd", "NormalizedEmail", "NormalizedUserName", "PasswordHash", "PhoneNumber", "PhoneNumberConfirmed", "SecurityStamp", "TwoFactorEnabled", "UserName" },
|
||||||
values: new object[,]
|
values: new object[,]
|
||||||
{
|
{
|
||||||
{ "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", 0, "e21f342e-e51b-49bc-8e1c-e5e1850cbe7d", "paul@exemple.com", false, "Paul", "A.", false, null, "PAUL@EXEMPLE.COM", "PASLA", "AQAAAAIAAYagAAAAEI1VUySaarTQ0fnHErjdFYCdY3RHc0gBsXf7beebl/gIELG9r+negBoOOflW1PlqNw==", "222-222-2222", false, "2e2a1e6a-c280-458b-8378-078407c218c5", false, "PasLa" },
|
{ "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", 0, "12929beb-3cd0-4f28-a965-ecb9d0299c86", "paul@exemple.com", false, "Paul", "A.", false, null, "PAUL@EXEMPLE.COM", "PASLA", "AQAAAAIAAYagAAAAEN5YIl6BfmRcgns81BzscQa5/UmHzZxkoBraDPod7EFwjxYL0KJCneEimbytwK91lQ==", "222-222-2222", false, "5a5c5690-7ac8-4cb6-8820-b840f5a0e4f6", false, "PasLa" },
|
||||||
{ "ecf7503a-591c-454e-a824-048e10bd0474", 0, "2ac18a08-5d70-48e8-9573-320dad586981", "admin@admin.com", false, "Roger", "Admin", false, null, "ADMIN@ADMIN.COM", "ADMIN", "AQAAAAIAAYagAAAAEOGVyf1NmEyY4lQvKgz6hPT/e1tBM6OD+QhgvL+F5cl18hJd3SgTaXr68sG1R+zZ/w==", "111-111-1111", false, "f5e5a167-cf8a-49d0-a59a-c3bce8edd1b4", false, "Admin" }
|
{ "ecf7503a-591c-454e-a824-048e10bd0474", 0, "88a1532a-3749-409e-8463-7f68f04c2225", "admin@admin.com", false, "Roger", "Admin", false, null, "ADMIN@ADMIN.COM", "ADMIN", "AQAAAAIAAYagAAAAEOixAy1U6YTbU41EkE4Yb3isi7ZhI/6YVpmzsfcy2aC2e7olVRw52N7h+ivBX6nSVg==", "111-111-1111", false, "f1e4d7cd-ff9b-428c-9bbf-a560e4607775", false, "Admin" }
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.InsertData(
|
migrationBuilder.InsertData(
|
||||||
@ -376,13 +383,13 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
columns: new[] { "Id", "EmailAddress", "FirstName", "LastName", "LinkedAccountId", "PaymentId", "PhoneNumber", "PurchaseDate", "ShippingAddressId", "Status" },
|
columns: new[] { "Id", "EmailAddress", "FirstName", "LastName", "LinkedAccountId", "PaymentId", "PhoneNumber", "PurchaseDate", "ShippingAddressId", "Status" },
|
||||||
values: new object[,]
|
values: new object[,]
|
||||||
{
|
{
|
||||||
{ 6, "test@admin.com", "Jérémy", "Le Petit", null, null, "111-111-1111", new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2628), 2, 0 },
|
{ 6, "test@admin.com", "Jérémy", "Le Petit", null, null, "111-111-1111", new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7242), 2, 0 },
|
||||||
{ 1, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2559), 1, 0 },
|
{ 1, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7175), 1, 0 },
|
||||||
{ 2, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2620), 1, 1 },
|
{ 2, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7234), 1, 1 },
|
||||||
{ 3, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2622), 1, 3 },
|
{ 3, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7236), 1, 3 },
|
||||||
{ 4, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2624), 1, 4 },
|
{ 4, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7238), 1, 4 },
|
||||||
{ 5, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2626), 1, 5 },
|
{ 5, "admin@admin.com", "Roger", "Admin", "ecf7503a-591c-454e-a824-048e10bd0474", null, "111-111-1111", new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7240), 1, 5 },
|
||||||
{ 7, "paul@exemple.com", "Paul", "A.", "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", null, "111-111-1111", new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2657), 3, 3 }
|
{ 7, "paul@exemple.com", "Paul", "A.", "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", null, "111-111-1111", new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7259), 3, 3 }
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.InsertData(
|
migrationBuilder.InsertData(
|
||||||
@ -454,6 +461,11 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
unique: true,
|
unique: true,
|
||||||
filter: "[NormalizedUserName] IS NOT NULL");
|
filter: "[NormalizedUserName] IS NOT NULL");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "IX_ChargesModel_BillingAddressId",
|
||||||
|
table: "ChargesModel",
|
||||||
|
column: "BillingAddressId");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "IX_Invoices_LinkedAccountId",
|
name: "IX_Invoices_LinkedAccountId",
|
||||||
table: "Invoices",
|
table: "Invoices",
|
||||||
@ -511,10 +523,10 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
name: "Products");
|
name: "Products");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "Addresses");
|
name: "ChargesModel");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "ChargesModel");
|
name: "Addresses");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "AspNetUsers");
|
name: "AspNetUsers");
|
@ -101,7 +101,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
{
|
{
|
||||||
Id = "ecf7503a-591c-454e-a824-048e10bd0474",
|
Id = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "2ac18a08-5d70-48e8-9573-320dad586981",
|
ConcurrencyStamp = "88a1532a-3749-409e-8463-7f68f04c2225",
|
||||||
Email = "admin@admin.com",
|
Email = "admin@admin.com",
|
||||||
EmailConfirmed = false,
|
EmailConfirmed = false,
|
||||||
FirstName = "Roger",
|
FirstName = "Roger",
|
||||||
@ -109,10 +109,10 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "ADMIN@ADMIN.COM",
|
NormalizedEmail = "ADMIN@ADMIN.COM",
|
||||||
NormalizedUserName = "ADMIN",
|
NormalizedUserName = "ADMIN",
|
||||||
PasswordHash = "AQAAAAIAAYagAAAAEOGVyf1NmEyY4lQvKgz6hPT/e1tBM6OD+QhgvL+F5cl18hJd3SgTaXr68sG1R+zZ/w==",
|
PasswordHash = "AQAAAAIAAYagAAAAEOixAy1U6YTbU41EkE4Yb3isi7ZhI/6YVpmzsfcy2aC2e7olVRw52N7h+ivBX6nSVg==",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "f5e5a167-cf8a-49d0-a59a-c3bce8edd1b4",
|
SecurityStamp = "f1e4d7cd-ff9b-428c-9bbf-a560e4607775",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "Admin"
|
UserName = "Admin"
|
||||||
},
|
},
|
||||||
@ -120,7 +120,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
{
|
{
|
||||||
Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
||||||
AccessFailedCount = 0,
|
AccessFailedCount = 0,
|
||||||
ConcurrencyStamp = "e21f342e-e51b-49bc-8e1c-e5e1850cbe7d",
|
ConcurrencyStamp = "12929beb-3cd0-4f28-a965-ecb9d0299c86",
|
||||||
Email = "paul@exemple.com",
|
Email = "paul@exemple.com",
|
||||||
EmailConfirmed = false,
|
EmailConfirmed = false,
|
||||||
FirstName = "Paul",
|
FirstName = "Paul",
|
||||||
@ -128,10 +128,10 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LockoutEnabled = false,
|
LockoutEnabled = false,
|
||||||
NormalizedEmail = "PAUL@EXEMPLE.COM",
|
NormalizedEmail = "PAUL@EXEMPLE.COM",
|
||||||
NormalizedUserName = "PASLA",
|
NormalizedUserName = "PASLA",
|
||||||
PasswordHash = "AQAAAAIAAYagAAAAEI1VUySaarTQ0fnHErjdFYCdY3RHc0gBsXf7beebl/gIELG9r+negBoOOflW1PlqNw==",
|
PasswordHash = "AQAAAAIAAYagAAAAEN5YIl6BfmRcgns81BzscQa5/UmHzZxkoBraDPod7EFwjxYL0KJCneEimbytwK91lQ==",
|
||||||
PhoneNumber = "222-222-2222",
|
PhoneNumber = "222-222-2222",
|
||||||
PhoneNumberConfirmed = false,
|
PhoneNumberConfirmed = false,
|
||||||
SecurityStamp = "2e2a1e6a-c280-458b-8378-078407c218c5",
|
SecurityStamp = "5a5c5690-7ac8-4cb6-8820-b840f5a0e4f6",
|
||||||
TwoFactorEnabled = false,
|
TwoFactorEnabled = false,
|
||||||
UserName = "PasLa"
|
UserName = "PasLa"
|
||||||
});
|
});
|
||||||
@ -232,6 +232,9 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
b.Property<long>("AmountInCents")
|
b.Property<long>("AmountInCents")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<int>("BillingAddressId")
|
||||||
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<string>("CurrencyCode")
|
b.Property<string>("CurrencyCode")
|
||||||
.IsRequired()
|
.IsRequired()
|
||||||
.HasColumnType("nvarchar(max)");
|
.HasColumnType("nvarchar(max)");
|
||||||
@ -262,6 +265,8 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("BillingAddressId");
|
||||||
|
|
||||||
b.ToTable("ChargesModel");
|
b.ToTable("ChargesModel");
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -325,7 +330,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2559),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7175),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 0
|
Status = 0
|
||||||
},
|
},
|
||||||
@ -337,7 +342,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2620),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7234),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 1
|
Status = 1
|
||||||
},
|
},
|
||||||
@ -349,7 +354,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2622),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7236),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 3
|
Status = 3
|
||||||
},
|
},
|
||||||
@ -361,7 +366,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2624),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7238),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 4
|
Status = 4
|
||||||
},
|
},
|
||||||
@ -373,7 +378,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "Admin",
|
LastName = "Admin",
|
||||||
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
LinkedAccountId = "ecf7503a-591c-454e-a824-048e10bd0474",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2626),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7240),
|
||||||
ShippingAddressId = 1,
|
ShippingAddressId = 1,
|
||||||
Status = 5
|
Status = 5
|
||||||
},
|
},
|
||||||
@ -384,7 +389,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
FirstName = "Jérémy",
|
FirstName = "Jérémy",
|
||||||
LastName = "Le Petit",
|
LastName = "Le Petit",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2628),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7242),
|
||||||
ShippingAddressId = 2,
|
ShippingAddressId = 2,
|
||||||
Status = 0
|
Status = 0
|
||||||
},
|
},
|
||||||
@ -396,7 +401,7 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
LastName = "A.",
|
LastName = "A.",
|
||||||
LinkedAccountId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
LinkedAccountId = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
|
||||||
PhoneNumber = "111-111-1111",
|
PhoneNumber = "111-111-1111",
|
||||||
PurchaseDate = new DateTime(2022, 12, 12, 10, 47, 9, 782, DateTimeKind.Local).AddTicks(2657),
|
PurchaseDate = new DateTime(2022, 12, 12, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7259),
|
||||||
ShippingAddressId = 3,
|
ShippingAddressId = 3,
|
||||||
Status = 3
|
Status = 3
|
||||||
});
|
});
|
||||||
@ -1202,6 +1207,17 @@ namespace GrossesMitainesAPI.Migrations
|
|||||||
.HasForeignKey("InventoryUserId");
|
.HasForeignKey("InventoryUserId");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("GrossesMitainesAPI.Models.ChargesModel", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("GrossesMitainesAPI.Models.AddressModel", "BillingAddress")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("BillingAddressId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.Navigation("BillingAddress");
|
||||||
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
modelBuilder.Entity("GrossesMitainesAPI.Models.InvoiceModel", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount")
|
b.HasOne("GrossesMitainesAPI.Data.InventoryUser", "LinkedAccount")
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
namespace GrossesMitainesAPI.Models;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
|
||||||
|
namespace GrossesMitainesAPI.Models;
|
||||||
public class ChargeReturnModel {
|
public class ChargeReturnModel {
|
||||||
public string Token { get; set; }
|
public string Token { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
@ -9,4 +11,5 @@ public class ChargeReturnModel {
|
|||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
public int Invoice { get; set; }
|
public int Invoice { get; set; }
|
||||||
public string LastFourDigits { get; set; }
|
public string LastFourDigits { get; set; }
|
||||||
|
public AddressModel ShippingAddress { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,5 @@ public class ChargesModel {
|
|||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
public string LastFourDigits { get; set; }
|
public string LastFourDigits { get; set; }
|
||||||
|
public AddressModel BillingAddress { get; set; }
|
||||||
}
|
}
|
||||||
|
@ -36,4 +36,20 @@ namespace GrossesMitainesAPI.Models;
|
|||||||
public string Email { get; set; }
|
public string Email { get; set; }
|
||||||
public string Phone { get; set; }
|
public string Phone { get; set; }
|
||||||
public string LastFourDigits { get; set; }
|
public string LastFourDigits { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
[Required, Range(1, int.MaxValue)]
|
||||||
|
public int BillCivicNumber { get; set; }
|
||||||
|
public string? BillAppartment { get; set; }
|
||||||
|
[Required, MinLength(3), MaxLength(50)]
|
||||||
|
public string BillStreet { get; set; }
|
||||||
|
[Required, MinLength(4), MaxLength(50)]
|
||||||
|
public string BillCity { get; set; }
|
||||||
|
[Required, MaxLength(3)]
|
||||||
|
public string BillProvince { get; set; }
|
||||||
|
[Required, MinLength(4), MaxLength(30)]
|
||||||
|
public string BillCountry { get; set; }
|
||||||
|
// Source pour regex: https://stackoverflow.com/questions/15774555/efficient-regex-for-canadian-postal-code-function
|
||||||
|
//[Required, RegularExpression(@"/^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i")]
|
||||||
|
public string BillPostalCode { get; set; }
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user