code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped

This commit is contained in:
2026-01-26 22:16:33 +01:00
parent f2bd80ccd3
commit 09632d004d
72 changed files with 1946 additions and 277 deletions

View File

@@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach } from 'vitest';
import { GetSponsorBillingUseCase } from '../../../../core/payments/application/use-cases/GetSponsorBillingUseCase';
import { Sponsor } from '../../../../core/racing/domain/entities/sponsor/Sponsor';
import { SeasonSponsorship } from '../../../../core/racing/domain/entities/season/SeasonSponsorship';
import { Payment, PaymentType, PaymentStatus } from '../../../../core/payments/domain/entities/Payment';
import { Payment, PaymentType, PaymentStatus, PayerType } from '../../../../core/payments/domain/entities/Payment';
import { Money } from '../../../../core/racing/domain/value-objects/Money';
import { SponsorTestContext } from '../SponsorTestContext';
@@ -55,7 +55,7 @@ describe('Sponsor Billing Use Case Orchestration', () => {
platformFee: 100,
netAmount: 900,
payerId: 'sponsor-123',
payerType: 'sponsor',
payerType: 'team',
leagueId: 'league-1',
seasonId: 'season-1',
status: PaymentStatus.COMPLETED,
@@ -71,7 +71,7 @@ describe('Sponsor Billing Use Case Orchestration', () => {
platformFee: 200,
netAmount: 1800,
payerId: 'sponsor-123',
payerType: 'sponsor',
payerType: 'team',
leagueId: 'league-2',
seasonId: 'season-2',
status: PaymentStatus.COMPLETED,
@@ -87,7 +87,7 @@ describe('Sponsor Billing Use Case Orchestration', () => {
platformFee: 300,
netAmount: 2700,
payerId: 'sponsor-123',
payerType: 'sponsor',
payerType: 'team',
leagueId: 'league-3',
seasonId: 'season-3',
status: PaymentStatus.COMPLETED,
@@ -133,7 +133,7 @@ describe('Sponsor Billing Use Case Orchestration', () => {
platformFee: 100,
netAmount: 900,
payerId: 'sponsor-123',
payerType: 'sponsor',
payerType: 'team',
leagueId: 'league-1',
seasonId: 'season-1',
status: PaymentStatus.COMPLETED,
@@ -149,7 +149,7 @@ describe('Sponsor Billing Use Case Orchestration', () => {
platformFee: 50,
netAmount: 450,
payerId: 'sponsor-123',
payerType: 'sponsor',
payerType: 'team',
leagueId: 'league-2',
seasonId: 'season-2',
status: PaymentStatus.PENDING,

View File

@@ -96,7 +96,7 @@ describe('Sponsor Campaigns Use Case Orchestration', () => {
expect(sponsorships.summary.activeSponsorships).toBe(1);
expect(sponsorships.summary.totalInvestment.amount).toBe(1000);
const s1 = sponsorships.sponsorships[0];
const s1 = sponsorships.sponsorships[0]!;
expect(s1.metrics.drivers).toBe(10);
expect(s1.metrics.races).toBe(5);
expect(s1.metrics.impressions).toBe(5000);

View File

@@ -44,7 +44,7 @@ describe('Sponsor League Detail Use Case Orchestration', () => {
expect(pricingResult.entityId).toBe(leagueId);
expect(pricingResult.acceptingApplications).toBe(true);
expect(pricingResult.tiers).toHaveLength(2);
expect(pricingResult.tiers[0].name).toBe('main');
expect(pricingResult.tiers[0]!.name).toBe('main');
expect(pricingResult.tiers[0].price.amount).toBe(10000);
});
});
@@ -52,7 +52,7 @@ describe('Sponsor League Detail Use Case Orchestration', () => {
describe('GetEntitySponsorshipPricingUseCase - Error Handling', () => {
it('should return error when pricing is not configured', async () => {
const result = await getEntitySponsorshipPricingUseCase.execute({
entityType: 'league',
entityType: 'season',
entityId: 'non-existent',
});