code refactoring

This commit is contained in:
Peter Maquiran
2024-08-18 13:27:57 +01:00
parent 650c772084
commit ef12ff439d
50 changed files with 729 additions and 735 deletions
@@ -0,0 +1,27 @@
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)
}
}