From 1e9f36c4be225a1a26ef3ebd8a95633579a78e26 Mon Sep 17 00:00:00 2001 From: Karl-Philipp Wulfert Date: Tue, 2 Apr 2019 15:35:43 +0200 Subject: [PATCH] refactor: apply structure to favorites and saveable things --- src/core/base/SaveableThing.ts | 17 +++++++++++------ src/core/things/Favorite.ts | 9 ++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/core/base/SaveableThing.ts b/src/core/base/SaveableThing.ts index 2b2d6400..cfea8ab8 100644 --- a/src/core/base/SaveableThing.ts +++ b/src/core/base/SaveableThing.ts @@ -17,14 +17,19 @@ import {SCThing, SCThingUserOrigin} from '../Thing'; /** * An encapsulation of the data (e.g. a thing) that is saved, which provides additional information. */ -export interface SCSaveableThing extends SCThing { - /** - * The contained data - */ - data: T; - +export interface SCSaveableThingWithoutReferences extends SCThing { /** * Type of the origin */ origin: SCThingUserOrigin; } + +/** + * An encapsulation of the data (e.g. a thing) that is saved, which provides additional information. + */ +export interface SCSaveableThing extends SCSaveableThingWithoutReferences { + /** + * The contained data + */ + data: T; +} diff --git a/src/core/things/Favorite.ts b/src/core/things/Favorite.ts index 614b21c5..59793cf1 100644 --- a/src/core/things/Favorite.ts +++ b/src/core/things/Favorite.ts @@ -12,7 +12,7 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ -import {SCSaveableThing} from '../base/SaveableThing'; +import {SCSaveableThing, SCSaveableThingWithoutReferences} from '../base/SaveableThing'; import {SCThingMeta, SCThingType} from '../Thing'; import {SCAcademicEventWithoutReferences} from './AcademicEvent'; import {SCArticleWithoutReferences} from './Article'; @@ -37,6 +37,13 @@ export type SCFavoriteDataTypes = SCAcademicEventWithoutReferences | SCSportCourseWithoutReferences | SCToDoWithoutReferences; +/** + * A favorite without references + */ +export interface SCFavoriteWithoutReferences extends SCSaveableThingWithoutReferences { + +} + /** * A favorite *