28 lines
727 B
TypeScript
28 lines
727 B
TypeScript
import { ViewModel } from "../contracts/view-models/ViewModel";
|
|
|
|
export class RecordEngagementOutputViewModel extends ViewModel {
|
|
eventId: string;
|
|
engagementWeight: number;
|
|
|
|
constructor(eventId: string, engagementWeight: number) {
|
|
super();
|
|
this.eventId = eventId;
|
|
this.engagementWeight = engagementWeight;
|
|
}
|
|
|
|
/** UI-specific: Formatted event ID for display */
|
|
get displayEventId(): string {
|
|
return `Event: ${this.eventId}`;
|
|
}
|
|
|
|
/** UI-specific: Formatted engagement weight */
|
|
get displayEngagementWeight(): string {
|
|
return `${this.engagementWeight.toFixed(2)}`;
|
|
}
|
|
|
|
/** UI-specific: Is high engagement */
|
|
get isHighEngagement(): boolean {
|
|
return this.engagementWeight > 1.0;
|
|
}
|
|
}
|