pos-be/src/modules/user-related/user/domain/usecases/managers/confirm-user.manager.ts

46 lines
1.1 KiB
TypeScript

import { Injectable } from '@nestjs/common';
import { BaseUpdateStatusManager } from 'src/core/modules/domain/usecase/managers/base-update-status.manager';
import { UserEntity } from '../../entities/user.entity';
import {
EventTopics,
validateRelations,
} from 'src/core/strings/constants/interface.constants';
import { UserModel } from '../../../data/models/user.model';
import { UserChangeStatusEvent } from '../../entities/event/user-change-status.event';
@Injectable()
export class ConfirmUserManager extends BaseUpdateStatusManager<UserEntity> {
getResult(): string {
return `Success active data ${ this.result.name }`;
}
async validateProcess(): Promise<void> {
return;
}
async beforeProcess(): Promise<void> {
return;
}
async afterProcess(): Promise<void> {
return;
}
get validateRelations(): validateRelations[] {
return [];
}
get entityTarget(): any {
return UserModel;
}
get eventTopics(): EventTopics[] {
return [
{
topic: UserChangeStatusEvent,
data: this.result,
},
];
}
}