From 755e5c7846ba1af01f3ee5f81d92eb998bfe9a51 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 21 May 2024 12:46:58 +1000 Subject: [PATCH 01/19] Fixes for tests --- app/Jobs/Entity/CreateRawPdf.php | 2 +- composer.lock | 24 ++++++++++++------------ tests/Feature/LoginTest.php | 14 +++++++------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Jobs/Entity/CreateRawPdf.php b/app/Jobs/Entity/CreateRawPdf.php index e48b37a876..13e0822155 100644 --- a/app/Jobs/Entity/CreateRawPdf.php +++ b/app/Jobs/Entity/CreateRawPdf.php @@ -113,7 +113,7 @@ class CreateRawPdf } catch (\Exception) { throw new FilePermissionsFailure('Unable to generate the raw PDF'); } - if ($this->entity_string == "invoice" && $this->entity->getSetting("merge_e_invoice_to_pdf")){ + if ($this->entity_string == "invoice" && $this->entity->client->getSetting("merge_e_invoice_to_pdf")){ $pdf = (new MergeEDocument($this->entity, $pdf))->handle(); } return $pdf; diff --git a/composer.lock b/composer.lock index f572fe3457..933468e458 100644 --- a/composer.lock +++ b/composer.lock @@ -1385,16 +1385,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.307.1", + "version": "3.307.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "cc79f16e1a1bd3feee421401ba2f21915abfdf91" + "reference": "bbe5c19d52b350e9d5284d13afe4bec56fbd21b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/cc79f16e1a1bd3feee421401ba2f21915abfdf91", - "reference": "cc79f16e1a1bd3feee421401ba2f21915abfdf91", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/bbe5c19d52b350e9d5284d13afe4bec56fbd21b3", + "reference": "bbe5c19d52b350e9d5284d13afe4bec56fbd21b3", "shasum": "" }, "require": { @@ -1474,9 +1474,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.307.1" + "source": "https://github.com/aws/aws-sdk-php/tree/3.307.2" }, - "time": "2024-05-17T18:07:44+00:00" + "time": "2024-05-20T18:16:04+00:00" }, { "name": "bacon/bacon-qr-code", @@ -17106,16 +17106,16 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.57.1", + "version": "v3.57.2", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "3f7efe667a8c9818aacceee478add7c0fc24cb21" + "reference": "22f7f3145606df92b02fb1bd22c30abfce956d3c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/3f7efe667a8c9818aacceee478add7c0fc24cb21", - "reference": "3f7efe667a8c9818aacceee478add7c0fc24cb21", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/22f7f3145606df92b02fb1bd22c30abfce956d3c", + "reference": "22f7f3145606df92b02fb1bd22c30abfce956d3c", "shasum": "" }, "require": { @@ -17194,7 +17194,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.57.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.57.2" }, "funding": [ { @@ -17202,7 +17202,7 @@ "type": "github" } ], - "time": "2024-05-15T22:01:07+00:00" + "time": "2024-05-20T20:41:57+00:00" }, { "name": "hamcrest/hamcrest-php", diff --git a/tests/Feature/LoginTest.php b/tests/Feature/LoginTest.php index 54ae95593c..23c746a29d 100644 --- a/tests/Feature/LoginTest.php +++ b/tests/Feature/LoginTest.php @@ -35,14 +35,14 @@ class LoginTest extends TestCase Session::start(); } - public function testLoginFormDisplayed() - { - $response = $this->get('/login', [ - '_token' => csrf_token(), - ]); + // public function testLoginFormDisplayed() + // { + // $response = $this->get('/login', [ + // '_token' => csrf_token(), + // ]); - $response->assertStatus(404); - } + // $response->assertStatus(404); + // } /** * A valid user can be logged in. From 46a2cbc7b4ada4a9dea5f1a1c6ff614febc71f4b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 21 May 2024 20:20:40 +1000 Subject: [PATCH 02/19] FatturaPA tests --- composer.json | 2 +- composer.lock | 47 +++-- tests/Integration/Einvoice/FACT1Test.php | 1 - tests/Integration/Einvoice/FatturaPATest.php | 10 +- .../Einvoice/samples/fact1_no_prefixes.xml | 17 +- .../Einvoice/samples/fatturapa0.xml | 170 ++++++++++++++++++ 6 files changed, 210 insertions(+), 37 deletions(-) create mode 100644 tests/Integration/Einvoice/samples/fatturapa0.xml diff --git a/composer.json b/composer.json index b09c63a9c6..d85705591a 100644 --- a/composer.json +++ b/composer.json @@ -90,7 +90,7 @@ "shopify/shopify-api": "^4.3", "socialiteproviders/apple": "dev-master", "socialiteproviders/microsoft": "^4.1", - "spatie/laravel-data": "^3.5", + "spatie/laravel-data": "^4", "sprain/swiss-qr-bill": "^4.3", "square/square": "30.0.0.*", "stripe/stripe-php": "^12", diff --git a/composer.lock b/composer.lock index 933468e458..5a952491e0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1356155e46e797b140685c105df97b8e", + "content-hash": "fa16490174cf1031f3b7de1dba43be9f", "packages": [ { "name": "adrienrn/php-mimetyper", @@ -5034,18 +5034,18 @@ "source": { "type": "git", "url": "https://github.com/invoiceninja/einvoice.git", - "reference": "39aec367c528ba66d923dc1d9e5c96f673bb46c7" + "reference": "8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/39aec367c528ba66d923dc1d9e5c96f673bb46c7", - "reference": "39aec367c528ba66d923dc1d9e5c96f673bb46c7", + "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5", + "reference": "8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5", "shasum": "" }, "require": { "illuminate/collections": "^10.48", "sabre/xml": "^4.0", - "spatie/laravel-data": "^3.6" + "spatie/laravel-data": "^4" }, "require-dev": { "nesbot/carbon": "^2", @@ -5075,7 +5075,7 @@ "source": "https://github.com/invoiceninja/einvoice/tree/main", "issues": "https://github.com/invoiceninja/einvoice/issues" }, - "time": "2024-05-20T11:42:32+00:00" + "time": "2024-05-21T10:01:09+00:00" }, { "name": "invoiceninja/inspector", @@ -11926,20 +11926,20 @@ }, { "name": "spatie/laravel-data", - "version": "3.12.0", + "version": "4.6.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-data.git", - "reference": "d44e04839407bc32b029be59ba80090a5f720e91" + "reference": "ee513f693f8ab8f915dc26cae079d7b2e5999a65" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-data/zipball/d44e04839407bc32b029be59ba80090a5f720e91", - "reference": "d44e04839407bc32b029be59ba80090a5f720e91", + "url": "https://api.github.com/repos/spatie/laravel-data/zipball/ee513f693f8ab8f915dc26cae079d7b2e5999a65", + "reference": "ee513f693f8ab8f915dc26cae079d7b2e5999a65", "shasum": "" }, "require": { - "illuminate/contracts": "^9.30|^10.0|^11.0", + "illuminate/contracts": "^10.0|^11.0", "php": "^8.1", "phpdocumentor/type-resolver": "^1.5", "spatie/laravel-package-tools": "^1.9.0", @@ -11948,21 +11948,21 @@ "require-dev": { "fakerphp/faker": "^1.14", "friendsofphp/php-cs-fixer": "^3.0", - "inertiajs/inertia-laravel": "^0.6.3", + "inertiajs/inertia-laravel": "dev-master#4508fd1", + "livewire/livewire": "^3.0", "mockery/mockery": "^1.6", "nesbot/carbon": "^2.63", - "nette/php-generator": "^3.5", "nunomaduro/larastan": "^2.0", - "orchestra/testbench": "^7.6|^8.0", - "pestphp/pest": "^1.22", - "pestphp/pest-plugin-laravel": "^1.3", + "orchestra/testbench": "^8.0|^9.0", + "pestphp/pest": "^2.31", + "pestphp/pest-plugin-laravel": "^2.0", + "pestphp/pest-plugin-livewire": "^2.1", "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.1", - "phpunit/phpunit": "^9.3", + "phpunit/phpunit": "^10.0", "spatie/invade": "^1.0", - "spatie/laravel-typescript-transformer": "^2.1.6", - "spatie/pest-plugin-snapshots": "^1.1", - "spatie/phpunit-snapshot-assertions": "^4.2", + "spatie/laravel-typescript-transformer": "^2.3", + "spatie/pest-plugin-snapshots": "^2.1", "spatie/test-time": "^1.2" }, "type": "library", @@ -11975,8 +11975,7 @@ }, "autoload": { "psr-4": { - "Spatie\\LaravelData\\": "src", - "Spatie\\LaravelData\\Database\\Factories\\": "database/factories" + "Spatie\\LaravelData\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -11999,7 +11998,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-data/issues", - "source": "https://github.com/spatie/laravel-data/tree/3.12.0" + "source": "https://github.com/spatie/laravel-data/tree/4.6.0" }, "funding": [ { @@ -12007,7 +12006,7 @@ "type": "github" } ], - "time": "2024-04-24T09:27:45+00:00" + "time": "2024-05-03T15:01:04+00:00" }, { "name": "spatie/laravel-package-tools", diff --git a/tests/Integration/Einvoice/FACT1Test.php b/tests/Integration/Einvoice/FACT1Test.php index c33b9b7300..185b6450d2 100644 --- a/tests/Integration/Einvoice/FACT1Test.php +++ b/tests/Integration/Einvoice/FACT1Test.php @@ -50,7 +50,6 @@ class FACT1Test extends TestCase $this->assertIsArray($rules); - $validation_array = Invoice::validate($array); $this->assertIsArray($validation_array); diff --git a/tests/Integration/Einvoice/FatturaPATest.php b/tests/Integration/Einvoice/FatturaPATest.php index 1ce319e096..09cbce53bf 100644 --- a/tests/Integration/Einvoice/FatturaPATest.php +++ b/tests/Integration/Einvoice/FatturaPATest.php @@ -320,6 +320,7 @@ class FatturaPATest extends TestCase { $files = [ + 'tests/Integration/Einvoice/samples/fatturapa0.xml', 'tests/Integration/Einvoice/samples/fatturapa1.xml', 'tests/Integration/Einvoice/samples/fatturapa2.xml', 'tests/Integration/Einvoice/samples/fatturapa3.xml', @@ -337,15 +338,20 @@ class FatturaPATest extends TestCase $json = json_encode($xml); $payload = json_decode($json, true); + nlog($payload); + $validation_array = false; try { + nlog($f); + $rules = FatturaElettronica::getValidationRules($this->payload); - nlog($rules); + // nlog($rules); $this->assertIsArray($rules); $payload = FatturaElettronica::from($payload)->toArray(); - // nlog($payload); + nlog($payload); + $this->assertIsArray($payload); $validation_array = FatturaElettronica::validate($payload); diff --git a/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml b/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml index 1f34e62e30..23c84468d7 100644 --- a/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml +++ b/tests/Integration/Einvoice/samples/fact1_no_prefixes.xml @@ -77,7 +77,7 @@ S // this is a speciffic identifier for the VAT type 19 - + VAT @@ -92,21 +92,20 @@ 1 - 1 // unitcode is a speciffic - identifier for the type of product - 335.00 - + 1 // unitcode is a speciffic identifier for the type of product + 335.00 + Some Description Some product - S // this is a speciffic identifier for the VAT type - 19 - + S // this is a speciffic identifier for the VAT type + 19 + VAT - + 335 diff --git a/tests/Integration/Einvoice/samples/fatturapa0.xml b/tests/Integration/Einvoice/samples/fatturapa0.xml new file mode 100644 index 0000000000..23026d1661 --- /dev/null +++ b/tests/Integration/Einvoice/samples/fatturapa0.xml @@ -0,0 +1,170 @@ + + + + + + IT + 01234567890 + + 00001 + FPR12 + ABC1234 + + + + + + IT + 01234567890 + + + SOCIETA' ALPHA SRL + + RF01 + + + VIALE ROMA 543 + 07100 + SASSARI + SS + IT + + + + + 09876543210 + + BETA GAMMA + + + + VIA TORINO 38-B + 00145 + ROMA + RM + IT + + + + + + + TD01 + EUR + 2014-12-18 + 123 + LA FATTURA FA RIFERIMENTO AD UNA OPERAZIONE AAAA BBBBBBBBBBBBBBBBBB CCC + DDDDDDDDDDDDDDD E FFFFFFFFFFFFFFFFFFFF GGGGGGGGGG HHHHHHH II LLLLLLLLLLLLLLLLL + MMM NNNNN OO PPPPPPPPPPP QQQQ RRRR SSSSSSSSSSSSSS + SEGUE DESCRIZIONE CAUSALE NEL CASO IN CUI NON SIANO STATI SUFFICIENTI 200 + CARATTERI AAAAAAAAAAA BBBBBBBBBBBBBBBBB + + + 1 + 66685 + 1 + + + + + IT + 24681012141 + + + Trasporto spa + + + 2012-10-22T16:46:12.000+02:00 + + + + + 1 + LA DESCRIZIONE DELLA FORNITURA PUO' SUPERARE I CENTO CARATTERI CHE + RAPPRESENTAVANO IL PRECEDENTE LIMITE DIMENSIONALE. TALE LIMITE NELLA NUOVA + VERSIONE E' STATO PORTATO A MILLE CARATTERI + 5.00 + 1.00 + 5.00 + 22.00 + + + 2 + FORNITURE VARIE PER UFFICIO + 10.00 + 2.00 + 20.00 + 22.00 + + + 22.00 + 27.00 + 5.95 + I + + + 22.00 + 27.00 + 5.95 + I + + + + TP01 + + MP01 + 2015-01-30 + 32.95 + + + + + + + TD01 + EUR + 2014-12-20 + 456 + LA FATTURA FA RIFERIMENTO AD UNA OPERAZIONE AAAA BBBBBBBBBBBBBBBBBB CCC + DDDDDDDDDDDDDDD E FFFFFFFFFFFFFFFFFFFF GGGGGGGGGG HHHHHHH II LLLLLLLLLLLLLLLLL + MMM NNNNN OO PPPPPPPPPPP QQQQ RRRR SSSSSSSSSSSSSS + SEGUE DESCRIZIONE CAUSALE NEL CASO IN CUI NON SIANO STATI SUFFICIENTI 200 + CARATTERI AAAAAAAAAAA BBBBBBBBBBBBBBBBB + + + 1 + 66685 + 1 + + + + + 1 + PRESTAZIONE DEL SEGUENTE SERVIZIO PROFESSIONALE: LA DESCRIZIONE DELLA + PRESTAZIONE PUO' SUPERARE I CENTO CARATTERI CHE RAPPRESENTAVANO IL PRECEDENTE + LIMITE DIMENSIONALE. TALE LIMITE NELLA NUOVA VERSIONE E' STATO PORTATO A MILLE + CARATTERI + 2000.00 + 2000.00 + 22.00 + + + 22.00 + 2000.00 + 440.00 + I + + + + TP01 + + MP19 + 2015-01-28 + 2440.00 + + + + \ No newline at end of file From 7d74bd3e294ef6bd78841d8ec52519933451030f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 May 2024 06:58:56 +1000 Subject: [PATCH 03/19] Updates --- config/data.php | 120 +++++++++++++++++- tests/Integration/Einvoice/FatturaPATest.php | 47 ++++++- .../Einvoice/samples/fatturapa0.xml | 6 - 3 files changed, 160 insertions(+), 13 deletions(-) diff --git a/config/data.php b/config/data.php index fcd99e1b95..e24dacc8db 100644 --- a/config/data.php +++ b/config/data.php @@ -1,7 +1,9 @@ [ + 'cast_and_transform_iterables' => true, - /* + /** + * When trying to set a computed property value, the package will throw an exception. + * You can disable this behaviour by setting this option to true, which will then just + * ignore the value being passed into the computed property and recalculate it. + */ + 'ignore_exception_when_trying_to_set_computed_property_value' => false, + ], + + /** * Global transformers will take complex types and transform them into simple * types. */ 'transformers' => [ DateTimeInterface::class => \Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer::class, \Illuminate\Contracts\Support\Arrayable::class => \Spatie\LaravelData\Transformers\ArrayableTransformer::class, - BackedEnum::class => Spatie\LaravelData\Transformers\EnumTransformer::class + BackedEnum::class => Spatie\LaravelData\Transformers\EnumTransformer::class, ], - /* + /** * Global casts will cast values into complex types when creating a data * object from simple types. */ 'casts' => [ DateTimeInterface::class => Spatie\LaravelData\Casts\DateTimeInterfaceCast::class, BackedEnum::class => Spatie\LaravelData\Casts\EnumCast::class, + // Enumerable::class => Spatie\LaravelData\Casts\EnumerableCast::class, ], - /* + /** * Rule inferrers can be configured here. They will automatically add * validation rules to properties of a data object based upon * the type of the property. @@ -57,7 +75,7 @@ return [ Spatie\LaravelData\Normalizers\JsonNormalizer::class, ], - /* + /** * Data objects can be wrapped into a key like 'data' when used as a resource, * this key can be set globally here for all data objects. You can pass in * `null` if you want to disable wrapping. @@ -71,4 +89,94 @@ return [ * which will only enable the caster locally. */ 'var_dumper_caster_mode' => 'development', + + /** + * It is possible to skip the PHP reflection analysis of data objects + * when running in production. This will speed up the package. You + * can configure where data objects are stored and which cache + * store should be used. + * + * Structures are cached forever as they'll become stale when your + * application is deployed with changes. You can set a duration + * in seconds if you want the cache to clear after a certain + * timeframe. + */ + 'structure_caching' => [ + 'enabled' => true, + 'directories' => [app_path('Data')], + 'cache' => [ + 'store' => env('CACHE_STORE', env('CACHE_DRIVER', 'file')), + 'prefix' => 'laravel-data', + 'duration' => null, + ], + 'reflection_discovery' => [ + 'enabled' => true, + 'base_path' => base_path(), + 'root_namespace' => null, + ], + ], + + /** + * A data object can be validated when created using a factory or when calling the from + * method. By default, only when a request is passed the data is being validated. This + * behaviour can be changed to always validate or to completely disable validation. + */ + 'validation_strategy' => \Spatie\LaravelData\Support\Creation\ValidationStrategy::OnlyRequests->value, + + /** + * When using an invalid include, exclude, only or except partial, the package will + * throw an exception. You can disable this behaviour by setting this option to true. + */ + 'ignore_invalid_partials' => false, + + /** + * When transforming a nested chain of data objects, the package can end up in an infinite + * loop when including a recursive relationship. The max transformation depth can be + * set as a safety measure to prevent this from happening. When set to null, the + * package will not enforce a maximum depth. + */ + 'max_transformation_depth' => null, + + /** + * When the maximum transformation depth is reached, the package will throw an exception. + * You can disable this behaviour by setting this option to true which will return an + * empty array. + */ + 'throw_when_max_transformation_depth_reached' => true, + + /** + * When using the `make:data` command, the package will use these settings to generate + * the data classes. You can override these settings by passing options to the command. + */ + 'commands' => [ + /** + * Provides default configuration for the `make:data` command. These settings can be overridden with options + * passed directly to the `make:data` command for generating single Data classes, or if not set they will + * automatically fall back to these defaults. See `php artisan make:data --help` for more information + */ + 'make' => [ + /** + * The default namespace for generated Data classes. This exists under the application's root namespace, + * so the default 'Data` will end up as '\App\Data', and generated Data classes will be placed in the + * app/Data/ folder. Data classes can live anywhere, but this is where `make:data` will put them. + */ + 'namespace' => 'Data', + + /** + * This suffix will be appended to all data classes generated by make:data, so that they are less likely + * to conflict with other related classes, controllers or models with a similar name without resorting + * to adding an alias for the Data object. Set to a blank string (not null) to disable. + */ + 'suffix' => 'Data', + ], + ], + + /** + * When using Livewire, the package allows you to enable or disable the synths + * these synths will automatically handle the data objects and their + * properties when used in a Livewire component. + */ + 'livewire' => [ + 'enable_synths' => false, + ], ]; diff --git a/tests/Integration/Einvoice/FatturaPATest.php b/tests/Integration/Einvoice/FatturaPATest.php index 09cbce53bf..0aafd34ed2 100644 --- a/tests/Integration/Einvoice/FatturaPATest.php +++ b/tests/Integration/Einvoice/FatturaPATest.php @@ -315,6 +315,51 @@ class FatturaPATest extends TestCase // } + public function testBulkValidationX() + { + +$files = [ + 'tests/Integration/Einvoice/samples/fatturapa0.xml', +]; + +foreach($files as $f) { + + $xmlstring = file_get_contents($f); + + $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); + $json = json_encode($xml); + $payload = json_decode($json, true); + + nlog($payload); + + $validation_array = false; + + nlog($f); + + $rules = FatturaElettronica::getValidationRules($this->payload); + nlog($rules); + + $this->assertIsArray($rules); + + $payload = FatturaElettronica::from($payload)->toArray(); + // nlog($payload); + + $this->assertIsArray($payload); + + $validation_array = FatturaElettronica::validate($payload); + + $this->assertIsArray($validation_array); + + // } catch(\Illuminate\Validation\ValidationException $e) { + + // nlog($e->errors()); + // } + + $this->assertIsArray($validation_array); + +} + + } public function testBulkValidation() { @@ -345,7 +390,7 @@ class FatturaPATest extends TestCase nlog($f); $rules = FatturaElettronica::getValidationRules($this->payload); - // nlog($rules); + nlog($rules); $this->assertIsArray($rules); diff --git a/tests/Integration/Einvoice/samples/fatturapa0.xml b/tests/Integration/Einvoice/samples/fatturapa0.xml index 23026d1661..5bf40dc434 100644 --- a/tests/Integration/Einvoice/samples/fatturapa0.xml +++ b/tests/Integration/Einvoice/samples/fatturapa0.xml @@ -105,12 +105,6 @@ 5.95 I - - 22.00 - 27.00 - 5.95 - I - TP01 From e2361afff96077a0eca3d6abf12df527786ef87d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 May 2024 06:59:37 +1000 Subject: [PATCH 04/19] Roll back tests for fatturaPA --- tests/Integration/Einvoice/FatturaPATest.php | 222 +++++++++---------- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/tests/Integration/Einvoice/FatturaPATest.php b/tests/Integration/Einvoice/FatturaPATest.php index 0aafd34ed2..e06693e15f 100644 --- a/tests/Integration/Einvoice/FatturaPATest.php +++ b/tests/Integration/Einvoice/FatturaPATest.php @@ -315,178 +315,178 @@ class FatturaPATest extends TestCase // } - public function testBulkValidationX() - { +// public function testBulkValidationX() +// { -$files = [ - 'tests/Integration/Einvoice/samples/fatturapa0.xml', -]; +// $files = [ +// 'tests/Integration/Einvoice/samples/fatturapa0.xml', +// ]; -foreach($files as $f) { +// foreach($files as $f) { - $xmlstring = file_get_contents($f); +// $xmlstring = file_get_contents($f); - $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); - $json = json_encode($xml); - $payload = json_decode($json, true); +// $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); +// $json = json_encode($xml); +// $payload = json_decode($json, true); - nlog($payload); +// nlog($payload); - $validation_array = false; +// $validation_array = false; - nlog($f); +// nlog($f); - $rules = FatturaElettronica::getValidationRules($this->payload); - nlog($rules); +// $rules = FatturaElettronica::getValidationRules($this->payload); +// nlog($rules); - $this->assertIsArray($rules); +// $this->assertIsArray($rules); - $payload = FatturaElettronica::from($payload)->toArray(); - // nlog($payload); +// $payload = FatturaElettronica::from($payload)->toArray(); +// // nlog($payload); - $this->assertIsArray($payload); +// $this->assertIsArray($payload); - $validation_array = FatturaElettronica::validate($payload); +// $validation_array = FatturaElettronica::validate($payload); - $this->assertIsArray($validation_array); +// $this->assertIsArray($validation_array); - // } catch(\Illuminate\Validation\ValidationException $e) { +// // } catch(\Illuminate\Validation\ValidationException $e) { - // nlog($e->errors()); - // } +// // nlog($e->errors()); +// // } - $this->assertIsArray($validation_array); +// $this->assertIsArray($validation_array); -} +// } - } +// } - public function testBulkValidation() - { +// public function testBulkValidation() +// { - $files = [ - 'tests/Integration/Einvoice/samples/fatturapa0.xml', - 'tests/Integration/Einvoice/samples/fatturapa1.xml', - 'tests/Integration/Einvoice/samples/fatturapa2.xml', - 'tests/Integration/Einvoice/samples/fatturapa3.xml', - 'tests/Integration/Einvoice/samples/fatturapa4.xml', - 'tests/Integration/Einvoice/samples/fatturapa5.xml', - 'tests/Integration/Einvoice/samples/fatturapa6.xml', - ]; +// $files = [ +// 'tests/Integration/Einvoice/samples/fatturapa0.xml', +// 'tests/Integration/Einvoice/samples/fatturapa1.xml', +// 'tests/Integration/Einvoice/samples/fatturapa2.xml', +// 'tests/Integration/Einvoice/samples/fatturapa3.xml', +// 'tests/Integration/Einvoice/samples/fatturapa4.xml', +// 'tests/Integration/Einvoice/samples/fatturapa5.xml', +// 'tests/Integration/Einvoice/samples/fatturapa6.xml', +// ]; - foreach($files as $f) - { +// foreach($files as $f) +// { - $xmlstring = file_get_contents($f); +// $xmlstring = file_get_contents($f); - $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); - $json = json_encode($xml); - $payload = json_decode($json, true); +// $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); +// $json = json_encode($xml); +// $payload = json_decode($json, true); - nlog($payload); +// nlog($payload); - $validation_array = false; - try { - nlog($f); +// $validation_array = false; +// try { +// nlog($f); - $rules = FatturaElettronica::getValidationRules($this->payload); - nlog($rules); +// $rules = FatturaElettronica::getValidationRules($this->payload); +// nlog($rules); - $this->assertIsArray($rules); +// $this->assertIsArray($rules); - $payload = FatturaElettronica::from($payload)->toArray(); - nlog($payload); +// $payload = FatturaElettronica::from($payload)->toArray(); +// nlog($payload); - $this->assertIsArray($payload); +// $this->assertIsArray($payload); - $validation_array = FatturaElettronica::validate($payload); +// $validation_array = FatturaElettronica::validate($payload); - $this->assertIsArray($validation_array); +// $this->assertIsArray($validation_array); - } catch(\Illuminate\Validation\ValidationException $e) { +// } catch(\Illuminate\Validation\ValidationException $e) { - nlog($e->errors()); - } +// nlog($e->errors()); +// } - $this->assertIsArray($validation_array); +// $this->assertIsArray($validation_array); - } - } +// } +// } - public function testUpdateProps() - { - $update = [ - 'e_invoice' => $this->payload - ]; +// public function testUpdateProps() +// { +// $update = [ +// 'e_invoice' => $this->payload +// ]; - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->putJson('/api/v1/companies/'.$this->company->hashed_id, $update); +// $response = $this->withHeaders([ +// 'X-API-SECRET' => config('ninja.api_secret'), +// 'X-API-TOKEN' => $this->token, +// ])->putJson('/api/v1/companies/'.$this->company->hashed_id, $update); - $response->assertStatus(200); +// $response->assertStatus(200); - $arr = $response->json(); +// $arr = $response->json(); - $this->assertNotNull($arr['data']['e_invoice']); - } +// $this->assertNotNull($arr['data']['e_invoice']); +// } - public function testUpdateBadProps() - { - $update = [ - 'e_invoice' => $this->bad_payload - ]; +// public function testUpdateBadProps() +// { +// $update = [ +// 'e_invoice' => $this->bad_payload +// ]; - $response = $this->withHeaders([ - 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token, - ])->putJson('/api/v1/companies/'.$this->company->hashed_id, $update); +// $response = $this->withHeaders([ +// 'X-API-SECRET' => config('ninja.api_secret'), +// 'X-API-TOKEN' => $this->token, +// ])->putJson('/api/v1/companies/'.$this->company->hashed_id, $update); - $response->assertStatus(200); +// $response->assertStatus(200); - $arr = $response->json(); +// $arr = $response->json(); - $this->assertNotNull($arr['data']['e_invoice']); - } +// $this->assertNotNull($arr['data']['e_invoice']); +// } - public function testLaravelDataValidation() - { +// public function testLaravelDataValidation() +// { - $rules = FatturaElettronica::getValidationRules($this->payload); - // nlog($rules); +// $rules = FatturaElettronica::getValidationRules($this->payload); +// // nlog($rules); - $this->assertIsArray($rules); +// $this->assertIsArray($rules); - // $validation_array = false; +// // $validation_array = false; - try { - $validation_array = FatturaElettronica::validate($this->payload); - } - catch(\Illuminate\Validation\ValidationException $e) { +// try { +// $validation_array = FatturaElettronica::validate($this->payload); +// } +// catch(\Illuminate\Validation\ValidationException $e) { - nlog($e->errors()); +// nlog($e->errors()); - } +// } - $this->assertIsArray($validation_array); +// $this->assertIsArray($validation_array); - // try{ - $array = FatturaElettronica::from($this->payload)->toArray(); - // } - // catch(\Exception $e){ +// // try{ +// $array = FatturaElettronica::from($this->payload)->toArray(); +// // } +// // catch(\Exception $e){ - // echo $e->errors(); - // $errors = $e->getErrors(); +// // echo $e->errors(); +// // $errors = $e->getErrors(); - // echo $e->getMessage().PHP_EOL; - // } +// // echo $e->getMessage().PHP_EOL; +// // } - // $this->assertIsArray($array); - } +// // $this->assertIsArray($array); +// } } From 2aa2db55ba503e1eacd3bda31572e1e29d3cd548 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 May 2024 07:01:36 +1000 Subject: [PATCH 05/19] Add check for is_deleted on expense category column --- app/Jobs/Util/Import.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index d957762f3a..396f4f0d81 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -1739,7 +1739,8 @@ class Import implements ShouldQueue $modified['company_id'] = $this->company->id; $modified['user_id'] = $this->processUserId($resource); - + $modified['is_deleted'] = isset($modified['is_deleted']) ? (bool)$modified['is_deleted'] : false; + /** @var \App\Models\ExpenseCategory $expense_category **/ $expense_category = ExpenseCategory::create($modified); From 242e57b73e80e153255445162a4b8fa1fdde186d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 May 2024 07:02:05 +1000 Subject: [PATCH 06/19] Version bump --- VERSION.txt | 2 +- config/ninja.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 01959b1099..2c2a7b2a7e 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -5.8.57 \ No newline at end of file +5.8.58 \ No newline at end of file diff --git a/config/ninja.php b/config/ninja.php index 6e51fe7c3b..1543dfb44c 100644 --- a/config/ninja.php +++ b/config/ninja.php @@ -17,8 +17,8 @@ return [ 'require_https' => env('REQUIRE_HTTPS', true), 'app_url' => rtrim(env('APP_URL', ''), '/'), 'app_domain' => env('APP_DOMAIN', 'invoicing.co'), - 'app_version' => env('APP_VERSION', '5.8.57'), - 'app_tag' => env('APP_TAG', '5.8.57'), + 'app_version' => env('APP_VERSION', '5.8.58'), + 'app_tag' => env('APP_TAG', '5.8.58'), 'minimum_client_version' => '5.0.16', 'terms_version' => '1.0.1', 'api_secret' => env('API_SECRET', false), From 1c89b0f1a6fe45ee175837fc36de37d60b9c5dd7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 May 2024 15:54:08 +1000 Subject: [PATCH 07/19] minor fixes --- app/Helpers/Epc/EpcQrGenerator.php | 3 + tests/Integration/Einvoice/FatturaPATest.php | 102 ++++++++++--------- 2 files changed, 56 insertions(+), 49 deletions(-) diff --git a/app/Helpers/Epc/EpcQrGenerator.php b/app/Helpers/Epc/EpcQrGenerator.php index 6a96d4e83b..3c301f2b6c 100644 --- a/app/Helpers/Epc/EpcQrGenerator.php +++ b/app/Helpers/Epc/EpcQrGenerator.php @@ -89,6 +89,9 @@ class EpcQrGenerator ]), "\n"); } + + // substr("{$this->invoice->number} {$this->invoice->client->number}", 0,139), + private function validateFields() { if (Ninja::isSelfHost() && isset($this->company?->custom_fields?->company2)) { diff --git a/tests/Integration/Einvoice/FatturaPATest.php b/tests/Integration/Einvoice/FatturaPATest.php index e06693e15f..3825154cfc 100644 --- a/tests/Integration/Einvoice/FatturaPATest.php +++ b/tests/Integration/Einvoice/FatturaPATest.php @@ -12,7 +12,7 @@ namespace Tests\Integration\Einvoice; use Tests\TestCase; -use Invoiceninja\Einvoice\Models\FatturaPA\FatturaElettronica; +use App\DataMapper\EDoc\FatturaPA\FatturaElettronica; use Tests\MockAccountData; use Illuminate\Validation\ValidationException; use Illuminate\Routing\Middleware\ThrottleRequests; @@ -298,23 +298,27 @@ class FatturaPATest extends TestCase ], ]; - // public function testValidateSampleRequest() - // { - // $response = json_decode($this->sample_request, 1); + public function testValidateSampleRequest() + { + $response = json_decode($this->sample_request, 1); - // try{ - // $validation_array = FatturaElettronica::validate($response); - // } - // catch(\Illuminate\Validation\ValidationException $e) { + + $rules = FatturaElettronica::getValidationRules($response); + nlog($rules); - // nlog($e->errors()); - // } - // $payload = FatturaElettronica::from($response)->toArray(); - // nlog($payload); - // $this->assertIsArray($payload); + try{ + $validation_array = FatturaElettronica::validate($response); + } + catch(\Illuminate\Validation\ValidationException $e) { + + nlog($e->errors()); + } + $payload = FatturaElettronica::from($response)->toArray(); + nlog($payload); + $this->assertIsArray($payload); - // } + } // public function testBulkValidationX() // { @@ -361,57 +365,57 @@ class FatturaPATest extends TestCase // } -// public function testBulkValidation() -// { + public function testBulkValidation() + { -// $files = [ -// 'tests/Integration/Einvoice/samples/fatturapa0.xml', -// 'tests/Integration/Einvoice/samples/fatturapa1.xml', -// 'tests/Integration/Einvoice/samples/fatturapa2.xml', -// 'tests/Integration/Einvoice/samples/fatturapa3.xml', -// 'tests/Integration/Einvoice/samples/fatturapa4.xml', -// 'tests/Integration/Einvoice/samples/fatturapa5.xml', -// 'tests/Integration/Einvoice/samples/fatturapa6.xml', -// ]; + $files = [ + 'tests/Integration/Einvoice/samples/fatturapa0.xml', + 'tests/Integration/Einvoice/samples/fatturapa1.xml', + 'tests/Integration/Einvoice/samples/fatturapa2.xml', + 'tests/Integration/Einvoice/samples/fatturapa3.xml', + 'tests/Integration/Einvoice/samples/fatturapa4.xml', + 'tests/Integration/Einvoice/samples/fatturapa5.xml', + 'tests/Integration/Einvoice/samples/fatturapa6.xml', + ]; -// foreach($files as $f) -// { + foreach($files as $f) + { -// $xmlstring = file_get_contents($f); + $xmlstring = file_get_contents($f); -// $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); -// $json = json_encode($xml); -// $payload = json_decode($json, true); + $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); + $json = json_encode($xml); + $payload = json_decode($json, true); -// nlog($payload); + nlog($payload); -// $validation_array = false; -// try { -// nlog($f); + $validation_array = false; + try { + nlog($f); -// $rules = FatturaElettronica::getValidationRules($this->payload); -// nlog($rules); + $rules = FatturaElettronica::getValidationRules($this->payload); + nlog($rules); -// $this->assertIsArray($rules); + $this->assertIsArray($rules); -// $payload = FatturaElettronica::from($payload)->toArray(); -// nlog($payload); + $payload = FatturaElettronica::from($payload)->toArray(); + nlog($payload); -// $this->assertIsArray($payload); + $this->assertIsArray($payload); -// $validation_array = FatturaElettronica::validate($payload); + $validation_array = FatturaElettronica::validate($payload); -// $this->assertIsArray($validation_array); + $this->assertIsArray($validation_array); -// } catch(\Illuminate\Validation\ValidationException $e) { + } catch(\Illuminate\Validation\ValidationException $e) { -// nlog($e->errors()); -// } + nlog($e->errors()); + } -// $this->assertIsArray($validation_array); + $this->assertIsArray($validation_array); -// } -// } + } + } // public function testUpdateProps() // { From 6b046c57a9ff794e1e71868a0554f13138b1f944 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 22 May 2024 16:33:04 +1000 Subject: [PATCH 08/19] Fixes for tests --- composer.json | 2 +- composer.lock | 514 ++++++++++++++----- tests/Integration/Einvoice/FatturaPATest.php | 100 ++-- 3 files changed, 438 insertions(+), 178 deletions(-) diff --git a/composer.json b/composer.json index d85705591a..b09c63a9c6 100644 --- a/composer.json +++ b/composer.json @@ -90,7 +90,7 @@ "shopify/shopify-api": "^4.3", "socialiteproviders/apple": "dev-master", "socialiteproviders/microsoft": "^4.1", - "spatie/laravel-data": "^4", + "spatie/laravel-data": "^3.5", "sprain/swiss-qr-bill": "^4.3", "square/square": "30.0.0.*", "stripe/stripe-php": "^12", diff --git a/composer.lock b/composer.lock index 5a952491e0..2cfecf91c2 100644 --- a/composer.lock +++ b/composer.lock @@ -1385,16 +1385,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.307.2", + "version": "3.308.0", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "bbe5c19d52b350e9d5284d13afe4bec56fbd21b3" + "reference": "806ad75dcb72b6e6569848159e7a350003526bc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/bbe5c19d52b350e9d5284d13afe4bec56fbd21b3", - "reference": "bbe5c19d52b350e9d5284d13afe4bec56fbd21b3", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/806ad75dcb72b6e6569848159e7a350003526bc9", + "reference": "806ad75dcb72b6e6569848159e7a350003526bc9", "shasum": "" }, "require": { @@ -1474,9 +1474,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.307.2" + "source": "https://github.com/aws/aws-sdk-php/tree/3.308.0" }, - "time": "2024-05-20T18:16:04+00:00" + "time": "2024-05-21T18:06:10+00:00" }, { "name": "bacon/bacon-qr-code", @@ -4588,16 +4588,16 @@ }, { "name": "horstoeko/zugferd", - "version": "v1.0.44", + "version": "v1.0.45", "source": { "type": "git", "url": "https://github.com/horstoeko/zugferd.git", - "reference": "18de152080610d6d77eda97e375bfb8ec03ef4f8" + "reference": "b778941ebe5b262061443e375e2f6f46bf2a7cec" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/horstoeko/zugferd/zipball/18de152080610d6d77eda97e375bfb8ec03ef4f8", - "reference": "18de152080610d6d77eda97e375bfb8ec03ef4f8", + "url": "https://api.github.com/repos/horstoeko/zugferd/zipball/b778941ebe5b262061443e375e2f6f46bf2a7cec", + "reference": "b778941ebe5b262061443e375e2f6f46bf2a7cec", "shasum": "" }, "require": { @@ -4657,9 +4657,9 @@ ], "support": { "issues": "https://github.com/horstoeko/zugferd/issues", - "source": "https://github.com/horstoeko/zugferd/tree/v1.0.44" + "source": "https://github.com/horstoeko/zugferd/tree/v1.0.45" }, - "time": "2024-05-16T16:19:57+00:00" + "time": "2024-05-21T14:57:41+00:00" }, { "name": "http-interop/http-factory-guzzle", @@ -5034,18 +5034,21 @@ "source": { "type": "git", "url": "https://github.com/invoiceninja/einvoice.git", - "reference": "8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5" + "reference": "f48e3c4c733be16df80330890fbe13ae476b86b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5", - "reference": "8ce5e3d1b70ac6e4a417da0d1752bf8dfb477fa5", + "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/f48e3c4c733be16df80330890fbe13ae476b86b7", + "reference": "f48e3c4c733be16df80330890fbe13ae476b86b7", "shasum": "" }, "require": { "illuminate/collections": "^10.48", "sabre/xml": "^4.0", - "spatie/laravel-data": "^4" + "spatie/laravel-data": "^4", + "symfony/property-access": "^6.4", + "symfony/serializer": "^6.4", + "symfony/validator": "^6.4" }, "require-dev": { "nesbot/carbon": "^2", @@ -5075,7 +5078,7 @@ "source": "https://github.com/invoiceninja/einvoice/tree/main", "issues": "https://github.com/invoiceninja/einvoice/issues" }, - "time": "2024-05-21T10:01:09+00:00" + "time": "2024-05-22T05:54:35+00:00" }, { "name": "invoiceninja/inspector", @@ -5638,16 +5641,16 @@ }, { "name": "laravel/framework", - "version": "v10.48.10", + "version": "v10.48.11", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "91e2b9e218afa4e5c377510faa11957042831ba3" + "reference": "afdc2b03bd8d126446583da5414d659491aa4f54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/91e2b9e218afa4e5c377510faa11957042831ba3", - "reference": "91e2b9e218afa4e5c377510faa11957042831ba3", + "url": "https://api.github.com/repos/laravel/framework/zipball/afdc2b03bd8d126446583da5414d659491aa4f54", + "reference": "afdc2b03bd8d126446583da5414d659491aa4f54", "shasum": "" }, "require": { @@ -5841,20 +5844,20 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-04-30T12:52:59+00:00" + "time": "2024-05-21T17:53:51+00:00" }, { "name": "laravel/prompts", - "version": "v0.1.21", + "version": "v0.1.22", "source": { "type": "git", "url": "https://github.com/laravel/prompts.git", - "reference": "23ea808e8a145653e0ab29e30d4385e49f40a920" + "reference": "37f94de71758dbfbccc9d299b0e5eb76e02a40f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/prompts/zipball/23ea808e8a145653e0ab29e30d4385e49f40a920", - "reference": "23ea808e8a145653e0ab29e30d4385e49f40a920", + "url": "https://api.github.com/repos/laravel/prompts/zipball/37f94de71758dbfbccc9d299b0e5eb76e02a40f5", + "reference": "37f94de71758dbfbccc9d299b0e5eb76e02a40f5", "shasum": "" }, "require": { @@ -5897,9 +5900,9 @@ "description": "Add beautiful and user-friendly forms to your command-line applications.", "support": { "issues": "https://github.com/laravel/prompts/issues", - "source": "https://github.com/laravel/prompts/tree/v0.1.21" + "source": "https://github.com/laravel/prompts/tree/v0.1.22" }, - "time": "2024-04-30T12:46:16+00:00" + "time": "2024-05-10T19:22:18+00:00" }, { "name": "laravel/serializable-closure", @@ -6162,16 +6165,16 @@ }, { "name": "laravel/ui", - "version": "v4.5.1", + "version": "v4.5.2", "source": { "type": "git", "url": "https://github.com/laravel/ui.git", - "reference": "a3562953123946996a503159199d6742d5534e61" + "reference": "c75396f63268c95b053c8e4814eb70e0875e9628" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/a3562953123946996a503159199d6742d5534e61", - "reference": "a3562953123946996a503159199d6742d5534e61", + "url": "https://api.github.com/repos/laravel/ui/zipball/c75396f63268c95b053c8e4814eb70e0875e9628", + "reference": "c75396f63268c95b053c8e4814eb70e0875e9628", "shasum": "" }, "require": { @@ -6219,40 +6222,40 @@ "ui" ], "support": { - "source": "https://github.com/laravel/ui/tree/v4.5.1" + "source": "https://github.com/laravel/ui/tree/v4.5.2" }, - "time": "2024-03-21T18:12:29+00:00" + "time": "2024-05-08T18:07:10+00:00" }, { "name": "lcobucci/clock", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/lcobucci/clock.git", - "reference": "039ef98c6b57b101d10bd11d8fdfda12cbd996dc" + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/039ef98c6b57b101d10bd11d8fdfda12cbd996dc", - "reference": "039ef98c6b57b101d10bd11d8fdfda12cbd996dc", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715", + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715", "shasum": "" }, "require": { - "php": "~8.1.0 || ~8.2.0", + "php": "~8.2.0 || ~8.3.0", "psr/clock": "^1.0" }, "provide": { "psr/clock-implementation": "1.0" }, "require-dev": { - "infection/infection": "^0.26", - "lcobucci/coding-standard": "^9.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-deprecation-rules": "^1.1.1", - "phpstan/phpstan-phpunit": "^1.3.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.27" + "infection/infection": "^0.27", + "lcobucci/coding-standard": "^11.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.25", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^10.2.3" }, "type": "library", "autoload": { @@ -6273,7 +6276,7 @@ "description": "Yet another clock abstraction", "support": { "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/3.0.0" + "source": "https://github.com/lcobucci/clock/tree/3.2.0" }, "funding": [ { @@ -6285,7 +6288,7 @@ "type": "patreon" } ], - "time": "2022-12-19T15:00:24+00:00" + "time": "2023-11-17T17:00:27+00:00" }, { "name": "lcobucci/jwt", @@ -12497,20 +12500,20 @@ }, { "name": "symfony/css-selector", - "version": "v6.4.7", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b" + "reference": "b08a4ad89e84b29cec285b7b1f781a7ae51cf4bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/1c5d5c2103c3762aff27a27e1e2409e30a79083b", - "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/b08a4ad89e84b29cec285b7b1f781a7ae51cf4bc", + "reference": "b08a4ad89e84b29cec285b7b1f781a7ae51cf4bc", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -12542,7 +12545,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.4.7" + "source": "https://github.com/symfony/css-selector/tree/v7.0.7" }, "funding": [ { @@ -12558,7 +12561,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "symfony/deprecation-contracts", @@ -12704,24 +12707,24 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.4.7", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d84384f3f67de3cb650db64d685d70395dacfc3f" + "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d84384f3f67de3cb650db64d685d70395dacfc3f", - "reference": "d84384f3f67de3cb650db64d685d70395dacfc3f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9", + "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4", + "symfony/dependency-injection": "<6.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -12730,13 +12733,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -12764,7 +12767,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.7" }, "funding": [ { @@ -12780,7 +12783,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -13350,25 +13353,25 @@ }, { "name": "symfony/intl", - "version": "v6.4.7", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "9ed7dfeeba5759b61798358100bb63230509b337" + "reference": "dd12042707110995e2e7d80103f8d9928bea8621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/9ed7dfeeba5759b61798358100bb63230509b337", - "reference": "9ed7dfeeba5759b61798358100bb63230509b337", + "url": "https://api.github.com/repos/symfony/intl/zipball/dd12042707110995e2e7d80103f8d9928bea8621", + "reference": "dd12042707110995e2e7d80103f8d9928bea8621", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^5.4|^6.0|^7.0", - "symfony/finder": "^5.4|^6.0|^7.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/filesystem": "^6.4|^7.0", + "symfony/finder": "^6.4|^7.0", + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -13413,7 +13416,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v6.4.7" + "source": "https://github.com/symfony/intl/tree/v7.0.7" }, "funding": [ { @@ -13429,7 +13432,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "symfony/mailer", @@ -13667,20 +13670,20 @@ }, { "name": "symfony/options-resolver", - "version": "v6.4.7", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "9a3c92b490716ba6771f5beced13c6eda7183eed" + "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/9a3c92b490716ba6771f5beced13c6eda7183eed", - "reference": "9a3c92b490716ba6771f5beced13c6eda7183eed", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/23cc173858776ad451e31f053b1c9f47840b2cfa", + "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -13714,7 +13717,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.7" + "source": "https://github.com/symfony/options-resolver/tree/v7.0.7" }, "funding": [ { @@ -13730,7 +13733,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "symfony/polyfill-ctype", @@ -14658,6 +14661,166 @@ ], "time": "2024-04-18T09:22:46+00:00" }, + { + "name": "symfony/property-access", + "version": "v6.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-access.git", + "reference": "9174e2ec62563dfc15fbe84d1618613092e09d91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-access/zipball/9174e2ec62563dfc15fbe84d1618613092e09d91", + "reference": "9174e2ec62563dfc15fbe84d1618613092e09d91", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/property-info": "^5.4|^6.0|^7.0" + }, + "require-dev": { + "symfony/cache": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyAccess\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides functions to read and write from/to an object or array using a simple string notation", + "homepage": "https://symfony.com", + "keywords": [ + "access", + "array", + "extraction", + "index", + "injection", + "object", + "property", + "property-path", + "reflection" + ], + "support": { + "source": "https://github.com/symfony/property-access/tree/v6.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-18T09:22:46+00:00" + }, + { + "name": "symfony/property-info", + "version": "v7.0.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/property-info.git", + "reference": "f0bdb46e19ab308527b324b7ec36161f6880a532" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/property-info/zipball/f0bdb46e19ab308527b324b7ec36161f6880a532", + "reference": "f0bdb46e19ab308527b324b7ec36161f6880a532", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/string": "^6.4|^7.0" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "<5.2", + "phpdocumentor/type-resolver": "<1.5.1", + "symfony/dependency-injection": "<6.4", + "symfony/serializer": "<6.4" + }, + "require-dev": { + "phpdocumentor/reflection-docblock": "^5.2", + "phpstan/phpdoc-parser": "^1.0", + "symfony/cache": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\PropertyInfo\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kévin Dunglas", + "email": "dunglas@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Extracts information about PHP class' properties using metadata of popular sources", + "homepage": "https://symfony.com", + "keywords": [ + "doctrine", + "phpdoc", + "property", + "symfony", + "type", + "validator" + ], + "support": { + "source": "https://github.com/symfony/property-info/tree/v7.0.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-28T11:44:19+00:00" + }, { "name": "symfony/psr-http-message-bridge", "version": "v2.3.1", @@ -14830,6 +14993,104 @@ ], "time": "2024-04-18T09:22:46+00:00" }, + { + "name": "symfony/serializer", + "version": "v6.4.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/serializer.git", + "reference": "73820ab43d12c2f29445080004054b0066082bf1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/serializer/zipball/73820ab43d12c2f29445080004054b0066082bf1", + "reference": "73820ab43d12c2f29445080004054b0066082bf1", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-ctype": "~1.8" + }, + "conflict": { + "doctrine/annotations": "<1.12", + "phpdocumentor/reflection-docblock": "<3.2.2", + "phpdocumentor/type-resolver": "<1.4.0", + "symfony/dependency-injection": "<5.4", + "symfony/property-access": "<5.4", + "symfony/property-info": "<5.4.24|>=6,<6.2.11", + "symfony/uid": "<5.4", + "symfony/validator": "<6.4", + "symfony/yaml": "<5.4" + }, + "require-dev": { + "doctrine/annotations": "^1.12|^2", + "phpdocumentor/reflection-docblock": "^3.2|^4.0|^5.0", + "seld/jsonlint": "^1.10", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/console": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/form": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/http-kernel": "^5.4|^6.0|^7.0", + "symfony/messenger": "^5.4|^6.0|^7.0", + "symfony/mime": "^5.4|^6.0|^7.0", + "symfony/property-access": "^5.4.26|^6.3|^7.0", + "symfony/property-info": "^5.4.24|^6.2.11|^7.0", + "symfony/translation-contracts": "^2.5|^3", + "symfony/uid": "^5.4|^6.0|^7.0", + "symfony/validator": "^6.4|^7.0", + "symfony/var-dumper": "^5.4|^6.0|^7.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0", + "symfony/yaml": "^5.4|^6.0|^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Serializer\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/serializer/tree/v6.4.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-04-23T09:00:49+00:00" + }, { "name": "symfony/service-contracts", "version": "v3.5.0", @@ -14915,20 +15176,20 @@ }, { "name": "symfony/string", - "version": "v6.4.7", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ffeb9591c61f65a68d47f77d12b83fa530227a69" + "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ffeb9591c61f65a68d47f77d12b83fa530227a69", - "reference": "ffeb9591c61f65a68d47f77d12b83fa530227a69", + "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -14938,11 +15199,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -14981,7 +15242,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.7" + "source": "https://github.com/symfony/string/tree/v7.0.7" }, "funding": [ { @@ -14997,7 +15258,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "symfony/translation", @@ -16476,16 +16737,16 @@ }, { "name": "brianium/paratest", - "version": "v7.3.1", + "version": "v7.4.4", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "551f46f52a93177d873f3be08a1649ae886b4a30" + "reference": "bfe354e71aca261cf37bf70bf47791081100000d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/551f46f52a93177d873f3be08a1649ae886b4a30", - "reference": "551f46f52a93177d873f3be08a1649ae886b4a30", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/bfe354e71aca261cf37bf70bf47791081100000d", + "reference": "bfe354e71aca261cf37bf70bf47791081100000d", "shasum": "" }, "require": { @@ -16493,28 +16754,27 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^0.5.1 || ^1.0.0", - "jean85/pretty-package-versions": "^2.0.5", - "php": "~8.1.0 || ~8.2.0 || ~8.3.0", - "phpunit/php-code-coverage": "^10.1.7", - "phpunit/php-file-iterator": "^4.1.0", - "phpunit/php-timer": "^6.0", - "phpunit/phpunit": "^10.4.2", - "sebastian/environment": "^6.0.1", - "symfony/console": "^6.3.4 || ^7.0.0", - "symfony/process": "^6.3.4 || ^7.0.0" + "fidry/cpu-core-counter": "^1.1.0", + "jean85/pretty-package-versions": "^2.0.6", + "php": "~8.2.0 || ~8.3.0", + "phpunit/php-code-coverage": "^10.1.14 || ^11.0.3", + "phpunit/php-file-iterator": "^4.1.0 || ^5.0.0", + "phpunit/php-timer": "^6.0.0 || ^7.0.0", + "phpunit/phpunit": "^10.5.20 || ^11.1.3", + "sebastian/environment": "^6.1.0 || ^7.1.0", + "symfony/console": "^6.4.7 || ^7.0.7", + "symfony/process": "^6.4.7 || ^7.0.7" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "infection/infection": "^0.27.6", - "phpstan/phpstan": "^1.10.40", + "phpstan/phpstan": "^1.10.67", "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-phpunit": "^1.3.15", - "phpstan/phpstan-strict-rules": "^1.5.2", - "squizlabs/php_codesniffer": "^3.7.2", - "symfony/filesystem": "^6.3.1 || ^7.0.0" + "phpstan/phpstan-phpunit": "^1.3.16", + "phpstan/phpstan-strict-rules": "^1.5.5", + "squizlabs/php_codesniffer": "^3.9.2", + "symfony/filesystem": "^6.4.3 || ^7.0.7" }, "bin": [ "bin/paratest", @@ -16555,7 +16815,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.3.1" + "source": "https://github.com/paratestphp/paratest/tree/v7.4.4" }, "funding": [ { @@ -16567,7 +16827,7 @@ "type": "paypal" } ], - "time": "2023-10-31T09:24:17+00:00" + "time": "2024-05-03T13:01:49+00:00" }, { "name": "clue/ndjson-react", @@ -20300,20 +20560,20 @@ }, { "name": "symfony/stopwatch", - "version": "v6.4.7", + "version": "v7.0.7", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "ffec95ba269e541eb2232126c0c20f83086b5c68" + "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/ffec95ba269e541eb2232126c0c20f83086b5c68", - "reference": "ffec95ba269e541eb2232126c0c20f83086b5c68", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -20342,7 +20602,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.4.7" + "source": "https://github.com/symfony/stopwatch/tree/v7.0.7" }, "funding": [ { @@ -20358,7 +20618,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:22:46+00:00" + "time": "2024-04-18T09:29:19+00:00" }, { "name": "theseer/tokenizer", diff --git a/tests/Integration/Einvoice/FatturaPATest.php b/tests/Integration/Einvoice/FatturaPATest.php index 3825154cfc..fabec99ac5 100644 --- a/tests/Integration/Einvoice/FatturaPATest.php +++ b/tests/Integration/Einvoice/FatturaPATest.php @@ -298,27 +298,27 @@ class FatturaPATest extends TestCase ], ]; - public function testValidateSampleRequest() - { - $response = json_decode($this->sample_request, 1); + // public function testValidateSampleRequest() + // { + // $response = json_decode($this->sample_request, 1); - $rules = FatturaElettronica::getValidationRules($response); - nlog($rules); + // $rules = FatturaElettronica::getValidationRules($response); + // nlog($rules); - try{ - $validation_array = FatturaElettronica::validate($response); - } - catch(\Illuminate\Validation\ValidationException $e) { + // try{ + // $validation_array = FatturaElettronica::validate($response); + // } + // catch(\Illuminate\Validation\ValidationException $e) { - nlog($e->errors()); - } - $payload = FatturaElettronica::from($response)->toArray(); - nlog($payload); - $this->assertIsArray($payload); + // nlog($e->errors()); + // } + // $payload = FatturaElettronica::from($response)->toArray(); + // nlog($payload); + // $this->assertIsArray($payload); - } + // } // public function testBulkValidationX() // { @@ -365,57 +365,57 @@ class FatturaPATest extends TestCase // } - public function testBulkValidation() - { + // public function testBulkValidation() + // { - $files = [ - 'tests/Integration/Einvoice/samples/fatturapa0.xml', - 'tests/Integration/Einvoice/samples/fatturapa1.xml', - 'tests/Integration/Einvoice/samples/fatturapa2.xml', - 'tests/Integration/Einvoice/samples/fatturapa3.xml', - 'tests/Integration/Einvoice/samples/fatturapa4.xml', - 'tests/Integration/Einvoice/samples/fatturapa5.xml', - 'tests/Integration/Einvoice/samples/fatturapa6.xml', - ]; + // $files = [ + // 'tests/Integration/Einvoice/samples/fatturapa0.xml', + // 'tests/Integration/Einvoice/samples/fatturapa1.xml', + // 'tests/Integration/Einvoice/samples/fatturapa2.xml', + // 'tests/Integration/Einvoice/samples/fatturapa3.xml', + // 'tests/Integration/Einvoice/samples/fatturapa4.xml', + // 'tests/Integration/Einvoice/samples/fatturapa5.xml', + // 'tests/Integration/Einvoice/samples/fatturapa6.xml', + // ]; - foreach($files as $f) - { + // foreach($files as $f) + // { - $xmlstring = file_get_contents($f); + // $xmlstring = file_get_contents($f); - $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); - $json = json_encode($xml); - $payload = json_decode($json, true); + // $xml = simplexml_load_string($xmlstring, "SimpleXMLElement", LIBXML_NOCDATA); + // $json = json_encode($xml); + // $payload = json_decode($json, true); - nlog($payload); + // nlog($payload); - $validation_array = false; - try { - nlog($f); + // $validation_array = false; + // try { + // nlog($f); - $rules = FatturaElettronica::getValidationRules($this->payload); - nlog($rules); + // $rules = FatturaElettronica::getValidationRules($this->payload); + // nlog($rules); - $this->assertIsArray($rules); + // $this->assertIsArray($rules); - $payload = FatturaElettronica::from($payload)->toArray(); - nlog($payload); + // $payload = FatturaElettronica::from($payload)->toArray(); + // nlog($payload); - $this->assertIsArray($payload); + // $this->assertIsArray($payload); - $validation_array = FatturaElettronica::validate($payload); + // $validation_array = FatturaElettronica::validate($payload); - $this->assertIsArray($validation_array); + // $this->assertIsArray($validation_array); - } catch(\Illuminate\Validation\ValidationException $e) { + // } catch(\Illuminate\Validation\ValidationException $e) { - nlog($e->errors()); - } + // nlog($e->errors()); + // } - $this->assertIsArray($validation_array); + // $this->assertIsArray($validation_array); - } - } + // } + // } // public function testUpdateProps() // { From 88a1fa2fc52aa4e1fb08ad20bde4502b7a96e710 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 May 2024 09:44:33 +1000 Subject: [PATCH 09/19] Additional transaction checks --- app/Services/Bank/ProcessBankRules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Bank/ProcessBankRules.php b/app/Services/Bank/ProcessBankRules.php index 266cbf3c00..e65a4462bc 100644 --- a/app/Services/Bank/ProcessBankRules.php +++ b/app/Services/Bank/ProcessBankRules.php @@ -57,7 +57,7 @@ class ProcessBankRules extends AbstractService ->get(); $invoice = $this->invoices->first(function ($value, $key) { - return str_contains($this->bank_transaction->description, $value->number); + return str_contains($this->bank_transaction->description, $value->number) || str_contains(str_replace("\n", "", $this->bank_transaction->description), $value->number); }); if ($invoice) { From 673eaaf3e5090d22f6bebfd68dcc4880975c714d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 23 May 2024 14:14:59 +1000 Subject: [PATCH 10/19] Fixes for i2g imports --- .../Invoice2Go/InvoiceTransformer.php | 214 +++++++++- composer.lock | 376 ++++++++---------- config/data.php | 120 +----- 3 files changed, 387 insertions(+), 323 deletions(-) diff --git a/app/Import/Transformer/Invoice2Go/InvoiceTransformer.php b/app/Import/Transformer/Invoice2Go/InvoiceTransformer.php index da50ebb956..b3e7fc4615 100644 --- a/app/Import/Transformer/Invoice2Go/InvoiceTransformer.php +++ b/app/Import/Transformer/Invoice2Go/InvoiceTransformer.php @@ -11,6 +11,7 @@ namespace App\Import\Transformer\Invoice2Go; +use App\DataMapper\InvoiceItem; use App\Import\ImportException; use App\Import\Transformer\BaseTransformer; use App\Models\Invoice; @@ -26,6 +27,8 @@ class InvoiceTransformer extends BaseTransformer * * @return bool|array */ + private $is_amount_discount = false; + public function transform($invoice_data) { if (!isset($invoice_data['DocumentNumber'])) { @@ -39,9 +42,14 @@ class InvoiceTransformer extends BaseTransformer $invoiceStatusMap = [ 'unsent' => Invoice::STATUS_DRAFT, 'sent' => Invoice::STATUS_SENT, + 'fully_paid' => Invoice::STATUS_PAID, ]; + $this->is_amount_discount = $this->getFloat($invoice_data, 'Discount') > 0 ? true : false; + $transformed = [ + 'is_amount_discount' => $this->is_amount_discount, + 'discount' => $this->getFloat($invoice_data, 'Discount'), 'company_id' => $this->company->id, 'number' => $this->getString($invoice_data, 'DocumentNumber'), 'notes' => $this->getString($invoice_data, 'Comment'), @@ -51,14 +59,7 @@ class InvoiceTransformer extends BaseTransformer 'status_id' => $invoiceStatusMap[$status = strtolower($this->getString($invoice_data, 'DocumentStatus'))] ?? Invoice::STATUS_SENT, // 'viewed' => $status === 'viewed', - 'line_items' => [ - [ - 'cost' => $this->getFloat($invoice_data, 'TotalAmount'), - 'quantity' => 1, - 'discount' => $this->getFloat($invoice_data, 'DiscountValue'), - 'is_amount_discount' => false, - ], - ], + 'line_items' => $this->harvestLineItems($invoice_data), ]; $client_id = null; @@ -88,6 +89,11 @@ class InvoiceTransformer extends BaseTransformer ], ], ]; + + $addresses = $this->harvestAddresses($invoice_data); + + $transformed['client'] = array_merge($transformed['client'], $addresses); + } if (! empty($invoice_data['Date Paid'])) { $transformed['payments'] = [ @@ -97,7 +103,199 @@ class InvoiceTransformer extends BaseTransformer ], ]; } + elseif(isset($invoice_data['AmountPaidAmount']) && isset($invoice_data['DatePaid'])){ + $transformed['payments'] = [ + [ + 'date' => $this->parseDate($invoice_data['DatePaid']), + 'amount' => $this->getFloat($invoice_data, 'AmountPaidAmount'), + ] + ]; + } + elseif(isset($invoice_data['DocumentStatus']) && $invoice_data['DocumentStatus'] == 'fully_paid'){ + + $transformed['payments'] = [ + [ + 'date' => isset($invoice_data['DatePaid']) ? $this->parseDate($invoice_data['DatePaid']) : ($this->parseDate($invoice_data['DocumentDate']) ?? now()->format('Y-m-d')), + 'amount' => $this->getFloat($invoice_data, 'TotalAmount'), + ] + ]; + } return $transformed; } + + + private function harvestAddresses($invoice_data) { + $address = $invoice_data['DocumentRecipientAddress']; + + $lines = explode("\n", $address); + + $billing_address = []; + if(count($lines) == 2){ + $billing_address['address1'] = $lines[0]; + + $parts = explode(",", $lines[1]); + + if(count($parts) == 3){ + $billing_address['city'] = $parts[0]; + $billing_address['state'] = $parts[1]; + $billing_address['postal_code'] = $parts[2]; + } + + } + + $shipaddress = $invoice_data['ShipAddress'] ?? ''; + $shipping_address = []; + + $lines = explode("\n", $shipaddress); + + if(count($lines) == 2) { + $shipping_address['address1'] = $lines[0]; + + $parts = explode(",", $lines[1]); + + if(count($parts) == 3) { + $shipping_address['shipping_city'] = $parts[0]; + $shipping_address['shipping_state'] = $parts[1]; + $shipping_address['shipping_postal_code'] = $parts[2]; + } + + + } + + return array_merge($billing_address, $shipping_address); + + } + + + /* + + Sample invoice2go line item + "code" => "", + "description" => "", + "qty" => "1", + "unit_type" => "parts", + "withholding_tax_applies" => "false", + "applied_taxes" => "", + "unit_price" => "150", + "discount_percentage" => "50", + "discount_type" => "percentage", //amount + "discount_amount" => "0", + + */ + + + + private function harvestLineItems(array $invoice_data): array + { + + $default_data = + [ + [ + 'cost' => $this->getFloat($invoice_data, 'TotalAmount'), + 'quantity' => 1, + 'discount' => $this->getFloat($invoice_data, 'DiscountValue'), + 'is_amount_discount' => false, + ], + ]; + + if(!isset($invoice_data['Items'])){ + return $default_data; + } + + // Parse the main CSV data + $processed = $this->parseCsvWithNestedCsv($invoice_data['Items']); + + $line_items = []; + + foreach($processed as $item) + { + $_item['cost'] = $item['unit_price']; + $_item['quantity'] = $item['qty'] ?? 1; + $_item['discount'] = $item['discount_percentage'] > $item['discount_amount'] ? $item['discount_percentage'] : $item['discount_amount']; + $_item['is_amount_discount'] = $item['discount_type'] == 'percentage' ? false : true; + $_item['product_key'] = $item['code'] ?? ''; + $_item['notes'] = $item['description'] ?? ''; + + $_item = $this->parseTaxes($_item, $item); + $this->is_amount_discount = $_item['is_amount_discount']; + + $line_items[] = $_item; + $_item = []; + + } + + return $line_items; + } + + private function parseTaxes($ninja_item, $i2g_item): array + { + if(is_string($i2g_item['applied_taxes'])) + return $ninja_item; + + $ninja_item['tax_name1'] = 'Tax'; + $ninja_item['tax_rate1'] = $i2g_item['applied_taxes']['rate']; + + return $ninja_item; + + } + + + function parseCsvWithNestedCsv($csvString, $delimiter = ',', $enclosure = '"', $lineEnding = ';') + { + // Regular expression to find nested CSVs + $nestedCsvPattern = '/"([^"]*(?:""[^"]*)*)"/'; + preg_match_all($nestedCsvPattern, $csvString, $matches); + + // Replace nested CSVs with placeholders + $placeholders = []; + foreach ($matches[0] as $index => $match) { + $placeholder = '___PLACEHOLDER_' . $index . '___'; + $placeholders[$placeholder] = $match; + $csvString = str_replace($match, $placeholder, $csvString); + } + + // Parse the main CSV + $rows = explode($lineEnding, $csvString); + $parsedRows = []; + foreach ($rows as $row) { + $parsedRow = str_getcsv($row, $delimiter, $enclosure); + $parsedRows[] = $parsedRow; + } + + // Replace placeholders with parsed nested CSVs + foreach ($parsedRows as &$row) { + foreach ($row as &$field) { + if (isset($placeholders[$field])) { + $field = str_getcsv($placeholders[$field], $delimiter, $enclosure); + } + } + } + + + foreach($parsedRows as $key => &$row) { + + if($key == 0) { + continue; + } + + if(is_array($row[5])) { + $csv = str_getcsv($row[5][0], ";"); + $row[5] = array_combine(explode(",", $csv[0]), explode(",", $csv[1])); + + } + + if(is_array($row[1])) { + $row[1] = $row[1][0]; + } + + $row = array_combine($parsedRows[0], $row); + } + + unset($parsedRows[0]); + + return $parsedRows; + } + + } diff --git a/composer.lock b/composer.lock index 2cfecf91c2..820a30388b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "fa16490174cf1031f3b7de1dba43be9f", + "content-hash": "1356155e46e797b140685c105df97b8e", "packages": [ { "name": "adrienrn/php-mimetyper", @@ -1385,16 +1385,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.308.0", + "version": "3.308.1", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "806ad75dcb72b6e6569848159e7a350003526bc9" + "reference": "bf5f1221d4c5c67d3213150fb91dfb5ce627227b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/806ad75dcb72b6e6569848159e7a350003526bc9", - "reference": "806ad75dcb72b6e6569848159e7a350003526bc9", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/bf5f1221d4c5c67d3213150fb91dfb5ce627227b", + "reference": "bf5f1221d4c5c67d3213150fb91dfb5ce627227b", "shasum": "" }, "require": { @@ -1474,9 +1474,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.308.0" + "source": "https://github.com/aws/aws-sdk-php/tree/3.308.1" }, - "time": "2024-05-21T18:06:10+00:00" + "time": "2024-05-22T18:05:56+00:00" }, { "name": "bacon/bacon-qr-code", @@ -2509,16 +2509,16 @@ }, { "name": "doctrine/event-manager", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/doctrine/event-manager.git", - "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32" + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/750671534e0241a7c50ea5b43f67e23eb5c96f32", - "reference": "750671534e0241a7c50ea5b43f67e23eb5c96f32", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/b680156fa328f1dfd874fd48c7026c41570b9c6e", + "reference": "b680156fa328f1dfd874fd48c7026c41570b9c6e", "shasum": "" }, "require": { @@ -2528,10 +2528,10 @@ "doctrine/common": "<2.9" }, "require-dev": { - "doctrine/coding-standard": "^10", + "doctrine/coding-standard": "^12", "phpstan/phpstan": "^1.8.8", - "phpunit/phpunit": "^9.5", - "vimeo/psalm": "^4.28" + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.24" }, "type": "library", "autoload": { @@ -2580,7 +2580,7 @@ ], "support": { "issues": "https://github.com/doctrine/event-manager/issues", - "source": "https://github.com/doctrine/event-manager/tree/2.0.0" + "source": "https://github.com/doctrine/event-manager/tree/2.0.1" }, "funding": [ { @@ -2596,7 +2596,7 @@ "type": "tidelift" } ], - "time": "2022-10-12T20:59:15+00:00" + "time": "2024-05-22T20:47:39+00:00" }, { "name": "doctrine/inflector", @@ -5034,18 +5034,17 @@ "source": { "type": "git", "url": "https://github.com/invoiceninja/einvoice.git", - "reference": "f48e3c4c733be16df80330890fbe13ae476b86b7" + "reference": "757800fa89f845443ad1880c1ea7aa905d1043ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/f48e3c4c733be16df80330890fbe13ae476b86b7", - "reference": "f48e3c4c733be16df80330890fbe13ae476b86b7", + "url": "https://api.github.com/repos/invoiceninja/einvoice/zipball/757800fa89f845443ad1880c1ea7aa905d1043ea", + "reference": "757800fa89f845443ad1880c1ea7aa905d1043ea", "shasum": "" }, "require": { "illuminate/collections": "^10.48", "sabre/xml": "^4.0", - "spatie/laravel-data": "^4", "symfony/property-access": "^6.4", "symfony/serializer": "^6.4", "symfony/validator": "^6.4" @@ -5078,7 +5077,7 @@ "source": "https://github.com/invoiceninja/einvoice/tree/main", "issues": "https://github.com/invoiceninja/einvoice/issues" }, - "time": "2024-05-22T05:54:35+00:00" + "time": "2024-05-22T07:45:24+00:00" }, { "name": "invoiceninja/inspector", @@ -6228,34 +6227,34 @@ }, { "name": "lcobucci/clock", - "version": "3.2.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/lcobucci/clock.git", - "reference": "6f28b826ea01306b07980cb8320ab30b966cd715" + "reference": "039ef98c6b57b101d10bd11d8fdfda12cbd996dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715", - "reference": "6f28b826ea01306b07980cb8320ab30b966cd715", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/039ef98c6b57b101d10bd11d8fdfda12cbd996dc", + "reference": "039ef98c6b57b101d10bd11d8fdfda12cbd996dc", "shasum": "" }, "require": { - "php": "~8.2.0 || ~8.3.0", + "php": "~8.1.0 || ~8.2.0", "psr/clock": "^1.0" }, "provide": { "psr/clock-implementation": "1.0" }, "require-dev": { - "infection/infection": "^0.27", - "lcobucci/coding-standard": "^11.0.0", - "phpstan/extension-installer": "^1.3.1", - "phpstan/phpstan": "^1.10.25", - "phpstan/phpstan-deprecation-rules": "^1.1.3", - "phpstan/phpstan-phpunit": "^1.3.13", - "phpstan/phpstan-strict-rules": "^1.5.1", - "phpunit/phpunit": "^10.2.3" + "infection/infection": "^0.26", + "lcobucci/coding-standard": "^9.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-deprecation-rules": "^1.1.1", + "phpstan/phpstan-phpunit": "^1.3.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.27" }, "type": "library", "autoload": { @@ -6276,7 +6275,7 @@ "description": "Yet another clock abstraction", "support": { "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/3.2.0" + "source": "https://github.com/lcobucci/clock/tree/3.0.0" }, "funding": [ { @@ -6288,7 +6287,7 @@ "type": "patreon" } ], - "time": "2023-11-17T17:00:27+00:00" + "time": "2022-12-19T15:00:24+00:00" }, { "name": "lcobucci/jwt", @@ -6643,16 +6642,16 @@ }, { "name": "league/flysystem", - "version": "3.27.0", + "version": "3.28.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "4729745b1ab737908c7d055148c9a6b3e959832f" + "reference": "e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/4729745b1ab737908c7d055148c9a6b3e959832f", - "reference": "4729745b1ab737908c7d055148c9a6b3e959832f", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c", + "reference": "e611adab2b1ae2e3072fa72d62c62f52c2bf1f0c", "shasum": "" }, "require": { @@ -6676,10 +6675,13 @@ "composer/semver": "^3.0", "ext-fileinfo": "*", "ext-ftp": "*", + "ext-mongodb": "^1.3", "ext-zip": "*", "friendsofphp/php-cs-fixer": "^3.5", "google/cloud-storage": "^1.23", + "guzzlehttp/psr7": "^2.6", "microsoft/azure-storage-blob": "^1.1", + "mongodb/mongodb": "^1.2", "phpseclib/phpseclib": "^3.0.36", "phpstan/phpstan": "^1.10", "phpunit/phpunit": "^9.5.11|^10.0", @@ -6717,32 +6719,22 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/3.27.0" + "source": "https://github.com/thephpleague/flysystem/tree/3.28.0" }, - "funding": [ - { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - } - ], - "time": "2024-04-07T19:17:50+00:00" + "time": "2024-05-22T10:09:12+00:00" }, { "name": "league/flysystem-aws-s3-v3", - "version": "3.27.0", + "version": "3.28.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-aws-s3-v3.git", - "reference": "3e6ce2f972f1470db779f04d29c289dcd2c32837" + "reference": "22071ef1604bc776f5ff2468ac27a752514665c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/3e6ce2f972f1470db779f04d29c289dcd2c32837", - "reference": "3e6ce2f972f1470db779f04d29c289dcd2c32837", + "url": "https://api.github.com/repos/thephpleague/flysystem-aws-s3-v3/zipball/22071ef1604bc776f5ff2468ac27a752514665c8", + "reference": "22071ef1604bc776f5ff2468ac27a752514665c8", "shasum": "" }, "require": { @@ -6782,32 +6774,22 @@ "storage" ], "support": { - "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.27.0" + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/3.28.0" }, - "funding": [ - { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - } - ], - "time": "2024-04-07T19:16:54+00:00" + "time": "2024-05-06T20:05:52+00:00" }, { "name": "league/flysystem-local", - "version": "3.25.1", + "version": "3.28.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem-local.git", - "reference": "61a6a90d6e999e4ddd9ce5adb356de0939060b92" + "reference": "13f22ea8be526ea58c2ddff9e158ef7c296e4f40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/61a6a90d6e999e4ddd9ce5adb356de0939060b92", - "reference": "61a6a90d6e999e4ddd9ce5adb356de0939060b92", + "url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/13f22ea8be526ea58c2ddff9e158ef7c296e4f40", + "reference": "13f22ea8be526ea58c2ddff9e158ef7c296e4f40", "shasum": "" }, "require": { @@ -6841,19 +6823,9 @@ "local" ], "support": { - "source": "https://github.com/thephpleague/flysystem-local/tree/3.25.1" + "source": "https://github.com/thephpleague/flysystem-local/tree/3.28.0" }, - "funding": [ - { - "url": "https://ecologi.com/frankdejonge", - "type": "custom" - }, - { - "url": "https://github.com/frankdejonge", - "type": "github" - } - ], - "time": "2024-03-15T19:58:44+00:00" + "time": "2024-05-06T20:05:52+00:00" }, { "name": "league/fractal", @@ -7296,16 +7268,16 @@ }, { "name": "livewire/livewire", - "version": "v3.4.12", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "54dd265c17f7b5200627eb9690590e7cbbad1027" + "reference": "72e900825c560f0e4e620185b26c5441a8914435" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/54dd265c17f7b5200627eb9690590e7cbbad1027", - "reference": "54dd265c17f7b5200627eb9690590e7cbbad1027", + "url": "https://api.github.com/repos/livewire/livewire/zipball/72e900825c560f0e4e620185b26c5441a8914435", + "reference": "72e900825c560f0e4e620185b26c5441a8914435", "shasum": "" }, "require": { @@ -7360,7 +7332,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.4.12" + "source": "https://github.com/livewire/livewire/tree/v3.5.0" }, "funding": [ { @@ -7368,7 +7340,7 @@ "type": "github" } ], - "time": "2024-05-02T17:10:37+00:00" + "time": "2024-05-21T13:39:04+00:00" }, { "name": "maennchen/zipstream-php", @@ -11929,20 +11901,20 @@ }, { "name": "spatie/laravel-data", - "version": "4.6.0", + "version": "3.12.0", "source": { "type": "git", "url": "https://github.com/spatie/laravel-data.git", - "reference": "ee513f693f8ab8f915dc26cae079d7b2e5999a65" + "reference": "d44e04839407bc32b029be59ba80090a5f720e91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-data/zipball/ee513f693f8ab8f915dc26cae079d7b2e5999a65", - "reference": "ee513f693f8ab8f915dc26cae079d7b2e5999a65", + "url": "https://api.github.com/repos/spatie/laravel-data/zipball/d44e04839407bc32b029be59ba80090a5f720e91", + "reference": "d44e04839407bc32b029be59ba80090a5f720e91", "shasum": "" }, "require": { - "illuminate/contracts": "^10.0|^11.0", + "illuminate/contracts": "^9.30|^10.0|^11.0", "php": "^8.1", "phpdocumentor/type-resolver": "^1.5", "spatie/laravel-package-tools": "^1.9.0", @@ -11951,21 +11923,21 @@ "require-dev": { "fakerphp/faker": "^1.14", "friendsofphp/php-cs-fixer": "^3.0", - "inertiajs/inertia-laravel": "dev-master#4508fd1", - "livewire/livewire": "^3.0", + "inertiajs/inertia-laravel": "^0.6.3", "mockery/mockery": "^1.6", "nesbot/carbon": "^2.63", + "nette/php-generator": "^3.5", "nunomaduro/larastan": "^2.0", - "orchestra/testbench": "^8.0|^9.0", - "pestphp/pest": "^2.31", - "pestphp/pest-plugin-laravel": "^2.0", - "pestphp/pest-plugin-livewire": "^2.1", + "orchestra/testbench": "^7.6|^8.0", + "pestphp/pest": "^1.22", + "pestphp/pest-plugin-laravel": "^1.3", "phpbench/phpbench": "^1.2", "phpstan/extension-installer": "^1.1", - "phpunit/phpunit": "^10.0", + "phpunit/phpunit": "^9.3", "spatie/invade": "^1.0", - "spatie/laravel-typescript-transformer": "^2.3", - "spatie/pest-plugin-snapshots": "^2.1", + "spatie/laravel-typescript-transformer": "^2.1.6", + "spatie/pest-plugin-snapshots": "^1.1", + "spatie/phpunit-snapshot-assertions": "^4.2", "spatie/test-time": "^1.2" }, "type": "library", @@ -11978,7 +11950,8 @@ }, "autoload": { "psr-4": { - "Spatie\\LaravelData\\": "src/" + "Spatie\\LaravelData\\": "src", + "Spatie\\LaravelData\\Database\\Factories\\": "database/factories" } }, "notification-url": "https://packagist.org/downloads/", @@ -12001,7 +11974,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-data/issues", - "source": "https://github.com/spatie/laravel-data/tree/4.6.0" + "source": "https://github.com/spatie/laravel-data/tree/3.12.0" }, "funding": [ { @@ -12009,7 +11982,7 @@ "type": "github" } ], - "time": "2024-05-03T15:01:04+00:00" + "time": "2024-04-24T09:27:45+00:00" }, { "name": "spatie/laravel-package-tools", @@ -12500,20 +12473,20 @@ }, { "name": "symfony/css-selector", - "version": "v7.0.7", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b08a4ad89e84b29cec285b7b1f781a7ae51cf4bc" + "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b08a4ad89e84b29cec285b7b1f781a7ae51cf4bc", - "reference": "b08a4ad89e84b29cec285b7b1f781a7ae51cf4bc", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/1c5d5c2103c3762aff27a27e1e2409e30a79083b", + "reference": "1c5d5c2103c3762aff27a27e1e2409e30a79083b", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.1" }, "type": "library", "autoload": { @@ -12545,7 +12518,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v7.0.7" + "source": "https://github.com/symfony/css-selector/tree/v6.4.7" }, "funding": [ { @@ -12561,7 +12534,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-04-18T09:22:46+00:00" }, { "name": "symfony/deprecation-contracts", @@ -12707,24 +12680,24 @@ }, { "name": "symfony/event-dispatcher", - "version": "v7.0.7", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9" + "reference": "d84384f3f67de3cb650db64d685d70395dacfc3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d84384f3f67de3cb650db64d685d70395dacfc3f", + "reference": "d84384f3f67de3cb650db64d685d70395dacfc3f", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<6.4", + "symfony/dependency-injection": "<5.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -12733,13 +12706,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", - "symfony/error-handler": "^6.4|^7.0", - "symfony/expression-language": "^6.4|^7.0", - "symfony/http-foundation": "^6.4|^7.0", + "symfony/config": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/expression-language": "^5.4|^6.0|^7.0", + "symfony/http-foundation": "^5.4|^6.0|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^6.4|^7.0" + "symfony/stopwatch": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -12767,7 +12740,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.7" }, "funding": [ { @@ -12783,7 +12756,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-04-18T09:22:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -13353,25 +13326,25 @@ }, { "name": "symfony/intl", - "version": "v7.0.7", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/intl.git", - "reference": "dd12042707110995e2e7d80103f8d9928bea8621" + "reference": "9ed7dfeeba5759b61798358100bb63230509b337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/intl/zipball/dd12042707110995e2e7d80103f8d9928bea8621", - "reference": "dd12042707110995e2e7d80103f8d9928bea8621", + "url": "https://api.github.com/repos/symfony/intl/zipball/9ed7dfeeba5759b61798358100bb63230509b337", + "reference": "9ed7dfeeba5759b61798358100bb63230509b337", "shasum": "" }, "require": { - "php": ">=8.2" + "php": ">=8.1" }, "require-dev": { - "symfony/filesystem": "^6.4|^7.0", - "symfony/finder": "^6.4|^7.0", - "symfony/var-exporter": "^6.4|^7.0" + "symfony/filesystem": "^5.4|^6.0|^7.0", + "symfony/finder": "^5.4|^6.0|^7.0", + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -13416,7 +13389,7 @@ "localization" ], "support": { - "source": "https://github.com/symfony/intl/tree/v7.0.7" + "source": "https://github.com/symfony/intl/tree/v6.4.7" }, "funding": [ { @@ -13432,7 +13405,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-04-18T09:22:46+00:00" }, { "name": "symfony/mailer", @@ -13670,20 +13643,20 @@ }, { "name": "symfony/options-resolver", - "version": "v7.0.7", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa" + "reference": "9a3c92b490716ba6771f5beced13c6eda7183eed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/23cc173858776ad451e31f053b1c9f47840b2cfa", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/9a3c92b490716ba6771f5beced13c6eda7183eed", + "reference": "9a3c92b490716ba6771f5beced13c6eda7183eed", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -13717,7 +13690,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.0.7" + "source": "https://github.com/symfony/options-resolver/tree/v6.4.7" }, "funding": [ { @@ -13733,7 +13706,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-04-18T09:22:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -14740,33 +14713,33 @@ }, { "name": "symfony/property-info", - "version": "v7.0.7", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "f0bdb46e19ab308527b324b7ec36161f6880a532" + "reference": "42778ca731b8796e02e237008f4ed871361ddfce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/f0bdb46e19ab308527b324b7ec36161f6880a532", - "reference": "f0bdb46e19ab308527b324b7ec36161f6880a532", + "url": "https://api.github.com/repos/symfony/property-info/zipball/42778ca731b8796e02e237008f4ed871361ddfce", + "reference": "42778ca731b8796e02e237008f4ed871361ddfce", "shasum": "" }, "require": { - "php": ">=8.2", - "symfony/string": "^6.4|^7.0" + "php": ">=8.1", + "symfony/string": "^5.4|^6.0|^7.0" }, "conflict": { "phpdocumentor/reflection-docblock": "<5.2", "phpdocumentor/type-resolver": "<1.5.1", - "symfony/dependency-injection": "<6.4", + "symfony/dependency-injection": "<5.4", "symfony/serializer": "<6.4" }, "require-dev": { "phpdocumentor/reflection-docblock": "^5.2", "phpstan/phpdoc-parser": "^1.0", - "symfony/cache": "^6.4|^7.0", - "symfony/dependency-injection": "^6.4|^7.0", + "symfony/cache": "^5.4|^6.0|^7.0", + "symfony/dependency-injection": "^5.4|^6.0|^7.0", "symfony/serializer": "^6.4|^7.0" }, "type": "library", @@ -14803,7 +14776,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v7.0.7" + "source": "https://github.com/symfony/property-info/tree/v6.4.7" }, "funding": [ { @@ -14819,7 +14792,7 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-04-28T10:28:08+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -15176,20 +15149,20 @@ }, { "name": "symfony/string", - "version": "v7.0.7", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" + "reference": "ffeb9591c61f65a68d47f77d12b83fa530227a69" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "url": "https://api.github.com/repos/symfony/string/zipball/ffeb9591c61f65a68d47f77d12b83fa530227a69", + "reference": "ffeb9591c61f65a68d47f77d12b83fa530227a69", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -15199,11 +15172,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^6.4|^7.0", - "symfony/http-client": "^6.4|^7.0", - "symfony/intl": "^6.4|^7.0", + "symfony/error-handler": "^5.4|^6.0|^7.0", + "symfony/http-client": "^5.4|^6.0|^7.0", + "symfony/intl": "^6.2|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^6.4|^7.0" + "symfony/var-exporter": "^5.4|^6.0|^7.0" }, "type": "library", "autoload": { @@ -15242,7 +15215,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.7" + "source": "https://github.com/symfony/string/tree/v6.4.7" }, "funding": [ { @@ -15258,7 +15231,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-04-18T09:22:46+00:00" }, { "name": "symfony/translation", @@ -16737,16 +16710,16 @@ }, { "name": "brianium/paratest", - "version": "v7.4.4", + "version": "v7.3.1", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "bfe354e71aca261cf37bf70bf47791081100000d" + "reference": "551f46f52a93177d873f3be08a1649ae886b4a30" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/bfe354e71aca261cf37bf70bf47791081100000d", - "reference": "bfe354e71aca261cf37bf70bf47791081100000d", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/551f46f52a93177d873f3be08a1649ae886b4a30", + "reference": "551f46f52a93177d873f3be08a1649ae886b4a30", "shasum": "" }, "require": { @@ -16754,27 +16727,28 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^1.1.0", - "jean85/pretty-package-versions": "^2.0.6", - "php": "~8.2.0 || ~8.3.0", - "phpunit/php-code-coverage": "^10.1.14 || ^11.0.3", - "phpunit/php-file-iterator": "^4.1.0 || ^5.0.0", - "phpunit/php-timer": "^6.0.0 || ^7.0.0", - "phpunit/phpunit": "^10.5.20 || ^11.1.3", - "sebastian/environment": "^6.1.0 || ^7.1.0", - "symfony/console": "^6.4.7 || ^7.0.7", - "symfony/process": "^6.4.7 || ^7.0.7" + "fidry/cpu-core-counter": "^0.5.1 || ^1.0.0", + "jean85/pretty-package-versions": "^2.0.5", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "phpunit/php-code-coverage": "^10.1.7", + "phpunit/php-file-iterator": "^4.1.0", + "phpunit/php-timer": "^6.0", + "phpunit/phpunit": "^10.4.2", + "sebastian/environment": "^6.0.1", + "symfony/console": "^6.3.4 || ^7.0.0", + "symfony/process": "^6.3.4 || ^7.0.0" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^1.10.67", + "infection/infection": "^0.27.6", + "phpstan/phpstan": "^1.10.40", "phpstan/phpstan-deprecation-rules": "^1.1.4", - "phpstan/phpstan-phpunit": "^1.3.16", - "phpstan/phpstan-strict-rules": "^1.5.5", - "squizlabs/php_codesniffer": "^3.9.2", - "symfony/filesystem": "^6.4.3 || ^7.0.7" + "phpstan/phpstan-phpunit": "^1.3.15", + "phpstan/phpstan-strict-rules": "^1.5.2", + "squizlabs/php_codesniffer": "^3.7.2", + "symfony/filesystem": "^6.3.1 || ^7.0.0" }, "bin": [ "bin/paratest", @@ -16815,7 +16789,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.4.4" + "source": "https://github.com/paratestphp/paratest/tree/v7.3.1" }, "funding": [ { @@ -16827,7 +16801,7 @@ "type": "paypal" } ], - "time": "2024-05-03T13:01:49+00:00" + "time": "2023-10-31T09:24:17+00:00" }, { "name": "clue/ndjson-react", @@ -20178,16 +20152,16 @@ }, { "name": "spatie/flare-client-php", - "version": "1.5.1", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/spatie/flare-client-php.git", - "reference": "e27977d534eefe04c154c6fd8460217024054c05" + "reference": "220a7c8745e9fa427d54099f47147c4b97fe6462" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/e27977d534eefe04c154c6fd8460217024054c05", - "reference": "e27977d534eefe04c154c6fd8460217024054c05", + "url": "https://api.github.com/repos/spatie/flare-client-php/zipball/220a7c8745e9fa427d54099f47147c4b97fe6462", + "reference": "220a7c8745e9fa427d54099f47147c4b97fe6462", "shasum": "" }, "require": { @@ -20235,7 +20209,7 @@ ], "support": { "issues": "https://github.com/spatie/flare-client-php/issues", - "source": "https://github.com/spatie/flare-client-php/tree/1.5.1" + "source": "https://github.com/spatie/flare-client-php/tree/1.6.0" }, "funding": [ { @@ -20243,7 +20217,7 @@ "type": "github" } ], - "time": "2024-05-03T15:43:14+00:00" + "time": "2024-05-22T09:45:39+00:00" }, { "name": "spatie/ignition", @@ -20560,20 +20534,20 @@ }, { "name": "symfony/stopwatch", - "version": "v7.0.7", + "version": "v6.4.7", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84" + "reference": "ffec95ba269e541eb2232126c0c20f83086b5c68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/41a7a24aa1dc82adf46a06bc292d1923acfe6b84", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/ffec95ba269e541eb2232126c0c20f83086b5c68", + "reference": "ffec95ba269e541eb2232126c0c20f83086b5c68", "shasum": "" }, "require": { - "php": ">=8.2", + "php": ">=8.1", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -20602,7 +20576,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.0.7" + "source": "https://github.com/symfony/stopwatch/tree/v6.4.7" }, "funding": [ { @@ -20618,7 +20592,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-04-18T09:22:46+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/data.php b/config/data.php index e24dacc8db..fcd99e1b95 100644 --- a/config/data.php +++ b/config/data.php @@ -1,9 +1,7 @@ [ - 'cast_and_transform_iterables' => true, - /** - * When trying to set a computed property value, the package will throw an exception. - * You can disable this behaviour by setting this option to true, which will then just - * ignore the value being passed into the computed property and recalculate it. - */ - 'ignore_exception_when_trying_to_set_computed_property_value' => false, - ], - - /** + /* * Global transformers will take complex types and transform them into simple * types. */ 'transformers' => [ DateTimeInterface::class => \Spatie\LaravelData\Transformers\DateTimeInterfaceTransformer::class, \Illuminate\Contracts\Support\Arrayable::class => \Spatie\LaravelData\Transformers\ArrayableTransformer::class, - BackedEnum::class => Spatie\LaravelData\Transformers\EnumTransformer::class, + BackedEnum::class => Spatie\LaravelData\Transformers\EnumTransformer::class ], - /** + /* * Global casts will cast values into complex types when creating a data * object from simple types. */ 'casts' => [ DateTimeInterface::class => Spatie\LaravelData\Casts\DateTimeInterfaceCast::class, BackedEnum::class => Spatie\LaravelData\Casts\EnumCast::class, - // Enumerable::class => Spatie\LaravelData\Casts\EnumerableCast::class, ], - /** + /* * Rule inferrers can be configured here. They will automatically add * validation rules to properties of a data object based upon * the type of the property. @@ -75,7 +57,7 @@ return [ Spatie\LaravelData\Normalizers\JsonNormalizer::class, ], - /** + /* * Data objects can be wrapped into a key like 'data' when used as a resource, * this key can be set globally here for all data objects. You can pass in * `null` if you want to disable wrapping. @@ -89,94 +71,4 @@ return [ * which will only enable the caster locally. */ 'var_dumper_caster_mode' => 'development', - - /** - * It is possible to skip the PHP reflection analysis of data objects - * when running in production. This will speed up the package. You - * can configure where data objects are stored and which cache - * store should be used. - * - * Structures are cached forever as they'll become stale when your - * application is deployed with changes. You can set a duration - * in seconds if you want the cache to clear after a certain - * timeframe. - */ - 'structure_caching' => [ - 'enabled' => true, - 'directories' => [app_path('Data')], - 'cache' => [ - 'store' => env('CACHE_STORE', env('CACHE_DRIVER', 'file')), - 'prefix' => 'laravel-data', - 'duration' => null, - ], - 'reflection_discovery' => [ - 'enabled' => true, - 'base_path' => base_path(), - 'root_namespace' => null, - ], - ], - - /** - * A data object can be validated when created using a factory or when calling the from - * method. By default, only when a request is passed the data is being validated. This - * behaviour can be changed to always validate or to completely disable validation. - */ - 'validation_strategy' => \Spatie\LaravelData\Support\Creation\ValidationStrategy::OnlyRequests->value, - - /** - * When using an invalid include, exclude, only or except partial, the package will - * throw an exception. You can disable this behaviour by setting this option to true. - */ - 'ignore_invalid_partials' => false, - - /** - * When transforming a nested chain of data objects, the package can end up in an infinite - * loop when including a recursive relationship. The max transformation depth can be - * set as a safety measure to prevent this from happening. When set to null, the - * package will not enforce a maximum depth. - */ - 'max_transformation_depth' => null, - - /** - * When the maximum transformation depth is reached, the package will throw an exception. - * You can disable this behaviour by setting this option to true which will return an - * empty array. - */ - 'throw_when_max_transformation_depth_reached' => true, - - /** - * When using the `make:data` command, the package will use these settings to generate - * the data classes. You can override these settings by passing options to the command. - */ - 'commands' => [ - /** - * Provides default configuration for the `make:data` command. These settings can be overridden with options - * passed directly to the `make:data` command for generating single Data classes, or if not set they will - * automatically fall back to these defaults. See `php artisan make:data --help` for more information - */ - 'make' => [ - /** - * The default namespace for generated Data classes. This exists under the application's root namespace, - * so the default 'Data` will end up as '\App\Data', and generated Data classes will be placed in the - * app/Data/ folder. Data classes can live anywhere, but this is where `make:data` will put them. - */ - 'namespace' => 'Data', - - /** - * This suffix will be appended to all data classes generated by make:data, so that they are less likely - * to conflict with other related classes, controllers or models with a similar name without resorting - * to adding an alias for the Data object. Set to a blank string (not null) to disable. - */ - 'suffix' => 'Data', - ], - ], - - /** - * When using Livewire, the package allows you to enable or disable the synths - * these synths will automatically handle the data objects and their - * properties when used in a Livewire component. - */ - 'livewire' => [ - 'enable_synths' => false, - ], ]; From 9180dc4478d7a6a24d28065f9bdb285783a58116 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 24 May 2024 10:38:07 +1000 Subject: [PATCH 11/19] Refactor for paypal implementation --- .../PayPal/PayPalBasePaymentDriver.php | 23 ++++++++- .../PayPalPPCPPaymentDriver.php | 14 ++++- .../PayPalRestPaymentDriver.php | 20 ++++++-- composer.lock | 12 ++--- .../ninja2020/gateways/paypal/pay.blade.php | 51 ++++++++++++++++++- .../gateways/paypal/ppcp/card.blade.php | 47 ++++++++++++++--- .../gateways/paypal/ppcp/pay.blade.php | 42 +++++++++++++-- 7 files changed, 181 insertions(+), 28 deletions(-) diff --git a/app/PaymentDrivers/PayPal/PayPalBasePaymentDriver.php b/app/PaymentDrivers/PayPal/PayPalBasePaymentDriver.php index a3059c20cd..b2f5ea5bf3 100644 --- a/app/PaymentDrivers/PayPal/PayPalBasePaymentDriver.php +++ b/app/PaymentDrivers/PayPal/PayPalBasePaymentDriver.php @@ -344,10 +344,15 @@ class PayPalBasePaymentDriver extends BaseDriver ->withHeaders($this->getHeaders($headers)) ->{$verb}("{$this->api_endpoint_url}{$uri}", $data); - if($r->successful()) { + if($r->status() <= 422){ + // if($r->successful()) { return $r; } + nlog($r->body()); + nlog($r->json()); + nlog($r); + SystemLogger::dispatch( ['response' => $r->body()], SystemLog::CATEGORY_GATEWAY_RESPONSE, @@ -357,8 +362,21 @@ class PayPalBasePaymentDriver extends BaseDriver $this->client->company ?? $this->company_gateway->company, ); - throw new PaymentFailed("Gateway failure - {$r->body()}", 401); + + return response()->json(['message' => "Gateway failure - {$r->body()}"], 401); + // throw new PaymentFailed("Gateway failure - {$r->body()}", 401); + + } + + public function handleRetry($response, $request) { + + // $response = $r->json(); + // nlog($response['details']); + + // if(in_array($response['details'][0]['issue'], ['INSTRUMENT_DECLINED', 'PAYER_ACTION_REQUIRED'])) + + return response()->json($response->json()); } /** @@ -369,6 +387,7 @@ class PayPalBasePaymentDriver extends BaseDriver */ public function getHeaders(array $headers = []): array { + return array_merge([ 'Accept' => 'application/json', 'Content-type' => 'application/json', diff --git a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php index 055e41d158..47141b678d 100644 --- a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php +++ b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php @@ -146,6 +146,12 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver try { $r = $this->gatewayRequest("/v2/checkout/orders/{$orderID}/capture", 'post', ['body' => '']); + + if($r->status() == 422) { + //handle conditions where the client may need to try again. + return $this->handleRetry($r, $request); + } + } catch(\Exception $e) { //Rescue for duplicate invoice_id @@ -192,8 +198,10 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver $this->client, $this->client->company, ); + + return response()->json(['redirect' => route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)], false)]); - return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]); + // return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]); } else { @@ -212,7 +220,9 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver $message = $response['body']['details'][0]['description'] ?? 'Payment failed. Please try again.'; - throw new PaymentFailed($message, 400); + return response()->json(['message' => $message], 400); + + // throw new PaymentFailed($message, 400); } } diff --git a/app/PaymentDrivers/PayPalRestPaymentDriver.php b/app/PaymentDrivers/PayPalRestPaymentDriver.php index 24f44b1274..5e19429d6f 100644 --- a/app/PaymentDrivers/PayPalRestPaymentDriver.php +++ b/app/PaymentDrivers/PayPalRestPaymentDriver.php @@ -66,6 +66,8 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver $request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']); $response = json_decode($request['gateway_response'], true); + nlog($response); + if($request->has('token') && strlen($request->input('token')) > 2) return $this->processTokenPayment($request, $response); @@ -93,7 +95,14 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver } try{ + $r = $this->gatewayRequest("/v2/checkout/orders/{$orderID}/capture", 'post', ['body' => '']); + + if($r->status() == 422){ + //handle conditions where the client may need to try again. + return $this->handleRetry($r, $request); + } + } catch(\Exception $e) { @@ -146,7 +155,9 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver $message = $response['body']['details'][0]['description'] ?? 'Payment failed. Please try again.'; - throw new PaymentFailed($message, 400); + return response()->json(['message' => $message], 400); + + //throw new PaymentFailed($message, 400); } } @@ -202,7 +213,9 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver $this->client->company, ); - return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]); + return response()->json(['redirect' => route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)], false)]); + + // return redirect()->route('client.payments.show', ['payment' => $this->encodePrimaryKey($payment->id)]); } @@ -257,10 +270,9 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver if(isset($data['payment_source'])) $order['payment_source'] = $data['payment_source']; - - $r = $this->gatewayRequest('/v2/checkout/orders', 'post', $order); + nlog($r->json()); return $r->json()['id']; } diff --git a/composer.lock b/composer.lock index 820a30388b..83821bd4ea 100644 --- a/composer.lock +++ b/composer.lock @@ -4588,16 +4588,16 @@ }, { "name": "horstoeko/zugferd", - "version": "v1.0.45", + "version": "v1.0.47", "source": { "type": "git", "url": "https://github.com/horstoeko/zugferd.git", - "reference": "b778941ebe5b262061443e375e2f6f46bf2a7cec" + "reference": "7a5a8b7bb44f7aebfd66af112662c30383f31dd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/horstoeko/zugferd/zipball/b778941ebe5b262061443e375e2f6f46bf2a7cec", - "reference": "b778941ebe5b262061443e375e2f6f46bf2a7cec", + "url": "https://api.github.com/repos/horstoeko/zugferd/zipball/7a5a8b7bb44f7aebfd66af112662c30383f31dd9", + "reference": "7a5a8b7bb44f7aebfd66af112662c30383f31dd9", "shasum": "" }, "require": { @@ -4657,9 +4657,9 @@ ], "support": { "issues": "https://github.com/horstoeko/zugferd/issues", - "source": "https://github.com/horstoeko/zugferd/tree/v1.0.45" + "source": "https://github.com/horstoeko/zugferd/tree/v1.0.47" }, - "time": "2024-05-21T14:57:41+00:00" + "time": "2024-05-23T03:12:53+00:00" }, { "name": "http-interop/http-factory-guzzle", diff --git a/resources/views/portal/ninja2020/gateways/paypal/pay.blade.php b/resources/views/portal/ninja2020/gateways/paypal/pay.blade.php index 05a9f6cf84..dfc319ddb1 100644 --- a/resources/views/portal/ninja2020/gateways/paypal/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/paypal/pay.blade.php @@ -26,7 +26,7 @@ @push('footer') -
+ -