feat(platform): add CRM SMS and payment settings

This commit is contained in:
2026-07-29 15:41:27 +08:00
parent 6db200a2fc
commit ead7bdc2e2
25 changed files with 23250 additions and 140 deletions

View File

@@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection;
using Tiku.Application.Commerce;
using Tiku.Application.PlatformBilling;
using Tiku.Application.Security;
using Tiku.Domain.Platform;
using Tiku.Domain.Tenancy;
using Tiku.Infrastructure.Persistence;
@@ -68,8 +69,17 @@ internal sealed class PlatformBillingPaymentGateway(
}
else
{
account = await services.GetRequiredService<IPaymentProviderConfigService>()
.GetActiveAccountAsync(platformTenantId, normalized, token);
var channel = await dbContext.PlatformPaymentChannels.AsNoTracking()
.Where(value => value.Provider == normalized && value.Status == PlatformPaymentChannelStatus.Active)
.OrderBy(value => value.Priority)
.FirstOrDefaultAsync(token)
?? throw new PaymentProviderException("Platform payment channel is missing.", "platform_payment_channel_missing");
account = new PaymentProviderAccount(
platformTenantId,
normalized,
channel.Mode,
channel.ConfigPublic,
JsonDocument.Parse("{}").RootElement.Clone());
}
return await operation(resolvedProvider, account, token);