Compare commits

..

No commits in common. "b404d4f2d04c6ea3ed23376f45bd3d3d6174023d" and "4facacb85314e0530510cd813b2dee6b0ea11260" have entirely different histories.

16 changed files with 207 additions and 492 deletions

View File

@ -70,7 +70,6 @@ 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());
@ -78,7 +77,6 @@ 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());
@ -101,9 +99,7 @@ public class InvoiceController : Controller {
} }
try { try {
inv = _context.Invoices.Where(x => x.Id == id).Include("ShippingAddress") inv = _context.Invoices.Where(x => x.Id == id).Include("ShippingAddress").First();
.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();
@ -168,26 +164,16 @@ public class InvoiceController : Controller {
// Charges! // Charges!
StripeConfiguration.ApiKey = _stripeOptions.Value.SecretKey; StripeConfiguration.ApiKey = _stripeOptions.Value.SecretKey;
AddressModel bill = new() { ChargesModel chr;
CivicNumber = sinv.BillCivicNumber,
Street = sinv.BillStreet,
City = sinv.BillCity,
Appartment= sinv.BillAppartment,
Country= sinv.BillCountry,
PostalCode= sinv.BillPostalCode,
Province= sinv.BillProvince,
};
ChargesModel chr = new() { chr = new() {
Token = sinv.Token, Token = sinv.Token,
AmountInCents = sinv.AmountInCents, AmountInCents = sinv.AmountInCents,
Name = sinv.Name, Name = sinv.Name,
Phone = sinv.Phone, Phone = sinv.Phone,
Email = sinv.Email, Email = sinv.Email,
Description = sinv.Description, Description = sinv.Description,
CurrencyCode = sinv.CurrencyCode, CurrencyCode = sinv.CurrencyCode
LastFourDigits = sinv.LastFourDigits,
BillingAddress = bill
}; };
inv.Payment = chr; inv.Payment = chr;
@ -204,6 +190,13 @@ public class InvoiceController : Controller {
if (charge.FailureMessage is not null && charge.FailureMessage != "") if (charge.FailureMessage is not null && charge.FailureMessage != "")
return Json(charge.ToJson()); return Json(charge.ToJson());
try {
_context.Invoices.Update(inv);
_context.SaveChanges();
} catch (Exception ex) {
_logger.LogError(20, ex.Message);
return BadRequest(ex.Message);
}
if (user.Result is not null) { // Gestion de l'adresse client. if (user.Result is not null) { // Gestion de l'adresse client.
inv.LinkedAccount = user.Result; inv.LinkedAccount = user.Result;

View File

@ -12,18 +12,17 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace GrossesMitainesAPI.Migrations namespace GrossesMitainesAPI.Migrations
{ {
[DbContext(typeof(InventoryContext))] [DbContext(typeof(InventoryContext))]
[Migration("20221212202643_Initial-Db")] [Migration("20221204170850_Initial-Db")]
partial class InitialDb partial class InitialDb
{ {
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "7.0.0") .HasAnnotation("ProductVersion", "6.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 128); .HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b =>
{ {
@ -104,7 +103,7 @@ namespace GrossesMitainesAPI.Migrations
{ {
Id = "ecf7503a-591c-454e-a824-048e10bd0474", Id = "ecf7503a-591c-454e-a824-048e10bd0474",
AccessFailedCount = 0, AccessFailedCount = 0,
ConcurrencyStamp = "88a1532a-3749-409e-8463-7f68f04c2225", ConcurrencyStamp = "61f3249f-495f-48c8-ac7e-7d21b3da82c7",
Email = "admin@admin.com", Email = "admin@admin.com",
EmailConfirmed = false, EmailConfirmed = false,
FirstName = "Roger", FirstName = "Roger",
@ -112,10 +111,10 @@ namespace GrossesMitainesAPI.Migrations
LockoutEnabled = false, LockoutEnabled = false,
NormalizedEmail = "ADMIN@ADMIN.COM", NormalizedEmail = "ADMIN@ADMIN.COM",
NormalizedUserName = "ADMIN", NormalizedUserName = "ADMIN",
PasswordHash = "AQAAAAIAAYagAAAAEOixAy1U6YTbU41EkE4Yb3isi7ZhI/6YVpmzsfcy2aC2e7olVRw52N7h+ivBX6nSVg==", PasswordHash = "AQAAAAEAACcQAAAAELswgBNsSfJwmigdKX2rpHseOEi20F+ZUhxapu80HTnxZamC3lu1hyAGMXj4kQumMw==",
PhoneNumber = "111-111-1111", PhoneNumber = "111-111-1111",
PhoneNumberConfirmed = false, PhoneNumberConfirmed = false,
SecurityStamp = "f1e4d7cd-ff9b-428c-9bbf-a560e4607775", SecurityStamp = "3098997b-a081-41ec-aa08-6cdea0028db7",
TwoFactorEnabled = false, TwoFactorEnabled = false,
UserName = "Admin" UserName = "Admin"
}, },
@ -123,7 +122,7 @@ namespace GrossesMitainesAPI.Migrations
{ {
Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", Id = "af9178c8-1a02-4ff8-bc0a-c8248dad6e09",
AccessFailedCount = 0, AccessFailedCount = 0,
ConcurrencyStamp = "12929beb-3cd0-4f28-a965-ecb9d0299c86", ConcurrencyStamp = "b7103a3b-8f05-462d-9fc0-5d4faa4669dc",
Email = "paul@exemple.com", Email = "paul@exemple.com",
EmailConfirmed = false, EmailConfirmed = false,
FirstName = "Paul", FirstName = "Paul",
@ -131,10 +130,10 @@ namespace GrossesMitainesAPI.Migrations
LockoutEnabled = false, LockoutEnabled = false,
NormalizedEmail = "PAUL@EXEMPLE.COM", NormalizedEmail = "PAUL@EXEMPLE.COM",
NormalizedUserName = "PASLA", NormalizedUserName = "PASLA",
PasswordHash = "AQAAAAIAAYagAAAAEN5YIl6BfmRcgns81BzscQa5/UmHzZxkoBraDPod7EFwjxYL0KJCneEimbytwK91lQ==", PasswordHash = "AQAAAAEAACcQAAAAEN68b+gEQV5Vx2grBL94+BzugXFrgXko6KtdY3p/NJN17mk8QCpGlQfJ3BMe040+dg==",
PhoneNumber = "222-222-2222", PhoneNumber = "222-222-2222",
PhoneNumberConfirmed = false, PhoneNumberConfirmed = false,
SecurityStamp = "5a5c5690-7ac8-4cb6-8820-b840f5a0e4f6", SecurityStamp = "99183d90-1f1c-4a8e-9891-ea8ab3b714d0",
TwoFactorEnabled = false, TwoFactorEnabled = false,
UserName = "PasLa" UserName = "PasLa"
}); });
@ -146,7 +145,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Appartment") b.Property<string>("Appartment")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -230,14 +229,11 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
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)");
@ -250,10 +246,6 @@ namespace GrossesMitainesAPI.Migrations
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("LastFourDigits")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -268,8 +260,6 @@ namespace GrossesMitainesAPI.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("BillingAddressId");
b.ToTable("ChargesModel"); b.ToTable("ChargesModel");
}); });
@ -279,7 +269,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("EmailAddress") b.Property<string>("EmailAddress")
.IsRequired() .IsRequired()
@ -333,7 +323,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7175), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9261),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 0 Status = 0
}, },
@ -345,7 +335,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7234), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9300),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 1 Status = 1
}, },
@ -357,7 +347,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7236), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9327),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 3 Status = 3
}, },
@ -369,7 +359,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7238), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9333),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 4 Status = 4
}, },
@ -381,7 +371,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7240), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9338),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 5 Status = 5
}, },
@ -392,7 +382,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7242), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9344),
ShippingAddressId = 2, ShippingAddressId = 2,
Status = 0 Status = 0
}, },
@ -404,7 +394,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7259), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9357),
ShippingAddressId = 3, ShippingAddressId = 3,
Status = 3 Status = 3
}); });
@ -416,7 +406,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int?>("InvoiceModelId") b.Property<int?>("InvoiceModelId")
.HasColumnType("int"); .HasColumnType("int");
@ -570,7 +560,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Category") b.Property<string>("Category")
.IsRequired() .IsRequired()
@ -1069,12 +1059,14 @@ namespace GrossesMitainesAPI.Migrations
new new
{ {
Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af",
ConcurrencyStamp = "eac9c483-2e9f-4f9e-9b97-dc1c761f76c2",
Name = "Administrateur", Name = "Administrateur",
NormalizedName = "ADMINISTRATEUR" NormalizedName = "ADMINISTRATEUR"
}, },
new new
{ {
Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e",
ConcurrencyStamp = "fb8da1f2-a9df-4faa-9786-259cbc8c6f1c",
Name = "Client", Name = "Client",
NormalizedName = "CLIENT" NormalizedName = "CLIENT"
}); });
@ -1086,7 +1078,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -1111,7 +1103,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -1210,17 +1202,6 @@ 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")

