Files
gridpilot.gg/apps/website/lib/view-models/RecordPageViewInputViewModel.ts
Marc Mintel d97f50ed72
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 6m4s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data fixes
2026-01-23 11:59:49 +01:00

27 lines
721 B
TypeScript

/**
* Record page view input view model
* Represents input data for recording a page view
*
* Note: No matching generated DTO available yet
*/
import { ViewModel } from "../contracts/view-models/ViewModel";
export class RecordPageViewInputViewModel extends ViewModel {
path: string;
userId?: string;
constructor(data: { path: string; userId?: string }) {
this.path = data.path;
this.userId = data.userId;
}
/** UI-specific: Formatted path for display */
get displayPath(): string {
return this.path.startsWith('/') ? this.path : `/${this.path}`;
}
/** UI-specific: Has user context */
get hasUserContext(): boolean {
return this.userId !== undefined && this.userId !== '';
}
}