diff --git a/models/application/applicant-contact-info.json b/models/application/applicant-contact-info.json index 20d3e9bc9b97af8b62399d7d80e98021b8c742d6..90278b9ea35aab1791b7b43259785986a4adfcb6 100644 --- a/models/application/applicant-contact-info.json +++ b/models/application/applicant-contact-info.json @@ -8,10 +8,21 @@ { "$ref": "../common/address-national.json" }, + { + "$ref": "../common/address-postbox.json" + }, { "$ref": "../common/address-international.json" } ], + "discriminator": { + "propertyName": "type", + "mapping": { + "national": "../common/address-national.json", + "postbox": "../common/address-postbox.json", + "international": "../common/address-international.json" + } + }, "description": "Physikalische (Post-)Adresse" }, "telephone": { diff --git a/models/application/applicant-organization.json b/models/application/applicant-organization.json index 5f7f3c7d12c8738be1617fe343e7b6371fe1c61f..125cd3fb5a790a09beebc87a4f0a4453cf4070b7 100644 --- a/models/application/applicant-organization.json +++ b/models/application/applicant-organization.json @@ -1,7 +1,8 @@ { - "title": "Applicant Organisation", "type": "object", + "title": "Applicant Organisation", "description": "Antragsteller in Form von einer Organisation, z.B. einem Unternehmen", + "additionalProperties": false, "properties": { "identifier": { "type": "array", @@ -57,10 +58,21 @@ { "$ref": "../common/address-national.json" }, + { + "$ref": "../common/address-postbox.json" + }, { "$ref": "../common/address-international.json" } ], + "discriminator": { + "propertyName": "type", + "mapping": { + "national": "../common/address-national.json", + "postbox": "../common/address-postbox.json", + "international": "../common/address-international.json" + } + }, "description": "Offizielle Adresse" }, "legalRepresentatives": { @@ -84,6 +96,15 @@ "required": [ "method" ] + }, + "type": { + "type": "string", + "enum": [ + "organization" + ] } - } + }, + "required": [ + "type" + ] } \ No newline at end of file diff --git a/models/application/applicant-person.json b/models/application/applicant-person.json index 3b5a780f9017d075bcde51c3d0f6334b9e9707e2..8e51e383a16305209665981f0edab2a0487e91e0 100644 --- a/models/application/applicant-person.json +++ b/models/application/applicant-person.json @@ -1,7 +1,8 @@ { - "title": "Applicant Person", "type": "object", + "title": "Applicant Person", "description": "Antragstellerdaten für eine natürliche Person", + "additionalProperties": false, "properties": { "identifier": { "type": "array", @@ -18,64 +19,15 @@ }, "contactInfo": { "$ref": "./applicant-contact-info.json" + }, + "type": { + "type": "string", + "enum": [ + "person" + ] } }, - "x-examples": { - "example-1": { - "identifier": [ - { - "id": "918", - "schemeName": "Antragsportal", - "schemeId": "urn:com:example:antragsportal:user" - } - ], - "contactInfo": { - "physicalAddress": { - "street": "Kurzer Weg", - "houseNumber": 7, - "postalCode": "12345", - "city": "string", - "addressSupplement": "string" - }, - "telephone": [ - { - "number": "+49 89 32168-42", - "mobile": true, - "description": "string" - } - ], - "electronicAddresses": [ - { - "channelType": "Service-Account-Mailbox", - "address": "string" - } - ] - }, - "identityInfo": { - "gender": "m", - "nationality": "string", - "familyName": "string", - "givenName": "string", - "birthName": "string", - "doctoralDegrees": "string", - "artisticName": "string", - "dateOfBirth": "2020-04-16", - "placeOfBirth": "string", - "placeOfResidence": { - "street": "string", - "houseNumber": null, - "houseNumberSuffix": "st", - "postalCode": "strin", - "city": "string", - "addressSupplement": "string" - } - }, - "authentificationInfo": { - "timestamp": "2020-04-16T06:50:39Z", - "authentificationToken": {}, - "authentificationMethod": "string", - "assuranceLevel": "low" - } - } - } + "required": [ + "type" + ] } \ No newline at end of file diff --git a/models/application/applicant.json b/models/application/applicant.json index a07958d62ee87719a84fdc328f2b1e2ad324d475..8a7b21172062a4e333f6fe2237ed427cfb9fd1f7 100644 --- a/models/application/applicant.json +++ b/models/application/applicant.json @@ -1,4 +1,6 @@ { + "title": "Applicant", + "description": "Ein Antragsteller, entweder eine Organisation oder eine natürliche Person", "oneOf": [ { "$ref": "./applicant-person.json" @@ -7,6 +9,11 @@ "$ref": "./applicant-organization.json" } ], - "title": "Applicant", - "description": "Ein Antragsteller, entweder eine Organisation oder eine natürliche Person" + "discriminator": { + "propertyName": "type", + "mapping": { + "person": "./applicant-person.json", + "organization": "./applicant-organization.json" + } + } } \ No newline at end of file diff --git a/models/common/address-international.json b/models/common/address-international.json index 1d9067e80cff697974966ccd8ba684030efd4218..df51e991ce028ef73deff7c43f7d28c705a77f0a 100644 --- a/models/common/address-international.json +++ b/models/common/address-international.json @@ -3,6 +3,22 @@ "title": "International Address", "description": "Eine internationale Adresse, bestehend aus ein bis fünf Adresszeilen.", "additionalProperties": false, + "x-examples": { + "example-1": { + "lines": [ + "760 United Nations Plaza", + "Manhattan, New York City, New York 10017" + ], + "country": "368" + }, + "example-2": { + "lines": [ + "Threadneedle Street", + "London EC2R 8AH" + ], + "country": "168" + } + }, "properties": { "lines": { "type": "array", @@ -20,26 +36,17 @@ "minLength": 3, "maxLength": 3, "pattern": "^[0-9]{3}$" + }, + "type": { + "type": "string", + "enum": [ + "international" + ] } }, "required": [ "lines", - "country" - ], - "x-examples": { - "example-1": { - "lines": [ - "760 United Nations Plaza", - "Manhattan, New York City, New York 10017" - ], - "country": "368" - }, - "example-2": { - "lines": [ - "Threadneedle Street", - "London EC2R 8AH" - ], - "country": "168" - } - } + "country", + "type" + ] } \ No newline at end of file diff --git a/models/common/address-national.json b/models/common/address-national.json index 6dd957511040b4547f9d318fb46a5333a579db7e..322a019f1751d796772fb2e42e8e30889dfa63a4 100644 --- a/models/common/address-national.json +++ b/models/common/address-national.json @@ -9,79 +9,57 @@ "city": "Ankh-Morpork" } }, - "oneOf": [ - { - "additionalProperties": false, - "properties": { - "street": { - "type": "string", - "description": "Straße", - "maxLength": 55 - }, - "houseNumber": { - "type": [ - "string", - "integer" - ], - "description": "Hausnummer", - "maxLength": 9, - "pattern": "^[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?$", - "minimum": 1 - }, - "houseNumberSuffix": { - "type": "string", - "description": "Hausnummerzusatz", - "maxLength": 2, - "pattern": "^[\\p{L}0-9. ]*$" - }, - "postalCode": { - "type": "string", - "description": "Postleitzahl", - "minLength": 5, - "maxLength": 5, - "pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$" - }, - "city": { - "type": "string", - "description": "Ort", - "maxLength": 50 - }, - "addressSupplement": { - "type": "string", - "description": "Adresszusatz" - } - }, - "required": [ - "street", - "postalCode", - "city" - ] + "type": "object", + "additionalProperties": false, + "properties": { + "street": { + "type": "string", + "description": "Straße", + "maxLength": 55 + }, + "houseNumber": { + "type": [ + "string", + "integer" + ], + "description": "Hausnummer", + "maxLength": 9, + "pattern": "^[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?$", + "minimum": 1 + }, + "houseNumberSuffix": { + "type": "string", + "description": "Hausnummerzusatz", + "maxLength": 2, + "pattern": "^[\\p{L}0-9. ]*$" + }, + "postalCode": { + "type": "string", + "description": "Postleitzahl", + "minLength": 5, + "maxLength": 5, + "pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$" }, - { - "additionalProperties": false, - "properties": { - "postOfficeBox": { - "type": "string", - "description": "Postfach" - }, - "postalCode": { - "type": "string", - "description": "Postleitzahl", - "minLength": 5, - "maxLength": 5, - "pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$" - }, - "city": { - "type": "string", - "description": "Ort", - "maxLength": 50 - } - }, - "required": [ - "postalCode", - "city" + "city": { + "type": "string", + "description": "Ort", + "maxLength": 50 + }, + "addressSupplement": { + "type": "string", + "description": "Adresszusatz" + }, + "type": { + "type": "string", + "enum": [ + "national" ] } - ], - "type": "object" + }, + "required": [ + "street", + "postalCode", + "city", + "type" + ] } \ No newline at end of file diff --git a/models/common/address-postbox.json b/models/common/address-postbox.json new file mode 100644 index 0000000000000000000000000000000000000000..b7366a6c618bb973b0b5107dcec790ae744af52b --- /dev/null +++ b/models/common/address-postbox.json @@ -0,0 +1,43 @@ +{ + "title": "Postfach Address", + "description": "Eine Adresse eines Postfachs.", + "x-examples": { + "example-1": { + "street": "Kurzer Weg", + "houseNumber": 7, + "postalCode": "12345", + "city": "Ankh-Morpork" + } + }, + "type": "object", + "additionalProperties": false, + "properties": { + "postOfficeBox": { + "type": "string", + "description": "Postfach" + }, + "postalCode": { + "type": "string", + "description": "Postleitzahl", + "minLength": 5, + "maxLength": 5, + "pattern": "^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$" + }, + "city": { + "type": "string", + "description": "Ort", + "maxLength": 50 + }, + "type": { + "type": "string", + "enum": [ + "postbox" + ] + } + }, + "required": [ + "postalCode", + "city", + "type" + ] +} \ No newline at end of file diff --git a/models/common/individual.json b/models/common/individual.json index 123e4cf7a80988145200bea3e1a5ef9cd4545c37..1023123168212e7e80d9ffac0fcdc7fa537e64a0 100644 --- a/models/common/individual.json +++ b/models/common/individual.json @@ -40,12 +40,23 @@ "description": "Adresse als Alternative (Choice) von nationaler und internationaler Adresse.", "oneOf": [ { - "$ref": "../common/address-national.json" + "$ref": "./address-national.json" }, { - "$ref": "../common/address-international.json" + "$ref": "./address-postbox.json" + }, + { + "$ref": "./address-international.json" } - ] + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "national": "./address-national.json", + "postbox": "./address-postbox.json", + "international": "./address-international.json" + } + } }, "identifiers": { "type": "array", diff --git a/models/destination-no-id.json b/models/destination-no-id.json index 8e9860a2eb02be8f745b9fdc278673e053930e1f..d00068c54049c249cf20bf32c36a64cdae64dc63 100644 --- a/models/destination-no-id.json +++ b/models/destination-no-id.json @@ -40,10 +40,21 @@ { "$ref": "./common/address-national.json" }, + { + "$ref": "./common/address-postbox.json" + }, { "$ref": "./common/address-international.json" } - ] + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "national": "./common/address-national.json", + "postbox": "./common/address-postbox.json", + "international": "./common/address-international.json" + } + } }, "identifiers": { "type": "array",