{
    "$id": "https://idhub.pangea.org/vc_schemas/financial-vulnerability.json",
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "title": "Financial Vulnerability Credential",
    "description": "A Financial Vulnerability Credential is issued to individuals or families to prove their financial vulnerability based on various factors, with the objective of presenting it to a third party to receive benefits or services.",
    "name": [
        {
            "value": "Financial Vulnerability Credential",
            "lang": "en"
        },
        {
            "value": "Credencial de Vulnerabilitat Financera",
            "lang": "ca_ES"
        },
        {
            "value": "Credencial de Vulnerabilidad Financiera",
            "lang": "es"
        }
    ],
    "type": "object",
    "allOf": [
        {
            "$ref": "https://idhub.pangea.org/vc_schemas/ebsi/attestation.json"
        },
        {
            "properties": {
                "credentialSubject": {
                    "description": "Defines additional properties on credentialSubject",
                    "type": "object",
                    "properties": {
                        "id": {
                            "description": "Defines a unique identifier (DID) of the credential subject",
                            "type": "string",
                            "minLength":  1
                        },
                        "firstName": {
                            "description": "Name of the credential subject",
                            "type": "string",
                            "minLength":  1
                        },
                        "lastName": {
                            "description": "Surname of the credential subject",
                            "type": "string",
                            "minLength":  1
                        },
                        "email": {
                            "type": "string",
                            "format": "email",
                            "pattern": "^\\S+@\\S+\\.\\S+$"
                        },
                        "phoneNumber": {
                            "type": "string"
                        },
                        "identityDocType": {
                            "description": "Type of the Identity Document of the credential subject",
                            "type": "string",
                            "minLength":  1
                        },
                        "identityNumber": {
                            "description": "Number of the Identity Document of the credential subject",
                            "type": "string",
                            "minLength":  1
                        },
                        "streetAddress": {
                            "description": "Postal address of the credential Subject",
                            "type": "string",
                            "minLength":  1
                        },
                        "socialWorkerName": {
                            "description": "Name of the social worker that support the vulnerable person/family",
                            "type": "string",
                            "minLength":  1
                        },
                        "socialWorkerSurname": {
                            "description": "Surname of the social worker that support the vulnerable person/family",
                            "type": "string",
                            "minLength":  1
                        },
                        "financialVulnerabilityScore": {
                            "description": "Measure of an individual's susceptibility to financial hardship",
                            "type": "string",
                            "minLength":  1
                        },
                        "amountCoveredByOtherAids": {
                            "type": "string",
                            "minLength":  1
                        },
                        "connectivityOptionList": {
                            "type": "string"
                        },
                        "assessmentDate": {
                            "type": "string",
                            "format": "date",
                            "minLength":  1
                        }
                    },
                    "required": [
                        "id",
                        "firstName",
                        "lastName",
                        "email",
                        "identityDocType",
                        "identityNumber",
                        "streetAddress",
                        "socialWorkerName",
                        "socialWorkerSurname",
                        "financialVulnerabilityScore",
                        "amountCoveredByOtherAids",
                        "assessmentDate"
                    ]
                }
            }
        }
    ]
}