Created
September 6, 2017 11:09
-
-
Save lukashavrlant/4563cfaf81c305b570217816835a10d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class CreatePortfolioActionAdapter implements HttpActionBuilder<PortfolioManagementCommand> { | |
public constructor( | |
private entityRepository: EntityRepository<Entity>, | |
private responseBuilder: HttpResponseDataBuilder | |
) { | |
} | |
public build(request: HttpRequest, security: SecurityDescriptor): Promise<PortfolioManagementCommand> { | |
const portfolioId = new Uuidv4(request.getBodyData('portfolioId')); | |
const createPortfolioCommand = new CreatePortfolio(this.entityRepository, portfolioId); | |
return Promise.resolve(createPortfolioCommand); | |
} | |
public getResponseData(actionResult: ActionResult): HttpResponseData { | |
return this.responseBuilder.createResponseData(actionResult); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment