CQRS implementation in typescript