rename message broker interface
This commit is contained in:
parent
6eb9b40e14
commit
3f11f16e59
|
@ -18,6 +18,12 @@ import { UserPresenter } from './user.presenter';
|
||||||
import { ICollection } from '../../../database/src/interfaces/collection.interface';
|
import { ICollection } from '../../../database/src/interfaces/collection.interface';
|
||||||
import { RpcValidationPipe } from './rpc.validation-pipe';
|
import { RpcValidationPipe } from './rpc.validation-pipe';
|
||||||
|
|
||||||
|
@UsePipes(
|
||||||
|
new RpcValidationPipe({
|
||||||
|
whitelist: true,
|
||||||
|
forbidUnknownValues: false,
|
||||||
|
}),
|
||||||
|
)
|
||||||
@Controller()
|
@Controller()
|
||||||
export class UsersController {
|
export class UsersController {
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -72,12 +78,6 @@ export class UsersController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@UsePipes(
|
|
||||||
new RpcValidationPipe({
|
|
||||||
whitelist: true,
|
|
||||||
forbidUnknownValues: false,
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
@GrpcMethod('UsersService', 'Update')
|
@GrpcMethod('UsersService', 'Update')
|
||||||
async updateUser(data: UpdateUserRequest): Promise<UserPresenter> {
|
async updateUser(data: UpdateUserRequest): Promise<UserPresenter> {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AmqpConnection } from '@golevelup/nestjs-rabbitmq';
|
import { AmqpConnection } from '@golevelup/nestjs-rabbitmq';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { IMessageBroker } from '../../domain/interfaces/user-messager';
|
import { IMessageBroker } from '../../domain/interfaces/message-broker';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LoggingMessager extends IMessageBroker {
|
export class LoggingMessager extends IMessageBroker {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { AmqpConnection } from '@golevelup/nestjs-rabbitmq';
|
import { AmqpConnection } from '@golevelup/nestjs-rabbitmq';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { IMessageBroker } from '../../domain/interfaces/user-messager';
|
import { IMessageBroker } from '../../domain/interfaces/message-broker';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UserMessager extends IMessageBroker {
|
export class UserMessager extends IMessageBroker {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { AutoMap } from '@automapper/classes';
|
import { AutoMap } from '@automapper/classes';
|
||||||
import { IsOptional, IsString } from 'class-validator';
|
import { IsEmail, IsOptional, IsPhoneNumber, IsString } from 'class-validator';
|
||||||
|
|
||||||
export class CreateUserRequest {
|
export class CreateUserRequest {
|
||||||
@IsString()
|
@IsString()
|
||||||
|
@ -17,12 +17,12 @@ export class CreateUserRequest {
|
||||||
@AutoMap()
|
@AutoMap()
|
||||||
lastName?: string;
|
lastName?: string;
|
||||||
|
|
||||||
@IsString()
|
@IsEmail()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@AutoMap()
|
@AutoMap()
|
||||||
email?: string;
|
email?: string;
|
||||||
|
|
||||||
@IsString()
|
@IsPhoneNumber()
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@AutoMap()
|
@AutoMap()
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
Loading…
Reference in New Issue