2021-05-02 19:59:16 +02:00
|
|
|
"use strict";
|
|
|
|
|
2022-01-10 17:09:20 +01:00
|
|
|
const dateUtils = require('../../services/date_utils');
|
2023-01-03 13:52:37 +01:00
|
|
|
const AbstractBeccaEntity = require("./abstract_becca_entity");
|
2021-05-02 19:59:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* RecentNote represents recently visited note.
|
2022-04-16 00:17:32 +02:00
|
|
|
*
|
2023-01-03 13:52:37 +01:00
|
|
|
* @extends AbstractBeccaEntity
|
2021-05-02 19:59:16 +02:00
|
|
|
*/
|
2023-01-03 13:52:37 +01: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();
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-01-03 13:52:37 +01:00
|
|
|
module.exports = BRecentNote;
|