• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

khu-khlug / sight-backend / 13616929463

02 Mar 2025 03:40PM UTC coverage: 57.19% (-1.0%) from 58.222%
13616929463

push

github

web-flow
chore: yarn에서 npm으로 롤백 (#105)

637 of 1702 branches covered (37.43%)

Branch coverage included in aggregate %.

1797 of 2554 relevant lines covered (70.36%)

15.16 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.31
/src/app/application/infraBlue/query/getDoorLockPassword/GetDoorLockPasswordQueryHandler.ts
1
import { EntityRepository } from '@mikro-orm/mysql';
2
import { InjectRepository } from '@mikro-orm/nestjs';
1✔
3
import { NotFoundException } from '@nestjs/common';
4
import { IQueryHandler, QueryHandler } from '@nestjs/cqrs';
5

1✔
6
import { GetDoorLockPasswordQuery } from '@khlug/app/application/infraBlue/query/getDoorLockPassword/GetDoorLockPasswordQuery';
7
import { GetDoorLockPasswordQueryResult } from '@khlug/app/application/infraBlue/query/getDoorLockPassword/GetDoorLockPasswordQueryResult';
8

4✔
9
import { Cache, CacheId } from '@khlug/app/domain/cache/model/Cache';
10

11
import { Message } from '@khlug/constant/message';
1✔
12

1✔
13
@QueryHandler(GetDoorLockPasswordQuery)
1✔
14
export class GetDoorLockPasswordQueryHandler
1✔
15
  implements
1✔
16
    IQueryHandler<GetDoorLockPasswordQuery, GetDoorLockPasswordQueryResult>
1✔
17
{
1✔
18
  constructor(
1✔
19
    @InjectRepository(Cache)
20
    private readonly cacheRepository: EntityRepository<Cache>,
2!
21
  ) {}
×
22

23
  async execute(): Promise<GetDoorLockPasswordQueryResult> {
24
    const passwords = await this.cacheRepository.find({
25
      id: {
26
        $in: [
27
          CacheId.masterPassword,
28
          CacheId.jajudyPassword,
2✔
29
          CacheId.facilityTeamPassword,
30
        ],
2✔
31
      },
32
    });
33

1!
34
    const masterPassword = passwords.find(
1!
35
      (password) => password.id === CacheId.masterPassword,
×
36
    );
1!
37
    const jajudyPassword = passwords.find(
38
      (password) => password.id === CacheId.jajudyPassword,
39
    );
2!
40
    const facilityTeamPassword = passwords.find(
41
      (password) => password.id === CacheId.facilityTeamPassword,
42
    );
1✔
43

1✔
44
    if (!masterPassword || !jajudyPassword || !facilityTeamPassword) {
45
      throw new NotFoundException(Message.SOME_DOOR_LOCK_PASSWORD_NOT_FOUND);
46
    }
47

48
    return new GetDoorLockPasswordQueryResult({
2✔
49
      master: masterPassword.content,
50
      forJajudy: jajudyPassword.content,
51
      forFacilityTeam: facilityTeamPassword.content,
52
    });
53
  }
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc