many fixes and improvements - rework for modules/ and common/

feat(emailer): add Postmark and Resend providers
This commit is contained in:
2025-06-06 12:21:43 -04:00
parent 31ba18fa8d
commit 25b94d3e02
313 changed files with 6586 additions and 18260 deletions

View File

@@ -0,0 +1,31 @@
using Hutopy.Modules.Tipping.Contracts;
using Hutopy.Modules.Tipping.Data;
namespace Hutopy.Modules.Tipping.Services;
public class TipPaymentNotifier(
TippingDbContext dbContext,
ILogger<TipPaymentNotifier> logger)
: ITipPaymentNotifier
{
public async Task NotifyPaymentSucceedAsync(
string sessionId,
string invoiceUrl,
CancellationToken ct)
{
var tip = await dbContext.Tips.SingleOrDefaultAsync(
t => t.StripeSessionId == sessionId,
cancellationToken: ct);
if (tip is not null)
{
tip.Status = TipStatus.Paid;
tip.StripeInvoiceUrl = invoiceUrl;
await dbContext.SaveChangesAsync(ct);
}
else
{
logger.LogError("Tip with session ID {SessionId} not found", sessionId);
}
}
}