Commands
import { Command } from '@node-ts/bus-messages'
export class ChargeCreditCard extends Command {
/**
* A unique name that identifies the message. This should be done in namespace style syntax,
* ie: organisation/domain/command-name
*/
$name = 'my-app/accounts/charge-credit-card'
/**
* The contract version of this message. This can be incremented if this message changes the
* number of properties etc to maintain backwards compatibility
*/
$version = 1
/**
* Create a charge on a credit card
* @param creditCardToken Identfies the card to charge
* @param amountThe amount, in USD, to charge the card
*/
constructor (
readonly creditCardToken: string,
readonly amount: number
) {
}
}Sending a command
Handling a Command
Last updated