Full JSDoc for src/schemas complete.
This commit is contained in:
parent
ec37c2f59d
commit
76e2f56eb4
4 changed files with 152 additions and 4 deletions
|
|
@ -17,6 +17,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
|
|||
//NPM Imports
|
||||
const {mongoose} = require('mongoose');
|
||||
|
||||
/**
|
||||
* DB Schema for Documents representing a user ban from a single channel
|
||||
*/
|
||||
const channelBanSchema = new mongoose.Schema({
|
||||
user: {
|
||||
type: mongoose.SchemaTypes.ObjectID,
|
||||
|
|
@ -41,6 +44,10 @@ const channelBanSchema = new mongoose.Schema({
|
|||
});
|
||||
|
||||
//methods
|
||||
/**
|
||||
* Calculates days until ban expiration
|
||||
* @returns {Number} Days until the given ban expires
|
||||
*/
|
||||
channelBanSchema.methods.getDaysUntilExpiration = function(){
|
||||
//Get ban date
|
||||
const expirationDate = new Date(this.banDate);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue