feat: Add Stripe payment integration and subscription management

- Add Stripe.net SDK for payment processing
- Implement StripeService with checkout sessions, customer portal, webhooks
- Implement SubscriptionService for quota management
- Add quota enforcement to CVCheckService
- Create Pricing, Billing, Settings pages
- Add checkout success/cancel pages
- Update Check and Dashboard with usage indicators
- Add ResetMonthlyUsageJob for billing cycle resets
- Add database migration for subscription fields

Plan tiers: Free (3 checks), Professional £49/mo (30), Enterprise £199/mo (unlimited)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 12:03:24 +00:00
parent 6f384f8d09
commit 28d7d41b25
27 changed files with 2427 additions and 1 deletions

View File

@@ -24,6 +24,7 @@ public sealed class CVCheckServiceTests : IDisposable
private readonly Mock<IFileStorageService> _fileStorageServiceMock;
private readonly Mock<IBackgroundJobClient> _backgroundJobClientMock;
private readonly Mock<IAuditService> _auditServiceMock;
private readonly Mock<ISubscriptionService> _subscriptionServiceMock;
private readonly Mock<ILogger<CVCheckService>> _loggerMock;
private readonly CVCheckService _sut;
@@ -37,13 +38,19 @@ public sealed class CVCheckServiceTests : IDisposable
_fileStorageServiceMock = new Mock<IFileStorageService>();
_backgroundJobClientMock = new Mock<IBackgroundJobClient>();
_auditServiceMock = new Mock<IAuditService>();
_subscriptionServiceMock = new Mock<ISubscriptionService>();
_loggerMock = new Mock<ILogger<CVCheckService>>();
// Setup subscription service to allow checks by default
_subscriptionServiceMock.Setup(x => x.CanPerformCheckAsync(It.IsAny<Guid>()))
.ReturnsAsync(true);
_sut = new CVCheckService(
_dbContext,
_fileStorageServiceMock.Object,
_backgroundJobClientMock.Object,
_auditServiceMock.Object,
_subscriptionServiceMock.Object,
_loggerMock.Object);
}