@@ -3,10 +3,7 @@ import { InjectRepository } from '@nestjs/typeorm';
3
3
import { Repository } from 'typeorm' ;
4
4
import { Ordering } from '../shared/decorators/ordenate.decorator' ;
5
5
import { Pagination } from '../shared/decorators/paginate.decorator' ;
6
- import {
7
- getWhereClauseBoolean ,
8
- getWhereClauseNumber ,
9
- } from '../shared/helpers/sql-query-helper' ;
6
+ import { getWhereClauseNumber } from '../shared/helpers/sql-query-helper' ;
10
7
import { ResponsePaginate } from '../shared/interfaces/response-paginate.interface' ;
11
8
import { CreateRotinaDto } from './dto/create-rotina.dto' ;
12
9
import { UpdateRotinaDto } from './dto/update-rotina.dto' ;
@@ -70,7 +67,6 @@ export class RotinaService {
70
67
71
68
whereClause += getWhereClauseNumber ( filter . id , 'id' ) ;
72
69
whereClause += getWhereClauseNumber ( filter . idIdoso , '"idIdoso"' ) ;
73
- whereClause += getWhereClauseBoolean ( filter . notificacao , '"notificacao"' ) ;
74
70
whereClause += this . getWhereClauseDate ( filter . dataHora ) ;
75
71
76
72
return whereClause ;
@@ -114,7 +110,7 @@ export class RotinaService {
114
110
return this . _repository
115
111
. createQueryBuilder ( 'rotinas' )
116
112
. where (
117
- `(("dataHora"::date BETWEEN '${ startString } '::date AND '${ endString } '::date) OR (dias && '{${ weekday } }'::rotina_dias_enum[])) AND lpad(date_part('hour', "dataHora")::text, 2, '0') || ':' || lpad(date_part('minute', "dataHora")::text, 2, '0') = '${ time } '` ,
113
+ `"notificacao" = ${ true } AND (("dataHora"::date BETWEEN '${ startString } '::date AND '${ endString } '::date) OR (dias && '{${ weekday } }'::rotina_dias_enum[])) AND lpad(date_part('hour', "dataHora")::text, 2, '0') || ':' || lpad(date_part('minute', "dataHora")::text, 2, '0') = '${ time } '` ,
118
114
)
119
115
. getMany ( ) ;
120
116
}
0 commit comments