|
| 1 | +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger' |
| 2 | +import { TeamRole } from '@repo/types' |
| 3 | + |
| 4 | +export class InvitationInvitedByResponse { |
| 5 | + @ApiProperty({ example: 'uuid-user-1' }) |
| 6 | + id: string |
| 7 | + |
| 8 | + @ApiProperty({ example: 'Иван Иванов', nullable: true }) |
| 9 | + name: string | null |
| 10 | + |
| 11 | + @ApiProperty({ example: 'owner@example.com' }) |
| 12 | + email: string |
| 13 | +} |
| 14 | + |
| 15 | +export class InvitationTeamSummaryResponse { |
| 16 | + @ApiProperty({ example: 'uuid-team-1' }) |
| 17 | + id: string |
| 18 | + |
| 19 | + @ApiProperty({ example: 'Dream Team' }) |
| 20 | + name: string |
| 21 | + |
| 22 | + @ApiPropertyOptional({ example: null, nullable: true }) |
| 23 | + avatarUrl: string | null |
| 24 | +} |
| 25 | + |
| 26 | +export class TeamInvitationResponse { |
| 27 | + @ApiProperty({ example: 'uuid-invitation-1' }) |
| 28 | + id: string |
| 29 | + |
| 30 | + @ApiProperty({ example: 'uuid-team-1' }) |
| 31 | + teamId: string |
| 32 | + |
| 33 | + @ApiProperty({ example: 'uuid-user-1' }) |
| 34 | + invitedById: string |
| 35 | + |
| 36 | + @ApiProperty({ example: 'user@example.com' }) |
| 37 | + email: string |
| 38 | + |
| 39 | + @ApiProperty({ enum: ['OWNER', 'ADMIN', 'MEMBER'], example: 'MEMBER' }) |
| 40 | + role: TeamRole |
| 41 | + |
| 42 | + @ApiProperty({ |
| 43 | + enum: ['PENDING', 'ACCEPTED', 'DECLINED', 'EXPIRED'], |
| 44 | + example: 'PENDING', |
| 45 | + }) |
| 46 | + status: 'PENDING' | 'ACCEPTED' | 'DECLINED' | 'EXPIRED' |
| 47 | + |
| 48 | + @ApiProperty({ example: '550e8400-e29b-41d4-a716-446655440000' }) |
| 49 | + token: string |
| 50 | + |
| 51 | + @ApiProperty({ example: '2026-04-11T12:00:00.000Z' }) |
| 52 | + expiresAt: Date |
| 53 | + |
| 54 | + @ApiProperty({ example: '2026-04-09T12:00:00.000Z' }) |
| 55 | + createdAt: Date |
| 56 | + |
| 57 | + @ApiProperty({ example: '2026-04-09T12:00:00.000Z' }) |
| 58 | + updatedAt: Date |
| 59 | + |
| 60 | + @ApiPropertyOptional({ type: InvitationInvitedByResponse }) |
| 61 | + invitedBy?: InvitationInvitedByResponse |
| 62 | + |
| 63 | + @ApiPropertyOptional({ type: InvitationTeamSummaryResponse }) |
| 64 | + team?: InvitationTeamSummaryResponse |
| 65 | +} |
| 66 | + |
| 67 | +export class MyInvitationResponse { |
| 68 | + @ApiProperty({ example: 'uuid-invitation-1' }) |
| 69 | + id: string |
| 70 | + |
| 71 | + @ApiProperty({ example: 'user@example.com' }) |
| 72 | + email: string |
| 73 | + |
| 74 | + @ApiProperty({ enum: ['OWNER', 'ADMIN', 'MEMBER'], example: 'MEMBER' }) |
| 75 | + role: TeamRole |
| 76 | + |
| 77 | + @ApiProperty({ example: '550e8400-e29b-41d4-a716-446655440000' }) |
| 78 | + token: string |
| 79 | + |
| 80 | + @ApiProperty({ example: '2026-04-11T12:00:00.000Z' }) |
| 81 | + expiresAt: Date |
| 82 | + |
| 83 | + @ApiProperty({ example: '2026-04-09T12:00:00.000Z' }) |
| 84 | + createdAt: Date |
| 85 | + |
| 86 | + @ApiProperty({ type: InvitationTeamSummaryResponse }) |
| 87 | + team: InvitationTeamSummaryResponse |
| 88 | + |
| 89 | + @ApiProperty({ type: InvitationInvitedByResponse }) |
| 90 | + invitedBy: InvitationInvitedByResponse |
| 91 | +} |
0 commit comments