View File

@ -3,14 +3,10 @@ using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable #nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace GrossesMitainesAPI.Migrations namespace GrossesMitainesAPI.Migrations
{ {
/// <inheritdoc />
public partial class InitialDb : Migration public partial class InitialDb : Migration
{ {
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
@ -54,6 +50,25 @@ 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)
},
constraints: table =>
{
table.PrimaryKey("PK_ChargesModel", x => x.Id);
});
migrationBuilder.CreateTable( migrationBuilder.CreateTable(
name: "Products", name: "Products",
columns: table => new columns: table => new
@ -209,33 +224,6 @@ 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
@ -309,8 +297,8 @@ namespace GrossesMitainesAPI.Migrations
columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" }, columns: new[] { "Id", "ConcurrencyStamp", "Name", "NormalizedName" },
values: new object[,] values: new object[,]
{ {
{ "1b7b9c55-c746-493a-a24f-3d5ca937298e", null, "Client", "CLIENT" }, { "1b7b9c55-c746-493a-a24f-3d5ca937298e", "fb8da1f2-a9df-4faa-9786-259cbc8c6f1c", "Client", "CLIENT" },
{ "c9e08b20-d8a5-473f-9f52-572eb23c12af", null, "Administrateur", "ADMINISTRATEUR" } { "c9e08b20-d8a5-473f-9f52-572eb23c12af", "eac9c483-2e9f-4f9e-9b97-dc1c761f76c2", "Administrateur", "ADMINISTRATEUR" }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -318,8 +306,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, "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" }, { "af9178c8-1a02-4ff8-bc0a-c8248dad6e09", 0, "b7103a3b-8f05-462d-9fc0-5d4faa4669dc", "paul@exemple.com", false, "Paul", "A.", false, null, "PAUL@EXEMPLE.COM", "PASLA", "AQAAAAEAACcQAAAAEN68b+gEQV5Vx2grBL94+BzugXFrgXko6KtdY3p/NJN17mk8QCpGlQfJ3BMe040+dg==", "222-222-2222", false, "99183d90-1f1c-4a8e-9891-ea8ab3b714d0", false, "PasLa" },
{ "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" } { "ecf7503a-591c-454e-a824-048e10bd0474", 0, "61f3249f-495f-48c8-ac7e-7d21b3da82c7", "admin@admin.com", false, "Roger", "Admin", false, null, "ADMIN@ADMIN.COM", "ADMIN", "AQAAAAEAACcQAAAAELswgBNsSfJwmigdKX2rpHseOEi20F+ZUhxapu80HTnxZamC3lu1hyAGMXj4kQumMw==", "111-111-1111", false, "3098997b-a081-41ec-aa08-6cdea0028db7", false, "Admin" }
}); });
migrationBuilder.InsertData( migrationBuilder.InsertData(
@ -378,26 +366,34 @@ namespace GrossesMitainesAPI.Migrations
{ "c9e08b20-d8a5-473f-9f52-572eb23c12af", "ecf7503a-591c-454e-a824-048e10bd0474" } { "c9e08b20-d8a5-473f-9f52-572eb23c12af", "ecf7503a-591c-454e-a824-048e10bd0474" }
}); });
migrationBuilder.InsertData(
table: "Invoices",
columns: new[] { "Id", "EmailAddress", "FirstName", "LastName", "LinkedAccountId", "PaymentId", "PhoneNumber", "PurchaseDate", "ShippingAddressId", "Status" },
values: new object[] { 6, "test@admin.com", "Jérémy", "Le Petit", null, null, "111-111-1111", new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9344), 2, 0 });
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "Invoices", table: "Invoices",
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, 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, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9261), 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, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9300), 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, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9327), 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, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9333), 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, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9338), 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, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9357), 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(
table: "ProductInvoice",
columns: new[] { "Id", "InvoiceModelId", "ProductId", "Quantity" },
values: new object[] { 16, 6, 20, 4L });
migrationBuilder.InsertData( migrationBuilder.InsertData(
table: "ProductInvoice", table: "ProductInvoice",
columns: new[] { "Id", "InvoiceModelId", "ProductId", "Quantity" }, columns: new[] { "Id", "InvoiceModelId", "ProductId", "Quantity" },
values: new object[,] values: new object[,]
{ {
{ 16, 6, 20, 4L },
{ 1, 1, 1, 2L }, { 1, 1, 1, 2L },
{ 2, 1, 4, 5L }, { 2, 1, 4, 5L },
{ 3, 2, 3, 1L }, { 3, 2, 3, 1L },
@ -461,11 +457,6 @@ 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",
@ -492,7 +483,6 @@ namespace GrossesMitainesAPI.Migrations
column: "ProductId"); column: "ProductId");
} }
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder)
{ {
migrationBuilder.DropTable( migrationBuilder.DropTable(
@ -523,10 +513,10 @@ namespace GrossesMitainesAPI.Migrations
name: "Products"); name: "Products");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "ChargesModel"); name: "Addresses");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "Addresses"); name: "ChargesModel");
migrationBuilder.DropTable( migrationBuilder.DropTable(
name: "AspNetUsers"); name: "AspNetUsers");

