null paiment id
Some checks failed
Dotnet build and test / log-the-inputs (push) Failing after 4s
Dotnet build and test / build (push) Failing after 1s

This commit is contained in:
Paul Schneider
2025-07-15 15:42:30 +01:00
parent 62e863e343
commit d8b09cb42e
8 changed files with 3710 additions and 41 deletions

View File

@ -1,13 +1,5 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "9.0.6",
"commands": [
"dotnet-ef"
],
"rollForward": false
}
}
"tools": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,182 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Yavsc.Migrations
{
/// <inheritdoc />
public partial class nullPaimentIdOnQuery : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project");
migrationBuilder.DropForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "RdvQueries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "Project",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairMultiCutQueries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairCutQueries",
type: "text",
nullable: true,
oldClrType: typeof(string),
oldType: "text");
migrationBuilder.AddForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
migrationBuilder.AddForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
migrationBuilder.AddForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries");
migrationBuilder.DropForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project");
migrationBuilder.DropForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries");
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "RdvQueries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "Project",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairMultiCutQueries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PaymentId",
table: "HairCutQueries",
type: "text",
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "text",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_HairCutQueries_PayPalPayment_PaymentId",
table: "HairCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_HairMultiCutQueries_PayPalPayment_PaymentId",
table: "HairMultiCutQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_Project_PayPalPayment_PaymentId",
table: "Project",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_RdvQueries_PayPalPayment_PaymentId",
table: "RdvQueries",
column: "PaymentId",
principalTable: "PayPalPayment",
principalColumn: "CreationToken",
onDelete: ReferentialAction.Cascade);
}
}
}

View File

@ -1226,7 +1226,6 @@ namespace Yavsc.Migrations
.HasColumnType("bigint");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -1317,7 +1316,6 @@ namespace Yavsc.Migrations
.HasColumnType("bigint");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -2283,7 +2281,6 @@ namespace Yavsc.Migrations
.HasColumnType("integer");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -2444,7 +2441,6 @@ namespace Yavsc.Migrations
.HasColumnType("text");
b.Property<string>("PaymentId")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PerformerId")
@ -2890,9 +2886,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()
@ -2947,9 +2941,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()
@ -3285,9 +3277,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()
@ -3347,9 +3337,7 @@ namespace Yavsc.Migrations
b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation")
.WithMany()
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
.HasForeignKey("PaymentId");
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile")
.WithMany()

View File

@ -39,16 +39,7 @@ namespace Yavsc.Models
using System.Configuration;
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
private readonly ILogger<ApplicationDbContext> logger;
public ApplicationDbContext(ILoggerFactory loggerFactory,
DbContextOptions<ApplicationDbContext> options) : base(options)
{
logger = loggerFactory.CreateLogger<ApplicationDbContext>();
}
{
protected override void OnModelCreating(ModelBuilder builder)
{
base.OnModelCreating(builder);
@ -89,7 +80,13 @@ namespace Yavsc.Models
builder.Entity<Activity>().Property(a => a.ParentCode).IsRequired(false);
// builder.Entity<IdentityUserLogin<String>>().HasKey(i=> new { i.LoginProvider, i.UserId, i.ProviderKey });
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
string? envCxStr = Environment.GetEnvironmentVariable(Constants.YavscConnectionStringEnvName);
if (envCxStr != null)
optionsBuilder.UseNpgsql(envCxStr);
base.OnConfiguring(optionsBuilder);
}
public DbSet<Client> Applications { get; set; }
public DbSet<RefreshToken> RefreshTokens { get; set; }

View File

@ -98,7 +98,7 @@ namespace Yavsc.Models.Billing
[ForeignKey("Regularisation")]
public string PaymentId { get; set; }
public string? PaymentId { get; set; }
[Display(Name = "Acquittement de la facture")]
public virtual PayPalPayment Regularisation { get; set; }