{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "BankTransaction",
    "type": "object",
    "properties": {
        "id": { "type": "string", "format": "uuid" },
        "bankStatementId": { "type": "string", "format": "uuid" },
        "companyId": { "type": "string", "format": "uuid" },
        "clientId": { "type": "string", "format": "uuid" },
        "transactionDate": { "type": "string", "format": "date-time" },
        "amount": { "type": "string" },
        "currency": { "type": "string", "enum": ["ARS", "USD"] },
        "description": {
            "type": ["object", "string"],
            "properties": {
                "encryptedData": { "type": "string" },
                "keyName": { "type": "string" },
                "algorithm": { "type": "string" },
                "version": { "type": "integer" }
            },
            "required": ["encryptedData", "keyName"]
        },
        "reference": {
            "type": ["object", "string", "null"],
            "properties": {
                "encryptedData": { "type": "string" },
                "keyName": { "type": "string" },
                "algorithm": { "type": "string" },
                "version": { "type": "integer" }
            },
            "required": ["encryptedData", "keyName"]
        },
        "referenceHash": { "type": ["string", "null"] },
        "balanceAfter": { "type": "string" },
        "status": { "type": "string", "enum": ["UNMATCHED", "MATCHED", "IGNORED"] },
        "createdAt": { "type": "string", "format": "date-time" },
        "createdBy": { "type": "string", "format": "uuid" },
        "updatedAt": { "type": "string", "format": "date-time" },
        "updatedBy": { "type": "string", "format": "uuid" },
        "deletedAt": { "type": "string", "format": "date-time" },
        "deletedBy": { "type": "string", "format": "uuid" }
    },
    "required": [
        "id",
        "bankStatementId",
        "companyId",
        "transactionDate",
        "amount",
        "currency",
        "description",
        "status",
        "createdAt",
        "createdBy"
    ]
}
