view data fixes
This commit is contained in:
@@ -9,19 +9,19 @@ import { TeamCreationStatusDisplay } from '../display-objects/TeamCreationStatus
|
||||
* Composes Display Objects and transforms ViewData for UI consumption.
|
||||
*/
|
||||
export class CreateTeamViewModel extends ViewModel {
|
||||
readonly teamId: string;
|
||||
readonly success: boolean;
|
||||
private readonly data: CreateTeamViewData;
|
||||
|
||||
// UI-specific derived fields (primitive outputs only)
|
||||
readonly successMessage: string;
|
||||
|
||||
constructor(viewData: CreateTeamViewData) {
|
||||
constructor(data: CreateTeamViewData) {
|
||||
super();
|
||||
this.teamId = viewData.teamId;
|
||||
this.success = viewData.success;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
// Derive UI-specific fields using Display Object
|
||||
this.successMessage = TeamCreationStatusDisplay.statusMessage(this.success);
|
||||
get teamId(): string { return this.data.teamId; }
|
||||
get success(): boolean { return this.data.success; }
|
||||
|
||||
/** UI-specific: Success message using Display Object */
|
||||
get successMessage(): string {
|
||||
return TeamCreationStatusDisplay.statusMessage(this.success);
|
||||
}
|
||||
|
||||
/** UI-specific: Whether team creation was successful */
|
||||
|
||||
Reference in New Issue
Block a user