diff --git a/src/app/api/customer/DocumentsNotaryController.ts b/src/app/api/customer/DocumentsNotaryController.ts index e1626b2c..9b603c3b 100644 --- a/src/app/api/customer/DocumentsNotaryController.ts +++ b/src/app/api/customer/DocumentsNotaryController.ts @@ -47,4 +47,40 @@ export default class DocumentsNotaryController extends ApiController { return; } } + + /** + * @description Get document by uid + * @returns IDocument document + */ + @Get("/api/v1/customer/documents_notary/:uid", [authHandler]) + protected async getByUid(req: Request, response: Response) { + try { + const uid = req.params["uid"]; + if (!uid) { + this.httpBadRequest(response, "uid is required"); + return; + } + + //get query + let query; + if (req.query["q"]) { + query = JSON.parse(req.query["q"] as string); + } + + const documentEntity = await this.documentsNotaryService.getByUid(uid, query); + + if (!documentEntity) { + this.httpNotFoundRequest(response, "Document not found"); + return; + } + + const document = DocumentNotary.hydrate(documentEntity, { strategy: "excludeAll" }); + + //success + this.httpSuccess(response, document); + } catch (error) { + this.httpInternalError(response, error); + return; + } + } } diff --git a/src/services/common/OvhService/OvhService.ts b/src/services/common/OvhService/OvhService.ts index c7ab8379..e1adceb1 100644 --- a/src/services/common/OvhService/OvhService.ts +++ b/src/services/common/OvhService/OvhService.ts @@ -22,6 +22,8 @@ export default class OvhService extends BaseService { receivers: [phoneNumber], senderForResponse: false, sender: "not.IT Fact", + noStopClause: true, + }, (error: any, response: any) => { if (error) { console.error('Error sending Ovh Sms');