many fixes and improvements - rework for modules/ and common/
feat(emailer): add Postmark and Resend providers
This commit is contained in:
26
backend/Modules/Creators/Services/CreatorLookup.cs
Normal file
26
backend/Modules/Creators/Services/CreatorLookup.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using Hutopy.Modules.Creators.Contracts;
|
||||
using Hutopy.Modules.Creators.Data;
|
||||
|
||||
namespace Hutopy.Modules.Creators.Services;
|
||||
|
||||
public sealed class CreatorLookup(
|
||||
CreatorsDbContext context)
|
||||
: ICreatorLookup
|
||||
{
|
||||
public async Task<CreatorReference?> GetCreatorAsync(Guid creatorId, CancellationToken cancellationToken)
|
||||
{
|
||||
Creator? creator = await context
|
||||
.Creators
|
||||
.FirstOrDefaultAsync(c => c.Id == creatorId, cancellationToken);
|
||||
|
||||
return creator is null
|
||||
? null
|
||||
: new CreatorReference(
|
||||
creator.Id,
|
||||
creator.Name,
|
||||
creator.PortraitUrl,
|
||||
creator.IsStripeDetailsSubmitted,
|
||||
creator.IsStripeChargesEnabled,
|
||||
creator.StripeAccountId);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user