{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/benjipays-com/json-schema/benjipays-com-customer-note-schema.json",
  "title": "CustomerNote",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/benjipays-com-benji-pays-merchant-api-openapi.yml#/components/schemas/CustomerNote",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "maxLength": 24
    },
    "content": {
      "type": "string",
      "maxLength": 1000
    },
    "entityType": {
      "type": "string",
      "const": "customer"
    },
    "entityId": {
      "type": "string",
      "maxLength": 200
    },
    "userInformation": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "userId": {
              "type": "string",
              "maxLength": 200
            },
            "userName": {
              "type": "string",
              "maxLength": 200
            },
            "userEmail": {
              "type": "string",
              "maxLength": 320
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "createdDate": {
      "anyOf": [
        {
          "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))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "updatedAt": {
      "anyOf": [
        {
          "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))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "deletedAt": {
      "anyOf": [
        {
          "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))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "activity": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "created",
              "edited",
              "deleted",
              "status_changed",
              "pinned",
              "unpinned"
            ]
          },
          "at": {
            "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))$"
          },
          "userInformation": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "userName": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "userEmail": {
                    "type": "string",
                    "maxLength": 320
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "changes": {
            "type": "object",
            "properties": {
              "content": {
                "type": "boolean"
              },
              "categorySlug": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "to": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "additionalProperties": false
              },
              "statusSlug": {
                "type": "object",
                "properties": {
                  "from": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "to": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "reason": {
            "type": "string",
            "enum": [
              "created",
              "replaced",
              "removed",
              "root_deleted"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "note",
              "comment"
            ]
          },
          "commentId": {
            "type": "string",
            "maxLength": 24
          }
        },
        "required": [
          "action"
        ],
        "additionalProperties": false
      }
    },
    "parentNoteId": {
      "type": "null"
    },
    "categorySlug": {
      "type": "string",
      "maxLength": 100
    },
    "statusSlug": {
      "type": "string",
      "maxLength": 100
    },
    "pinned": {
      "type": "boolean"
    },
    "resolvedAt": {
      "anyOf": [
        {
          "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))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "resolvedBy": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "userId": {
              "type": "string",
              "maxLength": 200
            },
            "userName": {
              "type": "string",
              "maxLength": 200
            },
            "userEmail": {
              "type": "string",
              "maxLength": 320
            }
          },
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "canDelete": {
      "type": "boolean"
    }
  },
  "required": [
    "id",
    "content",
    "parentNoteId",
    "categorySlug",
    "statusSlug",
    "pinned"
  ],
  "additionalProperties": false
}