mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
30 lines
1011 B
TypeScript
30 lines
1011 B
TypeScript
import { Injectable } from '@angular/core';
|
|
import { z } from 'zod';
|
|
import { SafeValidateSchema, ValidateSchema } from 'src/app/services/decorators/validate-schema.decorator';
|
|
import { MessageRemoteDataSourceService } from '../../data/repository/message/message-remote-data-source.service';
|
|
import { MessageSocketRepositoryService } from '../../data/repository/message/message-live-signalr-data-source.service';
|
|
|
|
|
|
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: MessageSocketRepositoryService
|
|
) { }
|
|
|
|
@SafeValidateSchema(MessageDeleteInputDTOSchema, 'MessageDeleteUseCaseService')
|
|
async execute(data: MessageDeleteInputDTO) {
|
|
return this.repository.sendMessageDelete(data)
|
|
}
|
|
}
|