From 3bf2bed575c526d4a369e60678481b40710b9084 Mon Sep 17 00:00:00 2001 From: Benjamin Petetot Date: Wed, 11 Dec 2024 16:20:46 +0100 Subject: [PATCH] feat(api): add getLegalDocumentStatusByUserId in legal-document api --- .../application/api/legal-documents-api.js | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/api/src/legal-documents/application/api/legal-documents-api.js b/api/src/legal-documents/application/api/legal-documents-api.js index 7c0829cbaf9..c68d51a5042 100644 --- a/api/src/legal-documents/application/api/legal-documents-api.js +++ b/api/src/legal-documents/application/api/legal-documents-api.js @@ -1,16 +1,29 @@ import { usecases } from '../../domain/usecases/index.js'; /** - * Accept legal document by user id. + * Accepts a legal document for a user by their ID. * - * @param{string} params.service - * @param{string} params.type - * @param{string} params.userId - * - * @returns {Promise} + * @param {Object} params - The parameters. + * @param {string} params.type - The type of the legal document. (e.g. 'TOS') + * @param {string} params.service - The service associated with the legal document. (e.g. 'pix-orga') + * @param {string} params.userId - The ID of the user. + * @returns {Promise} - A promise that resolves when the legal document is accepted. */ const acceptLegalDocumentByUserId = async ({ type, service, userId }) => { return usecases.acceptLegalDocumentByUserId({ type, service, userId }); }; -export { acceptLegalDocumentByUserId }; +/** + * Gets the status of a legal document for a user by their ID. + * + * @param {Object} params - The parameters. + * @param {string} params.type - The type of the legal document. (e.g. 'TOS') + * @param {string} params.service - The service associated with the legal document. (e.g. 'pix-orga') + * @param {string} params.userId - The ID of the user. + * @returns {Promise} - A promise that resolves with the status of the legal document. + */ +const getLegalDocumentStatusByUserId = async ({ type, service, userId }) => { + return usecases.getLegalDocumentStatusByUserId({ type, service, userId }); +}; + +export { acceptLegalDocumentByUserId, getLegalDocumentStatusByUserId };