refactor: refactor SCThingTypes from union-type to enum. SCThingType-type-attributes are now string-type-attributes.

This commit is contained in:
Michel Jonathan Schmitz
2018-12-05 18:51:28 +01:00
parent 641eff15b8
commit f9056eeb33
25 changed files with 134 additions and 192 deletions

View File

@@ -12,7 +12,7 @@
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCThing, SCThingMeta} from '../Thing';
import {SCThing, SCThingMeta, SCThingType} from '../Thing';
import {SCNationality} from '../types/i18n';
import {SCISO8601Date} from '../types/Time';
import {SCBuildingWithoutReferences} from './Building';
@@ -20,11 +20,6 @@ import {SCOrganizationWithoutReferences} from './Organization';
import {SCPointOfInterestWithoutReferences} from './PointOfInterest';
import {SCRoomWithoutReferences} from './Room';
/**
* Type of a person
*/
export type SCPersonType = 'person';
/**
* A person without references
*/
@@ -99,7 +94,7 @@ export interface SCPersonWithoutReferences extends SCThing {
/**
* Type of a person
*/
type: SCPersonType;
type: SCThingType.Person;
}
/**
@@ -118,6 +113,11 @@ export interface SCPerson extends SCPersonWithoutReferences {
| SCPointOfInterestWithoutReferences
| SCRoomWithoutReferences>;
/**
* Type of a person
*/
type: SCThingType.Person;
/**
* Locations where the person performs her/his work
*/