+ const query: VideoStatsTimeserieQuery = req.query
+ if (
+ (query.startDate && !query.endDate) ||
+ (!query.startDate && query.endDate)
+ ) {
+ return res.fail({
+ status: HttpStatusCode.BAD_REQUEST_400,
+ message: 'Both start date and end date should be defined if one of them is specified'
+ })
+ }
+
+ if (query.startDate && getIntervalByDays(query.startDate, query.endDate) > STATS_TIMESERIE.MAX_DAYS) {
+ return res.fail({
+ status: HttpStatusCode.BAD_REQUEST_400,
+ message: 'Star date and end date interval is too big'
+ })
+ }
+