type: object
properties:
  id:
    type: string
    format: uuid
    description: Unique identifier of the accounting event.
    example: "evt7c123-4567-89ab-cdef-123456789012"
  organisationId:
    type: string
    format: uuid
    description: Organisation identifier owning this accounting event.
    example: "47aa12f6-acf9-455f-9f3b-400e5c7a4862"
  sourceId:
    type: [string, "null"]
    format: uuid
    description: Source identifier when the source is an expense or bank movement.
    example: "b8e7c123-4567-89ab-cdef-123456789012"
  title:
    type: string
    description: Short display title of the accounting event.
    example: "EV-1A2B"
  subtitle:
    type: string
    description: Secondary display text of the accounting event.
    example: "EXPENSE INVOICE AMAZON EUR SYNCED"
  sourceType:
    $ref: '../../openapi.yaml#/components/schemas/AccountingEventSourceType'
  exportType:
    $ref: '../../openapi.yaml#/components/schemas/AccountingEventExportType'
  counterparty:
    type: string
    description: Counterparty shown for the accounting event.
    example: "Amazon"
  amount:
    type: number
    format: decimal
    description: Accounting event amount.
    example: 125.50
  currency:
    type: string
    description: ISO 4217 currency code.
    example: "EUR"
  createTime:
    type: string
    format: date-time
    description: Creation timestamp of the accounting event.
    example: "2026-07-01T10:15:30Z"
  lastAttempt:
    type: string
    format: date-time
    description: Timestamp of the latest sync attempt.
    example: "2026-07-01T10:15:30Z"
  latestAction:
    $ref: './AccountingEventAction.yaml'
  status:
    deprecated: true
    allOf:
      - $ref: '../../openapi.yaml#/components/schemas/AccountingEventLogStatus'
  errorMessage:
    deprecated: true
    allOf:
      - type: [string, "null"]
        description: Error message from the latest sync attempt, when available.
        example: "NetSuite API timeout"
required:
  - id
  - organisationId
  - title
  - subtitle
  - sourceType
  - exportType
  - counterparty
  - amount
  - currency
  - createTime
  - lastAttempt
  - latestAction
  - status
