Skip to content

Commit

Permalink
First Version
Browse files Browse the repository at this point in the history
  • Loading branch information
zerossB committed Aug 19, 2024
1 parent 60792c4 commit 657a50e
Show file tree
Hide file tree
Showing 34 changed files with 1,154 additions and 12 deletions.
20 changes: 20 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->exclude('bootstrap')
->exclude('storage')
->in(__DIR__);

$config = new Config();
$config->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short']
])
->setLineEnding("\n")
->setFinder($finder);

return $config;
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": {
"php": "^8.0|^8.1",
"illuminate/contracts": "^8.0|^9.0|^10.0|^11.0",
"bildvitta/sp-produto": "^1.0",
"bildvitta/sp-produto": "^0.1",
"spatie/laravel-package-tools": "^1.9.2"
},
"require-dev": {
Expand Down
10 changes: 9 additions & 1 deletion config/iss-vendas.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@

'front_uri' => env('MS_VENDAS_FRONT_URI', 'https://develop.vendas.nave.dev'),

'prefix' => env('MS_VENDAS_API_PREFIX', '/api')
'prefix' => env('MS_VENDAS_API_PREFIX', '/api'),

'db' => [
'host' => env('MS_VENDAS_DB_HOST'),
'port' => env('MS_VENDAS_DB_PORT'),
'database' => env('MS_VENDAS_DB_DATABASE'),
'username' => env('MS_VENDAS_DB_USERNAME'),
'password' => env('MS_VENDAS_DB_PASSWORD'),
],
];
3 changes: 3 additions & 0 deletions src/Contracts/IssVendasFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ interface IssVendasFactory
*/
public const DEFAULT_OPTIONS = ['allow_redirects' => false];

/**
* @return Sale
*/
public function sale(): Sale;
}
2 changes: 1 addition & 1 deletion src/Contracts/Resources/Programmatic/CustomerContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ interface CustomerContract
/**
* @const string
*/
public const ENDPOINT_FIND_BY_UUID = self::ENDPOINT_PREFIX.'/%s';
public const ENDPOINT_FIND_BY_UUID = self::ENDPOINT_PREFIX . '/%s';
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ interface RealEstateDevelopmentContract
/**
* @const string
*/
public const ENDPOINT_FIND_BY_UUID = self::ENDPOINT_PREFIX.'/%s';
public const ENDPOINT_FIND_BY_UUID = self::ENDPOINT_PREFIX . '/%s';
}
11 changes: 11 additions & 0 deletions src/Contracts/Resources/Programmatic/SaleContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ interface SaleContract
*/
public const ENDPOINT_UPDATE = self::ENDPOINT_PREFIX.'/%s';

/**
* @param string $uuid
*
* @return object
*/
public function find(string $uuid): object;

/**
* @param string $uuid
* @param array $data
*
* @return object
*/
public function update(string $uuid, array $data): object;
}
6 changes: 6 additions & 0 deletions src/Contracts/Resources/Programmatic/SaleFactContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ interface SaleFactContract
*/
public const ENDPOINT_PREFIX = '/programmatic/sales/%s/facts';


/**
* @param string $sale_uuid
* @param array $data
*
* @return object
*
* @throws RequestException
*/
public function create(string $sale_uuid, array $data): object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,31 @@ interface SalePersonalizationContract
*/
public const ENDPOINT_DELETE = '/programmatic/sales/personalizations/%s';


/**
* @param array $data
*
* @return object
*
* @throws RequestException
*/
public function create(array $data): object;

/**
* @param string $uuid
* @param array $data
*
* @return object
*
* @throws RequestException
*/
public function update(string $uuid, array $data): object;

/**
* @param string $uuid
*
* @return object
*
* @throws RequestException
*/
public function delete(string $uuid): object;
Expand Down
7 changes: 6 additions & 1 deletion src/Contracts/Resources/Programmatic/SaleStepContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ interface SaleStepContract
/**
* @const string
*/
public const ENDPOINT_FIND_BY_UUID = self::ENDPOINT_PREFIX.'/%s';
public const ENDPOINT_FIND_BY_UUID = self::ENDPOINT_PREFIX . '/%s';

/**
* @param string $uuid
*
* @return object
*/
public function find(string $uuid): object;

public function search(array $query = [], array $body = []): object;
Expand Down
11 changes: 11 additions & 0 deletions src/Contracts/Resources/Programmatic/UnitContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ interface UnitContract
*/
public const ENDPOINT_UPDATE = '/programmatic/produto/units/%s';

/**
* @param string $uuid
*
* @return object
*/
public function find(string $uuid): object;

/**
* @param string $uuid
* @param array $data
*
* @return object
*/
public function update(string $uuid, array $data): object;
}
5 changes: 5 additions & 0 deletions src/Contracts/Resources/SaleContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ interface SaleContract
*/
public const ENDPOINT_FIND_BY_UUID = self::ENDPOINT_PREFIX.'/%s';

/**
* @param string $uuid
*
* @return object
*/
public function find(string $uuid): object;
}
6 changes: 6 additions & 0 deletions src/IssVendas.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,17 @@ public function getHeaders()
);
}

/**
* @return Sale
*/
public function sale(): Sale
{
return new Sale($this);
}

/**
* @return Programmatic
*/
public function programmatic(): Programmatic
{
return new Programmatic($this);
Expand Down
3 changes: 3 additions & 0 deletions src/IssVendasServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

class IssVendasServiceProvider extends PackageServiceProvider
{
/**
* @param Package $package
*/
public function configurePackage(Package $package): void
{
/*
Expand Down
Loading

0 comments on commit 657a50e

Please sign in to comment.