-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a457aae
commit fa74803
Showing
14 changed files
with
194 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/Entities/ContasPagar/Schema/@shared/ContasPagarOcorrenciaDTO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace AleBatistella\BlingErpApi\Entities\ContasPagar\Schema\Shared; | ||
|
||
use AleBatistella\BlingErpApi\Entities\Shared\BaseResponseObject; | ||
use AleBatistella\BlingErpApi\Exceptions\BlingParseResponsePayloadException; | ||
|
||
readonly class ContasPagarOcorrenciaDTO extends BaseResponseObject | ||
{ | ||
/** | ||
* Constrói o objeto. | ||
* | ||
* @param int $tipo | ||
* @param ?bool $considerarDiasUteis | ||
* @param int $diaVencimento | ||
* @param ?string $dataLimite | ||
*/ | ||
public function __construct( | ||
public int $tipo, | ||
public ?bool $considerarDiasUteis, | ||
public int $diaVencimento, | ||
public ?string $dataLimite | ||
) {} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function from(array $attributes): static | ||
{ | ||
$allowedTypes = [3, 4, 5, 6, 7, 8]; | ||
if (!array_key_exists('tipo', $attributes) || !in_array($attributes['tipo'], $allowedTypes)) { | ||
throw new BlingParseResponsePayloadException($attributes); | ||
} | ||
|
||
return parent::from($attributes); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Entities/ContasPagar/Schema/@shared/ContasPagarOcorrenciaParceladaDTO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace AleBatistella\BlingErpApi\Entities\ContasPagar\Schema\Shared; | ||
|
||
use AleBatistella\BlingErpApi\Entities\Shared\BaseResponseObject; | ||
use AleBatistella\BlingErpApi\Exceptions\BlingParseResponsePayloadException; | ||
|
||
readonly class ContasPagarOcorrenciaParceladaDTO extends BaseResponseObject | ||
{ | ||
/** | ||
* Constrói o objeto. | ||
* | ||
* @param int $tipo | ||
* @param ?bool $considerarDiasUteis | ||
* @param int $diaVencimento | ||
* @param ?int $numeroParcelas | ||
*/ | ||
public function __construct( | ||
public int $tipo, | ||
public ?bool $considerarDiasUteis, | ||
public int $diaVencimento, | ||
public ?int $numeroParcelas | ||
) {} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function from(array $attributes): static | ||
{ | ||
if (!array_key_exists('tipo', $attributes) || $attributes['tipo'] !== 2) { | ||
throw new BlingParseResponsePayloadException($attributes); | ||
} | ||
|
||
return parent::from($attributes); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Entities/ContasPagar/Schema/@shared/ContasPagarOcorrenciaSemanalDTO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace AleBatistella\BlingErpApi\Entities\ContasPagar\Schema\Shared; | ||
|
||
use AleBatistella\BlingErpApi\Entities\Shared\BaseResponseObject; | ||
use AleBatistella\BlingErpApi\Exceptions\BlingParseResponsePayloadException; | ||
|
||
readonly class ContasPagarOcorrenciaSemanalDTO extends BaseResponseObject | ||
{ | ||
/** | ||
* Constrói o objeto. | ||
* | ||
* @param int $tipo | ||
* @param ?bool $considerarDiasUteis | ||
* @param int $diaSemanaVencimento | ||
* @param ?string $dataLimite | ||
*/ | ||
public function __construct( | ||
public int $tipo, | ||
public ?bool $considerarDiasUteis, | ||
public int $diaSemanaVencimento, | ||
public ?string $dataLimite | ||
) {} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function from(array $attributes): static | ||
{ | ||
if (!array_key_exists('tipo', $attributes) || $attributes['tipo'] !== 9) { | ||
throw new BlingParseResponsePayloadException($attributes); | ||
} | ||
|
||
return parent::from($attributes); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/Entities/ContasPagar/Schema/@shared/ContasPagarOcorrenciaUnicaDTO.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace AleBatistella\BlingErpApi\Entities\ContasPagar\Schema\Shared; | ||
|
||
use AleBatistella\BlingErpApi\Entities\Shared\BaseResponseObject; | ||
use AleBatistella\BlingErpApi\Exceptions\BlingParseResponsePayloadException; | ||
|
||
readonly class ContasPagarOcorrenciaUnicaDTO extends BaseResponseObject | ||
{ | ||
/** | ||
* Constrói o objeto. | ||
* | ||
* @param int $tipo | ||
*/ | ||
public function __construct( | ||
public int $tipo | ||
) {} | ||
|
||
/** | ||
* @inheritDoc | ||
*/ | ||
public static function from(array $attributes): static | ||
{ | ||
if (!array_key_exists('tipo', $attributes) || $attributes['tipo'] !== 1) { | ||
throw new BlingParseResponsePayloadException($attributes); | ||
} | ||
|
||
return parent::from($attributes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ | |
}, | ||
"borderos": [ | ||
0 | ||
] | ||
], | ||
"ocorrencia": { | ||
"tipo": 1 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,8 @@ | |
"tipoPagamento": 1, | ||
"situacao": 1, | ||
"fixa": false, | ||
"padrao": 0 | ||
"padrao": 0, | ||
"finalidade": 1 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters