-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add getLegalDocumentStatusByUserId in legal-document api
- Loading branch information
Showing
1 changed file
with
20 additions
and
7 deletions.
There are no files selected for viewing
27 changes: 20 additions & 7 deletions
27
api/src/legal-documents/application/api/legal-documents-api.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |