CreateAccountCommand (v1.0.0)
Command to create a new merchant account aggregate in the accounting system
CreateAccountCommand
Creates a new MerchantAccount aggregate with the specified configuration and chart of accounts.
Schema
{ "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "title": "CreateAccountCommand", "description": "Command to create a new merchant account aggregate in the accounting system", "properties": { "accountId": { "type": "object", "description": "Account identifier", "properties": { "value": { "type": "string", "format": "uuid", "description": "The unique account UUID" } }, "required": ["value"] }, "ownerId": { "type": "object", "description": "Owner identifier", "properties": { "value": { "type": "string", "format": "uuid", "description": "The unique owner UUID" } }, "required": ["value"] }, "currency": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "The currency in which the account operates (ISO 4217, 3 characters)", "example": "EUR" }, "delay": { "type": "integer", "description": "Delay configuration for the account", "example": 2 }, "country": { "type": "string", "pattern": "^[A-Z]{3}$", "description": "Country code where the account operates (ISO 3166, 3 characters)", "example": "NOR" }, "iban": { "type": "string", "maxLength": 34, "description": "International Bank Account Number", "example": "NO9386011117947" }, "bic": { "type": "string", "maxLength": 34, "description": "Bank Identifier Code", "example": "DNBANOKKXXX" }, "bookkeepingConfigId": { "type": "integer", "description": "Bookkeeping configuration identifier", "example": 15656 } }, "required": ["accountId", "ownerId", "currency", "delay", "country", "iban", "bic", "bookkeepingConfigId"], "additionalProperties": false}Purpose
This command initializes a new merchant account aggregate that will manage financial transactions and balances for a specific merchant in a given currency.
Key Attributes
- ID: Unique identifier for the merchant account aggregate
- Currency: The currency in which the account operates
- Account Holder ID: Identifier of the merchant who owns the account
- Account Holder Name: Name of the merchant
- Ledger: Hierarchy level (e.g., “COLLECTING”)
- Sub: Sub-hierarchy level (e.g., merchant-specific identifier)
- Booking Type: Type of booking (STANDARD, IPSP)
Business Rules
- Only one general ledger account is allowed per currency
- Chart of accounts must be defined for the specified ledger hierarchy
- Account metadata is stored for non-IPSP booking types
- Validates that the ledger configuration exists in the admin backend
Result
When successful, this command produces an AccountCreatedEvent and stores account metadata in the repository.