{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "UpdateCharitableGivings",
    "definitions": {
        "amount": {
            "type": "number",
            "multipleOf": 0.01,
            "minimum": 0,
            "maximum": 99999999999.99,
            "example": "10000.89",
            "description": "Defines an amount value (to 2 decimal places), between 0 and 99999999999.99"
        },
        "charityNames": {
            "type": "array",
            "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 75,
                "pattern": "^[A-Za-z0-9 &'\\(\\)\\*,\\-\\./@\u00a3]{1,75}$"
            }
        }
    },
    "properties": {
        "giftAidPayments": {
            "type": "object",
            "description": "Gift Aid Payments.",
            "properties": {
                "specifiedYear": {
                    "title": "Total Gift Aid Payments.",
                    "description": "The total amount of Gift Aid payments made within the specified tax year. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "oneOffSpecifiedYear": {
                    "title": "Total One Off Gift Aid Payments.",
                    "description": "The amount of one-off Gift Aid payments made within the specified tax year that has been included in giftAidPayments.specifiedYear. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "specifiedYearTreatedAsPreviousYear": {
                    "title": "Total Gift Aid payments made in the current tax year but treated as if they were mae in the previous tax year.",
                    "description": "The amount of Gift Aid payments made within the specified tax year that should be treated as if they were made in the previous tax year. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "followingYearTreatedAsSpecifiedYear": {
                    "title": "Total Gift Aid payments made in the next tax year but treated as if they were made in the current tax year.",
                    "description": "The amount of Gift Aid payments made in the following tax year that should be treated as if they were made in the specified tax year. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "nonUKCharities": {
                    "title": "Value of Gift Aid payments to non-UK charities.",
                    "description": "The total amount of Gift Aid payments made within the specified tax year to a charity outside the UK that has been included in giftAidPayments.specifiedYear. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "nonUKCharityNames": {
                    "title": "Non-UK Charity Names.",
                    "description": "Names of all non-UK charities that received gift aid payments where the amounts have been included in giftAidPayments.nonUkCharities. If giftAidPayments.nonUkCharities is greater than zero then this field is required. Each name should be between 1 and 75 characters in length. Allowed characters, including spaces are: mixed case alphanumeric characters and the characters: &'()*,-./@\u00a3",
                    "$ref": "#/definitions/charityNames"
                }
            }
        },
        "gifts": {
            "type": "object",
            "description": "Gifts",
            "properties": {
                "sharesOrSecurities": {
                    "title": "Value of qualifying shares or securities gifted to charity.",
                    "description": "The net benefit of shares and securities minus any amounts of benefits received from the charity. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "landAndBuildings": {
                    "title": "Value of qualifying land and buildings gifted to charity.",
                    "description": "The net benefit of land and buildings minus any amounts or benefits received from the charity. This should include any costs of the gift or sale such as legal or valuer's fees. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "investmentsNonUKCharities": {
                    "title": "Value of qualifying investments gifted to non-UK charities.",
                    "description": "The net amount of gifts of shares or securities or land and buildings that was made to a charity outside the UK that has been included in gifts.sharesOrSecurities and gifts.landAndBuildings. The value must be between 0 and 99999999999.99 up to 2 decimal places.",
                    "$ref": "#/definitions/amount"
                },
                "investmentsNonUKCharityNames": {
                    "title": "Non-UK Investment Charity Names.",
                    "description": "Names of all non-UK charities that received investments where the amounts are included in gifts.investmentsNonUKCharities. If gifts.investmentsNonUKCharities is greater than zero, then this field is required. Each name should be between 1 and 75 characters in length. Allowed characters, including spaces are: mixed case alphanumeric characters and the characters: &'()*,-./@\u00a3",
                    "$ref": "#/definitions/charityNames"
                }
            }
        }
    },
    "additionalProperties": false
}