public function handle(UpdateCouponCommand $command) { $couponDTO = $command->getCouponDTO(); $coupon = $this->couponService->findOneById($couponDTO->id); CouponDTOBuilder::setFromDTO($coupon, $couponDTO); $this->couponService->update($coupon); }
public function handle(DeleteCouponCommand $command) { $coupon = $this->couponService->findOneById($command->getCouponId()); $this->couponService->delete($coupon); }
public function handle(GetCouponQuery $query) { $coupon = $this->couponService->findOneById($query->getRequest()->getCouponId()); $query->getResponse()->setCouponDTOBuilder($this->dtoBuilderFactory->getCouponDTOBuilder($coupon)); }