IMPORTANT: The module comes with the entity ActivityLog, you have to add the configuration node_modules/nestjs-activity-log/**/*.entity.js
to let typeorm scan your entities or add them to the entities configuration variable in TypeORM.
Create activity log
Then it only remains to use the service ActivityLogService to register any user activity that you consider. This module is designed for applications with several clients and that in turn these clients have several users who use the application.
data.detail='Book created: The Lord of the Rings, The Return of the King';
data.additionalInfo={};// You can indicate the information you consider necessary
awaitthis.activityLogService.create(data);
// your logic to create the entity
}
}
Get activities log
To consult the registered activities, you just have to invoke the getActivities method indicating the param domain and retrieve the activities in reverse chronological order.
Additionally you can specify filters and indicate paging options.