AddAccountDefinitionCommand (v1.0.0)

Command to add a new account definition to an existing merchant account ledger

AddAccountDefinitionCommand

Adds a new account definition to an existing merchant account’s ledger structure.

Schema

schema.json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"title": "AddAccountDefinitionCommand",
"description": "Command to add a new account definition to an existing merchant account ledger",
"properties": {
"accountId": {
"type": "object",
"description": "Account identifier",
"properties": {
"value": {
"type": "string",
"format": "uuid",
"description": "The unique account UUID"
}
},
"required": ["value"]
},
"accountDefinitionId": {
"type": "integer",
"description": "Account definition identifier",
"example": 15652
},
"accountDefinitionName": {
"type": "string",
"description": "Name of the account definition",
"example": "MerchantDebt"
}
},
"required": ["accountId", "accountDefinitionId", "accountDefinitionName"],
"additionalProperties": false
}

Purpose

This command allows dynamic addition of new account types to existing merchant accounts, enabling support for new financial products or account categories.

Key Attributes

  • ID: Merchant account aggregate identifier
  • Ledger: Hierarchy level
  • Sub: Sub-hierarchy level
  • Definition: Account definition containing ID, type, and name

Business Rules

  • Account definition must exist in the configured chart of accounts
  • Account definition must not already exist in the ledger
  • Validates definition matches configured account structure

Result

Produces an AccountDefinitionAddedEvent when successful.