Notes/src/becca/entities/brecent_note.js

36 lines
877 B
JavaScript
Raw Normal View History

2021-05-02 19:59:16 +02:00
"use strict";
2024-02-16 21:38:09 +02:00
const dateUtils = require('../../services/date_utils');
const AbstractBeccaEntity = require('./abstract_becca_entity.js');
2021-05-02 19:59:16 +02:00
/**
* RecentNote represents recently visited note.
2022-04-16 00:17:32 +02:00
*
* @extends AbstractBeccaEntity
2021-05-02 19:59:16 +02:00
*/
class BRecentNote extends AbstractBeccaEntity {
2021-05-02 19:59:16 +02:00
static get entityName() { return "recent_notes"; }
static get primaryKeyName() { return "noteId"; }
constructor(row) {
super();
/** @type {string} */
2021-05-02 19:59:16 +02:00
this.noteId = row.noteId;
/** @type {string} */
2021-05-02 19:59:16 +02:00
this.notePath = row.notePath;
/** @type {string} */
2021-05-02 19:59:16 +02:00
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
}
getPojo() {
return {
noteId: this.noteId,
notePath: this.notePath,
utcDateCreated: this.utcDateCreated
}
}
2021-05-02 19:59:16 +02:00
}
module.exports = BRecentNote;