View File

@ -17,10 +17,10 @@ namespace GrossesMitainesAPI.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "7.0.0") .HasAnnotation("ProductVersion", "6.0.10")
.HasAnnotation("Relational:MaxIdentifierLength", 128); .HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b => modelBuilder.Entity("GrossesMitainesAPI.Data.InventoryUser", b =>
{ {
@ -101,7 +101,7 @@ namespace GrossesMitainesAPI.Migrations
{ {
Id = "ecf7503a-591c-454e-a824-048e10bd0474", Id = "ecf7503a-591c-454e-a824-048e10bd0474",
AccessFailedCount = 0, AccessFailedCount = 0,
ConcurrencyStamp = "88a1532a-3749-409e-8463-7f68f04c2225", ConcurrencyStamp = "61f3249f-495f-48c8-ac7e-7d21b3da82c7",
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 = "AQAAAAIAAYagAAAAEOixAy1U6YTbU41EkE4Yb3isi7ZhI/6YVpmzsfcy2aC2e7olVRw52N7h+ivBX6nSVg==", PasswordHash = "AQAAAAEAACcQAAAAELswgBNsSfJwmigdKX2rpHseOEi20F+ZUhxapu80HTnxZamC3lu1hyAGMXj4kQumMw==",
PhoneNumber = "111-111-1111", PhoneNumber = "111-111-1111",
PhoneNumberConfirmed = false, PhoneNumberConfirmed = false,
SecurityStamp = "f1e4d7cd-ff9b-428c-9bbf-a560e4607775", SecurityStamp = "3098997b-a081-41ec-aa08-6cdea0028db7",
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 = "12929beb-3cd0-4f28-a965-ecb9d0299c86", ConcurrencyStamp = "b7103a3b-8f05-462d-9fc0-5d4faa4669dc",
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 = "AQAAAAIAAYagAAAAEN5YIl6BfmRcgns81BzscQa5/UmHzZxkoBraDPod7EFwjxYL0KJCneEimbytwK91lQ==", PasswordHash = "AQAAAAEAACcQAAAAEN68b+gEQV5Vx2grBL94+BzugXFrgXko6KtdY3p/NJN17mk8QCpGlQfJ3BMe040+dg==",
PhoneNumber = "222-222-2222", PhoneNumber = "222-222-2222",
PhoneNumberConfirmed = false, PhoneNumberConfirmed = false,
SecurityStamp = "5a5c5690-7ac8-4cb6-8820-b840f5a0e4f6", SecurityStamp = "99183d90-1f1c-4a8e-9891-ea8ab3b714d0",
TwoFactorEnabled = false, TwoFactorEnabled = false,
UserName = "PasLa" UserName = "PasLa"
}); });
@ -143,7 +143,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Appartment") b.Property<string>("Appartment")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -227,14 +227,11 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
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)");
@ -247,10 +244,6 @@ namespace GrossesMitainesAPI.Migrations
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
b.Property<string>("LastFourDigits")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name") b.Property<string>("Name")
.IsRequired() .IsRequired()
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -265,8 +258,6 @@ namespace GrossesMitainesAPI.Migrations
b.HasKey("Id"); b.HasKey("Id");
b.HasIndex("BillingAddressId");
b.ToTable("ChargesModel"); b.ToTable("ChargesModel");
}); });
@ -276,7 +267,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("EmailAddress") b.Property<string>("EmailAddress")
.IsRequired() .IsRequired()
@ -330,7 +321,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7175), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9261),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 0 Status = 0
}, },
@ -342,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7234), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9300),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 1 Status = 1
}, },
@ -354,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7236), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9327),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 3 Status = 3
}, },
@ -366,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7238), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9333),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 4 Status = 4
}, },
@ -378,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7240), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9338),
ShippingAddressId = 1, ShippingAddressId = 1,
Status = 5 Status = 5
}, },
@ -389,7 +380,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7242), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9344),
ShippingAddressId = 2, ShippingAddressId = 2,
Status = 0 Status = 0
}, },
@ -401,7 +392,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, 12, 26, 42, 867, DateTimeKind.Local).AddTicks(7259), PurchaseDate = new DateTime(2022, 12, 4, 9, 8, 50, 6, DateTimeKind.Local).AddTicks(9357),
ShippingAddressId = 3, ShippingAddressId = 3,
Status = 3 Status = 3
}); });
@ -413,7 +404,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int?>("InvoiceModelId") b.Property<int?>("InvoiceModelId")
.HasColumnType("int"); .HasColumnType("int");
@ -567,7 +558,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Category") b.Property<string>("Category")
.IsRequired() .IsRequired()
@ -1066,12 +1057,14 @@ namespace GrossesMitainesAPI.Migrations
new new
{ {
Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af", Id = "c9e08b20-d8a5-473f-9f52-572eb23c12af",
ConcurrencyStamp = "eac9c483-2e9f-4f9e-9b97-dc1c761f76c2",
Name = "Administrateur", Name = "Administrateur",
NormalizedName = "ADMINISTRATEUR" NormalizedName = "ADMINISTRATEUR"
}, },
new new
{ {
Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e", Id = "1b7b9c55-c746-493a-a24f-3d5ca937298e",
ConcurrencyStamp = "fb8da1f2-a9df-4faa-9786-259cbc8c6f1c",
Name = "Client", Name = "Client",
NormalizedName = "CLIENT" NormalizedName = "CLIENT"
}); });
@ -1083,7 +1076,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -1108,7 +1101,7 @@ namespace GrossesMitainesAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("int"); .HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id")); SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("ClaimType") b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)"); .HasColumnType("nvarchar(max)");
@ -1207,17 +1200,6 @@ 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")

