view data fixes
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
* Record engagement input view model
|
||||
* Represents input data for recording an engagement event
|
||||
*
|
||||
* Note: No matching generated DTO available yet
|
||||
*/
|
||||
import { ViewModel } from "../contracts/view-models/ViewModel";
|
||||
import type { RecordEngagementInputViewData } from "../view-data/RecordEngagementInputViewData";
|
||||
|
||||
export class RecordEngagementInputViewModel extends ViewModel {
|
||||
eventType: string;
|
||||
userId?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
|
||||
constructor(data: { eventType: string; userId?: string; metadata?: Record<string, unknown> }) {
|
||||
constructor(data: RecordEngagementInputViewData) {
|
||||
super();
|
||||
this.eventType = data.eventType;
|
||||
this.userId = data.userId;
|
||||
this.metadata = data.metadata;
|
||||
@@ -31,4 +31,4 @@ export class RecordEngagementInputViewModel extends ViewModel {
|
||||
get metadataKeysCount(): number {
|
||||
return this.metadata ? Object.keys(this.metadata).length : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user