Skip to content

Commit

Permalink
Merge pull request #38 from stitch-digital/21-request-group-quotes
Browse files Browse the repository at this point in the history
21 request group quotes
  • Loading branch information
johntrickett86 authored Oct 27, 2024
2 parents c2cf124 + 6f8cbdc commit 22707e1
Show file tree
Hide file tree
Showing 78 changed files with 2,659 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders;

use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Body\HasJsonBody;

class CreateQuoteAttachmentFolder extends Request implements HasBody
{
use HasJsonBody;

/**
* @param array<string, mixed> $data
*/
public function __construct(protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data)
{
//
}

protected Method $method = Method::POST;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/';
}

/**
* @return array<string, mixed>
*/
public function defaultBody(): array
{
return $this->data;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class DeleteQuoteAttachmentFolder extends Request
{
public function __construct(protected int $folderId, protected readonly int $quoteId, protected readonly int $companyId)
{
//
}

protected Method $method = Method::DELETE;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'.$this->folderId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetQuoteAttachmentFolders extends Request implements Paginatable
{
public function __construct(protected readonly int $quoteId, protected readonly int $companyId)
{
//
}

/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class RetrieveQuoteAttachmentFolder extends Request
{
public function __construct(protected int $folderId, protected readonly int $quoteId, protected int $companyId)
{
//
}

/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'.$this->folderId;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\AttachmentFolders;

use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Body\HasJsonBody;

class UpdateQuoteAttachmentFolder extends Request implements HasBody
{
use HasJsonBody;

/**
* @param array<string, mixed> $data
*/
public function __construct(protected int $folderId, protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data)
{
//
}

protected Method $method = Method::PATCH;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/folders/'.$this->folderId;
}

/**
* @return array<string, mixed>
*/
public function defaultBody(): array
{
return $this->data;
}
}
41 changes: 41 additions & 0 deletions src/Requests/Quotes/Attachments/CreateQuoteAttachment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\Attachments;

use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Body\HasJsonBody;

class CreateQuoteAttachment extends Request implements HasBody
{
use HasJsonBody;

/**
* @param array<string, mixed> $data
*/
public function __construct(protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data)
{
//
}

protected Method $method = Method::POST;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/files/';
}

/**
* @return array<string, mixed>
*/
public function defaultBody(): array
{
return $this->data;
}
}
29 changes: 29 additions & 0 deletions src/Requests/Quotes/Attachments/DeleteQuoteAttachment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\Attachments;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class DeleteQuoteAttachment extends Request
{
public function __construct(protected string $attachmentId, protected readonly int $quoteId, protected int $companyId)
{
//
}

/**
* The HTTP method of the request
*/
protected Method $method = Method::DELETE;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/files/'.$this->attachmentId;
}
}
41 changes: 41 additions & 0 deletions src/Requests/Quotes/Attachments/UpdateQuoteAttachment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\Attachments;

use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Body\HasJsonBody;

class UpdateQuoteAttachment extends Request implements HasBody
{
use HasJsonBody;

/**
* @param array<string, mixed> $data
*/
public function __construct(protected string $attachmentId, protected readonly int $quoteId, protected readonly int $companyId, protected readonly array $data)
{
//
}

protected Method $method = Method::PATCH;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/attachments/files/'.$this->attachmentId;
}

/**
* @return array<string, mixed>
*/
public function defaultBody(): array
{
return $this->data;
}
}
41 changes: 41 additions & 0 deletions src/Requests/Quotes/CreateQuote.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes;

use Saloon\Contracts\Body\HasBody;
use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Body\HasJsonBody;

class CreateQuote extends Request implements HasBody
{
use HasJsonBody;

/**
* @param array<string, mixed> $data
*/
public function __construct(protected readonly int $companyId, protected readonly array $data)
{
//
}

protected Method $method = Method::POST;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/';
}

/**
* @return array<string, mixed>
*/
public function defaultBody(): array
{
return $this->data;
}
}
30 changes: 30 additions & 0 deletions src/Requests/Quotes/CustomFields/GetQuoteCustomFields.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\CustomFields;

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\PaginationPlugin\Contracts\Paginatable;

class GetQuoteCustomFields extends Request implements Paginatable
{
public function __construct(protected readonly int $quoteId, protected readonly int $companyId)
{
//
}

/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/customFields/';
}
}
29 changes: 29 additions & 0 deletions src/Requests/Quotes/CustomFields/RetrieveQuoteCustomField.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace StitchDigital\LaravelSimproApi\Requests\Quotes\CustomFields;

use Saloon\Enums\Method;
use Saloon\Http\Request;

class RetrieveQuoteCustomField extends Request
{
public function __construct(protected readonly int $customFieldId, protected readonly int $quoteId, protected readonly int $companyId)
{
//
}

/**
* The HTTP method of the request
*/
protected Method $method = Method::GET;

/**
* The endpoint for the request
*/
public function resolveEndpoint(): string
{
return '/companies/'.$this->companyId.'/quotes/'.$this->quoteId.'/customFields/'.$this->customFieldId;
}
}
Loading

0 comments on commit 22707e1

Please sign in to comment.