code quality
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
'use client';
|
||||
|
||||
|
||||
import type { ViewDataBuilder } from '@/lib/contracts/builders/ViewDataBuilder';
|
||||
import { DateFormatter } from '@/lib/formatters/DateFormatter';
|
||||
import { StatusFormatter } from '@/lib/formatters/StatusFormatter';
|
||||
import type { LeagueSponsorshipsApiDto } from '@/lib/types/tbd/LeagueSponsorshipsApiDto';
|
||||
import type { LeagueSponsorshipsViewData } from '@/lib/view-data/LeagueSponsorshipsViewData';
|
||||
import type { ViewDataBuilder } from '@/lib/contracts/builders/ViewDataBuilder';
|
||||
import type { GetSeasonSponsorshipsOutputDTO } from '@/lib/types/generated/GetSeasonSponsorshipsOutputDTO';
|
||||
|
||||
type LeagueSponsorshipsInputDTO = GetSeasonSponsorshipsOutputDTO & {
|
||||
leagueId: string;
|
||||
league: { id: string; name: string; description: string };
|
||||
sponsorshipSlots: LeagueSponsorshipsViewData['sponsorshipSlots'];
|
||||
}
|
||||
type LeagueSponsorshipsInputDTO = LeagueSponsorshipsApiDto;
|
||||
|
||||
export class LeagueSponsorshipsViewDataBuilder {
|
||||
public static build(apiDto: LeagueSponsorshipsInputDTO): LeagueSponsorshipsViewData {
|
||||
@@ -20,13 +16,13 @@ export class LeagueSponsorshipsViewDataBuilder {
|
||||
onTabChange: () => {},
|
||||
league: apiDto.league,
|
||||
sponsorshipSlots: apiDto.sponsorshipSlots,
|
||||
sponsorshipRequests: apiDto.sponsorships.map(r => ({
|
||||
sponsorshipRequests: apiDto.sponsorshipRequests.map(r => ({
|
||||
id: r.id,
|
||||
slotId: '', // Missing in DTO
|
||||
sponsorId: '', // Missing in DTO
|
||||
sponsorName: '', // Missing in DTO
|
||||
requestedAt: r.createdAt,
|
||||
formattedRequestedAt: DateFormatter.formatShort(r.createdAt),
|
||||
slotId: r.slotId,
|
||||
sponsorId: r.sponsorId,
|
||||
sponsorName: r.sponsorName,
|
||||
requestedAt: r.requestedAt,
|
||||
formattedRequestedAt: DateFormatter.formatShort(r.requestedAt),
|
||||
status: r.status as 'pending' | 'approved' | 'rejected',
|
||||
statusLabel: StatusFormatter.protestStatus(r.status),
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user