mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
31 lines
828 B
TypeScript
31 lines
828 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { MessageRepositoryService } from '../../data/repository/message-respository.service';
|
|
import { object, z } from 'zod';
|
|
import { ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
|
|
|
|
|
const MessageReactionInputDTOSchema = z.object({
|
|
memberId: z.number(),
|
|
messageId: z.string(),
|
|
roomId: z.string(),
|
|
reaction: z.string(),
|
|
requestId: z.string().optional()
|
|
})
|
|
|
|
export type MessageReactionInput = z.infer< typeof MessageReactionInputDTOSchema>
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class MessageReactionUseCaseService {
|
|
|
|
constructor(
|
|
public repository: MessageRepositoryService
|
|
) { }
|
|
|
|
@ValidateSchema(MessageReactionInputDTOSchema)
|
|
execute(input: MessageReactionInput) {
|
|
return this.repository.reactToMessage(input)
|
|
}
|
|
}
|