{
  "schemaVersion": "1",
  "updatedOn": "2026-10-01",
  "resources": {
    "suppliers": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "legalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "taxId": {
            "type": "string",
            "pattern": "^\\d{11}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "supplier",
              "service"
            ]
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "aliases": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "maxLength": 100
          }
        },
        "required": [
          "name",
          "kind"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "legalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "taxId": {
            "type": "string",
            "pattern": "^\\d{11}$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "supplier",
              "service"
            ]
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "aliases": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "maxLength": 100
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "kind",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "invoices": {
      "input": {
        "type": "object",
        "properties": {
          "receivingRequired": {
            "type": "boolean"
          },
          "lines": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "goods",
                    "charge"
                  ]
                },
                "productId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
                },
                "unit": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "orderReference": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "supplierCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                }
              },
              "required": [
                "id",
                "description",
                "quantity",
                "unit"
              ],
              "additionalProperties": false
            }
          },
          "orderReferences": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "recurrenceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "occurrenceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "issuerTaxId": {
            "type": "string",
            "pattern": "^\\d{11}$"
          },
          "invoiceType": {
            "type": "string",
            "maxLength": 50
          },
          "originalMissing": {
            "type": "boolean"
          },
          "issueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "reconciliationStatus": {
            "type": "string",
            "enum": [
              "confirmed",
              "unreviewed"
            ]
          },
          "reconciliationReason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "expenseId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "installments": {
            "minItems": 1,
            "maxItems": 360,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "dueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "id",
                "dueDate",
                "amount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "amount",
          "currency",
          "supplierId",
          "number",
          "issueDate",
          "concept",
          "category"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "receivingRequired": {
            "type": "boolean"
          },
          "lines": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "goods",
                    "charge"
                  ]
                },
                "productId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
                },
                "unit": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "orderReference": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "supplierCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                }
              },
              "required": [
                "id",
                "description",
                "quantity",
                "unit"
              ],
              "additionalProperties": false
            }
          },
          "orderReferences": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "recurrenceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "occurrenceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "issuerTaxId": {
            "type": "string",
            "pattern": "^\\d{11}$"
          },
          "invoiceType": {
            "type": "string",
            "maxLength": 50
          },
          "originalMissing": {
            "type": "boolean"
          },
          "issueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "reconciliationStatus": {
            "type": "string",
            "enum": [
              "confirmed",
              "unreviewed"
            ]
          },
          "reconciliationReason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "expenseId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "installments": {
            "minItems": 1,
            "maxItems": 360,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                "dueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "id",
                "dueDate",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid": {
            "type": "string"
          },
          "balance": {
            "type": "string"
          },
          "overdueAmount": {
            "type": "string"
          },
          "nextDueDate": {
            "type": "string",
            "format": "date",
            "readOnly": true,
            "description": "Próximo vencimiento con saldo pendiente al corte; respeta cuotas e imputaciones. dueDate conserva la fecha original del documento."
          },
          "hasReceipt": {
            "type": "boolean"
          },
          "hasInvoice": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency",
          "supplierId",
          "number",
          "issueDate",
          "concept",
          "category",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "expenses": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "recurrenceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "occurrenceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "reconciliationStatus": {
            "type": "string",
            "enum": [
              "confirmed",
              "unreviewed"
            ]
          },
          "reconciliationReason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "amount",
          "currency",
          "date",
          "concept",
          "category"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "recurrenceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "occurrenceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "reconciliationStatus": {
            "type": "string",
            "enum": [
              "confirmed",
              "unreviewed"
            ]
          },
          "reconciliationReason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "invoiceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid": {
            "type": "string"
          },
          "balance": {
            "type": "string"
          },
          "overdueAmount": {
            "type": "string"
          },
          "nextDueDate": {
            "type": "string",
            "format": "date",
            "readOnly": true,
            "description": "Próximo vencimiento con saldo pendiente al corte; respeta cuotas e imputaciones. dueDate conserva la fecha original del documento."
          },
          "hasReceipt": {
            "type": "boolean"
          },
          "hasInvoice": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "currency",
          "date",
          "concept",
          "category",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "payments": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "method": {
            "type": "string",
            "enum": [
              "cash",
              "transfer",
              "mercado_pago",
              "card",
              "check",
              "automatic_debit",
              "other"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "scheduled"
            ]
          },
          "executionDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "targetType": {
                  "type": "string",
                  "enum": [
                    "invoice",
                    "expense"
                  ]
                },
                "targetId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "targetType",
                "targetId",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "invoiceReferences": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "number": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                },
                "issueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "dueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                }
              },
              "required": [
                "number",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "documentedAdvance": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          }
        },
        "required": [
          "amount",
          "currency",
          "date",
          "method",
          "status",
          "allocations"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "paymentOrderId": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "method": {
            "type": "string",
            "enum": [
              "cash",
              "transfer",
              "mercado_pago",
              "card",
              "check",
              "automatic_debit",
              "other"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "completed",
              "scheduled"
            ]
          },
          "executionDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "targetType": {
                  "type": "string",
                  "enum": [
                    "invoice",
                    "expense"
                  ]
                },
                "targetId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "targetType",
                "targetId",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "invoiceReferences": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "number": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                },
                "issueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "dueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                }
              },
              "required": [
                "number",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "documentedAdvance": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "hasReceipt": {
            "type": "boolean"
          },
          "hasInvoice": {
            "type": "boolean"
          },
          "amountInSelection": {
            "type": "string",
            "description": "Porción del pago que corresponde a los filtros. amount conserva el importe original."
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "amount",
          "currency",
          "date",
          "method",
          "status",
          "allocations",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "credits": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "targetType": {
                  "type": "string",
                  "enum": [
                    "invoice",
                    "expense"
                  ]
                },
                "targetId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "targetType",
                "targetId",
                "amount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "amount",
          "currency",
          "supplierId",
          "date",
          "concept",
          "allocations"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "targetType": {
                  "type": "string",
                  "enum": [
                    "invoice",
                    "expense"
                  ]
                },
                "targetId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                }
              },
              "required": [
                "targetType",
                "targetId",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "amount",
          "currency",
          "supplierId",
          "date",
          "concept",
          "allocations",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "commitments": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "recurrenceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "occurrenceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "confirmed": {
            "type": "boolean"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "invoice",
              "expense"
            ]
          },
          "targetId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "paymentId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "amount",
          "currency",
          "dueDate",
          "concept",
          "category",
          "confirmed"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "recurrenceId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "occurrenceDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "confirmed": {
            "type": "boolean"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "invoice",
              "expense"
            ]
          },
          "targetId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "paymentId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "amount",
          "currency",
          "dueDate",
          "concept",
          "category",
          "confirmed",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "recurrences": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "nextDueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "endDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "frequency": {
            "type": "string",
            "enum": [
              "weekly",
              "monthly",
              "quarterly",
              "yearly"
            ]
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "amount",
          "currency",
          "nextDueDate",
          "concept",
          "category",
          "frequency",
          "active"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "nextDueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "endDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "frequency": {
            "type": "string",
            "enum": [
              "weekly",
              "monthly",
              "quarterly",
              "yearly"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "amount",
          "currency",
          "nextDueDate",
          "concept",
          "category",
          "frequency",
          "active",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "customers": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "legalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "taxId": {
            "type": "string",
            "pattern": "^\\d{11}$"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "aliases": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "legalName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "taxId": {
            "type": "string",
            "pattern": "^\\d{11}$"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "aliases": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "sales-invoices": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "invoiceType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "issueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "installments": {
            "minItems": 1,
            "maxItems": 360,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "dueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "id",
                "dueDate",
                "amount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "amount",
          "currency",
          "customerId",
          "number",
          "issueDate",
          "concept",
          "category"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "invoiceType": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "issueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "dueDate": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "installments": {
            "minItems": 1,
            "maxItems": 360,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "dueDate": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "id",
                "dueDate",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paid": {
            "type": "string",
            "readOnly": true
          },
          "credited": {
            "type": "string",
            "readOnly": true
          },
          "balance": {
            "type": "string",
            "readOnly": true
          },
          "overdue": {
            "type": "string",
            "readOnly": true
          },
          "status": {
            "enum": [
              "pending",
              "partial",
              "paid"
            ],
            "readOnly": true
          },
          "schedule": {
            "type": "array",
            "readOnly": true,
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "dueDate": {
                  "type": "string",
                  "format": "date"
                },
                "amount": {
                  "type": "string"
                },
                "paid": {
                  "type": "string"
                },
                "balance": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "required": [
          "amount",
          "currency",
          "customerId",
          "number",
          "issueDate",
          "concept",
          "category",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "receipts": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "method": {
            "type": "string",
            "enum": [
              "cash",
              "transfer",
              "mercado_pago",
              "card",
              "check",
              "automatic_debit",
              "other"
            ]
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "purpose": {
            "type": "string",
            "enum": [
              "invoice",
              "unbilled",
              "advance"
            ]
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invoiceId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "invoiceId",
                "amount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "amount",
          "currency",
          "date",
          "method",
          "concept",
          "category",
          "purpose",
          "allocations"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "method": {
            "type": "string",
            "enum": [
              "cash",
              "transfer",
              "mercado_pago",
              "card",
              "check",
              "automatic_debit",
              "other"
            ]
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "purpose": {
            "type": "string",
            "enum": [
              "invoice",
              "unbilled",
              "advance"
            ]
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invoiceId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "invoiceId",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "amount",
          "currency",
          "date",
          "method",
          "concept",
          "category",
          "purpose",
          "allocations",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "sales-credits": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invoiceId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "invoiceId",
                "amount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "amount",
          "currency",
          "customerId",
          "number",
          "date",
          "concept",
          "allocations"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "amount": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "customerId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "concept": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "allocations": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invoiceId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "invoiceId",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "amount",
          "currency",
          "customerId",
          "number",
          "date",
          "concept",
          "allocations",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "payment-orders": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "prepared"
            ]
          },
          "lines": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invoiceId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "invoiceId",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "advances": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "concept": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "id",
                "concept",
                "amount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "supplierId",
          "number",
          "date",
          "currency",
          "status",
          "lines"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "currency": {
            "type": "string",
            "enum": [
              "ARS",
              "USD"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "prepared",
              "paid"
            ]
          },
          "lines": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "invoiceId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "installmentId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "invoiceId",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "advances": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "concept": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 500
                },
                "amount": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,12})(\\.\\d{1,2})?$"
                }
              },
              "required": [
                "id",
                "concept",
                "amount"
              ],
              "additionalProperties": false
            }
          },
          "paymentId": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "supplierId",
          "number",
          "date",
          "currency",
          "status",
          "lines",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "products": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "unit": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "supplierCodes": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "supplierId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "code": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                }
              },
              "required": [
                "supplierId",
                "code"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "sku",
          "name",
          "unit"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "sku": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "unit": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "supplierCodes": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "supplierId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "code": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                }
              },
              "required": [
                "supplierId",
                "code"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "sku",
          "name",
          "unit",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "delivery-notes": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "received"
            ]
          },
          "orderReferences": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "lines": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "productId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
                },
                "unit": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "orderReference": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "supplierCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "matches": {
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "invoiceId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "lineId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      },
                      "quantity": {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
                      }
                    },
                    "required": [
                      "invoiceId",
                      "lineId",
                      "quantity"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "productId",
                "description",
                "quantity",
                "unit",
                "matches"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "supplierId",
          "number",
          "date",
          "status",
          "lines"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "supplierId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "received"
            ]
          },
          "orderReferences": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "lines": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "productId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "quantity": {
                  "type": "string",
                  "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
                },
                "unit": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "orderReference": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "supplierCode": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1000
                },
                "matches": {
                  "maxItems": 500,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "invoiceId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "lineId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 1000
                      },
                      "quantity": {
                        "type": "string",
                        "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
                      }
                    },
                    "required": [
                      "invoiceId",
                      "lineId",
                      "quantity"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "id",
                "productId",
                "description",
                "quantity",
                "unit",
                "matches"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "supplierId",
          "number",
          "date",
          "status",
          "lines",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "stock-movements": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
          },
          "unit": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "direction": {
            "type": "string",
            "enum": [
              "in",
              "out"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "opening",
              "adjustment",
              "return",
              "consumption"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          }
        },
        "required": [
          "productId",
          "date",
          "quantity",
          "unit",
          "direction",
          "kind",
          "reason"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "documentIds": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "productId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "quantity": {
            "type": "string",
            "pattern": "^(0|[1-9]\\d{0,9})(\\.\\d{1,4})?$"
          },
          "unit": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "direction": {
            "type": "string",
            "enum": [
              "in",
              "out"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "opening",
              "adjustment",
              "return",
              "consumption"
            ]
          },
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "productId",
          "date",
          "quantity",
          "unit",
          "direction",
          "kind",
          "reason",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "documents": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "mime": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 52428800
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "source": {
            "type": "string",
            "enum": [
              "web",
              "gmail",
              "telegram",
              "api",
              "migration"
            ]
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processed",
              "unsupported"
            ]
          },
          "externalMessageId": {
            "type": "string",
            "maxLength": 500
          },
          "externalAttachmentId": {
            "type": "string",
            "maxLength": 500
          },
          "classification": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "relations": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resource": {
                  "type": "string",
                  "enum": [
                    "customers",
                    "sales-invoices",
                    "receipts",
                    "sales-credits",
                    "payment-orders",
                    "products",
                    "delivery-notes",
                    "stock-movements",
                    "suppliers",
                    "invoices",
                    "expenses",
                    "payments",
                    "credits",
                    "commitments",
                    "recurrences",
                    "documents",
                    "issues",
                    "notification-rules",
                    "notifications"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "required": [
                "resource",
                "id"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "name",
          "mime",
          "size",
          "sha256",
          "path",
          "source",
          "receivedAt",
          "status"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "mime": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 52428800
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "path": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "source": {
            "type": "string",
            "enum": [
              "web",
              "gmail",
              "telegram",
              "api",
              "migration"
            ]
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processed",
              "unsupported"
            ]
          },
          "externalMessageId": {
            "type": "string",
            "maxLength": 500
          },
          "externalAttachmentId": {
            "type": "string",
            "maxLength": 500
          },
          "classification": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "relations": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "resource": {
                  "type": "string",
                  "enum": [
                    "customers",
                    "sales-invoices",
                    "receipts",
                    "sales-credits",
                    "payment-orders",
                    "products",
                    "delivery-notes",
                    "stock-movements",
                    "suppliers",
                    "invoices",
                    "expenses",
                    "payments",
                    "credits",
                    "commitments",
                    "recurrences",
                    "documents",
                    "issues",
                    "notification-rules",
                    "notifications"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "required": [
                "resource",
                "id"
              ],
              "additionalProperties": false
            }
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "mime",
          "size",
          "sha256",
          "path",
          "source",
          "receivedAt",
          "status",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    },
    "issues": {
      "input": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "error"
            ]
          },
          "resource": {
            "type": "string",
            "enum": [
              "customers",
              "sales-invoices",
              "receipts",
              "sales-credits",
              "payment-orders",
              "products",
              "delivery-notes",
              "stock-movements",
              "suppliers",
              "invoices",
              "expenses",
              "payments",
              "credits",
              "commitments",
              "recurrences",
              "documents",
              "issues",
              "notification-rules",
              "notifications"
            ]
          },
          "recordId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "resolvedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "title",
          "description",
          "status",
          "severity"
        ],
        "additionalProperties": false
      },
      "record": {
        "type": "object",
        "properties": {
          "externalId": {
            "type": "string",
            "maxLength": 500
          },
          "notes": {
            "type": "string",
            "maxLength": 10000
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1000
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "resolved"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "error"
            ]
          },
          "resource": {
            "type": "string",
            "enum": [
              "customers",
              "sales-invoices",
              "receipts",
              "sales-credits",
              "payment-orders",
              "products",
              "delivery-notes",
              "stock-movements",
              "suppliers",
              "invoices",
              "expenses",
              "payments",
              "credits",
              "commitments",
              "recurrences",
              "documents",
              "issues",
              "notification-rules",
              "notifications"
            ]
          },
          "recordId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "resolvedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "automatic": {
            "type": "string",
            "const": "receiving"
          },
          "receiving": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "resource": {
                "type": "string",
                "enum": [
                  "invoices",
                  "delivery-notes"
                ]
              },
              "recordId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "lineId": {
                "type": "string"
              },
              "supplierId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "supplierName": {
                "type": "string"
              },
              "invoiceId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "invoiceLineId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "invoiceNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "productId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "supplierCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "description": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "invoicedQuantity": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "receivedQuantity": {
                "type": "string"
              },
              "missingQuantity": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "excessQuantity": {
                "type": "string"
              },
              "unlinkedQuantity": {
                "type": "string"
              },
              "receivingStatus": {
                "type": "string",
                "enum": [
                  "unlinked",
                  "pending",
                  "partial",
                  "complete",
                  "excess",
                  "mismatch"
                ]
              },
              "detailPending": {
                "type": "boolean"
              },
              "deliveryNoteIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "deliveryNoteNumbers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "orderReferences": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "documentIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "deliveries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "noteId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "lineId": {
                      "type": "string"
                    },
                    "number": {
                      "type": "string"
                    },
                    "date": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "string"
                    },
                    "reasons": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": [
                    "noteId",
                    "lineId",
                    "number",
                    "date",
                    "quantity",
                    "reasons"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "key",
              "resource",
              "recordId",
              "lineId",
              "supplierId",
              "supplierName",
              "invoiceId",
              "invoiceLineId",
              "invoiceNumber",
              "productId",
              "supplierCode",
              "description",
              "unit",
              "invoicedQuantity",
              "receivedQuantity",
              "missingQuantity",
              "excessQuantity",
              "unlinkedQuantity",
              "receivingStatus",
              "detailPending",
              "deliveryNoteIds",
              "deliveryNoteNumbers",
              "orderReferences",
              "reasons",
              "documentIds",
              "deliveries"
            ],
            "additionalProperties": false
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "voidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "title",
          "description",
          "status",
          "severity",
          "id",
          "version",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": true
      }
    }
  },
  "definitions": {
    "ReceivingRow": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string"
        },
        "resource": {
          "type": "string",
          "enum": [
            "invoices",
            "delivery-notes"
          ]
        },
        "recordId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "lineId": {
          "type": "string"
        },
        "supplierId": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "supplierName": {
          "type": "string"
        },
        "invoiceId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "type": "null"
            }
          ]
        },
        "invoiceLineId": {
          "type": [
            "string",
            "null"
          ]
        },
        "invoiceNumber": {
          "type": [
            "string",
            "null"
          ]
        },
        "productId": {
          "anyOf": [
            {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "type": "null"
            }
          ]
        },
        "supplierCode": {
          "type": [
            "string",
            "null"
          ]
        },
        "description": {
          "type": "string"
        },
        "unit": {
          "type": "string"
        },
        "invoicedQuantity": {
          "type": [
            "string",
            "null"
          ]
        },
        "receivedQuantity": {
          "type": "string"
        },
        "missingQuantity": {
          "type": [
            "string",
            "null"
          ]
        },
        "excessQuantity": {
          "type": "string"
        },
        "unlinkedQuantity": {
          "type": "string"
        },
        "receivingStatus": {
          "type": "string",
          "enum": [
            "unlinked",
            "pending",
            "partial",
            "complete",
            "excess",
            "mismatch"
          ]
        },
        "detailPending": {
          "type": "boolean"
        },
        "deliveryNoteIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "deliveryNoteNumbers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "orderReferences": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "reasons": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "documentIds": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "deliveries": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "noteId": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "lineId": {
                "type": "string"
              },
              "number": {
                "type": "string"
              },
              "date": {
                "type": "string"
              },
              "quantity": {
                "type": "string"
              },
              "reasons": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "noteId",
              "lineId",
              "number",
              "date",
              "quantity",
              "reasons"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "key",
        "resource",
        "recordId",
        "lineId",
        "supplierId",
        "supplierName",
        "invoiceId",
        "invoiceLineId",
        "invoiceNumber",
        "productId",
        "supplierCode",
        "description",
        "unit",
        "invoicedQuantity",
        "receivedQuantity",
        "missingQuantity",
        "excessQuantity",
        "unlinkedQuantity",
        "receivingStatus",
        "detailPending",
        "deliveryNoteIds",
        "deliveryNoteNumbers",
        "orderReferences",
        "reasons",
        "documentIds",
        "deliveries"
      ],
      "additionalProperties": false
    }
  }
}