mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
28 lines
862 B
TypeScript
28 lines
862 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { z } from 'zod';
|
|
import { MessageRepositoryService } from '../../data/repository/message-respository.service';
|
|
import { SafeValidateSchema, ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
|
|
|
export const MessageDeleteInputDTOSchema = z.object({
|
|
requestId: z.string().optional(),
|
|
roomId: z.string(),
|
|
messageId: z.string(),
|
|
senderId: z.number(),
|
|
});
|
|
export type MessageDeleteInputDTO = z.infer<typeof MessageDeleteInputDTOSchema>
|
|
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class MessageDeleteLiveUseCaseService {
|
|
constructor(
|
|
public repository: MessageRepositoryService
|
|
) { }
|
|
|
|
@SafeValidateSchema(MessageDeleteInputDTOSchema, 'MessageDeleteUseCaseService')
|
|
async execute(data: MessageDeleteInputDTO) {
|
|
return this.repository.sendMessageDelete(data)
|
|
}
|
|
}
|