many fixes and improvements - rework for modules/ and common/
feat(emailer): add Postmark and Resend providers
This commit is contained in:
21
backend/Modules/Tipping/Data/Tip.cs
Normal file
21
backend/Modules/Tipping/Data/Tip.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Hutopy.Common.Domain;
|
||||
|
||||
namespace Hutopy.Modules.Tipping.Data;
|
||||
|
||||
public class Tip : Entity
|
||||
{
|
||||
public Guid CreatorId { get; set; }
|
||||
public TipStatus Status { get; set; }
|
||||
public decimal Amount { get; set; }
|
||||
[MaxLength(8)] public required string Currency { get; set; }
|
||||
[MaxLength(2048)] public required string Message { get; set; }
|
||||
[MaxLength(256)] public required string StripeSessionId { get; set; }
|
||||
[MaxLength(2048)] public string? StripeInvoiceUrl { get; set; }
|
||||
}
|
||||
|
||||
public enum TipStatus : short
|
||||
{
|
||||
Pending = 0,
|
||||
Paid = 1,
|
||||
}
|
||||
22
backend/Modules/Tipping/Data/TippingDbContext.cs
Normal file
22
backend/Modules/Tipping/Data/TippingDbContext.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace Hutopy.Modules.Tipping.Data;
|
||||
|
||||
public sealed class TippingDbContext(
|
||||
DbContextOptions<TippingDbContext> options)
|
||||
: DbContext(options)
|
||||
{
|
||||
public const string SchemaName = "Tipping";
|
||||
|
||||
public DbSet<Tip> Tips => Set<Tip>();
|
||||
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder.HasDefaultSchema(SchemaName);
|
||||
|
||||
modelBuilder
|
||||
.Entity<Tip>()
|
||||
.Property(c => c.CreatedAt)
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasDefaultValueSql("CURRENT_TIMESTAMP");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user