• 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

74.6
/src/app/application/user/command/updateUnitedUser/UpdateUnitedUserCommandHandler.ts
1
import { Inject, NotFoundException } from '@nestjs/common';
2
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs';
1✔
3

4
import { Transactional } from '@khlug/core/persistence/transaction/Transactional';
5

1✔
6
import { UpdateUnitedUserCommand } from '@khlug/app/application/user/command/updateUnitedUser/UpdateUnitedUserCommand';
7
import { UpdateUnitedUserCommandResult } from '@khlug/app/application/user/command/updateUnitedUser/UpdateUnitedUserCommandResult';
8

2✔
9
import {
10
  IUserRepository,
11
  UserRepository,
1✔
12
} from '@khlug/app/domain/user/IUserRepository';
1✔
13

1✔
14
import { Message } from '@khlug/constant/message';
1✔
15

1✔
16
@CommandHandler(UpdateUnitedUserCommand)
1✔
17
export class UpdateUnitedUserCommandHandler
1✔
18
  implements
19
    ICommandHandler<UpdateUnitedUserCommand, UpdateUnitedUserCommandResult>
1!
20
{
×
21
  constructor(
22
    @Inject(UserRepository)
23
    private readonly userRepository: IUserRepository,
24
  ) {}
25

26
  @Transactional()
27
  async execute(
1✔
28
    command: UpdateUnitedUserCommand,
29
  ): Promise<UpdateUnitedUserCommandResult> {
1✔
30
    const { userId, email } = command;
31

32
    const user = await this.userRepository.findById(userId);
2!
33
    if (!user) {
2!
34
      throw new NotFoundException(Message.USER_NOT_FOUND);
×
35
    }
2✔
36

37
    user.setProfile({ email });
38
    await this.userRepository.save(user);
5!
39

40
    return new UpdateUnitedUserCommandResult(user);
41
  }
1✔
42
}
1✔
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