2021-05-02 19:59:16 +02:00
|
|
|
"use strict";
|
|
|
|
|
2021-05-17 22:10:00 +02:00
|
|
|
const dateUtils = require('../../services/date_utils.js');
|
2021-05-02 19:59:16 +02:00
|
|
|
const AbstractEntity = require("./abstract_entity.js");
|
|
|
|
|
|
|
|
/**
|
|
|
|
* RecentNote represents recently visited note.
|
|
|
|
*/
|
|
|
|
class RecentNote extends AbstractEntity {
|
|
|
|
static get entityName() { return "recent_notes"; }
|
|
|
|
static get primaryKeyName() { return "noteId"; }
|
|
|
|
|
|
|
|
constructor(row) {
|
|
|
|
super();
|
|
|
|
|
|
|
|
this.noteId = row.noteId;
|
|
|
|
this.notePath = row.notePath;
|
|
|
|
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;
|