diff --git a/api/README.md b/api/README.md index 0992cc6..47df36d 100644 --- a/api/README.md +++ b/api/README.md @@ -18,6 +18,8 @@ to ask some specific OAuth2 scopes. Exemples of CMS scopes: - `urn:cms:personal-informations:read`: read access to the user's basic personal informations - `urn:cms:civil-status:read`: read access to the user's civil status +- `urn:cms:professional-informations:read`: read access to the user's basic + professional informations Fetching data @@ -33,7 +35,8 @@ needs. Claims ------ -| name | required scope | Schema -| ----------------------|--------------------------------------|------- -| personalInformations | `urn:cms:personal-informations:read` | [Personal informations](../conceptual_model/personal-informations.md) -| civilStatus | `urn:cms:civil-status:read` | [Civil status](../conceptual_model/civil-status.md) +| name | required scope | Schema +| --------------------------|-----------------------------------------|------- +| personalInformations | `urn:cms:personal-informations:read` | [Personal informations](../conceptual_model/personal-informations.md) +| civilStatus | `urn:cms:civil-status:read` | [Civil status](../conceptual_model/civil-status.md) +| professionalInformations | `urn:cms:professional-informations:read`| [Professional informations](../conceptual_model/professional-informations.md) diff --git a/conceptual_model/README.md b/conceptual_model/README.md index 64e3456..7ddc614 100644 --- a/conceptual_model/README.md +++ b/conceptual_model/README.md @@ -14,11 +14,12 @@ if it has been certified. We defined for this purpose special data types, each with the following attributes : -| Name | Type | Description -| ------------------|------------|--------------------------------- -| value | any | The claim value -| source | string | Source of the data -| certificationDate | datetime | If the data was certified, and when. +| Name | Type | Description +| ------------------------|------------|------------------------------------------------------------------------------------------ +| value | any | The claim value +| source | string | Source of the data +| certificationDate | datetime | If the data was certified, and when. +| certificationExpiryDate | datetime | If the data was certified, and when the information will no longer valid (if applicable). See [Field types](field-types.md) @@ -28,5 +29,5 @@ Main Entities - [Personal Informations](personal-informations.md) - [Civil status](civil-status.md) - +- [Professional Informations](professional-informations.md) diff --git a/conceptual_model/civil-status.md b/conceptual_model/civil-status.md index 1fb1cee..1864381 100644 --- a/conceptual_model/civil-status.md +++ b/conceptual_model/civil-status.md @@ -17,4 +17,4 @@ Attributes | birthDate | [date](field-types.md#date-field) | birthPlace | [string](field-types.md#string-field) | birthCountry | [country](field-types.md#country-field) - +| status | [string](field-types.md#string-field) diff --git a/conceptual_model/field-types.md b/conceptual_model/field-types.md index d3dd58f..a0108a5 100644 --- a/conceptual_model/field-types.md +++ b/conceptual_model/field-types.md @@ -1,62 +1,79 @@ ### String field -| Name | Type | Format -| ------------------|----------|--------------------------------- -| value | string | any -| source | string | any -| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | string | any +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ### Date field -| Name | Type | Format -| ------------------|----------|--------------------------------- -| value | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) -| source | string | any -| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ### Email field -| Name | Type | Format -| ------------------|----------|--------------------------------- -| value | string | [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4) -| source | string | any -| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | string | [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4) +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ### Postal address field -| Name | Type | Format -| ------------------|----------|--------------------------------- -| value | string | AFNOR NF Z 10-011 -| source | string | any -| certificationDate | dstring | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | string | AFNOR NF Z 10-011 +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ### Phone number field -| Name | Type | Format -| ------------------|----------|--------------------------------- -| value | string | [E.164 Standard](https://www.itu.int/rec/T-REC-E.164/) -| source | string | any -| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | string | [E.164 Standard](https://www.itu.int/rec/T-REC-E.164/) +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ### Gender field -| Name | Type | Format -| ------------------|----------|--------------------------------- -| value | number | [ISO/IEC 5218](https://en.wikipedia.org/wiki/ISO/IEC_5218) -| source | string | any -| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | number | [ISO/IEC 5218](https://en.wikipedia.org/wiki/ISO/IEC_5218) +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) ### Country field -| Name | Type | Format -| ------------------|----------|--------------------------------- -| value | string | [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) -| source | string | any -| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | string | [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + + +### Status field + +| Name | Type | Format +| ------------------------|----------|--------------------------------- +| value | string | EMPLOYEE | STUDENT | SELF-EMPLOYED | RETIREE | UNEMPLOYED +| source | string | any +| certificationDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) +| certificationExpiryDate | string | [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) diff --git a/conceptual_model/professional-informations.md b/conceptual_model/professional-informations.md new file mode 100644 index 0000000..9b85b11 --- /dev/null +++ b/conceptual_model/professional-informations.md @@ -0,0 +1,16 @@ +Professional Informations +========================= + +[JSON Schema](schemas/professional-information.schema.json) + + +Attributes +---------- + +| Name | Type +| -----------------------|---------- +| workingEmail | [email](field-types.md#email-field) +| workingPostalAddress | [postal-address](field-types.md#postal-address-field) +| workingPhoneNumber | [phone number](field-types.md#phone-number-field) +| entrepriseName | [string](field-types.md#string-field) +| employeeId | [string](field-types.md#string-field) diff --git a/conceptual_model/schemas/civil-status.schema.json b/conceptual_model/schemas/civil-status.schema.json index a189b92..138b17b 100644 --- a/conceptual_model/schemas/civil-status.schema.json +++ b/conceptual_model/schemas/civil-status.schema.json @@ -38,6 +38,10 @@ "birthCountry": { "description": "The person's birth country", "$ref": "#/$defs/country_field" + }, + "status": { + "description": "The person's global status", + "$ref": "#/$defs/status_field" } }, "required": [], @@ -55,12 +59,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -77,12 +84,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -99,12 +109,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -156,12 +169,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -179,12 +195,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -202,12 +221,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -226,12 +248,40 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "value", + "source" + ], + "additionalProperties": false + }, + "status_field": { + "type": "object", + "properties": { + "value": { + "type": "string", + "enum": ["EMPLOYED", "STUDENT", "SELF-EMPLOYED", "RETIREE", "UNEMPLOYED"] + }, + "source": { + "type": "string" + }, + "certificationDate": { + "type": "string", + "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false } diff --git a/conceptual_model/schemas/personal-information.schema.json b/conceptual_model/schemas/personal-information.schema.json index 914a40c..013b9a4 100644 --- a/conceptual_model/schemas/personal-information.schema.json +++ b/conceptual_model/schemas/personal-information.schema.json @@ -41,12 +41,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -63,12 +66,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -85,12 +91,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -142,12 +151,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -165,12 +177,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -188,12 +203,15 @@ "certificationDate": { "type": "string", "format": "date-time" - } + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" + } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false }, @@ -212,12 +230,15 @@ "certificationDate": { "type": "string", "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" } }, "required": [ "value", - "source", - "certificationDate" + "source" ], "additionalProperties": false } diff --git a/conceptual_model/schemas/professional-informations.schema.json b/conceptual_model/schemas/professional-informations.schema.json new file mode 100644 index 0000000..2e8f3c6 --- /dev/null +++ b/conceptual_model/schemas/professional-informations.schema.json @@ -0,0 +1,168 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "professional-information.schema.json", + "title": "Professional Information", + "description": "A person's professional information", + "type": "object", + "properties": { + "workingEmail": { + "description": "The person's working email", + "$ref": "#/$defs/email_field" + }, + "workingPostalAddress": { + "description": "The person's secondary postal address", + "$ref": "#/$defs/postal_address_field" + }, + "workingPhoneNumber": { + "description": "The person's working secondary phone number", + "$ref": "#/$defs/phone_number_field" + }, + "employerId": { + "description": "The person's employer", + "$ref": "#/$defs/string_field" + }, + "employeeId": { + "description": "The employee ID in the employer information system", + "$ref": "#/$defs/string_field" + } + }, + "required": [], + "additionalProperties": false, + "$defs": { + "string_field": { + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "source": { + "type": "string" + }, + "certificationDate": { + "type": "string", + "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "value", + "source" + ], + "additionalProperties": false + }, + "email_field": { + "type": "object", + "properties": { + "value": { + "type": "string", + "format": "email" + }, + "source": { + "type": "string" + }, + "certificationDate": { + "type": "string", + "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "value", + "source" + ], + "additionalProperties": false + }, + "postal_address_field": { + "$comment": "Rough implementation of the AFNOR NF Z 10-011 standard", + "type": "object", + "properties": { + "value": { + "type": "object", + "properties": { + "line1": { + "type": "string", + "maxLength": 38 + }, + "line2": { + "type": "string", + "maxLength": 38 + }, + "line3": { + "type": "string", + "maxLength": 38 + }, + "line4": { + "type": "string", + "maxLength": 38 + }, + "line5": { + "type": "string", + "maxLength": 38 + }, + "line6": { + "type": "string", + "maxLength": 38 + }, + "line7": { + "type": "string", + "maxLength": 38 + } + }, + "$comment": "At least first line is expected to be filled", + "required": [ + "line1" + ], + "additionalProperties": false + }, + "source": { + "type": "string" + }, + "certificationDate": { + "type": "string", + "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "value", + "source" + ], + "additionalProperties": false + }, + "phone_number_field": { + "type": "object", + "properties": { + "value": { + "type": "string", + "$comment": "E.164 standard", + "pattern": "^\\+?[1-9]\\d{1,14}$" + }, + "source": { + "type": "string" + }, + "certificationDate": { + "type": "string", + "format": "date-time" + }, + "certificationExpiryDate": { + "type": "string", + "format": "date-time" + } + }, + "required": [ + "value", + "source" + ], + "additionalProperties": false + } + } +}