Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nckrtl committed Aug 29, 2024
1 parent f047fc4 commit 5bb4a8b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/ApiRequests/CompanyBranch/GetCompanyBranch.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@

use Saloon\Enums\Method;
use Saloon\Http\Request;
use Saloon\Traits\Plugins\HasTimeout;

// Description: Retrieves the collection of CompanyBranch resources.

class GetCompanyBranch extends Request
{
use HasTimeout;

protected int $connectTimeout = 60;

protected int $requestTimeout = 600;

protected Method $method = Method::GET;

public function __construct(
Expand Down
5 changes: 3 additions & 2 deletions src/DTO/Vacancy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct(
public ?array $educationLevel,
public ?array $contractDuration,
public ?array $compensationType,
public ?string $contactPerson,
public string|array|null $contactPerson,
public ?float $salaryMin,
public ?float $salaryMax,
public ?int $minHours,
Expand All @@ -40,7 +40,8 @@ public function __construct(
public ?int $publishedAtRefreshCount,
public ?string $youtubeId,
public bool $published,
) {}
) {
}

public static function fromResponse(Response $response, ?string $dtoType = null): self|VacancyForForStoreOrUpdate
{
Expand Down
20 changes: 19 additions & 1 deletion src/DeBanensite.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Support\Collection;
use NckRtl\DeBanensite\ApiRequests\CompanyBranch\GetCompanyBranch;
use NckRtl\DeBanensite\ApiRequests\CompanyBranch\GetCompanyBranches;
use NckRtl\DeBanensite\ApiRequests\GetAddress;
use NckRtl\DeBanensite\ApiRequests\Vacancy\DeleteVacancy;
use NckRtl\DeBanensite\ApiRequests\Vacancy\GetVacancies;
use NckRtl\DeBanensite\ApiRequests\Vacancy\GetVacancy;
Expand All @@ -14,7 +15,9 @@

class DeBanensite
{
public function __construct(protected DeBanensiteConnector $connector) {}
public function __construct(protected DeBanensiteConnector $connector)
{
}

public function allPublishedVacancyIds(): Collection
{
Expand Down Expand Up @@ -83,4 +86,19 @@ public function getLocations()
{
return $this->connector->send(new GetCompanyBranches())->dto();
}

public function getCompanyBranch(string $branchId, ?string $dtoType = null)
{
return $this->connector->send(new GetCompanyBranch($branchId))->json();
}

public function getCompanyBranches()
{
return $this->connector->send(new GetCompanyBranches())->json();
}

public function getAddress(string $addressId, ?string $dtoType = null)
{
return $this->connector->send(new GetAddress($addressId))->json();
}
}

0 comments on commit 5bb4a8b

Please sign in to comment.