Files
sxchnge/backend/contracts/sendico/models/ledger/operation.yaml
T

125 lines
4.5 KiB
YAML

components:
schemas:
LedgerStatementVisibility:
description: Visibility of the account-history projection returned for the requested ledger account.
type: string
enum:
- full
- partial
LedgerEntryType:
description: Lowercase ledger entry type string from the BFF response.
type: string
example: transfer
LedgerLineType:
description: Lowercase posting-line type string from the BFF response.
type: string
example: main
LedgerAccountOperationSummary:
description: |
Account-history summary projection for a ledger statement entry.
`accountAmount` is the exact decimal sum of visible posting-line amounts whose `ledgerAccountRef`
equals the requested statement account. Positive means net credit, negative means net debit,
zero means net neutral, and the currency matches the requested ledger account currency.
type: object
additionalProperties: false
required:
- entryRef
- entryType
- accountAmount
- eventTime
- version
- visibility
properties:
entryRef:
description: Statement entry reference.
$ref: ../objectid.yaml#/components/schemas/ObjectId
entryType:
$ref: ./operation.yaml#/components/schemas/LedgerEntryType
accountAmount:
$ref: ../common/money.yaml#/components/schemas/Money
description:
description: Human-readable entry description when present.
type: string
eventTime:
description: Event timestamp carried by the canonical statement entry.
type: string
format: date-time
version:
description: Immutable ledger history version used for deterministic ordering.
type: integer
format: int64
visibility:
$ref: ./operation.yaml#/components/schemas/LedgerStatementVisibility
LedgerAccountOperationLine:
description: Visible posting line included in the account-history projection.
type: object
additionalProperties: false
required:
- ledgerAccountRef
- money
- lineType
properties:
ledgerAccountRef:
description: Ledger account reference for the visible posting line.
$ref: ../objectid.yaml#/components/schemas/ObjectId
money:
$ref: ../common/money.yaml#/components/schemas/Money
lineType:
$ref: ./operation.yaml#/components/schemas/LedgerLineType
organizationRef:
description: Owning organization reference when visible to the caller.
$ref: ../objectid.yaml#/components/schemas/ObjectId
LedgerAccountOperation:
description: |
Detailed account-history projection for a statement entry.
This payload is scoped to the requested ledger account and does not expose general journal-entry data outside that visibility model.
type: object
additionalProperties: false
required:
- entryRef
- entryType
- accountAmount
- eventTime
- version
- visibility
- lines
properties:
entryRef:
description: Statement entry reference.
$ref: ../objectid.yaml#/components/schemas/ObjectId
entryType:
$ref: ./operation.yaml#/components/schemas/LedgerEntryType
accountAmount:
$ref: ../common/money.yaml#/components/schemas/Money
description:
description: Human-readable entry description when present.
type: string
eventTime:
description: Event timestamp carried by the canonical statement entry.
type: string
format: date-time
version:
description: Immutable ledger history version used for deterministic ordering.
type: integer
format: int64
visibility:
$ref: ./operation.yaml#/components/schemas/LedgerStatementVisibility
lines:
description: Visible posting lines included in the account-history projection.
type: array
items:
$ref: ./operation.yaml#/components/schemas/LedgerAccountOperationLine
metadata:
description: Entry metadata when visible to the caller.
type: object
additionalProperties:
type: string
organizationRef:
description: Entry organization reference when visible to the caller.
$ref: ../objectid.yaml#/components/schemas/ObjectId