View File

@ -1,6 +1,4 @@
using System.ComponentModel.DataAnnotations; namespace GrossesMitainesAPI.Models;
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; }
@ -10,6 +8,4 @@ public class ChargeReturnModel {
public string Email { get; set; } public string Email { get; set; }
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 AddressModel ShippingAddress { get; set; }
} }

View File

@ -11,6 +11,4 @@ public class ChargesModel {
public string Name { get; set; } public string Name { get; set; }
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 AddressModel BillingAddress { get; set; }
} }

View File

@ -35,21 +35,4 @@ namespace GrossesMitainesAPI.Models;
public string Name { get; set; } public string Name { get; set; }
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; }
[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; }
} }

View File

@ -10,7 +10,7 @@
"DefaultConnection": "Server=(localdb)\\mssqllocaldb; Database=GrossesMitainesDB; Trusted_Connection=True; MultipleActiveResultSets=true" "DefaultConnection": "Server=(localdb)\\mssqllocaldb; Database=GrossesMitainesDB; Trusted_Connection=True; MultipleActiveResultSets=true"
}, },
"StripeTest": { "StripeTest": {
"PublicKey": "pk_test_51M8mzOEerenEZcQIUmJIrmsaZeeNlOil2G1JcMvvO68w50MJr8rDwUjVO44a8dDhSlsRH4GdzH9rDqtkg4Rtbzco00NqkHdn3H", "PublicKey": "pk_test_",
"SecretKey": "sk_test_51M8mzOEerenEZcQIyHb9AdeluhDsSy9PaxTeqDq6XUhSRCbbqvReHA2KoFb3a8Ru5PAzMgMlCKmj8UDpLKWzUUmr00rta511y8" "SecretKey": "sk_test_"
} }
} }

