view models
This commit is contained in:
@@ -1,15 +1,20 @@
|
||||
import { MembershipFeeDto } from '../dtos';
|
||||
import { MembershipFeeDto } from '../types/generated/MembershipFeeDto';
|
||||
|
||||
export class MembershipFeeViewModel implements MembershipFeeDto {
|
||||
id: string;
|
||||
leagueId: string;
|
||||
amount: number;
|
||||
currency: string;
|
||||
period: string;
|
||||
|
||||
constructor(dto: MembershipFeeDto) {
|
||||
Object.assign(this, dto);
|
||||
this.id = dto.id;
|
||||
this.leagueId = dto.leagueId;
|
||||
}
|
||||
|
||||
// Note: The generated DTO is incomplete
|
||||
// These fields will need to be added when the OpenAPI spec is updated
|
||||
amount: number = 0;
|
||||
currency: string = 'USD';
|
||||
period: string = 'monthly';
|
||||
|
||||
/** UI-specific: Formatted amount */
|
||||
get formattedAmount(): string {
|
||||
return `${this.currency} ${this.amount.toFixed(2)}`;
|
||||
|
||||
Reference in New Issue
Block a user