From 999e74b405fe3c98c16fbb5e741e048c7b73f545 Mon Sep 17 00:00:00 2001 From: "a.bouhuolia" Date: Mon, 4 Jan 2021 13:13:33 +0200 Subject: [PATCH] feat: add isPublished attribute to manual journal model. --- server/src/models/ManualJournal.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/server/src/models/ManualJournal.js b/server/src/models/ManualJournal.js index 899e37093..b3d8b4a07 100644 --- a/server/src/models/ManualJournal.js +++ b/server/src/models/ManualJournal.js @@ -16,8 +16,21 @@ export default class ManualJournal extends TenantModel { return ['createdAt', 'updatedAt']; } - static get resourceable() { - return true; + /** + * Virtual attributes. + */ + static get virtualAttributes() { + return [ + 'isPublished', + ]; + } + + /** + * Detarmines whether the invoice is published. + * @return {boolean} + */ + get isPublished() { + return !!this.publishedAt; } /**