mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 06:22:53 +00:00
refactor: apply structure to favorites and saveable things
This commit is contained in:
@@ -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.
|
* An encapsulation of the data (e.g. a thing) that is saved, which provides additional information.
|
||||||
*/
|
*/
|
||||||
export interface SCSaveableThing<T extends SCThing> extends SCThing {
|
export interface SCSaveableThingWithoutReferences extends SCThing {
|
||||||
/**
|
|
||||||
* The contained data
|
|
||||||
*/
|
|
||||||
data: T;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type of the origin
|
* Type of the origin
|
||||||
*/
|
*/
|
||||||
origin: SCThingUserOrigin;
|
origin: SCThingUserOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An encapsulation of the data (e.g. a thing) that is saved, which provides additional information.
|
||||||
|
*/
|
||||||
|
export interface SCSaveableThing<T extends SCThing> extends SCSaveableThingWithoutReferences {
|
||||||
|
/**
|
||||||
|
* The contained data
|
||||||
|
*/
|
||||||
|
data: T;
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
import {SCSaveableThing} from '../base/SaveableThing';
|
import {SCSaveableThing, SCSaveableThingWithoutReferences} from '../base/SaveableThing';
|
||||||
import {SCThingMeta, SCThingType} from '../Thing';
|
import {SCThingMeta, SCThingType} from '../Thing';
|
||||||
import {SCAcademicEventWithoutReferences} from './AcademicEvent';
|
import {SCAcademicEventWithoutReferences} from './AcademicEvent';
|
||||||
import {SCArticleWithoutReferences} from './Article';
|
import {SCArticleWithoutReferences} from './Article';
|
||||||
@@ -37,6 +37,13 @@ export type SCFavoriteDataTypes = SCAcademicEventWithoutReferences
|
|||||||
| SCSportCourseWithoutReferences
|
| SCSportCourseWithoutReferences
|
||||||
| SCToDoWithoutReferences;
|
| SCToDoWithoutReferences;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A favorite without references
|
||||||
|
*/
|
||||||
|
export interface SCFavoriteWithoutReferences extends SCSaveableThingWithoutReferences {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A favorite
|
* A favorite
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user