From 2860a11b618081ab88ecb1780a280cab37217a0e Mon Sep 17 00:00:00 2001 From: Karl-Philipp Wulfert Date: Mon, 28 Jan 2019 18:21:27 +0100 Subject: [PATCH] feat: add draft of todo --- src/core/Thing.ts | 1 + src/core/things/Favorite.ts | 4 ++- src/core/things/ToDo.ts | 60 +++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/core/things/ToDo.ts diff --git a/src/core/Thing.ts b/src/core/Thing.ts index 24d0b1e5..8a204dce 100644 --- a/src/core/Thing.ts +++ b/src/core/Thing.ts @@ -44,6 +44,7 @@ export enum SCThingType { Setting = 'setting', SportCourse = 'sport course', Ticket = 'ticket', + ToDo = 'todo', Tour = 'tour', Video = 'video', } diff --git a/src/core/things/Favorite.ts b/src/core/things/Favorite.ts index cac53680..614b21c5 100644 --- a/src/core/things/Favorite.ts +++ b/src/core/things/Favorite.ts @@ -22,6 +22,7 @@ import {SCPersonWithoutReferences} from './Person'; import {SCPointOfInterestWithoutReferences} from './PointOfInterest'; import {SCRoomWithoutReferences} from './Room'; import {SCSportCourseWithoutReferences} from './SportCourse'; +import {SCToDoWithoutReferences} from './ToDo'; /** * Types that can be made a favorite (added as a favorite) @@ -33,7 +34,8 @@ export type SCFavoriteDataTypes = SCAcademicEventWithoutReferences | SCPersonWithoutReferences | SCPointOfInterestWithoutReferences | SCRoomWithoutReferences - | SCSportCourseWithoutReferences; + | SCSportCourseWithoutReferences + | SCToDoWithoutReferences; /** * A favorite diff --git a/src/core/things/ToDo.ts b/src/core/things/ToDo.ts new file mode 100644 index 00000000..fd2d6a3f --- /dev/null +++ b/src/core/things/ToDo.ts @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2019 StApps + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program. If not, see . + */ +import {SCThingWithCategoriesSpecificValues, SCThingWithCategoriesWithoutReferences} from '../base/ThingWithCategories'; +import {SCThingType} from '../Thing'; +import {SCISO8601Date} from '../types/Time'; + +/** + * A "to do" without references + */ +export interface SCToDoWithoutReferences + extends SCThingWithCategoriesWithoutReferences { + /** + * Whether or not the "to do" is already done + */ + done: boolean; + + /** + * A date when the "to do" is due + */ + dueDate?: SCISO8601Date; + + /** + * Priority of the "to do" + */ + priority: SCToDoPriority; + + /** + * Type of the "to do" + */ + type: SCThingType.ToDo; +} + +/** + * A "to do" + * + * @validatable + */ +export interface SCToDo extends SCToDoWithoutReferences { +} + +/** + * A priority of a "to do" + */ +export enum SCToDoPriority { + LOW = 0, + NORMAL = 2, + HIGH = 5, +}