Dons PayPal
This commit is contained in:
parent
20a44bfde1
commit
e3b4414ab1
45 changed files with 7476 additions and 9 deletions
|
|
@ -58,6 +58,16 @@ namespace Yavsc.Models
|
|||
}
|
||||
builder.UseIdentityByDefaultColumns();
|
||||
|
||||
builder.Entity<PerformerDonation>(entity =>
|
||||
{
|
||||
entity.HasOne<ApplicationUser>().WithMany().HasForeignKey(d => d.DonorId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
entity.HasOne<PerformerProfile>().WithMany().HasForeignKey(d => d.PerformerId)
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
entity.HasIndex(d => d.CheckoutToken).IsUnique();
|
||||
entity.HasIndex(d => d.TransactionId).IsUnique();
|
||||
});
|
||||
|
||||
builder.Entity<NominativeServiceCommand>()
|
||||
.Property(command => command.AmountPaid)
|
||||
.HasDefaultValue(0m);
|
||||
|
|
@ -458,6 +468,7 @@ namespace Yavsc.Models
|
|||
public DbSet<BankIdentity> BankIdentity { get; set; }
|
||||
|
||||
public DbSet<PayPalPayment> PayPalPayment { get; set; }
|
||||
public DbSet<PerformerDonation> PerformerDonations { get; set; }
|
||||
|
||||
public DbSet<HyperLink> HyperLink { get; set; }
|
||||
|
||||
|
|
|
|||
32
src/Yavsc.Server/Models/Payment/PerformerDonation.cs
Normal file
32
src/Yavsc.Server/Models/Payment/PerformerDonation.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#nullable enable
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Payment;
|
||||
|
||||
public enum PerformerDonationState { Created, AwaitingApproval, Processing, Pending, Completed, Cancelled, Failed }
|
||||
|
||||
public sealed class PerformerDonation
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
[Required, MaxLength(450)]
|
||||
public string DonorId { get; set; } = "";
|
||||
[Required, MaxLength(450)]
|
||||
public string PerformerId { get; set; } = "";
|
||||
[Required, EmailAddress, MaxLength(127)]
|
||||
public string RecipientEmail { get; set; } = "";
|
||||
[Column(TypeName = "numeric(18,2)")]
|
||||
public decimal Amount { get; set; }
|
||||
[Required, MaxLength(3)]
|
||||
public string Currency { get; set; } = "EUR";
|
||||
public DateTimeOffset CreatedAt { get; set; }
|
||||
public PerformerDonationState State { get; set; }
|
||||
[MaxLength(100)]
|
||||
public string? CheckoutToken { get; set; }
|
||||
[MaxLength(32)]
|
||||
public string? TransactionId { get; set; }
|
||||
public DateTimeOffset? CompletedAt { get; set; }
|
||||
[ConcurrencyCheck]
|
||||
public Guid Revision { get; set; } = Guid.NewGuid();
|
||||
}
|
||||
|
|
@ -51,6 +51,9 @@ namespace Yavsc.Models.Workflow
|
|||
[Display(Name="Active")]
|
||||
public bool Active { get; set; }
|
||||
|
||||
[EmailAddress, MaxLength(127), ScaffoldColumn(false), JsonIgnore, System.Text.Json.Serialization.JsonIgnore]
|
||||
public string? DonationPayPalEmail { get; set; }
|
||||
|
||||
[Obsolete("Implement and use a new specialization setting")]
|
||||
[Display(Name="Maximal Daily Cost (euro/day)"),DisplayFormat(DataFormatString="{0:C}")]
|
||||
public int? MaxDailyCost { get; set; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue