view data fixes
This commit is contained in:
@@ -1,38 +1,14 @@
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
import { CurrencyDisplay } from '../display-objects/CurrencyDisplay';
|
||||
import { DateDisplay } from '../display-objects/DateDisplay';
|
||||
import { NumberDisplay } from '../display-objects/NumberDisplay';
|
||||
|
||||
/**
|
||||
* Interface for sponsorship data input
|
||||
*/
|
||||
export interface SponsorshipDataInput {
|
||||
id: string;
|
||||
type: 'leagues' | 'teams' | 'drivers' | 'races' | 'platform';
|
||||
entityId: string;
|
||||
entityName: string;
|
||||
tier?: 'main' | 'secondary';
|
||||
status: 'active' | 'pending_approval' | 'approved' | 'rejected' | 'expired';
|
||||
applicationDate?: string | Date;
|
||||
approvalDate?: string | Date;
|
||||
rejectionReason?: string;
|
||||
startDate: string | Date;
|
||||
endDate: string | Date;
|
||||
price: number;
|
||||
impressions: number;
|
||||
impressionsChange?: number;
|
||||
engagement?: number;
|
||||
details?: string;
|
||||
entityOwner?: string;
|
||||
applicationMessage?: string;
|
||||
}
|
||||
import type { SponsorshipViewData } from "../view-data/SponsorshipViewData";
|
||||
|
||||
/**
|
||||
* Sponsorship View Model
|
||||
*
|
||||
* View model for individual sponsorship data.
|
||||
*/
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
|
||||
export class SponsorshipViewModel extends ViewModel {
|
||||
id: string;
|
||||
type: 'leagues' | 'teams' | 'drivers' | 'races' | 'platform';
|
||||
@@ -53,7 +29,8 @@ export class SponsorshipViewModel extends ViewModel {
|
||||
entityOwner?: string;
|
||||
applicationMessage?: string;
|
||||
|
||||
constructor(data: SponsorshipDataInput) {
|
||||
constructor(data: SponsorshipViewData) {
|
||||
super();
|
||||
this.id = data.id;
|
||||
this.type = data.type;
|
||||
this.entityId = data.entityId;
|
||||
@@ -119,4 +96,4 @@ export class SponsorshipViewModel extends ViewModel {
|
||||
const end = DateDisplay.formatMonthYear(this.endDate);
|
||||
return `${start} - ${end}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user