fix issues in core
This commit is contained in:
@@ -23,13 +23,10 @@ export type SeasonSponsorshipFinancials = {
|
||||
currency: string;
|
||||
};
|
||||
|
||||
import type { LeagueId } from '../../domain/entities/LeagueId';
|
||||
import type { LeagueName } from '../../domain/entities/LeagueName';
|
||||
|
||||
export type SeasonSponsorshipDetail = {
|
||||
id: string;
|
||||
leagueId: LeagueId;
|
||||
leagueName: LeagueName;
|
||||
leagueId: string;
|
||||
leagueName: string;
|
||||
seasonId: string;
|
||||
seasonName: string;
|
||||
seasonStartDate?: Date;
|
||||
@@ -101,20 +98,18 @@ export class GetSeasonSponsorshipsUseCase {
|
||||
const completedRaces = races.filter(r => r.status === 'completed').length;
|
||||
const impressions = completedRaces * driverCount * 100;
|
||||
|
||||
const sponsorshipDetails: SeasonSponsorshipDetail[] = sponsorships.map(sponsorship => {
|
||||
const sponsorshipDetails: SeasonSponsorshipDetail[] = sponsorships.map((sponsorship) => {
|
||||
const platformFee = sponsorship.getPlatformFee();
|
||||
const netAmount = sponsorship.getNetAmount();
|
||||
|
||||
return {
|
||||
const detail: SeasonSponsorshipDetail = {
|
||||
id: sponsorship.id,
|
||||
leagueId: league.id,
|
||||
leagueName: league.name,
|
||||
leagueId: league.id.toString(),
|
||||
leagueName: league.name.toString(),
|
||||
seasonId: season.id,
|
||||
seasonName: season.name,
|
||||
seasonStartDate: season.startDate,
|
||||
seasonEndDate: season.endDate,
|
||||
tier: sponsorship.tier,
|
||||
status: sponsorship.status,
|
||||
tier: sponsorship.tier.toString(),
|
||||
status: sponsorship.status.toString(),
|
||||
pricing: {
|
||||
amount: sponsorship.pricing.amount,
|
||||
currency: sponsorship.pricing.currency,
|
||||
@@ -134,8 +129,12 @@ export class GetSeasonSponsorshipsUseCase {
|
||||
impressions,
|
||||
},
|
||||
createdAt: sponsorship.createdAt,
|
||||
activatedAt: sponsorship.activatedAt,
|
||||
...(season.startDate ? { seasonStartDate: season.startDate } : {}),
|
||||
...(season.endDate ? { seasonEndDate: season.endDate } : {}),
|
||||
...(sponsorship.activatedAt ? { activatedAt: sponsorship.activatedAt } : {}),
|
||||
};
|
||||
|
||||
return detail;
|
||||
});
|
||||
|
||||
this.output.present({
|
||||
|
||||
Reference in New Issue
Block a user