@@ -9,56 +9,68 @@ import { ApiPropertyOptional } from '@nestjs/swagger';
9
9
export class ExternalId {
10
10
@ApiPropertyOptional ( {
11
11
description : 'ID из kinopoisk HD' ,
12
- example : 'gsdfgujsdfgiowe23413 ' ,
12
+ example : '48e8d0acb0f62d8585101798eaeceec5 ' ,
13
13
} )
14
14
@Prop ( { index : true } )
15
15
kpHD : string ;
16
16
17
- @ApiPropertyOptional ( )
17
+ @ApiPropertyOptional ( { example : 'tt0232500' } )
18
18
@Prop ( { index : true } )
19
19
imdb : string ;
20
20
21
- @ApiPropertyOptional ( )
21
+ @ApiPropertyOptional ( { example : 9799 } )
22
22
@Prop ( { index : true } )
23
23
tmdb : number ;
24
24
}
25
25
26
- export class Rating {
27
- @ApiPropertyOptional ( )
28
- @Prop ( { unique : true } )
26
+ export class Votes {
27
+ @ApiPropertyOptional ( { example : 60000 } )
28
+ @Prop ( { index : true } )
29
29
kpHD : string ;
30
30
31
- @ApiPropertyOptional ( )
32
- @Prop ( { unique : true } )
31
+ @ApiPropertyOptional ( { example : 50000 } )
32
+ @Prop ( { index : true } )
33
33
imdb : string ;
34
34
35
- @ApiPropertyOptional ( )
36
- @Prop ( )
35
+ @ApiPropertyOptional ( { example : 10000 } )
36
+ @Prop ( { index : true } )
37
37
tmdb : number ;
38
+
39
+ @ApiPropertyOptional ( { example : 10000 , description : 'Количество голосов кинокритиков' } )
40
+ @Prop ( { index : true } )
41
+ filmCritics : number ;
42
+
43
+ @ApiPropertyOptional ( { example : 4000 , description : 'Количество голосов кинокритиков из РФ' } )
44
+ @Prop ( { index : true } )
45
+ russianFilmCritics : number ;
46
+
47
+ @ApiPropertyOptional ( { example : 34000 , description : 'Количество ожидающих выхода' } )
48
+ @Prop ( { index : true } )
49
+ await : number ;
38
50
}
39
51
40
- export class VendorNumbers {
41
- @ApiPropertyOptional ( )
52
+ export class Rating {
53
+ @ApiPropertyOptional ( { example : 6.2 , description : 'Рейтинг кинопоиска' } )
42
54
@Prop ( { index : true } )
43
55
kp : number ;
44
56
45
- @ApiPropertyOptional ( )
57
+ @ApiPropertyOptional ( { example : 8.4 , description : 'Рейтинг IMDB' } )
46
58
@Prop ( { index : true } )
47
59
imdb : number ;
48
60
49
- @ApiPropertyOptional ( )
61
+ @ApiPropertyOptional ( { example : 3.2 , description : 'Рейтинг TMDB' } )
50
62
@Prop ( { index : true } )
51
63
tmdb : number ;
52
64
53
- @ApiPropertyOptional ( )
65
+ @ApiPropertyOptional ( { example : 10 , description : 'Рейтинг кинокритиков' } )
54
66
@Prop ( { index : true } )
55
67
filmCritics : number ;
56
68
57
- @ApiPropertyOptional ( )
69
+ @ApiPropertyOptional ( { example : 5.1 , description : 'Рейтинг кинокритиков из РФ' } )
58
70
@Prop ( { index : true } )
59
71
russianFilmCritics : number ;
60
72
61
- @ApiPropertyOptional ( )
73
+ @ApiPropertyOptional ( { example : 6.1 , description : 'Рейтинг основанный на ожиданиях пользователей' } )
62
74
@Prop ( { index : true } )
63
75
await : number ;
64
76
}
@@ -100,23 +112,22 @@ export class Name {
100
112
}
101
113
102
114
export class Video {
103
- @ApiPropertyOptional ( )
115
+ @ApiPropertyOptional ( { example : 'https://www.youtube.com/embed/ZsJz2TJAPjw' , description : 'Url трейлера' } )
104
116
@Prop ( )
105
117
url : string ;
106
118
107
- @ApiPropertyOptional ( )
119
+ @ApiPropertyOptional ( { example : 'Official Trailer' } )
108
120
@Prop ( )
109
121
name : string ;
110
122
111
- @ApiPropertyOptional ( )
123
+ @ApiPropertyOptional ( { example : 'youtube | yandex' } )
112
124
@Prop ( )
113
125
site : string ;
114
126
115
- @ApiPropertyOptional ( )
116
127
@Prop ( )
117
128
size : number ;
118
129
119
- @ApiPropertyOptional ( )
130
+ @ApiPropertyOptional ( { example : 'TRAILER' } )
120
131
@Prop ( )
121
132
type : string ;
122
133
}
@@ -126,47 +137,44 @@ export class VideoTypes {
126
137
@Prop ( { type : ( ) => [ Video ] } )
127
138
trailers : Video [ ] ;
128
139
129
- @ApiPropertyOptional ( { type : ( ) => Video , isArray : true } )
130
140
@Prop ( { type : ( ) => [ Video ] } )
131
141
teasers : Video [ ] ;
132
142
}
133
143
134
144
export class Person {
135
- @ApiPropertyOptional ( )
145
+ @ApiPropertyOptional ( { example : 6317 , description : 'Id персоны с кинопоиска' } )
136
146
@Prop ( { index : true } )
137
147
id : number ;
138
148
139
- @ApiPropertyOptional ( )
149
+ @ApiPropertyOptional ( { example : 'https://st.kp.yandex.net/images/actor_iphone/iphone360_6317.jpg' } )
140
150
@Prop ( )
141
151
photo : string ;
142
152
143
- @ApiPropertyOptional ( )
153
+ @ApiPropertyOptional ( { example : 'Пол Уокер' } )
144
154
@Prop ( )
145
155
name : string ;
146
156
147
- @ApiPropertyOptional ( )
157
+ @ApiPropertyOptional ( { example : 'Paul Walker' } )
148
158
@Prop ( )
149
159
enName : string ;
150
160
151
- @ApiPropertyOptional ( )
152
161
@Prop ( )
153
162
description : string ;
154
163
155
- @ApiPropertyOptional ( )
164
+ @ApiPropertyOptional ( { example : 'actor' } )
156
165
@Prop ( )
157
166
profession : string ;
158
167
159
- @ApiPropertyOptional ( )
160
168
@Prop ( )
161
169
enProfession : string ;
162
170
}
163
171
164
172
export class CurrencyValue {
165
- @ApiPropertyOptional ( )
173
+ @ApiPropertyOptional ( { example : 207283925 , description : 'Сумма' } )
166
174
@Prop ( { index : true } )
167
175
value : number ;
168
176
169
- @ApiPropertyOptional ( )
177
+ @ApiPropertyOptional ( { example : '$' , description : 'Валюта' } )
170
178
@Prop ( )
171
179
currency : string ;
172
180
}
@@ -347,11 +355,11 @@ export class Technology {
347
355
}
348
356
349
357
export class YearRange {
350
- @ApiPropertyOptional ( )
358
+ @ApiPropertyOptional ( { example : 2022 , description : 'Год начала' } )
351
359
@Prop ( )
352
360
start : number ;
353
361
354
- @ApiPropertyOptional ( )
362
+ @ApiPropertyOptional ( { example : 2023 , description : 'Год окончания' } )
355
363
@Prop ( )
356
364
end : number ;
357
365
}
@@ -380,15 +388,14 @@ export class Movie {
380
388
externalId : ExternalId ;
381
389
382
390
// INFO: Name values
383
- @ApiPropertyOptional ( )
391
+ @ApiPropertyOptional ( { example : 'Человек паук' } )
384
392
@Prop ( { index : true } )
385
393
name : string ;
386
394
387
- @ApiPropertyOptional ( )
395
+ @ApiPropertyOptional ( { example : 'Spider man' } )
388
396
@Prop ( { index : true } )
389
397
alternativeName : string ;
390
398
391
- @ApiPropertyOptional ( )
392
399
@Prop ( { index : true } )
393
400
enName : string ;
394
401
@@ -397,33 +404,54 @@ export class Movie {
397
404
names : Name [ ] ;
398
405
399
406
// INFO: Type values
400
- @ApiPropertyOptional ( )
401
- @Prop ( )
407
+ @ApiPropertyOptional ( {
408
+ example : 'movie | tv-series | cartoon | anime | animated-series | tv-show' ,
409
+ description : 'Тип тайтла' ,
410
+ } )
411
+ @Prop ( { index : true } )
402
412
type : string ;
403
413
414
+ @ApiPropertyOptional ( {
415
+ example : '1 (movie) | 2 (tv-series) | 3 (cartoon) | 4 (anime) | 5 (animated-series) | 6 (tv-show)' ,
416
+ description : 'Тип тайтла в числовом обозначении' ,
417
+ } )
404
418
@Prop ( { index : true } )
405
419
typeNumber : number ;
406
420
407
421
@Prop ( { index : true } )
408
422
subType : string ;
409
423
410
424
// INFO: Year values
425
+ @ApiPropertyOptional ( {
426
+ example : '1860-2030' ,
427
+ description : 'Год премьеры' ,
428
+ } )
411
429
@Prop ( { index : true } )
412
430
year : number ;
413
431
414
432
// INFO: Description values
415
- @ApiPropertyOptional ( )
433
+ @ApiPropertyOptional ( {
434
+ description : 'Описание тайтла' ,
435
+ } )
416
436
@Prop ( )
417
437
description : string ;
418
438
419
- @ApiPropertyOptional ( )
439
+ @ApiPropertyOptional ( {
440
+ description : 'Сокращенное описание' ,
441
+ } )
420
442
@Prop ( )
421
443
shortDescription : string ;
422
444
423
- @ApiPropertyOptional ( )
445
+ @ApiPropertyOptional ( {
446
+ description : 'Слоган' ,
447
+ } )
424
448
@Prop ( )
425
449
slogan : string ;
426
450
451
+ @ApiPropertyOptional ( {
452
+ example : 'filming | pre-production | completed | announced | post-production' ,
453
+ description : 'Статус релиза тайтла' ,
454
+ } )
427
455
@Prop ( { index : true } )
428
456
status : string ;
429
457
@@ -432,25 +460,31 @@ export class Movie {
432
460
facts : Fact [ ] ;
433
461
434
462
// INFO: Movie rating values
435
- @ApiPropertyOptional ( { type : ( ) => VendorNumbers } )
436
- @Prop ( { type : ( ) => VendorNumbers } )
437
- rating : VendorNumbers ;
463
+ @ApiPropertyOptional ( { type : ( ) => Rating } )
464
+ @Prop ( { type : ( ) => Rating } )
465
+ rating : Rating ;
438
466
439
- @ApiPropertyOptional ( )
440
- @Prop ( )
441
- votes : VendorNumbers ;
467
+ @ApiPropertyOptional ( { type : ( ) => Votes } )
468
+ @Prop ( { type : ( ) => Votes } )
469
+ votes : Votes ;
442
470
443
471
// INFO: Length value
444
- @ApiPropertyOptional ( )
472
+ @ApiPropertyOptional ( { example : 120 , description : 'Продолжительность фильма' } )
445
473
@Prop ( )
446
474
movieLength : number ;
447
475
448
476
// INFO: Age rating values
449
- @ApiPropertyOptional ( )
477
+ @ApiPropertyOptional ( {
478
+ example : 'pg13' ,
479
+ description : 'Возрастной рейтинг по MPAA' ,
480
+ } )
450
481
@Prop ( )
451
482
ratingMpaa : string ;
452
483
453
- @ApiPropertyOptional ( )
484
+ @ApiPropertyOptional ( {
485
+ example : '16' ,
486
+ description : 'Возрастной рейтинг' ,
487
+ } )
454
488
@Prop ( )
455
489
ageRating : number ;
456
490
@@ -463,15 +497,13 @@ export class Movie {
463
497
@Prop ( { type : ( ) => ShortImage } )
464
498
poster : ShortImage ;
465
499
466
- @ApiPropertyOptional ( { type : ( ) => ShortImage } )
467
500
@Prop ( { type : ( ) => ShortImage } )
468
501
horizontalPoster : ShortImage ;
469
502
470
503
@ApiPropertyOptional ( { type : ( ) => ShortImage } )
471
504
@Prop ( { type : ( ) => ShortImage } )
472
505
backdrop : ShortImage ;
473
506
474
- @ApiPropertyOptional ( { type : ( ) => Images } )
475
507
@Prop ( { type : ( ) => Images } )
476
508
imagesInfo : Images ;
477
509
@@ -493,7 +525,6 @@ export class Movie {
493
525
@Prop ( { type : ( ) => [ Person ] } )
494
526
persons : Person [ ] ;
495
527
496
- @ApiPropertyOptional ( )
497
528
@Prop ( )
498
529
color : string ;
499
530
@@ -505,7 +536,6 @@ export class Movie {
505
536
@Prop ( )
506
537
distributors : Distributor ;
507
538
508
- @ApiPropertyOptional ( { type : ( ) => SpokenLanguages , isArray : true } )
509
539
@Prop ( { type : ( ) => [ SpokenLanguages ] } )
510
540
spokenLanguages : SpokenLanguages [ ] ;
511
541
@@ -535,7 +565,6 @@ export class Movie {
535
565
@Prop ( { type : ( ) => Premiere } )
536
566
premiere : Premiere ;
537
567
538
- @ApiPropertyOptional ( )
539
568
@Prop ( )
540
569
ticketsOnSale : boolean ;
541
570
@@ -559,11 +588,11 @@ export class Movie {
559
588
@Prop ( { type : ( ) => [ YearRange ] } )
560
589
releaseYears : YearRange [ ] ;
561
590
562
- @ApiPropertyOptional ( )
591
+ @ApiPropertyOptional ( { example : 1 , description : 'Позиция тайтла в топ 10' } )
563
592
@Prop ( )
564
593
top10 : number ;
565
594
566
- @ApiPropertyOptional ( )
595
+ @ApiPropertyOptional ( { example : 200 , description : 'Позиция тайтла в топ 250' } )
567
596
@Prop ( )
568
597
top250 : number ;
569
598
}
0 commit comments