This file contains hidden or 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
{ | |
"list_transactions": [ | |
{ | |
"summary": { | |
"type_register": 1, | |
"order_id": "e6c81f1c-215e-4c78-8d4f-78da3fb9ec40", | |
"seller_id": "f7cc48df-2988-49b3-ba94-c6e14c9dffe5", | |
"marketplace_subsellerid": "700088243", | |
"merchand_id": "52136487", | |
"cnpj_marketplace": "49798493000146", |
This file contains hidden or 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
{ | |
"name": "crewhu-api", | |
"description": "CrewHu REST API", | |
"version": "0.0.1", | |
"private": true, | |
"scripts": { | |
"start": "npm run build && node dist/index.js", | |
"dev": "ts-node-dev --respawn --transpile-only src/index.ts", | |
"build": "rm -rf ./dist/* && tsc -p tsconfig-build.json", | |
"test": "mocha --reporter spec test", |
This file contains hidden or 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
<?php | |
abstract class ControllerBase | |
{ | |
// Coloquei para retornar um array só como exemplo, mas isso fica a critério =) | |
public abstract function execute(): array; | |
// Aqui eu uso o __invoke pq eu sempre faço um Controller por Use case, mas isso | |
// também pode ficar a critério do dev =) | |
public function __invoke(Request $request, Response $response, array $args): Response |
This file contains hidden or 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
{ | |
"subseller_id": 700095056, | |
"subsellerid_ext": null, | |
"legal_document_number": 22502755808, | |
"fiscal_type": "natural_person", | |
"enabled": "N", | |
"status": "Em Análise", | |
"payment_plan": 3, | |
"capture_payments_enabled": "N", | |
"anticipation_enabled": "N", |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> | |
<meta name="csrf-token" content="BXaKqDgOP35F78SttLZa9yXBImlldANBQWVLZVNF"> | |
<title>Avaliações Cultivar</title> |
This file contains hidden or 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
<?php | |
// Eu já consegui com essa configuração de rotas fazer com que seja esse path | |
// seja mapeado para o `ApproveProviderController` | |
return [ | |
'controllerMap' => [ | |
'approve-provider' => ApproveProviderController::class | |
], | |
'routes' => [ |
This file contains hidden or 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
<?php | |
// Infra/Repository/Adapters/ProviderAdapter.php | |
final class ProviderAdapter | |
{ | |
public static function adapt(User $record): Provider | |
{ | |
$address = new Address( | |
$record->logradouro, |
This file contains hidden or 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
<?php | |
return [ | |
'merchant_id' => '52136487', | |
'legal_document_number' => 25456363046, | |
'legal_name' => 'xpto ltda', | |
'birth_date' => '2021-04-23T20:13:17Z', | |
'mothers_name' => 'Maria da Silva', | |
'occupation' => 'string', | |
'business_address' => [ |
This file contains hidden or 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
<?php | |
declare(strict_types=1); | |
namespace App\Shared\Application; | |
use App\Shared\Application\Contracts\UseCaseBoundary; | |
use InvalidArgumentException; | |
/** |
This file contains hidden or 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
<?php | |
// Esse é um dos tipos de validações, coloquei só ele para não inflar aqui o gist | |
declare(strict_types=1); | |
namespace App\Shared\Infra\Validation\Validators; | |
use App\Shared\Infra\Validation\Contracts\FieldValidator; | |
use App\Shared\Infra\Validation\Exceptions\ValidationFieldException; |