Conditions | 3 |
Total Lines | 27 |
Code Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { QueryHandler } from '@nestjs/cqrs'; |
||
16 | |||
17 | public async execute(query: GetUsersPresenceQuery): Promise<UserView[]> { |
||
18 | const currentDate = this.dateUtils.getCurrentDate(); |
||
19 | const workedDays = this.dateUtils.getWorkedDaysDuringAPeriod(currentDate, currentDate); |
||
20 | |||
21 | if (0 === workedDays.length) { |
||
22 | console.log('innn'); |
||
23 | } |
||
24 | |||
25 | |||
26 | |||
27 | const users = await this.userRepository.findUsers(false); |
||
28 | const userViews: UserView[] = []; |
||
29 | |||
30 | for (const user of users) { |
||
31 | userViews.push( |
||
32 | new UserView( |
||
33 | user.getId(), |
||
34 | user.getFirstName(), |
||
35 | user.getLastName(), |
||
36 | user.getEmail(), |
||
37 | user.getRole() |
||
38 | ) |
||
39 | ); |
||
40 | } |
||
41 | |||
42 | return userViews; |
||
43 | } |
||
45 |