2021-05-02 19:59:16 +02:00
|
|
|
"use strict";
|
|
|
|
|
2022-01-10 17:09:20 +01:00
|
|
|
const dateUtils = require('../../services/date_utils');
|
|
|
|
const AbstractEntity = require("./abstract_entity");
|
2021-05-02 19:59:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* RecentNote represents recently visited note.
|
2022-04-16 00:17:32 +02:00
|
|
|
*
|
|
|
|
* @extends AbstractEntity
|
2021-05-02 19:59:16 +02:00
|
|
|
*/
|
|
|
|
class RecentNote extends AbstractEntity {
|
|
|
|
static get entityName() { return "recent_notes"; }
|
|
|
|
static get primaryKeyName() { return "noteId"; }
|
|
|
|
|
|
|
|
constructor(row) {
|
|
|
|
super();
|
|
|
|
|
2021-11-10 21:30:54 +01:00
|
|
|
/** @type {string} */
|
2021-05-02 19:59:16 +02:00
|
|
|
this.noteId = row.noteId;
|
2021-11-10 21:30:54 +01:00
|
|
|
/** @type {string} */
|
2021-05-02 19:59:16 +02:00
|
|
|
this.notePath = row.notePath;
|
2021-11-10 21:30:54 +01:00
|
|
|
/** @type {string} */
|
2021-05-02 19:59:16 +02:00
|
|
|
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
|
|
|
}
|
2021-05-08 22:13:08 +02:00
|
|
|
|
|
|
|
getPojo() {
|
|
|
|
return {
|
|
|
|
noteId: this.noteId,
|
|
|
|
notePath: this.notePath,
|
|
|
|
utcDateCreated: this.utcDateCreated
|
|
|
|
}
|
|
|
|
}
|
2021-05-02 19:59:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = RecentNote;
|