view models
This commit is contained in:
25
apps/website/lib/view-models/RecordPageViewInputViewModel.ts
Normal file
25
apps/website/lib/view-models/RecordPageViewInputViewModel.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Record page view input view model
|
||||
* Represents input data for recording a page view
|
||||
*
|
||||
* Note: No matching generated DTO available yet
|
||||
*/
|
||||
export class RecordPageViewInputViewModel {
|
||||
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 !== '';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user