Dons PayPal

This commit is contained in:
Paul Schneider 2026-11-02 10:40:29 +00:00
commit e3b4414ab1
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
45 changed files with 7476 additions and 9 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,89 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Yavsc.Migrations
{
/// <inheritdoc />
public partial class PerformerPayPalDonations : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "DonationPayPalEmail",
table: "Performers",
type: "character varying(127)",
maxLength: 127,
nullable: true);
migrationBuilder.CreateTable(
name: "PerformerDonations",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
DonorId = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
PerformerId = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: false),
RecipientEmail = table.Column<string>(type: "character varying(127)", maxLength: 127, nullable: false),
Amount = table.Column<decimal>(type: "numeric(18,2)", nullable: false),
Currency = table.Column<string>(type: "character varying(3)", maxLength: 3, nullable: false),
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false),
State = table.Column<int>(type: "integer", nullable: false),
CheckoutToken = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: true),
TransactionId = table.Column<string>(type: "character varying(32)", maxLength: 32, nullable: true),
CompletedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
Revision = table.Column<Guid>(type: "uuid", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PerformerDonations", x => x.Id);
table.ForeignKey(
name: "FK_PerformerDonations_AspNetUsers_DonorId",
column: x => x.DonorId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_PerformerDonations_Performers_PerformerId",
column: x => x.PerformerId,
principalTable: "Performers",
principalColumn: "PerformerId",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_PerformerDonations_CheckoutToken",
table: "PerformerDonations",
column: "CheckoutToken",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_PerformerDonations_DonorId",
table: "PerformerDonations",
column: "DonorId");
migrationBuilder.CreateIndex(
name: "IX_PerformerDonations_PerformerId",
table: "PerformerDonations",
column: "PerformerId");
migrationBuilder.CreateIndex(
name: "IX_PerformerDonations_TransactionId",
table: "PerformerDonations",
column: "TransactionId",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "PerformerDonations");
migrationBuilder.DropColumn(
name: "DonationPayPalEmail",
table: "Performers");
}
}
}

View file

@ -2738,6 +2738,71 @@ namespace Yavsc.Migrations
b.ToTable("PayPalPayment");
});
modelBuilder.Entity("Yavsc.Models.Payment.PerformerDonation", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<decimal>("Amount")
.HasColumnType("numeric(18,2)");
b.Property<string>("CheckoutToken")
.HasMaxLength(100)
.HasColumnType("character varying(100)");
b.Property<DateTimeOffset?>("CompletedAt")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("Currency")
.IsRequired()
.HasMaxLength(3)
.HasColumnType("character varying(3)");
b.Property<string>("DonorId")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("PerformerId")
.IsRequired()
.HasMaxLength(450)
.HasColumnType("character varying(450)");
b.Property<string>("RecipientEmail")
.IsRequired()
.HasMaxLength(127)
.HasColumnType("character varying(127)");
b.Property<Guid>("Revision")
.IsConcurrencyToken()
.HasColumnType("uuid");
b.Property<int>("State")
.HasColumnType("integer");
b.Property<string>("TransactionId")
.HasMaxLength(32)
.HasColumnType("character varying(32)");
b.HasKey("Id");
b.HasIndex("CheckoutToken")
.IsUnique();
b.HasIndex("DonorId");
b.HasIndex("PerformerId");
b.HasIndex("TransactionId")
.IsUnique();
b.ToTable("PerformerDonations");
});
modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b =>
{
b.Property<long>("Id")
@ -3266,6 +3331,10 @@ namespace Yavsc.Migrations
b.Property<bool>("Active")
.HasColumnType("boolean");
b.Property<string>("DonationPayPalEmail")
.HasMaxLength(127)
.HasColumnType("character varying(127)");
b.Property<string>("ExerciseCountryCode")
.IsRequired()
.HasColumnType("text");
@ -4514,6 +4583,21 @@ namespace Yavsc.Migrations
b.Navigation("Executor");
});
modelBuilder.Entity("Yavsc.Models.Payment.PerformerDonation", b =>
{
b.HasOne("Yavsc.Models.ApplicationUser", null)
.WithMany()
.HasForeignKey("DonorId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.HasOne("Yavsc.Models.Workflow.PerformerProfile", null)
.WithMany()
.HasForeignKey("PerformerId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
});
modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b =>
{
b.HasOne("Yavsc.Models.ApplicationUser", null)