1
- import { ApiProperty } from '@nestjs/swagger' ;
1
+ import { ApiProperty , OmitType } from '@nestjs/swagger' ;
2
2
import { Type } from 'class-transformer' ;
3
-
4
- export class CreateMatchingResponse {
5
- @ApiProperty ( { example : 1 , description : '매칭 ID' } )
6
- id : number ;
7
-
8
- @ApiProperty ( { example : 1 , description : '채팅방 아이디' } )
9
- chatRoomId : number ;
10
-
11
- @ApiProperty ( { example : 1 , description : '신청한 유저 아이디' } )
12
- requesterId : number ;
13
-
14
- @ApiProperty ( { example : 2 , description : '매칭 상대 유저 아이디' } )
15
- targetId : number ;
16
- }
3
+ import { MatchingRequestStatusEnum } from 'src/common/enum/matchingRequestStatus' ;
17
4
18
5
export class PatchMatchingResponse {
19
6
@ApiProperty ( { example : 1 , description : '매칭 ID' } )
@@ -81,7 +68,7 @@ class RequesterResponse {
81
68
representativePost ?: RepresentativePost ;
82
69
}
83
70
84
- class Matching {
71
+ export class MatchingResponse {
85
72
@ApiProperty ( { example : 1 , description : '매칭 ID' } )
86
73
id : number ;
87
74
@@ -93,23 +80,69 @@ class Matching {
93
80
requester : RequesterResponse ;
94
81
}
95
82
96
- export class GetMatchingsResponse {
83
+ export class CreateMatchingResponse {
84
+ @ApiProperty ( { example : 1 , description : '매칭 ID' } )
85
+ id : number ;
86
+
97
87
@ApiProperty ( {
98
- description : '매칭 존재 여부 ' ,
99
- example : true ,
88
+ description : '매칭 요청 메시지 ' ,
89
+ example : '안녕하세요! 매칭 요청합니다.' ,
100
90
} )
101
- hasMatching : boolean ;
91
+ message : string ;
92
+
93
+ @ApiProperty ( { example : 1 , description : '채팅방 아이디' } )
94
+ chatRoomId ?: number ;
102
95
103
96
@ApiProperty ( {
104
- description : '받은 매칭 수 ' ,
105
- example : 10 ,
97
+ example : '2024-10-11T09:00:00.000Z ' ,
98
+ description : '신청 시각' ,
106
99
} )
107
- matchingsCount : number ;
100
+ createdAt : string ;
101
+
102
+ @ApiProperty ( { example : 2 , description : '매칭 상대 유저 아이디' } )
103
+ targetId : number ;
108
104
105
+ @ApiProperty ( {
106
+ description : '매칭 요청자 정보' ,
107
+ type : RequesterResponse ,
108
+ } )
109
+ @Type ( ( ) => RequesterResponse )
110
+ requester : RequesterResponse ;
111
+ }
112
+
113
+ export class GetMatchingsResponse {
109
114
@ApiProperty ( {
110
115
description : '매칭 정보' ,
111
- type : [ Matching ] ,
116
+ type : [ MatchingResponse ] ,
117
+ } )
118
+ @Type ( ( ) => MatchingResponse )
119
+ matching : MatchingResponse [ ] ;
120
+ }
121
+
122
+ export class GetOneMatchingResponse extends OmitType ( PatchMatchingResponse , [
123
+ 'chatRoomId' ,
124
+ ] as const ) {
125
+ @ApiProperty ( {
126
+ example : '2024-10-11T09:00:00.000Z' ,
127
+ description : '신청 시각' ,
112
128
} )
113
- @Type ( ( ) => Matching )
114
- matching : Matching [ ] ;
129
+ createdAt : string ;
130
+ }
131
+
132
+ export interface MatchingRequest {
133
+ id : number ;
134
+ message : string ;
135
+ createdAt : string ;
136
+ requestStatus : MatchingRequestStatusEnum ;
137
+ chatRoomId : number ;
138
+ targetId : number ;
139
+ requester : {
140
+ id : number ;
141
+ nickname : string ;
142
+ profilePictureUrl : string ;
143
+ representativePost ?: {
144
+ postImages : { url : string ; orderNum : number } [ ] ;
145
+ styleTags : string [ ] ;
146
+ } ;
147
+ } ;
115
148
}
0 commit comments