mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
add interface
This commit is contained in:
+25
-3
@@ -2,7 +2,29 @@ import { Injectable, Input } from '@angular/core';
|
||||
import { MessageLocalDataSourceService } from '../../../data/repository/message/message-local-data-source.service';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { ParamsValidation } from 'src/app/services/decorators/validate-schema.decorator';
|
||||
import { MessageOutPutDataDTOSchema } from '../../../data/dto/message/messageOutputDTO';
|
||||
import { MessageEntitySchema } from 'src/app/core/chat/entity/message';
|
||||
import { z } from 'zod';
|
||||
|
||||
const SocketMessageCreateOutputSchema = MessageEntitySchema.pick({
|
||||
id: true,
|
||||
attachments: true,
|
||||
canEdit: true,
|
||||
editedAt: true,
|
||||
info: true,
|
||||
isDeleted: true,
|
||||
message: true,
|
||||
messageType: true,
|
||||
oneShot: true,
|
||||
reactions: true,
|
||||
receiverId: true,
|
||||
requireUnlock: true,
|
||||
roomId: true,
|
||||
sender: true,
|
||||
sending: true,
|
||||
sentAt: true,
|
||||
})
|
||||
|
||||
export type ISocketMessageCreateOutput = z.infer<typeof SocketMessageCreateOutputSchema>
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -14,9 +36,9 @@ export class SocketMessageCreateUseCaseService {
|
||||
) { }
|
||||
|
||||
@XTracerAsync({name:'Socket-Message-Create-UseCase', module:'chat', bugPrint: true})
|
||||
async execute(input: any, tracing?: TracingType) {
|
||||
async execute(input: ISocketMessageCreateOutput, tracing?: TracingType) {
|
||||
|
||||
ParamsValidation(MessageOutPutDataDTOSchema, input, tracing)
|
||||
ParamsValidation(SocketMessageCreateOutputSchema, input, tracing)
|
||||
|
||||
const incomingMessage = {
|
||||
...input,
|
||||
|
||||
Reference in New Issue
Block a user