Skip to content

Commit

Permalink
Support financial api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
vixducis committed Oct 27, 2024
1 parent 84c5cc1 commit c783761
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ToolboxClient/Directories/Financieel/FinancieelDirectory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Koba\ToolboxClient\Directories\Financieel;

use Koba\ToolboxClient\Directories\Financieel\GetOverTeZetten\GetOverteZettenCall;
use Koba\ToolboxClient\Directory\Directory;

class FinancieelDirectory extends Directory
{
public function getOverTeZetten(): GetOverteZettenCall
{
return GetOverteZettenCall::make($this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Koba\ToolboxClient\Directories\Financieel\GetOverTeZetten;

use Koba\ToolboxClient\Call\AbstractCall;
use Koba\ToolboxClient\Call\ResponseProcessor;
use Koba\ToolboxClient\Directories\Financieel\FinancieelDirectory;
use Koba\ToolboxClient\Request\HttpMethod;

class GetOverteZettenCall extends AbstractCall
{
public static function make(FinancieelDirectory $directory): self
{
return new self($directory);
}

protected function getMethod(): HttpMethod
{
return HttpMethod::GET;
}

protected function getEndpoint(): string
{
return "v1/financieel/overtezetten";
}

public function send(): OverTeZettenResponse
{
return ResponseProcessor::mapClass(
$this->performRequest(),
OverTeZettenResponse::class
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Koba\ToolboxClient\Directories\Financieel\GetOverTeZetten;

class OverTeZettenResponse
{
public int $aantal_leerlingenrekeningen;
public int $aantal_personeelsrekeningen;
public int $aantal_webshopbestellingen;
public int $aantal_kasverrichtingen;
public int $aantal_dienstverplaatsingen;
public int $aantal_terugbetalingen;
}
1 change: 1 addition & 0 deletions src/ToolboxClient/Scopes/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ enum Scope: string
case LERAREN = 'leraren';
case LEERLINGEN = 'leerlingen';
case GEBRUIKERSBEHEER = 'gebruikersbeheer';
case FINANCIEEL_OVERTEZETTEN = 'financieel.overtezetten';
}
6 changes: 6 additions & 0 deletions src/ToolboxClient/ToolboxClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Koba\ToolboxClient\AccessToken\AccessTokenStrategyInterface;
use Koba\ToolboxClient\Directories\Contactpersonen\ContactpersonenDirectory;
use Koba\ToolboxClient\Directories\Financieel\FinancieelDirectory;
use Koba\ToolboxClient\Directories\Gebruikersbeheer\GebruikersbeheerDirectory;
use Koba\ToolboxClient\Directories\Instellingsnummers\InstellingsnummersDirectory;
use Koba\ToolboxClient\Directories\Inventaris\InventarisDirectory;
Expand Down Expand Up @@ -75,4 +76,9 @@ public function gebruikersbeheer(): GebruikersbeheerDirectory
{
return new GebruikersbeheerDirectory($this->requestFactory);
}

public function financieel(): FinancieelDirectory
{
return new FinancieelDirectory($this->requestFactory);
}
}

0 comments on commit c783761

Please sign in to comment.