mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-02-26 02:42:13 +00:00
feat: make SCContactPoint extend SCThing
Refactor SCPerson and SCOrganization
This commit is contained in:
39
test/resources/ContactPoint.1.json
Normal file
39
test/resources/ContactPoint.1.json
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "contact point",
|
||||
"name": "Dienstadresse",
|
||||
"areaServed": {
|
||||
"type": "room",
|
||||
"categories": [
|
||||
"education"
|
||||
],
|
||||
"uid": "39c1a574-04ef-5157-9c6f-e271d93eb273",
|
||||
"name": "3.G 121",
|
||||
"alternateNames": [
|
||||
"Dienstzimmer"
|
||||
],
|
||||
"geo": {
|
||||
"point": {
|
||||
"coordinates": [
|
||||
8.66919,
|
||||
50.12834
|
||||
],
|
||||
"type": "Point"
|
||||
}
|
||||
}
|
||||
},
|
||||
"email": "info@example.com",
|
||||
"faxNumber": "069 / 123450",
|
||||
"officeHours": "Mo, Mi 8:00-13:00",
|
||||
"telephone": "069 / 12345",
|
||||
"url": "https://example.com",
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7beef",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCContactPoint"
|
||||
}
|
||||
26
test/resources/Organization.2.json
Normal file
26
test/resources/Organization.2.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"errorNames": [],
|
||||
"instance": {
|
||||
"type": "organization",
|
||||
"uid": "20e48393-0d2b-5bdc-9d92-5e0dc1e2860f",
|
||||
"contactPoints": [
|
||||
{
|
||||
"type": "contact point",
|
||||
"name": "Dienstadresse",
|
||||
"email": "info@example.com",
|
||||
"faxNumber": "069 / 123450",
|
||||
"officeHours": "Mo, Mi 8:00-13:00",
|
||||
"telephone": "069 / 12345",
|
||||
"url": "https://example.com",
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7beef"
|
||||
}
|
||||
],
|
||||
"name": "Technische Universität Berlin",
|
||||
"origin": {
|
||||
"indexed": "2018-09-11T12:30:00Z",
|
||||
"name": "Dummy",
|
||||
"type": "remote"
|
||||
}
|
||||
},
|
||||
"schema": "SCOrganization"
|
||||
}
|
||||
@@ -17,58 +17,14 @@
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7f451",
|
||||
"workLocations": [
|
||||
{
|
||||
"url": "http://www.fb03.uni-frankfurt.de/1234567",
|
||||
"email": "mustermann@soz.uni-frankfurt.de",
|
||||
"faxNumber": "",
|
||||
"telephone": "069/123-36232; -1324325",
|
||||
"hoursAvailable": "siehe Homepage",
|
||||
"areaServed": {
|
||||
"type": "room",
|
||||
"categories": [
|
||||
"education"
|
||||
],
|
||||
"uid": "39c1a574-04ef-5157-9c6f-e271d93eb273",
|
||||
"name": "3.G 121",
|
||||
"alternateNames": [
|
||||
"Dienstzimmer"
|
||||
],
|
||||
"geo": {
|
||||
"point": {
|
||||
"coordinates": [
|
||||
8.66919,
|
||||
50.12834
|
||||
],
|
||||
"type": "Point"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"url": "http://www2.uni-frankfurt.de/12345/vizepraesidenten",
|
||||
"email": "",
|
||||
"faxNumber": "",
|
||||
"telephone": "069/123-1235",
|
||||
"hoursAvailable": "siehe Homepage",
|
||||
"areaServed": {
|
||||
"type": "room",
|
||||
"categories": [
|
||||
"education"
|
||||
],
|
||||
"uid": "5e54aefd-078b-5007-bca1-53dc60f79d37",
|
||||
"name": "4.P 22",
|
||||
"alternateNames": [
|
||||
"Dienstzimmer"
|
||||
],
|
||||
"geo": {
|
||||
"point": {
|
||||
"coordinates": [
|
||||
8.66898,
|
||||
50.12772
|
||||
],
|
||||
"type": "Point"
|
||||
}
|
||||
}
|
||||
}
|
||||
"type": "contact point",
|
||||
"name": "Dienstadresse",
|
||||
"email": "info@example.com",
|
||||
"faxNumber": "069 / 123450",
|
||||
"officeHours": "Mo, Mi 8:00-13:00",
|
||||
"telephone": "069 / 12345",
|
||||
"url": "https://example.com",
|
||||
"uid": "be34a419-e9e8-5de0-b998-dd1b19e7beef"
|
||||
}
|
||||
],
|
||||
"origin": {
|
||||
|
||||
@@ -19,6 +19,7 @@ import {SCArticle, SCArticleWithoutReferences} from '../src/things/article';
|
||||
import {SCBook, SCBookWithoutReferences} from '../src/things/book';
|
||||
import {SCBuilding, SCBuildingWithoutReferences} from '../src/things/building';
|
||||
import {SCCatalog, SCCatalogWithoutReferences} from '../src/things/catalog';
|
||||
import {SCContactPoint, SCContactPointWithoutReferences} from '../src/things/contact-point';
|
||||
import {SCCourseOfStudies, SCCourseOfStudiesWithoutReferences} from '../src/things/course-of-studies';
|
||||
import {SCDateSeries, SCDateSeriesWithoutReferences} from '../src/things/date-series';
|
||||
import {SCDiff, SCDiffWithoutReferences} from '../src/things/diff';
|
||||
@@ -126,6 +127,17 @@ assert<Has<SCBuildingPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCBuildingWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCBuilding, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCContactPoint
|
||||
*/
|
||||
type SCContactPointPropertyTypes = PropertyTypesNested<SCContactPoint>;
|
||||
assert<NotHas<SCContactPointPropertyTypes, SCThingWithoutReferences>>(false);
|
||||
assert<Has<SCContactPointPropertyTypes, SCThingWithoutReferences>>(true);
|
||||
assert<NotHas<SCContactPointPropertyTypes, SCThing>>(true);
|
||||
assert<Has<SCContactPointPropertyTypes, SCThing>>(false);
|
||||
assert<Extends<SCContactPointWithoutReferences, SCThing>>(false);
|
||||
assert<Extends<SCContactPoint, SCThing>>(true);
|
||||
|
||||
/**
|
||||
* Types of properties of SCCatalog
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user