View File

@ -1,8 +1,7 @@
import { faTimes } from "@fortawesome/free-solid-svg-icons"; import { faTimes } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { weight } from "fontawesome";
const InvoiceItem = ({ invoice, onCancel, paymentInfos }) => { const InvoiceItem = ({ invoice, onCancel }) => {
const productTotal = (p) => { const productTotal = (p) => {
return (p.quantity * (p.product.status == 3 || p.product.status == 4 ? p.product.promoPrice : p.product.price)) return (p.quantity * (p.product.status == 3 || p.product.status == 4 ? p.product.promoPrice : p.product.price))
@ -82,8 +81,9 @@ const InvoiceItem = ({ invoice, onCancel, paymentInfos }) => {
) )
} }
} }
console.log(invoice);
return ( return (
<div className="invoice-item-container"> <div className="invoice-item-container">
<div className="invoice-item-info"> <div className="invoice-item-info">
{invoice.status != null ? {invoice.status != null ?
@ -94,26 +94,12 @@ const InvoiceItem = ({ invoice, onCancel, paymentInfos }) => {
null null
} }
<div className="invoice-item-expedition"> <div className="invoice-item-expedition">
<b>Adresse d'expédition :</b><br /> <b>Adresse d'expédition:</b><br />
{invoice.firstName} {invoice.lastName}<br /> {invoice.firstName} {invoice.lastName}<br />
{invoice.shippingAddress.civicNumber} {invoice.shippingAddress.street} <br /> {invoice.shippingAddress.civicNumber} {invoice.shippingAddress.street} <br />
{invoice.shippingAddress.appartment != null ? <>App: {invoice.shippingAddress.appartment} <br /></> : null} {invoice.shippingAddress.appartment != null ? <>App: {invoice.shippingAddress.appartment} <br /></> : null}
{invoice.shippingAddress.city}, {invoice.shippingAddress.province} {invoice.shippingAddress.postalCode}<br /> {invoice.shippingAddress.city}, {invoice.shippingAddress.province} {invoice.shippingAddress.postalCode}<br />
{invoice.shippingAddress.country}<br /><br/> {invoice.shippingAddress.country}<br />
{paymentInfos == true && invoice.payment != null ? <>
<label style={{"fontWeight": "bold"}}>Informations de paiement :</label><br/>
Nom : {invoice.payment.name}<br/>
Email : {invoice.payment.email}<br/>
Téléphone : {invoice.payment.phone}<br/>
Numéro de carte : **** **** **** {invoice.payment.lastFourDigits}<br/><br/>
<label style={{"fontWeight": "bold"}}>Adresse de Facturation :</label><br/>
{invoice.payment.billingAddress.civicNumber} {invoice.payment.billingAddress.street} <br />
{invoice.payment.billingAddress.appartment != null ? <>App: {invoice.payment.billingAddress.appartment} <br /></> : null}
{invoice.payment.billingAddress.city}, {invoice.payment.billingAddress.province} {invoice.payment.billingAddress.postalCode}<br />
{invoice.payment.billingAddress.country}<br /><br/>
</>
: null }
</div> </div>
</div> </div>
<div className="invoice-item-products"> <div className="invoice-item-products">

View File

@ -1,6 +1,6 @@
import InvoiceItem from "./InvoiceItem"; import InvoiceItem from "./InvoiceItem";
const InvoiceList = ({ invoices, onCancel, paymentInfos }) => { const InvoiceList = ({ invoices, onCancel }) => {
return ( return (
<div className="invoice-list-container"> <div className="invoice-list-container">
{invoices.map((invoice) => ( {invoices.map((invoice) => (
@ -8,7 +8,6 @@ const InvoiceList = ({ invoices, onCancel, paymentInfos }) => {
key={invoice.id} key={invoice.id}
invoice={invoice} invoice={invoice}
onCancel={onCancel} onCancel={onCancel}
paymentInfos={paymentInfos}
/> />
))} ))}
</div> </div>

View File

@ -1,12 +1,6 @@
import React, { useState, useContext, useEffect } from "react" import React, { useState } from "react"
import { CardElement, useElements, useStripe } from "@stripe/react-stripe-js" import { CardElement, useElements, useStripe } from "@stripe/react-stripe-js"
import { Row, Col, Button, Form } from "react-bootstrap" import { Button } from "react-bootstrap"
import Swal from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
import { CartContext } from "../components/Cart";
import { useNavigate } from "react-router-dom";
import { useForm } from "react-hook-form";
import Cookies from "universal-cookie";
const CARD_OPTIONS = { const CARD_OPTIONS = {
iconStyle: "solid", iconStyle: "solid",
@ -30,84 +24,16 @@ const CARD_OPTIONS = {
const PaymentForm = ({ cost, invoice }) => { const PaymentForm = ({ cost }) => {
const navigate = useNavigate();
const { register, handleSubmit, setValue, formState: { errors } } = useForm();
const cookies = new Cookies();
const mySwal = withReactContent(Swal); const [success, setSuccess] = useState(false);
const [cardName, setCardName] = useState(""); const [cardName, setCardName] = useState("");
const [cardPhone, setCardPhone] = useState("");
const [cardEmail, setCardEmail] = useState("");
const [isLoading, setIsLoading] = useState(false);
const [userAddresses, setUserAddresses] = useState([]);
const [currentAdress, setCurrentAdress] = useState({
civicNumber: "",
appartment: "",
street: "",
city: "",
province: "",
country: "",
postalCode: ""
})
const stripe = useStripe(); const stripe = useStripe();
const elements = useElements(); const elements = useElements();
const cart = useContext(CartContext);
const handleSubmit = async (e) => {
e.preventDefault();
useEffect(() => { const { error, paymentMethod } = await stripe.createPaymentMethod({
const userInfo = cookies.get("GMGM");
if (userInfo != null && userInfo.LoggedIn == true) {
fetch("https://localhost:7292/api/Address", {
method: 'GET',
credentials: 'include',
mode: 'cors'
},).then(async (response) => {
if (response.ok) {
const json = await response.json();
setUserAddresses(json);
if (json.length >= 1) {
setFormAddress(json[0]);
}
}
});
}
}, []);
const setFormAddress = (address) => {
setCurrentAdress((e) => {
return {
...e,
civicNumber: address.civicNumber,
appartment: address.appartment,
street: address.street,
city: address.city,
province: address.province,
country: address.country,
postalCode: address.postalCode
}
});
setValue("civicNumber", address.civicNumber);
setValue("appartment", address.appartment);
setValue("street", address.street);
setValue("city", address.city);
setValue("province", address.province);
setValue("country", address.country);
setValue("postalCode", address.postalCode);
}
const onSubmit = async (e) => {
//e.preventDefault();
setIsLoading(true);
const { error } = await stripe.createPaymentMethod({
type: "card", type: "card",
card: elements.getElement(CardElement) card: elements.getElement(CardElement)
}) })
@ -118,62 +44,32 @@ const PaymentForm = ({ cost, invoice }) => {
} }
if (!error) { if (!error) {
stripe.createToken(elements.getElement(CardElement), { name: cardName }) const { id } = paymentMethod;
.then((result) => {
if (!result.error) {
invoice.token = result.token.id;
invoice.description = `Payement de ${cost} à GM`;
invoice.amountInCents = cost;
invoice.currencyCode = "CAD";
invoice.name = cardName;
invoice.email = cardEmail;
invoice.phone = cardPhone;
invoice.lastFourDigits = result.token.card.last4;
invoice.billCivicNumber = currentAdress.civicNumber;
invoice.billAppartment = currentAdress.appartment;
invoice.billStreet = currentAdress.street;
invoice.billCity = currentAdress.city;
invoice.billProvince = currentAdress.province;
invoice.billCountry = currentAdress.country;
invoice.billPostalCode = currentAdress.postalCode;
const json = JSON.stringify(invoice); const json = JSON.stringify({ amount: cost, stripeId: id });
console.log(invoice);
fetch(`https://localhost:7292/api/Payment`, {
method: 'POST',
credentials: 'include',
mode: 'cors',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: json
}).then((response) => {
if (response.ok) {
console.log("Successful payment");
setSuccess(true);
}
else {
console.log(response);
}
}).catch((error) => {
console.log("Error: ", error);
})
fetch(`https://localhost:7292/api/Invoice`, {
method: 'POST',
credentials: 'include',
mode: 'cors',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: json
}).then((response) => {
if (response.ok) {
mySwal.fire({
title: 'Commande envoyée avec succès!',
timer: 2000,
icon: "success"
}).then(
() => {
cart.emptyCart();
navigate('/myInvoices');
}
);
}
else {
mySwal.fire({
title: 'Erreur!',
timer: 2000,
icon: "error"
}).then(() => {
setIsLoading(false);
});
}
});
}
});
} }
else { else {
console.log(error.message); console.log(error.message);
@ -184,113 +80,24 @@ const PaymentForm = ({ cost, invoice }) => {
return ( return (
<> <>
{ {!success ?
<Col xl={4}> <form onSubmit={handleSubmit}>
<form onSubmit={handleSubmit(onSubmit)}> <fieldset className="FormGroup">
<div style={{ "borderRadius": "5px" }} className="form-container"> <input className="FormRow" placeholder="Cardholder Name" id="cardholder-name" type="text" value={cardName} onChange={e => setCardName(e.target.value)} />
<div className="FormRow">
<CardElement options={CARD_OPTIONS} />
<h4 className="text-center">Adresse de Facturation</h4>
<div className="Error_color">
<div className="formulaire-address">
<h5>
Adresse
<Form.Select onChange={(e) => setFormAddress(userAddresses[e.target.value])}>
{userAddresses.map((a, i) => (
<option key={a.id} value={i} >{a.civicNumber} {a.street} </option>
))}
</Form.Select>
</h5>
<div className="form-group">
<label>Numéro civique*: </label>
<input type="number" min="0" {...register("civicNumber", { required: true })}
value={currentAdress.civicNumber}
onChange={(e) => setCurrentAdress((prev) => { return { ...prev, civicNumber: e.target.value } })} />
</div>
<div>
{errors.civicNumber && errors.civicNumber.type === 'required' && <span>Vous devez entrer une numéro civique!</span>}
</div>
<div className="form-group">
<label>Rue*: </label>
<input {...register("street", { required: true, minLength: 3, maxLength: 50 })}
value={currentAdress.street}
onChange={(e) => setCurrentAdress((prev) => { return { ...prev, street: e.target.value } })} />
</div>
<div>
{errors.street && errors.street.type === 'required' && <span>Vous devez entrer votre rue!</span>}
{errors.street && errors.street.type === 'minLength' && <span>Votre rue doit avoir au moins 3 lettres!</span>}
{errors.street && errors.street.type === 'maxLength' && <span>Votre rue doit avoir moins de 51 lettres!</span>}
</div>
<div className="form-group">
<label>Numéro d'appartement: </label>
<input {...register("appartment", { required: false })}
value={currentAdress.appartment}
onChange={(e) => setCurrentAdress((prev) => { return { ...prev, appartment: e.target.value } })} />
</div>
<div className="form-group">
<label>Ville*: </label>
<input {...register("city", { required: true, minLength: 4, maxLength: 50 })}
value={currentAdress.city}
onChange={(e) => setCurrentAdress((prev) => { return { ...prev, city: e.target.value } })} />
</div>
<div>
{errors.city && errors.city.type === 'required' && <span>Vous devez entrer votre ville!</span>}
{errors.city && errors.city.type === 'minLength' && <span>Votre ville doit avoir au moins 4 lettres!</span>}
{errors.city && errors.city.type === 'maxLength' && <span>Votre ville doit avoir moins de 51 lettres!</span>}
</div>
<div className="form-group">
<label>Province (abréviation)*: </label>
<input placeholder="Exemple: QC" {...register("province", { required: true, maxLength: 3 })}
value={currentAdress.province}
onChange={(e) => setCurrentAdress((prev) => { return { ...prev, province: e.target.value } })} />
</div>
<div>
{errors.province && errors.province.type === 'required' && <span>Vous devez entrer votre province!</span>}
{errors.province && errors.province.type === 'maxLength' && <span>Votre province doit avoir moins de 4 lettres!</span>}
</div>
<div className="form-group">
<label>Pays*: </label>
<input {...register("country", { required: true, minLength: 4, maxLength: 30 })}
value={currentAdress.country}
onChange={(e) => setCurrentAdress((prev) => { return { ...prev, country: e.target.value } })} />
</div>
<div>
{errors.country && errors.country.type === 'required' && <span>Vous devez entrer votre pays!</span>}
{errors.country && errors.country.type === 'minLength' && <span>Votre pays doit avoir au moins 4 lettres!</span>}
{errors.cicountryty && errors.country.type === 'maxLength' && <span>Votre pays doit avoir moins de 31 lettres!</span>}
</div>
<div className="form-group">
<label>Code postal*: </label>
<input {...register("postalCode", { required: true, pattern: /^[ABCEGHJ-NPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ -]?\d[ABCEGHJ-NPRSTV-Z]\d$/i })}
value={currentAdress.postalCode}
onChange={(e) => setCurrentAdress((prev) => { return { ...prev, postalCode: e.target.value } })} />
</div>
<div>
{errors.postalCode && errors.postalCode.type === 'required' && <span>Vous devez entrer votre code postal!</span>}
{errors.postalCode && errors.postalCode.type === 'pattern' && <span>Veuillez entrer un code postal valide!</span>}
</div>
</div>
</div>
</div> </div>
<Col md={12}> </fieldset>
<fieldset className="FormGroup"> <div className="Payment-btn-container">
<input className="FormRow cardholder-info" placeholder="Nom sur la carte" id="cardholder-name" type="text" value={cardName} onChange={e => setCardName(e.target.value)} /> <Button className="Payment-btn" type="submit">Payer</Button>
<input className="FormRow cardholder-info" placeholder="Téléphone de facturation" id="cardholder-phone" type="text" value={cardPhone} onChange={e => setCardPhone(e.target.value)} /> </div>
<input className="FormRow cardholder-info" placeholder="Addresse courriel de facturation" id="cardholder-email" type="text" value={cardEmail} onChange={e => setCardEmail(e.target.value)} /> </form>
<div className="FormRow"> :
<CardElement options={CARD_OPTIONS} /> <div>
</div> <h2>
</fieldset> L'achat s'est déroulé avec succès
<div className="Payment-btn-container"> </h2>
<Button className="Payment-btn" disabled={isLoading} type="submit">Payer</Button> </div>
{
isLoading && <div>Paiement en cours...</div>
}
</div>
</Col>
</form>
</Col>
} }
</> </>
) )

View File

@ -7,10 +7,10 @@ const PUBLIC_KEY = "pk_test_51M8mzOEerenEZcQIUmJIrmsaZeeNlOil2G1JcMvvO68w50MJr8r
const stripeTestPromise = loadStripe(PUBLIC_KEY); const stripeTestPromise = loadStripe(PUBLIC_KEY);
const StripeContainer = ({cost, invoice}) => { const StripeContainer = ({cost}) => {
return ( return (
<Elements stripe={stripeTestPromise}> <Elements stripe={stripeTestPromise}>
<PaymentForm cost={cost} invoice={invoice} /> <PaymentForm cost={cost}/>
</Elements> </Elements>
) )
} }

View File

@ -86,7 +86,6 @@ const Invoices = () => {
<InvoiceList <InvoiceList
invoices={invoices} invoices={invoices}
onCancel={handleCancelInvoice} onCancel={handleCancelInvoice}
paymentInfos={false}
/> />
</> </>
); );

View File

@ -69,12 +69,12 @@ const MyInvoices = () => {
}; };
return ( return (
<> <>
<InvoiceList <InvoiceList
invoices={invoices} invoices={invoices}
onCancel={handleCancelInvoice} onCancel={handleCancelInvoice}
paymentInfos={true}
/> />
</> </>
); );

View File

@ -4,6 +4,8 @@ import ReviewProdList from "../components/ReviewProdList";
import TotalProductsPrice from "../components/TotalProductsPrice"; import TotalProductsPrice from "../components/TotalProductsPrice";
import { Row, Col, Button } from "react-bootstrap"; import { Row, Col, Button } from "react-bootstrap";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import Swal from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
import { CartContext } from "../components/Cart"; import { CartContext } from "../components/Cart";
import StripeContainer from "../components/StripeContainer" import StripeContainer from "../components/StripeContainer"
@ -11,7 +13,7 @@ const ReviewInvoice = () => {
const navigate = useNavigate(); const navigate = useNavigate();
const mySwal = withReactContent(Swal);
const cart = useContext(CartContext); const cart = useContext(CartContext);
@ -88,48 +90,47 @@ const ReviewInvoice = () => {
navigate("/formulaire") navigate("/formulaire")
} }
const handleConfirmer = async () => {
const json = JSON.stringify(thisInvoice);
// const handleConfirmer = async () => { const response = await fetch(`https://localhost:7292/api/Invoice`, {
// const json = JSON.stringify(thisInvoice); method: 'POST',
credentials: 'include',
mode: 'cors',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: json
})
if (response.ok) {
mySwal.fire({
title: 'Commande envoyée avec succès!',
timer: 2000,
icon: "success"
}).then(
() => {
cart.emptyCart();
navigate('/morceaux');
}
)
}
else {
console.log("Erreur de creation la commande #" + thisInvoice.id);
mySwal.fire({
title: 'Erreur!',
timer: 2000,
icon: "error"
})
}
// const response = await fetch(`https://localhost:7292/api/Invoice`, { }
// method: 'POST',
// credentials: 'include',
// mode: 'cors',
// headers: {
// 'Accept': 'application/json',
// 'Content-Type': 'application/json'
// },
// body: json
// })
// if (response.ok) {
// mySwal.fire({
// title: 'Commande envoyée avec succès!',
// timer: 2000,
// icon: "success"
// }).then(
// () => {
// cart.emptyCart();
// navigate('/morceaux');
// }
// )
// }
// else {
// console.log("Erreur de creation la commande #" + thisInvoice.id);
// mySwal.fire({
// title: 'Erreur!',
// timer: 2000,
// icon: "error"
// })
// }
// }
return ( return (
<> <>
<Row> <Row>
<h2 className="confirmer-infos">Veuillez confirmer les informations ci-dessous!</h2> <h2 className="confirmer-infos">Veuillez confirmer les informations ci-dessous!</h2>
<Col xs={6} xl={4}> <Col xs={6} md={4}>
<div className="review-invoice-info"> <div className="review-invoice-info">
<div> <div>
@ -176,21 +177,21 @@ const ReviewInvoice = () => {
<TotalProductsPrice <TotalProductsPrice
/> />
</div> </div>
<Row className="invoice-buttons"> <Row className="invoice-buttons">
{/* <Col xs={6}> {/* <Col xs={6}>
<Button className="invoice-button confirmer" onClick={handleConfirmer}>Confirmer</Button> <Button className="invoice-button confirmer" onClick={handleConfirmer}>Confirmer</Button>
</Col> */} </Col> */}
<Col xs={12}> <Col xs={12}>
<Button className="invoice-button modifier" onClick={handleModify}>Modifier</Button> <Button className="invoice-button modifier" onClick={handleModify}>Modifier</Button>
</Col> </Col>
</Row> </Row>
</Col> </Col>
<Col xs={6} xl={4}> <Col xs={6} md={8}>
<ReviewProdList <ReviewProdList
/> />
</Col> </Col>
<StripeContainer cost={total} invoice={thisInvoice} />
</Row> </Row>
<StripeContainer cost={total} />
</> </>
); );

View File

@ -39,7 +39,7 @@ a {
border-radius: 4px; border-radius: 4px;
} }
.cardholder-info { #cardholder-name {
background-color: transparent; background-color: transparent;
border:none; border:none;
color:white; color:white;