public function pay($points, ContextInterface $context)
    {
        // decrease user points
        $this->userTable->payPoints($context->getUser()->getId(), $points);

        // add usage entry
        $this->usageTable->create([
            'route_id' => $context->getRouteId(),
            'user_id' => $context->getUser()->getId(),
            'app_id' => $context->getApp()->getId(),
            'points' => $points,
            'insert_date' => new \DateTime(),
        ]);

        // dispatch payed event
        $userContext = UserContext::newContext(
            $context->getUser()->getId(),
            $context->getApp()->getId()
        );

        $this->eventDispatcher->dispatch(PlanEvents::PAY, new PayedEvent($points, $userContext));
    }