1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-15 23:52:33 +01:00
invoiceninja/app/Http/Controllers/RecurringQuoteController.php

616 lines
23 KiB
PHP
Raw Normal View History

2019-05-05 02:49:01 +02:00
<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com).
2019-05-11 05:32:07 +02:00
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
2019-05-11 05:32:07 +02:00
*
2021-06-16 08:58:16 +02:00
* @license https://www.elastic.co/licensing/elastic-license
2019-05-11 05:32:07 +02:00
*/
2019-05-05 02:49:01 +02:00
namespace App\Http\Controllers;
use App\Factory\CloneRecurringQuoteFactory;
use App\Factory\CloneRecurringQuoteToQuoteFactory;
use App\Factory\RecurringQuoteFactory;
use App\Filters\RecurringQuoteFilters;
use App\Http\Requests\RecurringQuote\ActionRecurringQuoteRequest;
use App\Http\Requests\RecurringQuote\CreateRecurringQuoteRequest;
use App\Http\Requests\RecurringQuote\DestroyRecurringQuoteRequest;
use App\Http\Requests\RecurringQuote\EditRecurringQuoteRequest;
use App\Http\Requests\RecurringQuote\ShowRecurringQuoteRequest;
use App\Http\Requests\RecurringQuote\StoreRecurringQuoteRequest;
use App\Http\Requests\RecurringQuote\UpdateRecurringQuoteRequest;
2020-11-11 01:13:39 +01:00
use App\Models\Quote;
2019-05-05 02:49:01 +02:00
use App\Models\RecurringQuote;
use App\Repositories\RecurringQuoteRepository;
2020-11-11 01:13:39 +01:00
use App\Transformers\QuoteTransformer;
2019-05-05 02:49:01 +02:00
use App\Transformers\RecurringQuoteTransformer;
use App\Utils\Traits\MakesHash;
use Illuminate\Http\Request;
2020-10-28 11:10:49 +01:00
use Illuminate\Http\Response;
2019-05-05 02:49:01 +02:00
/**
* Class RecurringQuoteController.
2019-05-05 02:49:01 +02:00
*/
class RecurringQuoteController extends BaseController
{
use MakesHash;
protected $entity_type = RecurringQuote::class;
protected $entity_transformer = RecurringQuoteTransformer::class;
/**
* @var RecurringQuoteRepository
*/
protected $recurring_quote_repo;
protected $base_repo;
/**
* RecurringQuoteController constructor.
*
2020-10-28 11:10:49 +01:00
* @param RecurringQuoteRepository $recurring_quote_repo The RecurringQuote repo
2019-05-05 02:49:01 +02:00
*/
public function __construct(RecurringQuoteRepository $recurring_quote_repo)
{
parent::__construct();
$this->recurring_quote_repo = $recurring_quote_repo;
}
/**
* Show the list of recurring_invoices.
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @param RecurringQuoteFilters $filters The filters
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @return Response
2019-10-07 06:32:29 +02:00
*
*
2019-10-07 06:32:29 +02:00
* @OA\Get(
* path="/api/v1/recurring_quotes",
* operationId="getRecurringQuotes",
* tags={"recurring_quotes"},
* summary="Gets a list of recurring_quotes",
* description="Lists recurring_quotes, search and filters allow fine grained lists to be generated.
Query parameters can be added to performed more fine grained filtering of the recurring_quotes, these are handled by the RecurringQuoteFilters class which defines the methods available",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Response(
* response=200,
* description="A list of recurring_quotes",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
2019-05-05 02:49:01 +02:00
*/
public function index(RecurringQuoteFilters $filters)
{
$recurring_quotes = RecurringQuote::filter($filters);
2019-05-05 02:49:01 +02:00
return $this->listResponse($recurring_quotes);
}
/**
* Show the form for creating a new resource.
*
2020-10-28 11:10:49 +01:00
* @param CreateRecurringQuoteRequest $request The request
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @return Response
*
*
2019-10-07 06:32:29 +02:00
* @OA\Get(
* path="/api/v1/recurring_quotes/create",
* operationId="getRecurringQuotesCreate",
* tags={"recurring_quotes"},
* summary="Gets a new blank RecurringQuote object",
* description="Returns a blank object with default values",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Response(
* response=200,
* description="A blank RecurringQuote object",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
2019-05-05 02:49:01 +02:00
*/
public function create(CreateRecurringQuoteRequest $request)
{
$recurring_quote = RecurringQuoteFactory::create(auth()->user()->company()->id, auth()->user()->id);
return $this->itemResponse($recurring_quote);
}
/**
* Store a newly created resource in storage.
*
2020-10-28 11:10:49 +01:00
* @param StoreRecurringQuoteRequest $request The request
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @return Response
2019-10-07 06:32:29 +02:00
*
*
* @OA\Post(
* path="/api/v1/recurring_quotes",
* operationId="storeRecurringQuote",
* tags={"recurring_quotes"},
* summary="Adds a RecurringQuote",
* description="Adds an RecurringQuote to the system",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Response(
* response=200,
* description="Returns the saved RecurringQuote object",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
2019-05-05 02:49:01 +02:00
*/
public function store(StoreRecurringQuoteRequest $request)
{
$recurring_quote = $this->recurring_quote_repo->save($request, RecurringQuoteFactory::create(auth()->user()->company()->id, auth()->user()->id));
return $this->itemResponse($recurring_quote);
}
/**
* Display the specified resource.
*
2020-10-28 11:10:49 +01:00
* @param ShowRecurringQuoteRequest $request The request
* @param RecurringQuote $recurring_quote The RecurringQuote
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @return Response
2019-10-07 06:32:29 +02:00
*
*
* @OA\Get(
* path="/api/v1/recurring_quotes/{id}",
* operationId="showRecurringQuote",
* tags={"recurring_quotes"},
* summary="Shows an RecurringQuote",
* description="Displays an RecurringQuote by id",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Parameter(
* name="id",
* in="path",
* description="The RecurringQuote Hashed ID",
* example="D2J234DFA",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Response(
* response=200,
* description="Returns the RecurringQuote object",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
2019-05-05 02:49:01 +02:00
*/
public function show(ShowRecurringQuoteRequest $request, RecurringQuote $recurring_quote)
{
return $this->itemResponse($recurring_quote);
}
/**
* Show the form for editing the specified resource.
*
2020-10-28 11:10:49 +01:00
* @param EditRecurringQuoteRequest $request The request
* @param RecurringQuote $recurring_quote The RecurringQuote
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @return Response
2019-10-07 06:32:29 +02:00
*
*
2019-10-07 06:32:29 +02:00
* @OA\Get(
* path="/api/v1/recurring_quotes/{id}/edit",
* operationId="editRecurringQuote",
* tags={"recurring_quotes"},
* summary="Shows an RecurringQuote for editting",
* description="Displays an RecurringQuote by id",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Parameter(
* name="id",
* in="path",
* description="The RecurringQuote Hashed ID",
* example="D2J234DFA",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Response(
* response=200,
* description="Returns the RecurringQuote object",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
*/
2019-05-05 02:49:01 +02:00
public function edit(EditRecurringQuoteRequest $request, RecurringQuote $recurring_quote)
{
return $this->itemResponse($recurring_quote);
}
2019-05-05 02:49:01 +02:00
/**
* Update the specified resource in storage.
*
2020-10-28 11:10:49 +01:00
* @param UpdateRecurringQuoteRequest $request The request
* @param RecurringQuote $recurring_quote The RecurringQuote
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @return Response
2019-10-07 06:32:29 +02:00
*
*
2019-10-07 06:32:29 +02:00
* @OA\Put(
* path="/api/v1/recurring_quotes/{id}",
* operationId="updateRecurringQuote",
* tags={"recurring_quotes"},
* summary="Updates an RecurringQuote",
* description="Handles the updating of an RecurringQuote by id",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Parameter(
* name="id",
* in="path",
* description="The RecurringQuote Hashed ID",
* example="D2J234DFA",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Response(
* response=200,
* description="Returns the RecurringQuote object",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
*/
2019-05-05 02:49:01 +02:00
public function update(UpdateRecurringQuoteRequest $request, RecurringQuote $recurring_quote)
{
if ($request->entityIsDeleted($recurring_quote)) {
return $request->disallowUpdate();
}
2019-05-05 02:49:01 +02:00
$recurring_quote = $this->recurring_quote_repo->save(request(), $recurring_quote);
return $this->itemResponse($recurring_quote);
}
/**
* Remove the specified resource from storage.
*
2020-10-28 11:10:49 +01:00
* @param DestroyRecurringQuoteRequest $request
* @param RecurringQuote $recurring_quote
2019-05-05 02:49:01 +02:00
*
2020-10-28 11:10:49 +01:00
* @return Response
2019-10-07 06:32:29 +02:00
*
*
2020-10-28 11:10:49 +01:00
* @throws \Exception
2019-10-07 06:32:29 +02:00
* @OA\Delete(
* path="/api/v1/recurring_quotes/{id}",
* operationId="deleteRecurringQuote",
* tags={"recurring_quotes"},
* summary="Deletes a RecurringQuote",
* description="Handles the deletion of an RecurringQuote by id",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Parameter(
* name="id",
* in="path",
* description="The RecurringQuote Hashed ID",
* example="D2J234DFA",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Response(
* response=200,
* description="Returns a HTTP status",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
2019-05-05 02:49:01 +02:00
*/
public function destroy(DestroyRecurringQuoteRequest $request, RecurringQuote $recurring_quote)
{
$this->recurring_quote_repo->delete($recurring_quote);
2019-05-05 02:49:01 +02:00
return $this->itemResponse($recurring_quote->fresh());
2019-05-05 02:49:01 +02:00
}
/**
* Perform bulk actions on the list view.
*
2019-05-05 02:49:01 +02:00
* @return Collection
2019-10-07 06:32:29 +02:00
*
*
2019-10-07 06:32:29 +02:00
* @OA\Post(
* path="/api/v1/recurring_quotes/bulk",
* operationId="bulkRecurringQuotes",
* tags={"recurring_quotes"},
* summary="Performs bulk actions on an array of recurring_quotes",
* description="",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/index"),
* @OA\RequestBody(
2019-10-07 06:57:14 +02:00
* description="Hashed ids",
2019-10-07 06:32:29 +02:00
* required=true,
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* type="array",
* @OA\Items(
* type="integer",
* description="Array of hashed IDs to be bulk 'actioned",
* example="[0,1,2,3]",
* ),
* )
* )
* ),
* @OA\Response(
* response=200,
2019-10-07 06:57:14 +02:00
* description="The RecurringQuote response",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
2019-10-07 06:57:14 +02:00
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
2019-10-07 06:32:29 +02:00
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
2019-05-05 02:49:01 +02:00
*/
public function bulk()
{
$action = request()->input('action');
2019-05-05 02:49:01 +02:00
$ids = request()->input('ids');
$recurring_quotes = RecurringQuote::withTrashed()->find($this->transformKeys($ids));
2019-05-05 02:49:01 +02:00
$recurring_quotes->each(function ($recurring_quote, $key) use ($action) {
if (auth()->user()->can('edit', $recurring_quote)) {
2019-05-05 02:49:01 +02:00
$this->recurring_quote_repo->{$action}($recurring_quote);
}
2019-05-05 02:49:01 +02:00
});
return $this->listResponse(RecurringQuote::withTrashed()->whereIn('id', $this->transformKeys($ids)));
2019-05-05 02:49:01 +02:00
}
2019-10-07 06:32:29 +02:00
/**
* Recurring Quote Actions.
2019-10-07 06:32:29 +02:00
*
*
*
2019-10-07 06:32:29 +02:00
* @OA\Get(
* path="/api/v1/recurring_quotes/{id}/{action}",
* operationId="actionRecurringQuote",
* tags={"recurring_quotes"},
* summary="Performs a custom action on an RecurringQuote",
* description="Performs a custom action on an RecurringQuote.
2020-10-28 11:10:49 +01:00
The current range of actions are as follows
- clone_to_RecurringQuote
- clone_to_quote
- history
- delivery_note
- mark_paid
- download
- archive
- delete
- email",
2019-10-07 06:32:29 +02:00
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Parameter(
* name="id",
* in="path",
* description="The RecurringQuote Hashed ID",
* example="D2J234DFA",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
* @OA\Parameter(
* name="action",
* in="path",
* description="The action string to be performed",
* example="clone_to_quote",
* required=true,
* @OA\Schema(
* type="string",
* format="string",
* ),
* ),
2019-10-07 06:32:29 +02:00
* @OA\Response(
* response=200,
* description="Returns the RecurringQuote object",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
2019-10-07 06:32:29 +02:00
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/RecurringQuote"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
2019-10-07 06:32:29 +02:00
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
2020-10-28 11:10:49 +01:00
* @param ActionRecurringQuoteRequest $request
* @param RecurringQuote $recurring_quote
* @param $action
2019-10-07 06:32:29 +02:00
*/
2019-05-05 02:49:01 +02:00
public function action(ActionRecurringQuoteRequest $request, RecurringQuote $recurring_quote, $action)
{
switch ($action) {
case 'clone_to_RecurringQuote':
// $recurring_invoice = CloneRecurringQuoteFactory::create($recurring_invoice, auth()->user()->id);
// return $this->itemResponse($recurring_invoice);
break;
case 'clone_to_quote':
2020-11-11 01:13:39 +01:00
$quote = CloneRecurringQuoteToQuoteFactory::create($recurring_invoice, auth()->user()->id);
$this->entity_transformer = QuoteTransformer::class;
$this->entity_type = Quote::class;
return $this->itemResponse($quote);
2019-05-05 02:49:01 +02:00
break;
case 'history':
// code...
2019-05-05 02:49:01 +02:00
break;
case 'delivery_note':
// code...
2019-05-05 02:49:01 +02:00
break;
case 'mark_paid':
// code...
2019-05-05 02:49:01 +02:00
break;
case 'archive':
// code...
2019-05-05 02:49:01 +02:00
break;
case 'delete':
// code...
2019-05-05 02:49:01 +02:00
break;
case 'email':
//dispatch email to queue
break;
default:
// code...
2019-05-05 02:49:01 +02:00
break;
}
}
}