Skip to content

Commit

Permalink
feat(api): add getLegalDocumentStatusByUserId in legal-document api
Browse files Browse the repository at this point in the history
  • Loading branch information
bpetetot committed Dec 17, 2024
1 parent 08cc22d commit 3bf2bed
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions api/src/legal-documents/application/api/legal-documents-api.js
Original file line number Diff line number Diff line change
@@ -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<void>}
* @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<void>} - 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<LegalDocumentStatus>} - 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 };

0 comments on commit 3bf2bed

Please sign in to comment.