export class Step < T > { private invocation : Function ; private compensation : Function ; private readonly name : string ; constructor ( name = '' ) { this . name = name ; } public setInvocation ( method ) { this . invocation = method ; } public setCompensation ( method ) { this . compensation = method ; } public async invoke ( params ) { if ( this . invocation ) { return this . invocation ( params ) ; } } public async compensate ( params ) { if ( this . compensation ) { return this . compensation ( params ) ; } } public getName ( ) { return this . name ; } }