@@ -24,6 +24,7 @@ import { SortOrder } from 'mongoose';
24
24
import { Expose } from 'class-transformer' ;
25
25
import { EnumParam } from '../../../common/decorators/types/enum-param' ;
26
26
import { IRequestModel } from '../../../common/interfaces/request-model.interface' ;
27
+ import { DateParam } from '../../../common/decorators/types/date-param' ;
27
28
28
29
export enum MovieFieldV1_4 {
29
30
'id' = 'id' ,
@@ -150,7 +151,7 @@ export enum MovieSelectFieldV1_4 {
150
151
'persons' = 'persons' ,
151
152
'facts' = 'facts' ,
152
153
'fees' = 'fees' ,
153
- 'premiere.world ' = 'premiere.world ' ,
154
+ 'premiere' = 'premiere' ,
154
155
'similarMovies' = 'similarMovies' ,
155
156
'sequelsAndPrequels' = 'sequelsAndPrequels' ,
156
157
'watchability' = 'watchability' ,
@@ -512,33 +513,39 @@ export class MovieRequestDtoV1_4 implements IRequestModel {
512
513
} )
513
514
@IsOptional ( )
514
515
@ToArray ( )
516
+ @StringParam ( )
515
517
'persons.enProfession' : string [ ] ;
516
518
517
519
@ApiNullableProperty ( { type : 'string' , isArray : true , description : 'Поиск по сборам в мире (пример: `1000-6666666`)' } )
518
520
@IsOptional ( )
519
521
@ToArray ( )
520
522
@Validate ( IsNumberParam )
523
+ @NumberParam ( )
521
524
'fees.world' : string [ ] ;
522
525
@ApiNullableProperty ( { type : 'string' , isArray : true , description : 'Поиск по сборам в США (пример: `1000-6666666`)' } )
523
526
@IsOptional ( )
524
527
@ToArray ( )
525
528
@Validate ( IsNumberParam )
529
+ @NumberParam ( )
526
530
'fees.usa' : string [ ] ;
527
531
@ApiNullableProperty ( { type : 'string' , isArray : true , description : 'Поиск по сборам в России (пример: `1000-6666666`)' } )
528
532
@IsOptional ( )
529
533
@ToArray ( )
530
534
@Validate ( IsNumberParam )
535
+ @NumberParam ( )
531
536
'fees.russia' : string [ ] ;
532
537
533
538
@ApiNullableProperty ( { type : 'string' , isArray : true , description : 'Поиск по дате премьеры в мире (пример: `01.01.2020, 01.01.2020-31.12.2020`)' } )
534
539
@IsOptional ( )
535
540
@ToArray ( )
536
541
@Validate ( IsDateParam )
542
+ @DateParam ( )
537
543
'premiere.world' : string [ ] ;
538
544
@ApiNullableProperty ( { type : 'string' , isArray : true , description : 'Поиск по дате премьеры в США (пример: `01.01.2020, 01.01.2020-31.12.2020`)' } )
539
545
@IsOptional ( )
540
546
@ToArray ( )
541
547
@Validate ( IsDateParam )
548
+ @DateParam ( )
542
549
'premiere.usa' : string [ ] ;
543
550
@ApiNullableProperty ( {
544
551
type : 'string' ,
@@ -548,6 +555,7 @@ export class MovieRequestDtoV1_4 implements IRequestModel {
548
555
@IsOptional ( )
549
556
@ToArray ( )
550
557
@Validate ( IsDateParam )
558
+ @DateParam ( )
551
559
'premiere.russia' : string [ ] ;
552
560
@ApiNullableProperty ( {
553
561
type : 'string' ,
@@ -557,6 +565,7 @@ export class MovieRequestDtoV1_4 implements IRequestModel {
557
565
@IsOptional ( )
558
566
@ToArray ( )
559
567
@Validate ( IsDateParam )
568
+ @DateParam ( )
560
569
'premiere.digital' : string [ ] ;
561
570
@ApiNullableProperty ( {
562
571
type : 'string' ,
@@ -566,6 +575,7 @@ export class MovieRequestDtoV1_4 implements IRequestModel {
566
575
@IsOptional ( )
567
576
@ToArray ( )
568
577
@Validate ( IsDateParam )
578
+ @DateParam ( )
569
579
'premiere.cinema' : string [ ] ;
570
580
@ApiNullableProperty ( {
571
581
type : 'string' ,
@@ -574,20 +584,23 @@ export class MovieRequestDtoV1_4 implements IRequestModel {
574
584
} )
575
585
@IsOptional ( )
576
586
@ToArray ( )
587
+ @StringParam ( )
577
588
'premiere.country' : string [ ] ;
578
589
579
590
@ApiNullableProperty ( { isArray : true , description : 'Поиск по ID KinoPoisk из списка похожих фильмов (пример: `666, 555, !666`)' } )
580
591
@IsOptional ( )
581
592
@ToArray ( )
582
593
@Validate ( IsValueInRange , [ 250 , 7000000 ] )
583
594
@Validate ( IsNumberParam )
595
+ @NumberParam ( )
584
596
'similarMovies.id' : string [ ] ;
585
597
586
598
@ApiNullableProperty ( { isArray : true , description : 'Поиск по ID KinoPoisk из списка сиквелов и преквелов (пример: `666, 555, !666`)' } )
587
599
@IsOptional ( )
588
600
@ToArray ( )
589
601
@Validate ( IsValueInRange , [ 250 , 7000000 ] )
590
602
@Validate ( IsNumberParam )
603
+ @NumberParam ( )
591
604
'sequelsAndPrequels.id' : string [ ] ;
592
605
593
606
@ApiNullableProperty ( {
@@ -644,29 +657,6 @@ export class MovieRequestDtoV1_4 implements IRequestModel {
644
657
}
645
658
646
659
public model2Select ( ) {
647
- const defaultSelectFields = [
648
- 'id' ,
649
- 'externalId' ,
650
- 'name' ,
651
- 'logo' ,
652
- 'poster' ,
653
- 'alternativeName' ,
654
- 'enName' ,
655
- 'names' ,
656
- 'description' ,
657
- 'shortDescription' ,
658
- 'horizontalPoster' ,
659
- 'type' ,
660
- 'movieLength' ,
661
- 'seriesLength' ,
662
- 'totalSeriesLength' ,
663
- 'year' ,
664
- 'votes' ,
665
- 'rating' ,
666
- 'releaseYears' ,
667
- 'genres' ,
668
- 'countries' ,
669
- ] ;
670
660
const select = new SelectBuilder ( ) ;
671
661
672
662
return select . build ( this . selectFields , defaultSelectFields ) ;
0 commit comments