feat: adiciona a funcionalidade de fake call

This commit is contained in:
Felipe Medeiros
2024-10-07 01:13:02 -03:00
parent d7ddb99fb0
commit b80b203670
8 changed files with 60 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
import { RouterBroker } from '@api/abstract/abstract.router';
import {
OfferCallDto,
SendAudioDto,
SendButtonDto,
SendContactDto,
@@ -21,6 +22,7 @@ import {
listMessageSchema,
locationMessageSchema,
mediaMessageSchema,
offerCallSchema,
pollMessageSchema,
reactionMessageSchema,
statusMessageSchema,
@@ -166,6 +168,16 @@ export class MessageRouter extends RouterBroker {
execute: (instance, data) => sendMessageController.sendButtons(instance, data),
});
return res.status(HttpStatus.CREATED).json(response);
})
.post(this.routerPath('offerCall'), ...guards, async (req, res) => {
const response = await this.dataValidate<OfferCallDto>({
request: req,
schema: offerCallSchema,
ClassRef: OfferCallDto,
execute: (instance, data) => sendMessageController.offerCall(instance, data),
});
return res.status(HttpStatus.CREATED).json(response);
});
}