refactor
This commit is contained in:
53
apps/api/src/domain/race/dtos/DashboardFeedItemSummaryDTO.ts
Normal file
53
apps/api/src/domain/race/dtos/DashboardFeedItemSummaryDTO.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsString, IsOptional } from 'class-validator';
|
||||
|
||||
export type DashboardFeedItemType =
|
||||
| 'friend-joined-league'
|
||||
| 'friend-joined-team'
|
||||
| 'friend-finished-race'
|
||||
| 'friend-new-personal-best'
|
||||
| 'new-race-scheduled'
|
||||
| 'new-result-posted'
|
||||
| 'league-highlight';
|
||||
|
||||
export class DashboardFeedItemSummaryDTO {
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
id!: string;
|
||||
|
||||
@ApiProperty({
|
||||
enum: [
|
||||
'friend-joined-league',
|
||||
'friend-joined-team',
|
||||
'friend-finished-race',
|
||||
'friend-new-personal-best',
|
||||
'new-race-scheduled',
|
||||
'new-result-posted',
|
||||
'league-highlight',
|
||||
],
|
||||
})
|
||||
type!: DashboardFeedItemType;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
headline!: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
body?: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsString()
|
||||
timestamp!: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
ctaLabel?: string;
|
||||
|
||||
@ApiProperty({ required: false })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
ctaHref?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user