1.0.0 • Published 7 months ago

@cef-ebsi/vcdm1.1-vector-pda1-schema v1.0.0

Weekly downloads
-
License
EUPL-1.2
Repository
-
Last release
7 months ago

EBSI Logo

@cef-ebsi/vcdm1.1-vector-pda1-schema

PDA1 Credential

Data Type for the Portable Document A1 Document

The schema is published to the Trusted Schemas Registry with the IDs:

  • 0x1147358b8c0d251487cc8e1e26e4828f593745c6981fdf5b83081a3b302c5a7b (hexadecimal)
  • z2ASuhYeb2qQEWMjSKk6748TRR9UUXc3VUXjcjcPnMo3Y (multibase base58btc)

Table of Contents

JSON Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PDA1 Credential",
  "description": "Data Type for the Portable Document A1 Document",
  "type": "object",
  "allOf": [
    {
      "$ref": "./node_modules/@cef-ebsi/vcdm1.1-attestation-schema/schema.json"
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "description": "Full type chain, used to identify the credential base types",
          "type": "array",
          "items": {
            "type": "string"
          },
          "contains": {
            "type": "string",
            "const": "VerifiableCredential"
          },
          "uniqueItems": true
        }
      }
    },
    {
      "type": "object",
      "properties": {
        "credentialSubject": {
          "description": "Data Type for the Portable Document A1 Document",
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "socialsecuritypin": {
              "type": "string"
            },
            "gender": {
              "type": "string"
            },
            "forename": {
              "type": "string"
            },
            "familyname": {
              "type": "string"
            },
            "surnameAtBirth": {
              "type": "string"
            },
            "dateBirth": {
              "type": "string",
              "format": "date"
            },
            "nationalities": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/PDA1NationalityType"
              }
            },
            "placeOfBirth": {
              "type": "string"
            },
            "stateOfResidence": {
              "type": "object",
              "properties": {
                "streetBuildingNo": {
                  "type": "string"
                },
                "town": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "countryCode": {
                  "type": "string"
                }
              },
              "required": [
                "streetBuildingNo",
                "town",
                "postalCode",
                "countryCode"
              ]
            },
            "stateOfStay": {
              "type": "object",
              "properties": {
                "streetBuildingNo": {
                  "type": "string"
                },
                "town": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "countryCode": {
                  "type": "string"
                }
              },
              "required": [
                "streetBuildingNo",
                "town",
                "postalCode",
                "countryCode"
              ]
            },
            "legislationInformation": {
              "type": "object",
              "properties": {
                "memberStateWhichLegislationApplies": {
                  "$ref": "#/$defs/PDA1EUEFTACountryType"
                },
                "startingDate": {
                  "type": "string",
                  "format": "date"
                },
                "endingDate": {
                  "type": "string",
                  "format": "date"
                },
                "certificateForDurationActivity": {
                  "type": "boolean"
                },
                "determinationProvisional": {
                  "type": "boolean"
                },
                "transitionRulesApplyAsEC8832004": {
                  "type": "boolean"
                }
              },
              "required": [
                "memberStateWhichLegislationApplies",
                "startingDate",
                "endingDate",
                "certificateForDurationActivity",
                "determinationProvisional"
              ]
            },
            "employerInformation": {
              "type": "object",
              "properties": {
                "typeOfEmployment": {
                  "$ref": "#/$defs/PDA1EmploymentType"
                },
                "name": {
                  "type": "string"
                },
                "employerID": {
                  "type": "string"
                },
                "typeOfID": {
                  "$ref": "#/$defs/PDA1EmployerIDType"
                },
                "employerUID": {
                  "type": "string"
                }
              },
              "required": ["typeOfEmployment", "name"]
            },
            "employerAddress": {
              "type": "object",
              "properties": {
                "streetBuildingNo": {
                  "type": "string"
                },
                "town": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "countryCode": {
                  "$ref": "#/$defs/PDA1NationalityType"
                }
              },
              "required": ["town", "countryCode"]
            },
            "noFixedPlaceOfWorkExists": {
              "type": "boolean"
            },
            "placeOfWork": {
              "type": "object",
              "properties": {
                "nameBusinessName": {
                  "type": "string"
                },
                "flagBaseHomeState": {
                  "type": "string"
                },
                "companyID": {
                  "type": "string"
                },
                "typeOfID": {
                  "$ref": "#/$defs/PDA1EmployerIDType"
                },
                "employerUID": {
                  "type": "string"
                },
                "streetBuildingNo": {
                  "type": "string"
                },
                "town": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "countryCode": {
                  "$ref": "#/$defs/PDA1EUEFTACountryType"
                }
              },
              "required": ["nameBusinessName", "town", "countryCode"]
            },
            "statusConfirmation": {
              "type": "string",
              "$ref": "#/$defs/PDA1StatusConfirmation"
            },
            "documentID": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9-]{1,65}$"
            },
            "competentInstitution": {
              "type": "object",
              "properties": {
                "institutionID": {
                  "type": "string",
                  "pattern": "^[a-zA-Z0-9]{4,10}$"
                },
                "institutionName": {
                  "type": "string"
                },
                "institutionCountryCode": {
                  "type": "string",
                  "$ref": "#/$defs/PDA1EUEFTACountryType"
                }
              },
              "required": ["institutionID", "institutionCountryCode"]
            },
            "institutionContact": {
              "type": "object",
              "properties": {
                "officeFaxNo": {
                  "type": "string"
                },
                "officePhoneNo": {
                  "type": "string"
                },
                "eMail": {
                  "type": "string"
                },
                "institutionAddress": {
                  "type": "object",
                  "properties": {
                    "streetBuildingNo": {
                      "type": "string"
                    },
                    "town": {
                      "type": "string"
                    },
                    "postalCode": {
                      "type": "string"
                    },
                    "countryCode": {
                      "$ref": "#/$defs/PDA1EUEFTACountryType"
                    }
                  }
                }
              }
            }
          },
          "required": [
            "id",
            "socialsecuritypin",
            "gender",
            "forename",
            "familyname",
            "dateBirth",
            "nationalities",
            "placeOfBirth",
            "stateOfResidence",
            "stateOfStay",
            "legislationInformation",
            "employerInformation",
            "employerAddress",
            "noFixedPlaceOfWorkExists",
            "placeOfWork",
            "statusConfirmation",
            "documentID",
            "competentInstitution",
            "institutionContact"
          ]
        }
      },
      "required": ["credentialSubject"]
    }
  ],
  "$defs": {
    "PDA1NationalityType": {
      "enum": [
        "AT",
        "BE",
        "BG",
        "HR",
        "CY",
        "CZ",
        "DK",
        "EE",
        "FI",
        "FR",
        "DE",
        "EL",
        "HU",
        "IS",
        "IE",
        "IT",
        "LV",
        "LI",
        "LT",
        "LU",
        "MT",
        "NL",
        "NO",
        "PL",
        "PT",
        "RO",
        "SK",
        "SI",
        "ES",
        "SE",
        "CH",
        "UK",
        "XR",
        "XS",
        "XU",
        "AF",
        "AL",
        "DZ",
        "AD",
        "AO",
        "AG",
        "AR",
        "AM",
        "AU",
        "AZ",
        "BS",
        "BH",
        "BD",
        "BB",
        "BY",
        "BZ",
        "BJ",
        "BT",
        "BO",
        "BA",
        "BW",
        "BR",
        "BN",
        "BF",
        "BI",
        "KH",
        "CM",
        "CA",
        "CV",
        "CF",
        "TD",
        "CL",
        "CN",
        "CO",
        "KM",
        "CG",
        "CD",
        "CR",
        "CI",
        "CU",
        "DJ",
        "DM",
        "DO",
        "EC",
        "EG",
        "SV",
        "GQ",
        "ER",
        "ET",
        "FJ",
        "GA",
        "GM",
        "GE",
        "GH",
        "GD",
        "GT",
        "GN",
        "GW",
        "GY",
        "HT",
        "VA",
        "HN",
        "IN",
        "ID",
        "IR",
        "IQ",
        "IL",
        "JM",
        "JP",
        "JO",
        "KZ",
        "KE",
        "KI",
        "KP",
        "KR",
        "KW",
        "KG",
        "LA",
        "LB",
        "LS",
        "LR",
        "LY",
        "MK",
        "MG",
        "MW",
        "MY",
        "MV",
        "ML",
        "MH",
        "MR",
        "MU",
        "MX",
        "FM",
        "MD",
        "MC",
        "MN",
        "ME",
        "MA",
        "MZ",
        "MM",
        "NA",
        "NR",
        "NP",
        "NZ",
        "NI",
        "NE",
        "NG",
        "OM",
        "PK",
        "PW",
        "PS",
        "PA",
        "PG",
        "PY",
        "PE",
        "PH",
        "QA",
        "RU",
        "RW",
        "KN",
        "LC",
        "VC",
        "WS",
        "SM",
        "ST",
        "SA",
        "SN",
        "RS",
        "SC",
        "SL",
        "SG",
        "SB",
        "SO",
        "ZA",
        "SS",
        "LK",
        "SD",
        "SR",
        "SZ",
        "SY",
        "TJ",
        "TZ",
        "TH",
        "TL",
        "TG",
        "TO",
        "TT",
        "TN",
        "TR",
        "TM",
        "TV",
        "UG",
        "UA",
        "AE",
        "US",
        "UY",
        "UZ",
        "VU",
        "VE",
        "VN",
        "YE",
        "ZM",
        "ZW",
        "BQAQ",
        "BUMM",
        "BYAA",
        "CTKI",
        "CSHH",
        "DYBJ",
        "NQAQ",
        "TPTL",
        "FXFR",
        "AIDJ",
        "FQHH",
        "DDDE",
        "GEHH",
        "JTUM",
        "MIUM",
        "ANHH",
        "NTHH",
        "NHVU",
        "PCHH",
        "PZPA",
        "CSXX",
        "SKIN",
        "RHZW",
        "HVBF",
        "PUUM",
        "SUHH",
        "VDVN",
        "WKUM",
        "YDYE",
        "YUCS",
        "ZRCD"
      ]
    },
    "PDA1EUEFTACountryType": {
      "enum": [
        "AT",
        "BE",
        "BG",
        "HR",
        "CY",
        "CZ",
        "DK",
        "EE",
        "FI",
        "FR",
        "DE",
        "EL",
        "HU",
        "IS",
        "IE",
        "IT",
        "LV",
        "LI",
        "LT",
        "LU",
        "MT",
        "NL",
        "NO",
        "PL",
        "PT",
        "RO",
        "SK",
        "SI",
        "ES",
        "SE",
        "CH",
        "UK"
      ]
    },
    "PDA1EmploymentType": {
      "enum": ["01", "02"]
    },
    "PDA1EmployerIDType": {
      "enum": ["01", "02", "03", "99"]
    },
    "PDA1StatusConfirmation": {
      "enum": [
        "01",
        "02",
        "03",
        "04",
        "05",
        "06",
        "07",
        "08",
        "09",
        "10",
        "11",
        "12"
      ]
    }
  }
}

Installation

# with npm
npm add @cef-ebsi/vcdm1.1-vector-pda1-schema@1.0.0

# with Yarn
yarn add @cef-ebsi/vcdm1.1-vector-pda1-schema@1.0.0

# with pnpm
pnpm add @cef-ebsi/vcdm1.1-vector-pda1-schema@1.0.0

Usage

The package exports the schema and its metadata as JavaScript objects:

import { schema, metadata } from "@cef-ebsi/vcdm1.1-vector-pda1-schema";

// you can now use the schema and metadata

In addition, the package exports a TypeScript type corresponding to the schema:

import type { PDA1Credential } from "@cef-ebsi/vcdm1.1-vector-pda1-schema";

License

Copyright (C) 2024 European Union

This program is free software: you can redistribute it and/or modify it under the terms of the EUROPEAN UNION PUBLIC LICENCE v. 1.2 as published by the European Union.

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 EUROPEAN UNION PUBLIC LICENCE v. 1.2 for further details.

You should have received a copy of the EUROPEAN UNION PUBLIC LICENCE v. 1.2. along with this program. If not, see https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12.

1.0.0

7 months ago