From f26a20dbbd89aee27ca849272fe1f234e55b6b29 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 26 Oct 2020 06:15:03 +1100 Subject: [PATCH 01/11] working on date formatting --- app/Utils/HtmlEngine.php | 10 +- composer.lock | 990 ++++++++++++++++++++++++++++++++++----- 2 files changed, 873 insertions(+), 127 deletions(-) diff --git a/app/Utils/HtmlEngine.php b/app/Utils/HtmlEngine.php index 94a36c88b9c2..797675b26fd0 100644 --- a/app/Utils/HtmlEngine.php +++ b/app/Utils/HtmlEngine.php @@ -104,11 +104,11 @@ class HtmlEngine $data['$total_tax_values'] = ['value' => $this->totalTaxValues(), 'label' => ctrans('texts.taxes')]; $data['$line_tax_labels'] = ['value' => $this->lineTaxLabels(), 'label' => ctrans('texts.taxes')]; $data['$line_tax_values'] = ['value' => $this->lineTaxValues(), 'label' => ctrans('texts.taxes')]; - $data['$date'] = ['value' => $this->entity->date ?: ' ', 'label' => ctrans('texts.date')]; + $data['$date'] = ['value' => $this->formatDate($this->entity->date, $this->entity->client->date_format()) ?: ' ', 'label' => ctrans('texts.date')]; //$data['$invoice_date'] = ['value' => $this->date ?: ' ', 'label' => ctrans('texts.invoice_date')]; $data['$invoice.date'] = &$data['$date']; - $data['$due_date'] = ['value' => $this->entity->due_date ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')]; - $data['$payment_due'] = ['value' => $this->entity->due_date ?: ' ', 'label' => ctrans('texts.payment_due')]; + $data['$due_date'] = ['value' => $this->formatDate($this->entity->due_date, $this->entity->client->date_format()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')]; + $data['$payment_due'] = ['value' => $this->formatDate($this->entity->due_date, $this->entity->client->date_format()) ?: ' ', 'label' => ctrans('texts.payment_due')]; $data['$invoice.due_date'] = &$data['$due_date']; $data['$invoice.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')]; $data['$invoice.po_number'] = ['value' => $this->entity->po_number ?: ' ', 'label' => ctrans('texts.po_number')]; @@ -167,7 +167,7 @@ class HtmlEngine $data['$credit.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.credit_number')]; $data['$credit.total'] = &$data['$credit.total']; $data['$credit.po_number'] = &$data['$invoice.po_number']; - $data['$credit.date'] = ['value' => $this->entity->date, 'label' => ctrans('texts.credit_date')]; + $data['$credit.date'] = ['value' => $this->formatDate($this->entity->date, $this->entity->client->date_format()), 'label' => ctrans('texts.credit_date')]; $data['$balance'] = ['value' => Number::formatMoney($this->entity_calc->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.balance')]; $data['$credit.balance'] = &$data['$balance']; @@ -185,7 +185,7 @@ class HtmlEngine $data['$entity_issued_to'] = ['value' => '', 'label' => ctrans("texts.{$this->entity_string}_issued_to")]; $data['$your_entity'] = ['value' => '', 'label' => ctrans("texts.your_{$this->entity_string}")]; - $data['$quote.date'] = ['value' => $this->entity->date ?: ' ', 'label' => ctrans('texts.quote_date')]; + $data['$quote.date'] = ['value' => $this->formatDate($this->entity->date, $this->entity->client->date_format()) ?: ' ', 'label' => ctrans('texts.quote_date')]; $data['$quote.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.quote_number')]; $data['$quote.po_number'] = &$data['$invoice.po_number']; $data['$quote.quote_number'] = &$data['$quote.number']; diff --git a/composer.lock b/composer.lock index 4e7250b8470a..18d48d2d75c7 100644 --- a/composer.lock +++ b/composer.lock @@ -60,6 +60,10 @@ "open financial exchange", "parser" ], + "support": { + "issues": "https://github.com/asgrim/ofxparser/issues", + "source": "https://github.com/asgrim/ofxparser/tree/master" + }, "abandoned": true, "time": "2018-10-29T10:10:13+00:00" }, @@ -104,20 +108,24 @@ "ecommerce", "payment" ], + "support": { + "issues": "https://github.com/AuthorizeNet/sdk-php/issues", + "source": "https://github.com/AuthorizeNet/sdk-php/tree/master" + }, "time": "2019-01-14T13:32:41+00:00" }, { "name": "aws/aws-sdk-php", - "version": "3.158.11", + "version": "3.158.13", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "cdf3c097a606087654ac90ea1ffb8f3e86c423be" + "reference": "4d81b3f456435c30a4f9c71852164b6b46dc4d97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/cdf3c097a606087654ac90ea1ffb8f3e86c423be", - "reference": "cdf3c097a606087654ac90ea1ffb8f3e86c423be", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/4d81b3f456435c30a4f9c71852164b6b46dc4d97", + "reference": "4d81b3f456435c30a4f9c71852164b6b46dc4d97", "shasum": "" }, "require": { @@ -189,7 +197,12 @@ "s3", "sdk" ], - "time": "2020-10-21T18:12:19+00:00" + "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.158.13" + }, + "time": "2020-10-23T18:11:41+00:00" }, { "name": "brick/math", @@ -235,6 +248,10 @@ "brick", "math" ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/master" + }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/brick/math", @@ -296,6 +313,10 @@ "php", "sdk" ], + "support": { + "issues": "https://github.com/checkout/checkout-sdk-php/issues", + "source": "https://github.com/checkout/checkout-sdk-php/tree/1.0.13" + }, "time": "2020-10-12T13:00:31+00:00" }, { @@ -351,6 +372,10 @@ "xml", "xml invoice" ], + "support": { + "issues": "https://github.com/CleverIT/UBL_invoice/issues", + "source": "https://github.com/CleverIT/UBL_invoice/tree/v1.3.0" + }, "time": "2019-02-05T13:34:30+00:00" }, { @@ -403,6 +428,10 @@ "stream_filter_append", "stream_filter_register" ], + "support": { + "issues": "https://github.com/clue/php-stream-filter/issues", + "source": "https://github.com/clue/php-stream-filter/tree/v1.5.0" + }, "funding": [ { "url": "https://clue.engineering/support", @@ -469,6 +498,11 @@ "ssl", "tls" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.2.8" + }, "funding": [ { "url": "https://packagist.com", @@ -487,16 +521,16 @@ }, { "name": "composer/composer", - "version": "1.10.15", + "version": "1.10.16", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "547c9ee73fe26c77af09a0ea16419176b1cdbd12" + "reference": "217f0272673c72087862c40cf91ac07eb438d778" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/547c9ee73fe26c77af09a0ea16419176b1cdbd12", - "reference": "547c9ee73fe26c77af09a0ea16419176b1cdbd12", + "url": "https://api.github.com/repos/composer/composer/zipball/217f0272673c72087862c40cf91ac07eb438d778", + "reference": "217f0272673c72087862c40cf91ac07eb438d778", "shasum": "" }, "require": { @@ -563,6 +597,11 @@ "dependency", "package" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/composer/issues", + "source": "https://github.com/composer/composer/tree/1.10.16" + }, "funding": [ { "url": "https://packagist.com", @@ -577,7 +616,7 @@ "type": "tidelift" } ], - "time": "2020-10-13T13:59:09+00:00" + "time": "2020-10-24T07:55:59+00:00" }, { "name": "composer/package-versions-deprecated", @@ -632,6 +671,10 @@ } ], "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/master" + }, "funding": [ { "url": "https://packagist.com", @@ -707,6 +750,11 @@ "validation", "versioning" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/1.7.1" + }, "funding": [ { "url": "https://packagist.com", @@ -781,6 +829,11 @@ "spdx", "validator" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.4" + }, "funding": [ { "url": "https://packagist.com", @@ -799,16 +852,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.3", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ebd27a9866ae8254e873866f795491f02418c5a5" + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ebd27a9866ae8254e873866f795491f02418c5a5", - "reference": "ebd27a9866ae8254e873866f795491f02418c5a5", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", "shasum": "" }, "require": { @@ -839,6 +892,11 @@ "Xdebug", "performance" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/1.4.4" + }, "funding": [ { "url": "https://packagist.com", @@ -853,7 +911,7 @@ "type": "tidelift" } ], - "time": "2020-08-19T10:27:58+00:00" + "time": "2020-10-24T12:39:10+00:00" }, { "name": "czproject/git-php", @@ -895,6 +953,10 @@ "keywords": [ "git" ], + "support": { + "issues": "https://github.com/czproject/git-php/issues", + "source": "https://github.com/czproject/git-php/tree/v3.18.1" + }, "time": "2020-07-03T08:02:12+00:00" }, { @@ -928,6 +990,10 @@ "MIT" ], "description": "implementation of xdg base directory specification for php", + "support": { + "issues": "https://github.com/dnoegel/php-xdg-base-dir/issues", + "source": "https://github.com/dnoegel/php-xdg-base-dir/tree/v0.1.1" + }, "time": "2019-12-04T15:06:13+00:00" }, { @@ -1010,6 +1076,10 @@ "redis", "xcache" ], + "support": { + "issues": "https://github.com/doctrine/cache/issues", + "source": "https://github.com/doctrine/cache/tree/1.10.x" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1028,23 +1098,23 @@ }, { "name": "doctrine/dbal", - "version": "2.11.3", + "version": "2.12.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "fb5d5f2f26babf8dce217b1eb88300c22bb703a4" + "reference": "c6d37b4c42aaa3c3ee175f05eca68056f4185646" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/fb5d5f2f26babf8dce217b1eb88300c22bb703a4", - "reference": "fb5d5f2f26babf8dce217b1eb88300c22bb703a4", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/c6d37b4c42aaa3c3ee175f05eca68056f4185646", + "reference": "c6d37b4c42aaa3c3ee175f05eca68056f4185646", "shasum": "" }, "require": { "doctrine/cache": "^1.0", "doctrine/event-manager": "^1.0", "ext-pdo": "*", - "php": "^7.3" + "php": "^7.3 || ^8" }, "require-dev": { "doctrine/coding-standard": "^8.1", @@ -1117,6 +1187,10 @@ "sqlserver", "sqlsrv" ], + "support": { + "issues": "https://github.com/doctrine/dbal/issues", + "source": "https://github.com/doctrine/dbal/tree/2.12.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1131,7 +1205,7 @@ "type": "tidelift" } ], - "time": "2020-10-20T14:36:48+00:00" + "time": "2020-10-22T17:26:24+00:00" }, { "name": "doctrine/event-manager", @@ -1207,6 +1281,10 @@ "event system", "events" ], + "support": { + "issues": "https://github.com/doctrine/event-manager/issues", + "source": "https://github.com/doctrine/event-manager/tree/1.1.x" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1298,6 +1376,10 @@ "uppercase", "words" ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.x" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1374,6 +1456,10 @@ "parser", "php" ], + "support": { + "issues": "https://github.com/doctrine/lexer/issues", + "source": "https://github.com/doctrine/lexer/tree/1.2.1" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1436,6 +1522,10 @@ "cron", "schedule" ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.0.2" + }, "funding": [ { "url": "https://github.com/dragonmantank", @@ -1500,6 +1590,10 @@ "validation", "validator" ], + "support": { + "issues": "https://github.com/egulias/EmailValidator/issues", + "source": "https://github.com/egulias/EmailValidator/tree/2.1.22" + }, "time": "2020-09-26T15:48:38+00:00" }, { @@ -1556,28 +1650,32 @@ "laravel", "mailer" ], + "support": { + "issues": "https://github.com/fedeisas/laravel-mail-css-inliner/issues", + "source": "https://github.com/fedeisas/laravel-mail-css-inliner/tree/3.1" + }, "time": "2020-09-12T05:00:14+00:00" }, { "name": "fideloper/proxy", - "version": "4.4.0", + "version": "4.4.1", "source": { "type": "git", "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8" + "reference": "c073b2bd04d1c90e04dc1b787662b558dd65ade0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", - "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", + "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/c073b2bd04d1c90e04dc1b787662b558dd65ade0", + "reference": "c073b2bd04d1c90e04dc1b787662b558dd65ade0", "shasum": "" }, "require": { - "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0", + "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0", "php": ">=5.4.0" }, "require-dev": { - "illuminate/http": "^5.0|^6.0|^7.0|^8.0", + "illuminate/http": "^5.0|^6.0|^7.0|^8.0|^9.0", "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.0" }, @@ -1610,7 +1708,11 @@ "proxy", "trusted proxy" ], - "time": "2020-06-23T01:36:47+00:00" + "support": { + "issues": "https://github.com/fideloper/TrustedProxy/issues", + "source": "https://github.com/fideloper/TrustedProxy/tree/4.4.1" + }, + "time": "2020-10-22T13:48:01+00:00" }, { "name": "firebase/php-jwt", @@ -1660,6 +1762,10 @@ "jwt", "php" ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/master" + }, "time": "2020-03-25T18:49:23+00:00" }, { @@ -1710,20 +1816,24 @@ "faker", "fixtures" ], + "support": { + "issues": "https://github.com/fzaninotto/Faker/issues", + "source": "https://github.com/fzaninotto/Faker/tree/v1.9.1" + }, "time": "2019-12-12T13:22:17+00:00" }, { "name": "google/apiclient", - "version": "v2.7.2", + "version": "v2.8.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-api-php-client.git", - "reference": "9df720d72c59456b5466e3f66e1e78cfe422a5ba" + "reference": "cf9a070f9da78cd207a69b2a94832d381c8c4163" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/9df720d72c59456b5466e3f66e1e78cfe422a5ba", - "reference": "9df720d72c59456b5466e3f66e1e78cfe422a5ba", + "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/cf9a070f9da78cd207a69b2a94832d381c8c4163", + "reference": "cf9a070f9da78cd207a69b2a94832d381c8c4163", "shasum": "" }, "require": { @@ -1747,7 +1857,7 @@ "symfony/dom-crawler": "~2.1" }, "suggest": { - "cache/filesystem-adapter": "For caching certs and tokens (using Google_Client::setCache)" + "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" }, "type": "library", "extra": { @@ -1756,11 +1866,14 @@ } }, "autoload": { - "psr-0": { - "Google_": "src/" + "psr-4": { + "Google\\": "src/" }, + "files": [ + "src/aliases.php" + ], "classmap": [ - "src/Google/Service/" + "src/aliases.php" ] }, "notification-url": "https://packagist.org/downloads/", @@ -1772,7 +1885,11 @@ "keywords": [ "google" ], - "time": "2020-09-18T20:02:04+00:00" + "support": { + "issues": "https://github.com/googleapis/google-api-php-client/issues", + "source": "https://github.com/googleapis/google-api-php-client/tree/v2.8.0" + }, + "time": "2020-10-23T20:29:29+00:00" }, { "name": "google/apiclient-services", @@ -1809,6 +1926,10 @@ "keywords": [ "google" ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client-services/issues", + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.151" + }, "time": "2020-10-19T00:26:26+00:00" }, { @@ -1861,6 +1982,11 @@ "google", "oauth2" ], + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/master/", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.14.3" + }, "time": "2020-10-16T21:33:48+00:00" }, { @@ -1913,6 +2039,10 @@ "Result-Type", "result" ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.1" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -2003,6 +2133,10 @@ "rest", "web service" ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.2.0" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -2072,6 +2206,10 @@ "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.4.0" + }, "time": "2020-09-30T07:37:28+00:00" }, { @@ -2143,6 +2281,10 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/1.7.0" + }, "time": "2020-09-30T07:37:11+00:00" }, { @@ -2209,6 +2351,10 @@ "obfuscate", "youtube" ], + "support": { + "issues": "https://github.com/vinkla/hashids/issues", + "source": "https://github.com/vinkla/hashids/tree/3.0.0" + }, "time": "2018-03-12T16:30:09+00:00" }, { @@ -2259,6 +2405,10 @@ "psr-17", "psr-7" ], + "support": { + "issues": "https://github.com/http-interop/http-factory-guzzle/issues", + "source": "https://github.com/http-interop/http-factory-guzzle/tree/master" + }, "time": "2018-07-31T19:32:56+00:00" }, { @@ -2329,6 +2479,10 @@ "thumbnail", "watermark" ], + "support": { + "issues": "https://github.com/Intervention/image/issues", + "source": "https://github.com/Intervention/image/tree/master" + }, "time": "2019-11-02T09:15:47+00:00" }, { @@ -2380,6 +2534,10 @@ "release", "versions" ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/1.5.1" + }, "time": "2020-09-14T08:43:34+00:00" }, { @@ -2446,6 +2604,10 @@ "json", "schema" ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.10" + }, "time": "2020-05-27T16:41:55+00:00" }, { @@ -2492,6 +2654,10 @@ "presenter", "view" ], + "support": { + "issues": "https://github.com/laracasts/Presenter/issues", + "source": "https://github.com/laracasts/Presenter/tree/master" + }, "time": "2020-09-07T13:30:46+00:00" }, { @@ -2655,6 +2821,10 @@ "framework", "laravel" ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, "time": "2020-10-20T20:12:53+00:00" }, { @@ -2712,6 +2882,10 @@ "notifications", "slack" ], + "support": { + "issues": "https://github.com/laravel/slack-notification-channel/issues", + "source": "https://github.com/laravel/slack-notification-channel/tree/v2.2.0" + }, "time": "2020-08-25T18:21:34+00:00" }, { @@ -2777,6 +2951,10 @@ "laravel", "oauth" ], + "support": { + "issues": "https://github.com/laravel/socialite/issues", + "source": "https://github.com/laravel/socialite" + }, "time": "2020-10-21T12:45:02+00:00" }, { @@ -2841,6 +3019,10 @@ "laravel", "psysh" ], + "support": { + "issues": "https://github.com/laravel/tinker/issues", + "source": "https://github.com/laravel/tinker/tree/2.x" + }, "time": "2020-08-11T19:28:08+00:00" }, { @@ -2895,6 +3077,10 @@ "laravel", "ui" ], + "support": { + "issues": "https://github.com/laravel/ui/issues", + "source": "https://github.com/laravel/ui/tree/v3.0.0" + }, "time": "2020-09-11T15:34:08+00:00" }, { @@ -2964,6 +3150,12 @@ "md", "parser" ], + "support": { + "docs": "https://commonmark.thephpleague.com/", + "issues": "https://github.com/thephpleague/commonmark/issues", + "rss": "https://github.com/thephpleague/commonmark/releases.atom", + "source": "https://github.com/thephpleague/commonmark" + }, "funding": [ { "url": "https://enjoy.gitstore.app/repositories/thephpleague/commonmark", @@ -3075,6 +3267,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.x" + }, "funding": [ { "url": "https://offset.earth/frankdejonge", @@ -3128,6 +3324,10 @@ } ], "description": "Flysystem adapter for the AWS S3 SDK v3.x", + "support": { + "issues": "https://github.com/thephpleague/flysystem-aws-s3-v3/issues", + "source": "https://github.com/thephpleague/flysystem-aws-s3-v3/tree/1.0.29" + }, "time": "2020-10-08T18:58:37+00:00" }, { @@ -3175,6 +3375,10 @@ } ], "description": "An adapter decorator to enable meta-data caching.", + "support": { + "issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues", + "source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master" + }, "time": "2020-07-25T15:56:04+00:00" }, { @@ -3239,6 +3443,10 @@ "league", "rest" ], + "support": { + "issues": "https://github.com/thephpleague/fractal/issues", + "source": "https://github.com/thephpleague/fractal/tree/master" + }, "time": "2017-06-12T11:04:56+00:00" }, { @@ -3300,6 +3508,10 @@ "manipulation", "processing" ], + "support": { + "issues": "https://github.com/thephpleague/glide/issues", + "source": "https://github.com/thephpleague/glide/tree/1.6.0" + }, "time": "2020-07-07T12:23:45+00:00" }, { @@ -3341,6 +3553,10 @@ } ], "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.5.1" + }, "funding": [ { "url": "https://github.com/frankdejonge", @@ -3422,6 +3638,10 @@ "tumblr", "twitter" ], + "support": { + "issues": "https://github.com/thephpleague/oauth1-client/issues", + "source": "https://github.com/thephpleague/oauth1-client/tree/v1.8.2" + }, "time": "2020-09-28T09:39:08+00:00" }, { @@ -3447,6 +3667,7 @@ "require-dev": { "omnipay/tests": "^3" }, + "default-branch": true, "type": "metapackage", "extra": { "branch-alias": { @@ -3475,6 +3696,10 @@ "omnipay", "payment" ], + "support": { + "issues": "https://github.com/thephpleague/omnipay/issues", + "source": "https://github.com/thephpleague/omnipay/tree/master" + }, "time": "2020-09-22T14:02:17+00:00" }, { @@ -3532,6 +3757,10 @@ } ], "description": "A front-end framework for Laravel.", + "support": { + "issues": "https://github.com/livewire/livewire/issues", + "source": "https://github.com/livewire/livewire/tree/v1.3.5" + }, "funding": [ { "url": "https://github.com/calebporzio", @@ -3599,6 +3828,10 @@ "stream", "zip" ], + "support": { + "issues": "https://github.com/maennchen/ZipStream-PHP/issues", + "source": "https://github.com/maennchen/ZipStream-PHP/tree/master" + }, "time": "2019-07-17T11:01:58+00:00" }, { @@ -3681,6 +3914,10 @@ "money", "vo" ], + "support": { + "issues": "https://github.com/moneyphp/money/issues", + "source": "https://github.com/moneyphp/money/tree/master" + }, "time": "2020-03-18T17:49:59+00:00" }, { @@ -3762,6 +3999,10 @@ "logging", "psr-3" ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.1.1" + }, "funding": [ { "url": "https://github.com/Seldaek", @@ -3829,6 +4070,10 @@ "json", "jsonpath" ], + "support": { + "issues": "https://github.com/jmespath/jmespath.php/issues", + "source": "https://github.com/jmespath/jmespath.php/tree/2.6.0" + }, "time": "2020-07-31T21:01:56+00:00" }, { @@ -3875,20 +4120,24 @@ "keywords": [ "enum" ], + "support": { + "issues": "https://github.com/myclabs/php-enum/issues", + "source": "https://github.com/myclabs/php-enum/tree/master" + }, "time": "2020-02-14T08:15:52+00:00" }, { "name": "nesbot/carbon", - "version": "2.41.4", + "version": "2.41.5", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "6571aec754a648ef476a8d8f57993f7bc965afe4" + "reference": "c4a9caf97cfc53adfc219043bcecf42bc663acee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/6571aec754a648ef476a8d8f57993f7bc965afe4", - "reference": "6571aec754a648ef476a8d8f57993f7bc965afe4", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/c4a9caf97cfc53adfc219043bcecf42bc663acee", + "reference": "c4a9caf97cfc53adfc219043bcecf42bc663acee", "shasum": "" }, "require": { @@ -3954,6 +4203,10 @@ "datetime", "time" ], + "support": { + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, "funding": [ { "url": "https://opencollective.com/Carbon", @@ -3964,7 +4217,7 @@ "type": "tidelift" } ], - "time": "2020-10-22T07:28:05+00:00" + "time": "2020-10-23T06:02:30+00:00" }, { "name": "nikic/php-parser", @@ -4016,6 +4269,10 @@ "parser", "php" ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.10.2" + }, "time": "2020-09-26T10:30:38+00:00" }, { @@ -4087,6 +4344,10 @@ "nwidart", "rad" ], + "support": { + "issues": "https://github.com/nWidart/laravel-modules/issues", + "source": "https://github.com/nWidart/laravel-modules/tree/master" + }, "time": "2019-11-12T18:38:48+00:00" }, { @@ -4169,6 +4430,10 @@ "payment", "purchase" ], + "support": { + "issues": "https://github.com/thephpleague/omnipay-common/issues", + "source": "https://github.com/thephpleague/omnipay-common/tree/master" + }, "time": "2020-06-02T05:57:19+00:00" }, { @@ -4229,6 +4494,10 @@ "paypal", "purchase" ], + "support": { + "issues": "https://github.com/thephpleague/omnipay-paypal/issues", + "source": "https://github.com/thephpleague/omnipay-paypal/tree/v3.0.2" + }, "time": "2018-05-15T10:35:58+00:00" }, { @@ -4290,6 +4559,10 @@ "serialization", "serialize" ], + "support": { + "issues": "https://github.com/opis/closure/issues", + "source": "https://github.com/opis/closure/tree/3.6.0" + }, "time": "2020-10-11T21:42:15+00:00" }, { @@ -4335,6 +4608,11 @@ "pseudorandom", "random" ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, "time": "2020-10-15T08:29:30+00:00" }, { @@ -4406,6 +4684,10 @@ "http", "httplug" ], + "support": { + "issues": "https://github.com/php-http/client-common/issues", + "source": "https://github.com/php-http/client-common/tree/2.3.0" + }, "time": "2020-07-21T10:04:13+00:00" }, { @@ -4471,6 +4753,10 @@ "message", "psr7" ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.12.0" + }, "time": "2020-09-22T13:31:04+00:00" }, { @@ -4529,6 +4815,10 @@ "Guzzle", "http" ], + "support": { + "issues": "https://github.com/php-http/guzzle7-adapter/issues", + "source": "https://github.com/php-http/guzzle7-adapter/tree/0.1.1" + }, "time": "2020-10-21T17:30:51+00:00" }, { @@ -4587,6 +4877,10 @@ "client", "http" ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/master" + }, "time": "2020-07-13T15:43:23+00:00" }, { @@ -4660,6 +4954,10 @@ "message", "psr-7" ], + "support": { + "issues": "https://github.com/php-http/message/issues", + "source": "https://github.com/php-http/message/tree/1.9.1" + }, "time": "2020-10-13T06:21:08+00:00" }, { @@ -4710,6 +5008,10 @@ "stream", "uri" ], + "support": { + "issues": "https://github.com/php-http/message-factory/issues", + "source": "https://github.com/php-http/message-factory/tree/master" + }, "time": "2015-12-19T14:08:53+00:00" }, { @@ -4763,6 +5065,10 @@ "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.1.0" + }, "time": "2020-07-07T09:29:14+00:00" }, { @@ -4818,6 +5124,10 @@ "php", "type" ], + "support": { + "issues": "https://github.com/schmittjoh/php-option/issues", + "source": "https://github.com/schmittjoh/php-option/tree/1.7.5" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -4919,6 +5229,10 @@ "x.509", "x509" ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/2.0" + }, "funding": [ { "url": "https://github.com/terrafrost", @@ -5002,6 +5316,10 @@ "predis", "redis" ], + "support": { + "issues": "https://github.com/predis/predis/issues", + "source": "https://github.com/predis/predis/tree/v1.1.6" + }, "funding": [ { "url": "https://github.com/sponsors/tillkruss", @@ -5054,6 +5372,9 @@ "psr", "psr-6" ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, "time": "2016-08-06T20:24:11+00:00" }, { @@ -5103,6 +5424,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -5149,6 +5474,10 @@ "psr", "psr-14" ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, "time": "2019-01-08T18:20:26+00:00" }, { @@ -5198,6 +5527,9 @@ "psr", "psr-18" ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, "time": "2020-06-29T06:28:15+00:00" }, { @@ -5250,6 +5582,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, "time": "2019-04-30T12:38:16+00:00" }, { @@ -5300,6 +5635,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, { @@ -5347,6 +5685,9 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.3" + }, "time": "2020-03-23T09:12:05+00:00" }, { @@ -5395,6 +5736,9 @@ "psr-16", "simple-cache" ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, "time": "2017-10-23T01:57:42+00:00" }, { @@ -5467,6 +5811,10 @@ "interactive", "shell" ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/master" + }, "time": "2020-05-03T19:32:03+00:00" }, { @@ -5507,6 +5855,10 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { @@ -5570,6 +5922,10 @@ "queue", "set" ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.1.1" + }, "funding": [ { "url": "https://github.com/ramsey", @@ -5657,6 +6013,11 @@ "identifier", "uuid" ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "rss": "https://github.com/ramsey/uuid/releases.atom", + "source": "https://github.com/ramsey/uuid" + }, "funding": [ { "url": "https://github.com/ramsey", @@ -5715,6 +6076,11 @@ "uri", "url" ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/uri/issues", + "source": "https://github.com/fruux/sabre-uri" + }, "time": "2020-10-03T10:33:23+00:00" }, { @@ -5778,6 +6144,11 @@ "dom", "xml" ], + "support": { + "forum": "https://groups.google.com/group/sabredav-discuss", + "issues": "https://github.com/sabre-io/xml/issues", + "source": "https://github.com/fruux/sabre-xml" + }, "time": "2019-01-09T13:51:57+00:00" }, { @@ -5827,6 +6198,10 @@ "parser", "validator" ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/master" + }, "funding": [ { "url": "https://github.com/Seldaek", @@ -5881,6 +6256,10 @@ "keywords": [ "phar" ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/master" + }, "time": "2020-07-07T18:42:57+00:00" }, { @@ -5924,6 +6303,9 @@ "logging", "sentry" ], + "support": { + "source": "https://github.com/getsentry/sentry-php-sdk/tree/3.0.0" + }, "funding": [ { "url": "https://sentry.io/", @@ -6024,6 +6406,10 @@ "logging", "sentry" ], + "support": { + "issues": "https://github.com/getsentry/sentry-php/issues", + "source": "https://github.com/getsentry/sentry-php/tree/3.0.3" + }, "funding": [ { "url": "https://sentry.io/", @@ -6105,6 +6491,10 @@ "logging", "sentry" ], + "support": { + "issues": "https://github.com/getsentry/sentry-laravel/issues", + "source": "https://github.com/getsentry/sentry-laravel/tree/2.1.1" + }, "funding": [ { "url": "https://sentry.io/", @@ -6171,6 +6561,10 @@ "screenshot", "webpage" ], + "support": { + "issues": "https://github.com/spatie/browsershot/issues", + "source": "https://github.com/spatie/browsershot/tree/3.40.0" + }, "funding": [ { "url": "https://github.com/spatie", @@ -6231,6 +6625,10 @@ "image", "spatie" ], + "support": { + "issues": "https://github.com/spatie/image/issues", + "source": "https://github.com/spatie/image/tree/master" + }, "time": "2020-01-26T18:56:44+00:00" }, { @@ -6281,6 +6679,10 @@ "image-optimizer", "spatie" ], + "support": { + "issues": "https://github.com/spatie/image-optimizer/issues", + "source": "https://github.com/spatie/image-optimizer/tree/master" + }, "time": "2019-11-25T12:29:24+00:00" }, { @@ -6327,6 +6729,10 @@ "spatie", "temporary-directory" ], + "support": { + "issues": "https://github.com/spatie/temporary-directory/issues", + "source": "https://github.com/spatie/temporary-directory/tree/master" + }, "time": "2020-09-07T20:41:15+00:00" }, { @@ -6370,6 +6776,10 @@ } ], "description": "Laravel Eloquent HasManyThrough relationships with unlimited levels", + "support": { + "issues": "https://github.com/staudenmeir/eloquent-has-many-deep/issues", + "source": "https://github.com/staudenmeir/eloquent-has-many-deep/tree/v1.13" + }, "funding": [ { "url": "https://paypal.me/JonasStaudenmeir", @@ -6433,6 +6843,10 @@ "payment processing", "stripe" ], + "support": { + "issues": "https://github.com/stripe/stripe-php/issues", + "source": "https://github.com/stripe/stripe-php/tree/v7.61.0" + }, "time": "2020-10-20T20:01:45+00:00" }, { @@ -6495,6 +6909,10 @@ "mail", "mailer" ], + "support": { + "issues": "https://github.com/swiftmailer/swiftmailer/issues", + "source": "https://github.com/swiftmailer/swiftmailer/tree/v6.2.3" + }, "time": "2019-11-12T09:31:26+00:00" }, { @@ -6574,6 +6992,9 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -6588,7 +7009,7 @@ "type": "tidelift" } ], - "time": "2020-09-18T14:27:32+00:00" + "time": "2020-10-07T15:23:00+00:00" }, { "name": "symfony/css-selector", @@ -6641,6 +7062,9 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v5.1.4" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -6705,6 +7129,9 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/master" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -6776,6 +7203,9 @@ ], "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/error-handler/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -6863,6 +7293,9 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -6939,6 +7372,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.2.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7003,6 +7439,9 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7066,6 +7505,9 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7152,6 +7594,9 @@ ], "description": "Symfony HttpClient component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-client/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7228,6 +7673,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v2.3.1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7303,6 +7751,9 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-foundation/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7417,6 +7868,9 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/http-kernel/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7494,6 +7948,9 @@ "mime", "mime-type" ], + "support": { + "source": "https://github.com/symfony/mime/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7564,6 +8021,9 @@ "configuration", "options" ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7582,16 +8042,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", - "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", "shasum": "" }, "require": { @@ -7603,7 +8063,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7640,6 +8100,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7654,20 +8117,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "6c2f78eb8f5ab8eaea98f6d414a5915f2e0fce36" + "reference": "085241787d52fa6f7a774fd034135fef0cfd5496" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/6c2f78eb8f5ab8eaea98f6d414a5915f2e0fce36", - "reference": "6c2f78eb8f5ab8eaea98f6d414a5915f2e0fce36", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/085241787d52fa6f7a774fd034135fef0cfd5496", + "reference": "085241787d52fa6f7a774fd034135fef0cfd5496", "shasum": "" }, "require": { @@ -7679,7 +8142,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7717,6 +8180,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-iconv/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7731,20 +8197,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5" + "reference": "64fbe93b02024763359aea2bc81af05086c6af82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b740103edbdcc39602239ee8860f0f45a8eb9aa5", - "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64fbe93b02024763359aea2bc81af05086c6af82", + "reference": "64fbe93b02024763359aea2bc81af05086c6af82", "shasum": "" }, "require": { @@ -7756,7 +8222,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7795,6 +8261,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7809,20 +8278,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251" + "reference": "4ad5115c0f5d5172a9fe8147675ec6de266d8826" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/5dcab1bc7146cf8c1beaa4502a3d9be344334251", - "reference": "5dcab1bc7146cf8c1beaa4502a3d9be344334251", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/4ad5115c0f5d5172a9fe8147675ec6de266d8826", + "reference": "4ad5115c0f5d5172a9fe8147675ec6de266d8826", "shasum": "" }, "require": { @@ -7837,7 +8306,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7880,6 +8349,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7894,20 +8366,20 @@ "type": "tidelift" } ], - "time": "2020-08-04T06:02:08+00:00" + "time": "2020-10-21T09:57:48+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + "reference": "8db0ae7936b42feb370840cf24de1a144fb0ef27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", - "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8db0ae7936b42feb370840cf24de1a144fb0ef27", + "reference": "8db0ae7936b42feb370840cf24de1a144fb0ef27", "shasum": "" }, "require": { @@ -7919,7 +8391,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -7961,6 +8433,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -7975,20 +8450,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", - "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce", "shasum": "" }, "require": { @@ -8000,7 +8475,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8038,6 +8513,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8052,20 +8530,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3" + "reference": "3fe414077251a81a1b15b1c709faf5c2fbae3d4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", - "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3fe414077251a81a1b15b1c709faf5c2fbae3d4e", + "reference": "3fe414077251a81a1b15b1c709faf5c2fbae3d4e", "shasum": "" }, "require": { @@ -8075,7 +8553,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8115,6 +8593,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php70/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8129,20 +8610,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "639447d008615574653fb3bc60d1986d7172eaae" + "reference": "beecef6b463b06954638f02378f52496cb84bacc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", - "reference": "639447d008615574653fb3bc60d1986d7172eaae", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/beecef6b463b06954638f02378f52496cb84bacc", + "reference": "beecef6b463b06954638f02378f52496cb84bacc", "shasum": "" }, "require": { @@ -8151,7 +8632,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8188,6 +8669,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8202,20 +8686,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca" + "reference": "9d920e3218205554171b2503bb3e4a1366824a16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fffa1a52a023e782cdcc221d781fe1ec8f87fcca", - "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9d920e3218205554171b2503bb3e4a1366824a16", + "reference": "9d920e3218205554171b2503bb3e4a1366824a16", "shasum": "" }, "require": { @@ -8224,7 +8708,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8264,6 +8748,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8278,20 +8765,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + "reference": "f54ef00f4678f348f133097fa8c3701d197ff44d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", - "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/f54ef00f4678f348f133097fa8c3701d197ff44d", + "reference": "f54ef00f4678f348f133097fa8c3701d197ff44d", "shasum": "" }, "require": { @@ -8300,7 +8787,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8344,6 +8831,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8358,20 +8848,20 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-23T09:01:57+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.18.1", + "version": "v1.19.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "da48e2cccd323e48c16c26481bf5800f6ab1c49d" + "reference": "0cb03887bd447b892a8db9504b62659bf375056d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/da48e2cccd323e48c16c26481bf5800f6ab1c49d", - "reference": "da48e2cccd323e48c16c26481bf5800f6ab1c49d", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/0cb03887bd447b892a8db9504b62659bf375056d", + "reference": "0cb03887bd447b892a8db9504b62659bf375056d", "shasum": "" }, "require": { @@ -8384,7 +8874,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.18-dev" + "dev-main": "1.19-dev" }, "thanks": { "name": "symfony/polyfill", @@ -8421,6 +8911,9 @@ "portable", "uuid" ], + "support": { + "source": "https://github.com/symfony/polyfill-uuid/tree/v1.19.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8435,7 +8928,7 @@ "type": "tidelift" } ], - "time": "2020-07-14T12:35:20+00:00" + "time": "2020-10-21T09:57:48+00:00" }, { "name": "symfony/process", @@ -8485,6 +8978,9 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/5.1" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8577,6 +9073,9 @@ "uri", "url" ], + "support": { + "source": "https://github.com/symfony/routing/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8653,6 +9152,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/master" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8738,6 +9240,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8830,6 +9335,9 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8905,6 +9413,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.3.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -8995,6 +9506,9 @@ "debug", "dump" ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -9058,6 +9572,10 @@ ], "description": "CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.", "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", + "support": { + "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/2.2.3" + }, "time": "2020-07-13T06:12:54+00:00" }, { @@ -9118,6 +9636,9 @@ "lightlogs", "turbo124" ], + "support": { + "source": "https://github.com/turbo124/beacon/tree/1.0.3" + }, "time": "2020-10-01T05:21:36+00:00" }, { @@ -9184,6 +9705,9 @@ "gmail", "laravel" ], + "support": { + "source": "https://github.com/turbo124/laravel-gmail/tree/v5.0.0" + }, "time": "2020-10-01T03:04:41+00:00" }, { @@ -9250,6 +9774,10 @@ "env", "environment" ], + "support": { + "issues": "https://github.com/vlucas/phpdotenv/issues", + "source": "https://github.com/vlucas/phpdotenv/tree/v5.2.0" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -9308,6 +9836,10 @@ "clean", "php" ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/master" + }, "funding": [ { "url": "https://www.paypal.me/moelleken", @@ -9349,6 +9881,7 @@ "require": { "php": ">=5.3.0" }, + "default-branch": true, "type": "library", "extra": { "laravel": { @@ -9392,6 +9925,10 @@ "iso_3166_3", "laravel" ], + "support": { + "issues": "https://github.com/webpatser/laravel-countries/issues", + "source": "https://github.com/webpatser/laravel-countries" + }, "time": "2019-07-12T14:06:05+00:00" } ], @@ -9467,6 +10004,10 @@ "foundation", "laravel" ], + "support": { + "issues": "https://github.com/formers/former/issues", + "source": "https://github.com/formers/former/tree/4.5.0" + }, "time": "2020-09-23T18:18:13+00:00" }, { @@ -9509,6 +10050,10 @@ } ], "description": "A set of classes to create and manipulate HTML objects abstractions", + "support": { + "issues": "https://github.com/Anahkiasen/html-object/issues", + "source": "https://github.com/Anahkiasen/html-object/tree/master" + }, "time": "2017-05-31T07:52:45+00:00" }, { @@ -9579,6 +10124,10 @@ "profiler", "webprofiler" ], + "support": { + "issues": "https://github.com/barryvdh/laravel-debugbar/issues", + "source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.5.1" + }, "funding": [ { "url": "https://github.com/barryvdh", @@ -9660,6 +10209,10 @@ "phpunit", "testing" ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/5.0.4" + }, "time": "2020-08-26T13:44:25+00:00" }, { @@ -9725,6 +10278,10 @@ "laravel", "swagger" ], + "support": { + "issues": "https://github.com/DarkaOnLine/L5-Swagger/issues", + "source": "https://github.com/DarkaOnLine/L5-Swagger/tree/8.0.2" + }, "funding": [ { "url": "https://github.com/DarkaOnLine", @@ -9735,16 +10292,16 @@ }, { "name": "doctrine/annotations", - "version": "1.10.4", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "bfe91e31984e2ba76df1c1339681770401ec262f" + "reference": "88fb6fb1dae011de24dd6b632811c1ff5c2928f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/bfe91e31984e2ba76df1c1339681770401ec262f", - "reference": "bfe91e31984e2ba76df1c1339681770401ec262f", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/88fb6fb1dae011de24dd6b632811c1ff5c2928f5", + "reference": "88fb6fb1dae011de24dd6b632811c1ff5c2928f5", "shasum": "" }, "require": { @@ -9754,13 +10311,14 @@ }, "require-dev": { "doctrine/cache": "1.*", + "doctrine/coding-standard": "^6.0 || ^8.1", "phpstan/phpstan": "^0.12.20", "phpunit/phpunit": "^7.5 || ^9.1.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9.x-dev" + "dev-master": "1.11.x-dev" } }, "autoload": { @@ -9795,13 +10353,17 @@ } ], "description": "Docblock Annotations Parser", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org/projects/annotations.html", "keywords": [ "annotations", "docblock", "parser" ], - "time": "2020-08-10T19:35:50+00:00" + "support": { + "issues": "https://github.com/doctrine/annotations/issues", + "source": "https://github.com/doctrine/annotations/tree/1.11.0" + }, + "time": "2020-10-17T22:05:33+00:00" }, { "name": "doctrine/instantiator", @@ -9857,6 +10419,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.3.x" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -9926,6 +10492,10 @@ "flare", "reporting" ], + "support": { + "issues": "https://github.com/facade/flare-client-php/issues", + "source": "https://github.com/facade/flare-client-php/tree/1.3.7" + }, "funding": [ { "url": "https://github.com/spatie", @@ -10004,6 +10574,12 @@ "laravel", "page" ], + "support": { + "docs": "https://flareapp.io/docs/ignition-for-laravel/introduction", + "forum": "https://twitter.com/flareappio", + "issues": "https://github.com/facade/ignition/issues", + "source": "https://github.com/facade/ignition" + }, "time": "2020-10-14T08:59:59+00:00" }, { @@ -10053,6 +10629,10 @@ "flare", "ignition" ], + "support": { + "issues": "https://github.com/facade/ignition-contracts/issues", + "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" + }, "time": "2020-10-16T08:27:54+00:00" }, { @@ -10114,6 +10694,10 @@ "throwable", "whoops" ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.9.0" + }, "time": "2020-10-20T12:00:00+00:00" }, { @@ -10161,6 +10745,10 @@ "keywords": [ "test" ], + "support": { + "issues": "https://github.com/hamcrest/hamcrest-php/issues", + "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" + }, "time": "2020-07-09T08:09:16+00:00" }, { @@ -10222,6 +10810,10 @@ "debug", "debugbar" ], + "support": { + "issues": "https://github.com/maximebf/php-debugbar/issues", + "source": "https://github.com/maximebf/php-debugbar/tree/v1.16.3" + }, "time": "2020-05-06T07:06:27+00:00" }, { @@ -10290,6 +10882,10 @@ "test double", "testing" ], + "support": { + "issues": "https://github.com/mockery/mockery/issues", + "source": "https://github.com/mockery/mockery/tree/master" + }, "time": "2020-08-11T18:10:13+00:00" }, { @@ -10338,6 +10934,10 @@ "object", "object graph" ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.x" + }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", @@ -10414,6 +11014,10 @@ "php", "symfony" ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, "funding": [ { "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", @@ -10484,6 +11088,10 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/master" + }, "time": "2020-06-27T14:33:11+00:00" }, { @@ -10531,6 +11139,10 @@ } ], "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/master" + }, "time": "2020-06-27T14:39:04+00:00" }, { @@ -10580,6 +11192,10 @@ "reflection", "static analysis" ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, "time": "2020-06-27T09:03:43+00:00" }, { @@ -10632,6 +11248,10 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, "time": "2020-09-03T19:13:55+00:00" }, { @@ -10677,6 +11297,10 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + }, "time": "2020-09-17T18:55:26+00:00" }, { @@ -10740,6 +11364,10 @@ "spy", "stub" ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.12.1" + }, "time": "2020-09-29T09:10:42+00:00" }, { @@ -10807,6 +11435,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.0" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -10863,6 +11495,10 @@ "filesystem", "iterator" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -10922,6 +11558,10 @@ "keywords": [ "process" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -10977,6 +11617,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11032,6 +11676,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11127,6 +11775,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.2" + }, "funding": [ { "url": "https://phpunit.de/donate.html", @@ -11206,6 +11858,10 @@ "highlight.php", "syntax" ], + "support": { + "issues": "https://github.com/scrivo/highlight.php/issues", + "source": "https://github.com/scrivo/highlight.php" + }, "funding": [ { "url": "https://github.com/allejo", @@ -11258,6 +11914,10 @@ ], "description": "Library for parsing CLI options", "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11310,6 +11970,10 @@ ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.7" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11361,6 +12025,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11431,6 +12099,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11484,6 +12156,10 @@ ], "description": "Library for calculating the complexity of PHP code units", "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11546,6 +12222,10 @@ "unidiff", "unified diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11605,6 +12285,10 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11678,6 +12362,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11738,6 +12426,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11791,6 +12483,10 @@ ], "description": "Library for counting the lines of code in PHP source code", "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11844,6 +12540,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11895,6 +12595,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -11954,6 +12658,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -12005,6 +12713,10 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -12057,6 +12769,10 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/2.3.0" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -12106,6 +12822,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -12116,16 +12836,16 @@ }, { "name": "swagger-api/swagger-ui", - "version": "v3.35.2", + "version": "v3.36.0", "source": { "type": "git", "url": "https://github.com/swagger-api/swagger-ui.git", - "reference": "8fecd98c8bdc9541555155065d477d41d0bf3233" + "reference": "b9915b112821eca7bd99926787fbe38b91204d5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/8fecd98c8bdc9541555155065d477d41d0bf3233", - "reference": "8fecd98c8bdc9541555155065d477d41d0bf3233", + "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/b9915b112821eca7bd99926787fbe38b91204d5d", + "reference": "b9915b112821eca7bd99926787fbe38b91204d5d", "shasum": "" }, "type": "library", @@ -12169,7 +12889,11 @@ "swagger", "ui" ], - "time": "2020-10-15T21:07:34+00:00" + "support": { + "issues": "https://github.com/swagger-api/swagger-ui/issues", + "source": "https://github.com/swagger-api/swagger-ui/tree/v3.36.0" + }, + "time": "2020-10-22T17:41:54+00:00" }, { "name": "symfony/debug", @@ -12226,6 +12950,9 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/4.4" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -12303,6 +13030,9 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.1.7" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -12357,6 +13087,10 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/master" + }, "funding": [ { "url": "https://github.com/theseer", @@ -12412,6 +13146,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozart/assert/issues", + "source": "https://github.com/webmozart/assert/tree/master" + }, "time": "2020-07-08T17:02:28+00:00" }, { @@ -12446,6 +13184,10 @@ "MIT" ], "description": "The officially supported client for Postmark (http://postmarkapp.com)", + "support": { + "issues": "https://github.com/wildbit/postmark-php/issues", + "source": "https://github.com/wildbit/postmark-php/tree/4.0.0" + }, "time": "2020-09-10T16:36:51+00:00" }, { @@ -12513,6 +13255,10 @@ "rest", "service discovery" ], + "support": { + "issues": "https://github.com/zircote/swagger-php/issues", + "source": "https://github.com/zircote/swagger-php/tree/3.1.0" + }, "time": "2020-09-03T20:18:43+00:00" } ], @@ -12528,5 +13274,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.0.0" } From 30bfd0b808279294104bf8e9900a078b97c3c3bf Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 2 Nov 2020 12:11:49 +1100 Subject: [PATCH 02/11] Validation rules for credits and payments --- .../Requests/Payment/StorePaymentRequest.php | 4 +- .../ValidationRules/Credit/CreditsSumRule.php | 59 +++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 app/Http/ValidationRules/Credit/CreditsSumRule.php diff --git a/app/Http/Requests/Payment/StorePaymentRequest.php b/app/Http/Requests/Payment/StorePaymentRequest.php index 67c50a24e606..8b6ebbd65882 100644 --- a/app/Http/Requests/Payment/StorePaymentRequest.php +++ b/app/Http/Requests/Payment/StorePaymentRequest.php @@ -13,6 +13,7 @@ namespace App\Http\Requests\Payment; use App\Http\Requests\Request; use App\Http\ValidationRules\Credit\ValidCreditsRules; +use App\Http\ValidationRules\Credit\CreditsSumRule; use App\Http\ValidationRules\Payment\ValidInvoicesRules; use App\Http\ValidationRules\PaymentAmountsBalanceRule; use App\Http\ValidationRules\ValidCreditsPresentRule; @@ -76,7 +77,6 @@ class StorePaymentRequest extends Request } if (! isset($input['amount']) || $input['amount'] == 0) { - //$input['amount'] = $invoices_total - $credits_total; $input['amount'] = $invoices_total - $credits_total; //todo the payment amount is always less the credit amount applied } @@ -100,7 +100,7 @@ class StorePaymentRequest extends Request 'invoices.*.amount' => 'required', 'credits.*.credit_id' => 'bail|required|exists:credits,id', 'credits.*.credit_id' => new ValidCreditsRules($this->all()), - 'credits.*.amount' => 'required', + 'credits.*.amount' => ['required', new CreditsSumRule($this->all())], 'invoices' => new ValidPayableInvoicesRule(), 'number' => 'bail|nullable|unique:payments,number,'.$this->id.',id,company_id,'.$this->company_id, ]; diff --git a/app/Http/ValidationRules/Credit/CreditsSumRule.php b/app/Http/ValidationRules/Credit/CreditsSumRule.php new file mode 100644 index 000000000000..134a8bbe76b9 --- /dev/null +++ b/app/Http/ValidationRules/Credit/CreditsSumRule.php @@ -0,0 +1,59 @@ +input = $input; + } + + public function passes($attribute, $value) + { + return $this->checkCreditTotals(); + } + + private function checkCreditTotals() + { + + if( array_sum(array_column($this->input['credits'],'amount')) > array_sum(array_column($this->input['invoices'], 'amount'))) + return false; + + return true; + + } + + /** + * @return string + */ + public function message() + { + return "Total credits applied cannot be MORE than total of invoices"; + } +} From a76dd6809e0b47dbf7db0a98bdd3793bfefa6bd4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 2 Nov 2020 13:19:36 +1100 Subject: [PATCH 03/11] Fixes for release building script --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcbb19f476f2..b4748d96356a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,8 +41,7 @@ jobs: - name: Cleanup Builds run: | sudo rm -rf bootstrap/cache/* - sudo rm public/index.html - + - name: Build project # This would actually build your project, using zip for an example artifact run: | zip -r ./invoiceninja.zip ./ From 3434d5dd70946ba3c64ffadb4ee1859eea623b7e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 2 Nov 2020 15:58:43 +1100 Subject: [PATCH 04/11] Add events for payments --- app/Http/Controllers/PaymentController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 3b22ecb661ba..13a2ef9c63f6 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -29,8 +29,10 @@ use App\Repositories\BaseRepository; use App\Repositories\PaymentRepository; use App\Transformers\PaymentTransformer; use App\Utils\Traits\MakesHash; +use App\Events\Payment\PaymentWasUpdated; use Illuminate\Http\Request; use Illuminate\Http\Response; +use App\Utils\Ninja; /** * Class PaymentController. @@ -379,6 +381,7 @@ class PaymentController extends BaseController $payment = $this->payment_repo->save($request->all(), $payment); + event(new PaymentWasUpdated($payment, $payment->company, Ninja::eventVars())); return $this->itemResponse($payment); } From aa0b9ed976374c2304a46c4df551e52279e83484 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 2 Nov 2020 21:12:58 +1100 Subject: [PATCH 05/11] Deprecate invoice fields --- app/Transformers/InvoiceTransformer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Transformers/InvoiceTransformer.php b/app/Transformers/InvoiceTransformer.php index d4a308730bb7..27aa879b2c37 100644 --- a/app/Transformers/InvoiceTransformer.php +++ b/app/Transformers/InvoiceTransformer.php @@ -127,8 +127,8 @@ class InvoiceTransformer extends EntityTransformer 'custom_value2' => (string) $invoice->custom_value2 ?: '', 'custom_value3' => (string) $invoice->custom_value3 ?: '', 'custom_value4' => (string) $invoice->custom_value4 ?: '', - 'has_tasks' => (bool) $invoice->has_tasks, - 'has_expenses' => (bool) $invoice->has_expenses, + 'has_tasks' => (bool) false, //@deprecated v5.0.23 + 'has_expenses' => (bool) false, //@deprecated v5.0.23 'custom_surcharge1' => (float) $invoice->custom_surcharge1, 'custom_surcharge2' => (float) $invoice->custom_surcharge2, 'custom_surcharge3' => (float) $invoice->custom_surcharge3, From 9717424ce18cc2bf878895970080a36a70187d4c Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Nov 2020 08:18:02 +1100 Subject: [PATCH 06/11] Payment Tests --- app/Http/Controllers/PaymentController.php | 38 +++++----- tests/Feature/PaymentTest.php | 83 ++++++++++++++++++++++ 2 files changed, 103 insertions(+), 18 deletions(-) diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 13a2ef9c63f6..78caf1f26929 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -509,7 +509,8 @@ class PaymentController extends BaseController $payments->each(function ($payment, $key) use ($action) { if (auth()->user()->can('edit', $payment)) { - $this->payment_repo->{$action}($payment); + $this->performAction($payment, $action, true); + // $this->payment_repo->{$action}($payment); } }); @@ -587,30 +588,31 @@ class PaymentController extends BaseController * @param Payment $payment * @param $action */ - public function action(ActionPaymentRequest $request, Payment $payment, $action) + public function performAction(Payment $payment, $action, $bulk = false) { switch ($action) { - case 'clone_to_invoice': - //$payment = CloneInvoiceFactory::create($payment, auth()->user()->id); - //return $this->itemResponse($payment); - break; - case 'clone_to_quote': - //$quote = CloneInvoiceToQuoteFactory::create($payment, auth()->user()->id); - // todo build the quote transformer and return response here - break; - case 'history': - // code... - break; - case 'delivery_note': - // code... - break; - case 'mark_paid': - // code... + case 'restore': + $this->payment_repo->restore($payment); + + if (! $bulk) { + return $this->listResponse($payment); + } + break; case 'archive': + $this->payment_repo->archive($payment); + + if (! $bulk) { + return $this->listResponse($payment); + } // code... break; case 'delete': + $this->payment_repo->delete($payment); + + if (! $bulk) { + return $this->listResponse($payment); + } // code... break; case 'email': diff --git a/tests/Feature/PaymentTest.php b/tests/Feature/PaymentTest.php index b9f36304697a..0baa00a2172f 100644 --- a/tests/Feature/PaymentTest.php +++ b/tests/Feature/PaymentTest.php @@ -1302,4 +1302,87 @@ $contact = ClientContact::factory()->create([ $this->assertEquals(1, $payment->invoices()->count()); } } + + public function testPaymentActionArchive() + { + $this->invoice = null; + + $client = ClientFactory::create($this->company->id, $this->user->id); + $client->save(); + + $this->invoice = InvoiceFactory::create($this->company->id, $this->user->id); //stub the company and user_id + $this->invoice->client_id = $client->id; + + $this->invoice->line_items = $this->buildLineItems(); + $this->invoice->uses_inclusive_taxes = false; + + $this->invoice->save(); + + $this->invoice_calc = new InvoiceSum($this->invoice); + $this->invoice_calc->build(); + + $this->invoice = $this->invoice_calc->getInvoice(); + $this->invoice->save(); + $this->invoice->service()->markSent()->save(); + + $data = [ + 'amount' => 20.0, + 'client_id' => $this->encodePrimaryKey($client->id), + 'invoices' => [ + [ + 'invoice_id' => $this->encodePrimaryKey($this->invoice->id), + 'amount' => 10, + ], + ], + 'date' => '2019/12/12', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments/', $data); + + $response->assertStatus(200); + + $arr = $response->json(); + + $payment_id = $arr['data']['id']; + + $payment = Payment::whereId($this->decodePrimaryKey($payment_id))->first(); + + + $data = [ + 'ids' => [$this->encodePrimaryKey($payment->id)], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments/bulk?action=archive', $data); + + $arr = $response->json(); + + $this->assertGreaterThan(0, $arr['data'][0]['archived_at']); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments/bulk?action=restore', $data); + + $arr = $response->json(); + + $this->assertEquals(0, $arr['data'][0]['archived_at']); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments/bulk?action=delete', $data); + + $arr = $response->json(); +info(print_r($arr,1)); + $this->assertEquals(1, $arr['data'][0]['is_deleted']); + } + + + } From e7a1e4c4db8afbbe6a6342028a5d7337dafb3fc3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Nov 2020 16:44:50 +1100 Subject: [PATCH 07/11] Working on activities --- app/Http/Controllers/VendorController.php | 4 ++ .../Activity/CreatedVendorActivity.php | 54 +++++++++++++++++++ app/Models/Activity.php | 2 +- app/Providers/EventServiceProvider.php | 6 +++ tests/Feature/PaymentTest.php | 2 +- 5 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 app/Listeners/Activity/CreatedVendorActivity.php diff --git a/app/Http/Controllers/VendorController.php b/app/Http/Controllers/VendorController.php index 3c1482febe19..99fa589db1be 100644 --- a/app/Http/Controllers/VendorController.php +++ b/app/Http/Controllers/VendorController.php @@ -13,6 +13,8 @@ namespace App\Http\Controllers; use App\Factory\VendorFactory; use App\Filters\VendorFilters; +use App\Utils\Ninja; +use App\Events\Vendor\VendorWasCreated; use App\Http\Requests\Vendor\CreateVendorRequest; use App\Http\Requests\Vendor\DestroyVendorRequest; use App\Http\Requests\Vendor\EditVendorRequest; @@ -376,6 +378,8 @@ class VendorController extends BaseController $this->uploadLogo($request->file('company_logo'), $vendor->company, $vendor); + event(new VendorWasCreated($vendor, $vendor->company, Ninja::eventVars())); + return $this->itemResponse($vendor); } diff --git a/app/Listeners/Activity/CreatedVendorActivity.php b/app/Listeners/Activity/CreatedVendorActivity.php new file mode 100644 index 000000000000..cb7b1a223c46 --- /dev/null +++ b/app/Listeners/Activity/CreatedVendorActivity.php @@ -0,0 +1,54 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->vendor_id = $event->vendor->id; + $fields->user_id = $event->vendor->user_id; + $fields->company_id = $event->vendor->company_id; + $fields->activity_type_id = Activity::CREATE_VENDOR; + + $this->activity_repo->save($fields, $event->vendor, $event->event_vars); + } +} diff --git a/app/Models/Activity.php b/app/Models/Activity.php index 8ba4bf497480..6dc1824a41f3 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -47,7 +47,7 @@ class Activity extends StaticModel const RESTORE_PAYMENT = 27; // const RESTORE_CREDIT = 28; // const APPROVE_QUOTE = 29; // - const CREATE_VENDOR = 30; + const CREATE_VENDOR = 30; // const ARCHIVE_VENDOR = 31; const DELETE_VENDOR = 32; const RESTORE_VENDOR = 33; diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 40bfe5214a59..1f1f82e8182e 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -60,8 +60,10 @@ use App\Events\Quote\QuoteWasViewed; use App\Events\User\UserLoggedIn; use App\Events\User\UserWasCreated; use App\Events\User\UserWasDeleted; +use App\Events\Vendor\VendorWasCreated; use App\Listeners\Activity\ArchivedClientActivity; use App\Listeners\Activity\CreatedClientActivity; +use App\Listeners\Activity\CreatedVendorActivity; use App\Listeners\Activity\CreatedCreditActivity; use App\Listeners\Activity\CreatedQuoteActivity; use App\Listeners\Activity\CreditArchivedActivity; @@ -286,6 +288,10 @@ class EventServiceProvider extends ServiceProvider QuoteWasRestored::class => [ QuoteRestoredActivity::class, ], + VendorWasCreated::class => [ + CreatedVendorActivity::class, + ] + ]; /** diff --git a/tests/Feature/PaymentTest.php b/tests/Feature/PaymentTest.php index 0baa00a2172f..3b7d43e46a10 100644 --- a/tests/Feature/PaymentTest.php +++ b/tests/Feature/PaymentTest.php @@ -1379,7 +1379,7 @@ $contact = ClientContact::factory()->create([ ])->post('/api/v1/payments/bulk?action=delete', $data); $arr = $response->json(); -info(print_r($arr,1)); + $this->assertEquals(1, $arr['data'][0]['is_deleted']); } From 6eb9f0f6a6ad822d384007053ed7398f7c6e33c5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Nov 2020 21:04:15 +1100 Subject: [PATCH 08/11] Event testing --- app/Events/Client/ClientWasDeleted.php | 1 + app/Events/Client/ClientWasRestored.php | 6 +- app/Events/Client/ClientWasUpdated.php | 1 + app/Events/Credit/CreditWasRestored.php | 4 +- app/Events/Design/DesignWasRestored.php | 5 +- app/Events/Document/DocumentWasRestored.php | 4 +- app/Events/Expense/ExpenseWasRestored.php | 4 +- app/Events/Invoice/InvoiceWasRestored.php | 2 +- app/Events/Product/ProductWasRestored.php | 49 ++++ app/Events/Quote/QuoteWasRestored.php | 4 +- app/Events/Task/TaskWasRestored.php | 4 +- app/Events/Vendor/VendorWasRestored.php | 4 +- app/Http/Controllers/ClientController.php | 3 + app/Http/Controllers/ExpenseController.php | 7 + app/Http/Controllers/TaskController.php | 9 +- .../Activity/ClientUpdatedActivity.php | 58 ++++ .../Activity/CreatedExpenseActivity.php | 54 ++++ .../Activity/CreatedTaskActivity.php | 54 ++++ .../Activity/ExpenseArchivedActivity.php | 58 ++++ .../Activity/ExpenseDeletedActivity.php | 58 ++++ .../Activity/ExpenseRestoredActivity.php | 58 ++++ .../Activity/ExpenseUpdatedActivity.php | 58 ++++ .../Activity/TaskArchivedActivity.php | 58 ++++ .../Activity/TaskDeletedActivity.php | 58 ++++ .../Activity/TaskRestoredActivity.php | 58 ++++ .../Activity/TaskUpdatedActivity.php | 58 ++++ .../Activity/VendorArchivedActivity.php | 58 ++++ .../Activity/VendorDeletedActivity.php | 58 ++++ .../Activity/VendorRestoredActivity.php | 58 ++++ .../Activity/VendorUpdatedActivity.php | 58 ++++ app/Models/Activity.php | 28 +- app/Providers/EventServiceProvider.php | 80 +++++- app/Repositories/BaseRepository.php | 2 +- tests/Integration/EventTest.php | 253 ++++++++++++++++++ 34 files changed, 1304 insertions(+), 28 deletions(-) create mode 100644 app/Events/Product/ProductWasRestored.php create mode 100644 app/Listeners/Activity/ClientUpdatedActivity.php create mode 100644 app/Listeners/Activity/CreatedExpenseActivity.php create mode 100644 app/Listeners/Activity/CreatedTaskActivity.php create mode 100644 app/Listeners/Activity/ExpenseArchivedActivity.php create mode 100644 app/Listeners/Activity/ExpenseDeletedActivity.php create mode 100644 app/Listeners/Activity/ExpenseRestoredActivity.php create mode 100644 app/Listeners/Activity/ExpenseUpdatedActivity.php create mode 100644 app/Listeners/Activity/TaskArchivedActivity.php create mode 100644 app/Listeners/Activity/TaskDeletedActivity.php create mode 100644 app/Listeners/Activity/TaskRestoredActivity.php create mode 100644 app/Listeners/Activity/TaskUpdatedActivity.php create mode 100644 app/Listeners/Activity/VendorArchivedActivity.php create mode 100644 app/Listeners/Activity/VendorDeletedActivity.php create mode 100644 app/Listeners/Activity/VendorRestoredActivity.php create mode 100644 app/Listeners/Activity/VendorUpdatedActivity.php create mode 100644 tests/Integration/EventTest.php diff --git a/app/Events/Client/ClientWasDeleted.php b/app/Events/Client/ClientWasDeleted.php index 48fcaf25dca3..842a1d032646 100644 --- a/app/Events/Client/ClientWasDeleted.php +++ b/app/Events/Client/ClientWasDeleted.php @@ -12,6 +12,7 @@ namespace App\Events\Client; use App\Models\Client; +use App\Models\Company; use Illuminate\Queue\SerializesModels; /** diff --git a/app/Events/Client/ClientWasRestored.php b/app/Events/Client/ClientWasRestored.php index 505bf0f472a7..8f3f37f539f2 100644 --- a/app/Events/Client/ClientWasRestored.php +++ b/app/Events/Client/ClientWasRestored.php @@ -12,6 +12,7 @@ namespace App\Events\Client; use App\Models\Client; +use App\Models\Company; use Illuminate\Queue\SerializesModels; /** @@ -26,6 +27,8 @@ class ClientWasRestored */ public $client; + public $fromDeleted; + public $company; public $event_vars; @@ -37,9 +40,10 @@ class ClientWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Client $client, Company $company, array $event_vars) + public function __construct(Client $client, $fromDeleted, Company $company, array $event_vars) { $this->client = $client; + $this->fromDeleted = $fromDeleted; $this->company = $company; $this->event_vars = $event_vars; } diff --git a/app/Events/Client/ClientWasUpdated.php b/app/Events/Client/ClientWasUpdated.php index 419fea23353a..c249acb9750d 100644 --- a/app/Events/Client/ClientWasUpdated.php +++ b/app/Events/Client/ClientWasUpdated.php @@ -12,6 +12,7 @@ namespace App\Events\Client; use App\Models\Client; +use App\Models\Company; use Illuminate\Queue\SerializesModels; /** diff --git a/app/Events/Credit/CreditWasRestored.php b/app/Events/Credit/CreditWasRestored.php index f526ed5d515b..62f343eab3ca 100644 --- a/app/Events/Credit/CreditWasRestored.php +++ b/app/Events/Credit/CreditWasRestored.php @@ -30,6 +30,7 @@ class CreditWasRestored public $event_vars; + public $fromDeleted; /** * Create a new event instance. * @@ -37,9 +38,10 @@ class CreditWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Credit $credit, Company $company, array $event_vars) + public function __construct(Credit $credit, $fromDeleted, Company $company, array $event_vars) { $this->credit = $credit; + $this->fromDeleted = $fromDeleted; $this->company = $company; $this->event_vars = $event_vars; } diff --git a/app/Events/Design/DesignWasRestored.php b/app/Events/Design/DesignWasRestored.php index 0de7dd749987..34cca273a55c 100644 --- a/app/Events/Design/DesignWasRestored.php +++ b/app/Events/Design/DesignWasRestored.php @@ -32,6 +32,7 @@ class DesignWasRestored public $event_vars; + public $fromDeleted; /** * Create a new event instance. * @@ -39,10 +40,12 @@ class DesignWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Design $design, Company $company, array $event_vars) + public function __construct(Design $design, $fromDeleted, Company $company, array $event_vars) { $this->design = $design; + $this->fromDeleted = $fromDeleted; + $this->company = $company; $this->event_vars = $event_vars; diff --git a/app/Events/Document/DocumentWasRestored.php b/app/Events/Document/DocumentWasRestored.php index 672d6273e062..4cc21da2859f 100644 --- a/app/Events/Document/DocumentWasRestored.php +++ b/app/Events/Document/DocumentWasRestored.php @@ -31,6 +31,7 @@ class DocumentWasRestored public $event_vars; + public $fromDeleted; /** * Create a new event instance. * @@ -38,9 +39,10 @@ class DocumentWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Document $document, Company $company, array $event_vars) + public function __construct(Document $document, $fromDeleted, Company $company, array $event_vars) { $this->document = $document; + $this->fromDeleted = $fromDeleted; $this->company = $company; $this->event_vars = $event_vars; } diff --git a/app/Events/Expense/ExpenseWasRestored.php b/app/Events/Expense/ExpenseWasRestored.php index e00342f1a1fe..b844a13d5c84 100644 --- a/app/Events/Expense/ExpenseWasRestored.php +++ b/app/Events/Expense/ExpenseWasRestored.php @@ -31,6 +31,7 @@ class ExpenseWasRestored public $event_vars; + public $fromDeleted; /** * Create a new event instance. * @@ -38,9 +39,10 @@ class ExpenseWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Expense $expense, Company $company, array $event_vars) + public function __construct(Expense $expense, $fromDeleted, Company $company, array $event_vars) { $this->expense = $expense; + $this->fromDeleted = $fromDeleted; $this->company = $company; $this->event_vars = $event_vars; } diff --git a/app/Events/Invoice/InvoiceWasRestored.php b/app/Events/Invoice/InvoiceWasRestored.php index bd246e298c97..885193b4e8bd 100644 --- a/app/Events/Invoice/InvoiceWasRestored.php +++ b/app/Events/Invoice/InvoiceWasRestored.php @@ -32,7 +32,7 @@ class InvoiceWasRestored public $company; public $event_vars; - + /** * Create a new event instance. * diff --git a/app/Events/Product/ProductWasRestored.php b/app/Events/Product/ProductWasRestored.php new file mode 100644 index 000000000000..cc5c95b5b497 --- /dev/null +++ b/app/Events/Product/ProductWasRestored.php @@ -0,0 +1,49 @@ +product = $product; + $this->fromDeleted = $fromDeleted; + $this->company = $company; + $this->event_vars = $event_vars; + } +} diff --git a/app/Events/Quote/QuoteWasRestored.php b/app/Events/Quote/QuoteWasRestored.php index 48bed8389f9e..53abe1bc8ade 100644 --- a/app/Events/Quote/QuoteWasRestored.php +++ b/app/Events/Quote/QuoteWasRestored.php @@ -27,6 +27,7 @@ class QuoteWasRestored public $event_vars; + public $fromDeleted; /** * Create a new event instance. * @@ -34,9 +35,10 @@ class QuoteWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Quote $quote, Company $company, array $event_vars) + public function __construct(Quote $quote, $fromDeleted, Company $company, array $event_vars) { $this->quote = $quote; + $this->fromDeleted = $fromDeleted; $this->company = $company; $this->event_vars = $event_vars; } diff --git a/app/Events/Task/TaskWasRestored.php b/app/Events/Task/TaskWasRestored.php index a5fd02eae200..d0340f321d51 100644 --- a/app/Events/Task/TaskWasRestored.php +++ b/app/Events/Task/TaskWasRestored.php @@ -31,6 +31,7 @@ class TaskWasRestored public $event_vars; + public $fromDeleted; /** * Create a new event instance. * @@ -38,9 +39,10 @@ class TaskWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Task $task, Company $company, array $event_vars) + public function __construct(Task $task, $fromDeleted, Company $company, array $event_vars) { $this->task = $task; + $this->fromDeleted = $fromDeleted; $this->company = $company; $this->event_vars = $event_vars; } diff --git a/app/Events/Vendor/VendorWasRestored.php b/app/Events/Vendor/VendorWasRestored.php index de64cee44bd7..327d0972dee6 100644 --- a/app/Events/Vendor/VendorWasRestored.php +++ b/app/Events/Vendor/VendorWasRestored.php @@ -31,6 +31,7 @@ class VendorWasRestored public $event_vars; + public $fromDeleted; /** * Create a new event instance. * @@ -38,9 +39,10 @@ class VendorWasRestored * @param Company $company * @param array $event_vars */ - public function __construct(Vendor $vendor, Company $company, array $event_vars) + public function __construct(Vendor $vendor, $fromDeleted, Company $company, array $event_vars) { $this->vendor = $vendor; + $this->fromDeleted = $fromDeleted; $this->company = $company; $this->event_vars = $event_vars; } diff --git a/app/Http/Controllers/ClientController.php b/app/Http/Controllers/ClientController.php index 1145b4421b59..cfd03203082e 100644 --- a/app/Http/Controllers/ClientController.php +++ b/app/Http/Controllers/ClientController.php @@ -13,6 +13,7 @@ namespace App\Http\Controllers; use App\DataMapper\ClientSettings; use App\Events\Client\ClientWasCreated; +use App\Events\Client\ClientWasUpdated; use App\Factory\ClientFactory; use App\Filters\ClientFilters; use App\Http\Requests\Client\BulkClientRequest; @@ -288,6 +289,8 @@ class ClientController extends BaseController $this->uploadLogo($request->file('company_logo'), $client->company, $client); + event(new ClientWasUpdated($client, $client->company, Ninja::eventVars())); + return $this->itemResponse($client->fresh()); } diff --git a/app/Http/Controllers/ExpenseController.php b/app/Http/Controllers/ExpenseController.php index 22f44344bbec..378ab06c6aff 100644 --- a/app/Http/Controllers/ExpenseController.php +++ b/app/Http/Controllers/ExpenseController.php @@ -11,6 +11,8 @@ namespace App\Http\Controllers; +use App\Events\Expense\ExpenseWasCreated; +use App\Events\Expense\ExpenseWasUpdated; use App\Factory\ExpenseFactory; use App\Filters\ExpenseFilters; use App\Http\Requests\Expense\CreateExpenseRequest; @@ -29,6 +31,7 @@ use App\Models\Size; use App\Repositories\BaseRepository; use App\Repositories\ExpenseRepository; use App\Transformers\ExpenseTransformer; +use App\Utils\Ninja; use App\Utils\Traits\BulkOptions; use App\Utils\Traits\MakesHash; use App\Utils\Traits\Uploadable; @@ -281,6 +284,8 @@ class ExpenseController extends BaseController $this->uploadLogo($request->file('company_logo'), $expense->company, $expense); + event(new ExpenseWasUpdated($expense, $expense->company, Ninja::eventVars())); + return $this->itemResponse($expense->fresh()); } @@ -373,6 +378,8 @@ class ExpenseController extends BaseController { $expense = $this->expense_repo->save($request->all(), ExpenseFactory::create(auth()->user()->company()->id, auth()->user()->id)); + event(new ExpenseWasCreated($expense, $expense->company, Ninja::eventVars())); + return $this->itemResponse($expense); } diff --git a/app/Http/Controllers/TaskController.php b/app/Http/Controllers/TaskController.php index 06322ca27eb6..928249a95701 100644 --- a/app/Http/Controllers/TaskController.php +++ b/app/Http/Controllers/TaskController.php @@ -11,6 +11,8 @@ namespace App\Http\Controllers; +use App\Events\Task\TaskWasCreated; +use App\Events\Task\TaskWasUpdated; use App\Factory\TaskFactory; use App\Filters\TaskFilters; use App\Http\Requests\Task\CreateTaskRequest; @@ -24,11 +26,12 @@ use App\Jobs\Util\ProcessBulk; use App\Jobs\Util\UploadAvatar; use App\Models\Country; use App\Models\Currency; -use App\Models\Task; use App\Models\Size; +use App\Models\Task; use App\Repositories\BaseRepository; use App\Repositories\TaskRepository; use App\Transformers\TaskTransformer; +use App\Utils\Ninja; use App\Utils\Traits\BulkOptions; use App\Utils\Traits\MakesHash; use App\Utils\Traits\Uploadable; @@ -278,6 +281,8 @@ class TaskController extends BaseController $task = $this->task_repo->save($request->all(), $task); + event(new TaskWasUpdated($task, $task->company, Ninja::eventVars())); + return $this->itemResponse($task->fresh()); } @@ -370,6 +375,8 @@ class TaskController extends BaseController { $task = $this->task_repo->save($request->all(), TaskFactory::create(auth()->user()->company()->id, auth()->user()->id)); + event(new TaskWasCreated($task, $task->company, Ninja::eventVars())); + return $this->itemResponse($task); } diff --git a/app/Listeners/Activity/ClientUpdatedActivity.php b/app/Listeners/Activity/ClientUpdatedActivity.php new file mode 100644 index 000000000000..7bfdc5d2d755 --- /dev/null +++ b/app/Listeners/Activity/ClientUpdatedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $client = $event->client; + + $fields = new stdClass; + + $fields->client_id = $client->id; + $fields->user_id = $client->user_id; + $fields->company_id = $client->company_id; + $fields->activity_type_id = Activity::UPDATE_CLIENT; + + $this->activity_repo->save($fields, $client, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/CreatedExpenseActivity.php b/app/Listeners/Activity/CreatedExpenseActivity.php new file mode 100644 index 000000000000..2753b6298505 --- /dev/null +++ b/app/Listeners/Activity/CreatedExpenseActivity.php @@ -0,0 +1,54 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->expense_id = $event->expense->id; + $fields->user_id = $event->expense->user_id; + $fields->company_id = $event->expense->company_id; + $fields->activity_type_id = Activity::CREATE_EXPENSE; + + $this->activity_repo->save($fields, $event->expense, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/CreatedTaskActivity.php b/app/Listeners/Activity/CreatedTaskActivity.php new file mode 100644 index 000000000000..70ee99e5ddc4 --- /dev/null +++ b/app/Listeners/Activity/CreatedTaskActivity.php @@ -0,0 +1,54 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->task_id = $event->task->id; + $fields->user_id = $event->task->user_id; + $fields->company_id = $event->task->company_id; + $fields->activity_type_id = Activity::CREATE_TASK; + + $this->activity_repo->save($fields, $event->task, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/ExpenseArchivedActivity.php b/app/Listeners/Activity/ExpenseArchivedActivity.php new file mode 100644 index 000000000000..0d6a43ddfec7 --- /dev/null +++ b/app/Listeners/Activity/ExpenseArchivedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $expense = $event->expense; + + $fields = new stdClass; + + $fields->expense_id = $expense->id; + $fields->user_id = $expense->user_id; + $fields->company_id = $expense->company_id; + $fields->activity_type_id = Activity::ARCHIVE_EXPENSE; + + $this->activity_repo->save($fields, $expense, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/ExpenseDeletedActivity.php b/app/Listeners/Activity/ExpenseDeletedActivity.php new file mode 100644 index 000000000000..477e783a6ac7 --- /dev/null +++ b/app/Listeners/Activity/ExpenseDeletedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->expense_id = $event->expense->id; + $fields->user_id = $event->expense->user_id; + $fields->company_id = $event->expense->company_id; + $fields->activity_type_id = Activity::DELETE_VENDOR; + + $this->activity_repo->save($fields, $event->expense, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/ExpenseRestoredActivity.php b/app/Listeners/Activity/ExpenseRestoredActivity.php new file mode 100644 index 000000000000..c25fe9042864 --- /dev/null +++ b/app/Listeners/Activity/ExpenseRestoredActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->expense_id = $event->expense->id; + $fields->user_id = $event->expense->user_id; + $fields->company_id = $event->expense->company_id; + $fields->activity_type_id = Activity::RESTORE_EXPENSE; + + $this->activity_repo->save($fields, $event->expense, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/ExpenseUpdatedActivity.php b/app/Listeners/Activity/ExpenseUpdatedActivity.php new file mode 100644 index 000000000000..9f82f9dea3f4 --- /dev/null +++ b/app/Listeners/Activity/ExpenseUpdatedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $expense = $event->expense; + + $fields = new stdClass; + + $fields->expense_id = $expense->id; + $fields->user_id = $expense->user_id; + $fields->company_id = $expense->company_id; + $fields->activity_type_id = Activity::UPDATE_EXPENSE; + + $this->activity_repo->save($fields, $expense, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/TaskArchivedActivity.php b/app/Listeners/Activity/TaskArchivedActivity.php new file mode 100644 index 000000000000..e31935efdecd --- /dev/null +++ b/app/Listeners/Activity/TaskArchivedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $task = $event->task; + + $fields = new stdClass; + + $fields->task_id = $task->id; + $fields->user_id = $task->user_id; + $fields->company_id = $task->company_id; + $fields->activity_type_id = Activity::ARCHIVE_TASK; + + $this->activity_repo->save($fields, $task, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/TaskDeletedActivity.php b/app/Listeners/Activity/TaskDeletedActivity.php new file mode 100644 index 000000000000..3b201b680f9f --- /dev/null +++ b/app/Listeners/Activity/TaskDeletedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->task_id = $event->task->id; + $fields->user_id = $event->task->user_id; + $fields->company_id = $event->task->company_id; + $fields->activity_type_id = Activity::DELETE_TASK; + + $this->activity_repo->save($fields, $event->task, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/TaskRestoredActivity.php b/app/Listeners/Activity/TaskRestoredActivity.php new file mode 100644 index 000000000000..1188dc2072d7 --- /dev/null +++ b/app/Listeners/Activity/TaskRestoredActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->task_id = $event->task->id; + $fields->user_id = $event->task->user_id; + $fields->company_id = $event->task->company_id; + $fields->activity_type_id = Activity::RESTORE_TASK; + + $this->activity_repo->save($fields, $event->task, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/TaskUpdatedActivity.php b/app/Listeners/Activity/TaskUpdatedActivity.php new file mode 100644 index 000000000000..a503bc080195 --- /dev/null +++ b/app/Listeners/Activity/TaskUpdatedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $task = $event->task; + + $fields = new stdClass; + + $fields->task_id = $task->id; + $fields->user_id = $task->user_id; + $fields->company_id = $task->company_id; + $fields->activity_type_id = Activity::UPDATE_TASK; + + $this->activity_repo->save($fields, $task, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/VendorArchivedActivity.php b/app/Listeners/Activity/VendorArchivedActivity.php new file mode 100644 index 000000000000..3cbcc4acf1cf --- /dev/null +++ b/app/Listeners/Activity/VendorArchivedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $vendor = $event->vendor; + + $fields = new stdClass; + + $fields->vendor_id = $vendor->id; + $fields->user_id = $vendor->user_id; + $fields->company_id = $vendor->company_id; + $fields->activity_type_id = Activity::ARCHIVE_VENDOR; + + $this->activity_repo->save($fields, $vendor, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/VendorDeletedActivity.php b/app/Listeners/Activity/VendorDeletedActivity.php new file mode 100644 index 000000000000..5c2941afc481 --- /dev/null +++ b/app/Listeners/Activity/VendorDeletedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->vendor_id = $event->vendor->id; + $fields->user_id = $event->vendor->user_id; + $fields->company_id = $event->vendor->company_id; + $fields->activity_type_id = Activity::DELETE_VENDOR; + + $this->activity_repo->save($fields, $event->vendor, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/VendorRestoredActivity.php b/app/Listeners/Activity/VendorRestoredActivity.php new file mode 100644 index 000000000000..b14715736eca --- /dev/null +++ b/app/Listeners/Activity/VendorRestoredActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $fields = new stdClass; + + $fields->vendor_id = $event->vendor->id; + $fields->user_id = $event->vendor->user_id; + $fields->company_id = $event->vendor->company_id; + $fields->activity_type_id = Activity::RESTORE_VENDOR; + + $this->activity_repo->save($fields, $event->vendor, $event->event_vars); + } +} diff --git a/app/Listeners/Activity/VendorUpdatedActivity.php b/app/Listeners/Activity/VendorUpdatedActivity.php new file mode 100644 index 000000000000..930e6be6f911 --- /dev/null +++ b/app/Listeners/Activity/VendorUpdatedActivity.php @@ -0,0 +1,58 @@ +activity_repo = $activity_repo; + } + + /** + * Handle the event. + * + * @param object $event + * @return void + */ + public function handle($event) + { + MultiDB::setDb($event->company->db); + + $vendor = $event->vendor; + + $fields = new stdClass; + + $fields->vendor_id = $vendor->id; + $fields->user_id = $vendor->user_id; + $fields->company_id = $vendor->company_id; + $fields->activity_type_id = Activity::UPDATE_VENDOR; + + $this->activity_repo->save($fields, $vendor, $event->event_vars); + } +} diff --git a/app/Models/Activity.php b/app/Models/Activity.php index 6dc1824a41f3..e271bc920fb4 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -48,23 +48,23 @@ class Activity extends StaticModel const RESTORE_CREDIT = 28; // const APPROVE_QUOTE = 29; // const CREATE_VENDOR = 30; // - const ARCHIVE_VENDOR = 31; - const DELETE_VENDOR = 32; - const RESTORE_VENDOR = 33; - const CREATE_EXPENSE = 34; - const ARCHIVE_EXPENSE = 35; - const DELETE_EXPENSE = 36; - const RESTORE_EXPENSE = 37; + const ARCHIVE_VENDOR = 31;// + const DELETE_VENDOR = 32;// + const RESTORE_VENDOR = 33;// + const CREATE_EXPENSE = 34;// + const ARCHIVE_EXPENSE = 35;// + const DELETE_EXPENSE = 36;// + const RESTORE_EXPENSE = 37;// const VOIDED_PAYMENT = 39; // const REFUNDED_PAYMENT = 40; // const FAILED_PAYMENT = 41; - const CREATE_TASK = 42; - const UPDATE_TASK = 43; - const ARCHIVE_TASK = 44; - const DELETE_TASK = 45; - const RESTORE_TASK = 46; - const UPDATE_EXPENSE = 47; + const CREATE_TASK = 42; // + const UPDATE_TASK = 43; // + const ARCHIVE_TASK = 44; // + const DELETE_TASK = 45; // + const RESTORE_TASK = 46; // + const UPDATE_EXPENSE = 47;// const CREATE_USER = 48; // only used in CreateUser::job const UPDATE_USER = 49; // not needed? @@ -77,6 +77,8 @@ class Activity extends StaticModel const REVERSED_INVOICE = 58; // const CANCELLED_INVOICE = 59; // const VIEW_CREDIT = 60; // + const UPDATE_CLIENT = 61; // + const UPDATE_VENDOR = 62; // protected $casts = [ 'is_system' => 'boolean', diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 1f1f82e8182e..6a0db9ffcaab 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -30,6 +30,11 @@ use App\Events\Credit\CreditWasRestored; use App\Events\Credit\CreditWasUpdated; use App\Events\Credit\CreditWasViewed; use App\Events\Design\DesignWasArchived; +use App\Events\Expense\ExpenseWasArchived; +use App\Events\Expense\ExpenseWasCreated; +use App\Events\Expense\ExpenseWasDeleted; +use App\Events\Expense\ExpenseWasRestored; +use App\Events\Expense\ExpenseWasUpdated; use App\Events\Invoice\InvoiceWasArchived; use App\Events\Invoice\InvoiceWasCancelled; use App\Events\Invoice\InvoiceWasCreated; @@ -57,18 +62,34 @@ use App\Events\Quote\QuoteWasEmailed; use App\Events\Quote\QuoteWasRestored; use App\Events\Quote\QuoteWasUpdated; use App\Events\Quote\QuoteWasViewed; +use App\Events\Task\TaskWasArchived; +use App\Events\Task\TaskWasCreated; +use App\Events\Task\TaskWasDeleted; +use App\Events\Task\TaskWasRestored; +use App\Events\Task\TaskWasUpdated; use App\Events\User\UserLoggedIn; use App\Events\User\UserWasCreated; use App\Events\User\UserWasDeleted; +use App\Events\Vendor\VendorWasArchived; use App\Events\Vendor\VendorWasCreated; +use App\Events\Vendor\VendorWasDeleted; +use App\Events\Vendor\VendorWasRestored; +use App\Events\Vendor\VendorWasUpdated; use App\Listeners\Activity\ArchivedClientActivity; +use App\Listeners\Activity\ClientUpdatedActivity; use App\Listeners\Activity\CreatedClientActivity; -use App\Listeners\Activity\CreatedVendorActivity; use App\Listeners\Activity\CreatedCreditActivity; +use App\Listeners\Activity\CreatedExpenseActivity; use App\Listeners\Activity\CreatedQuoteActivity; +use App\Listeners\Activity\CreatedTaskActivity; +use App\Listeners\Activity\CreatedVendorActivity; use App\Listeners\Activity\CreditArchivedActivity; use App\Listeners\Activity\DeleteClientActivity; use App\Listeners\Activity\DeleteCreditActivity; +use App\Listeners\Activity\ExpenseArchivedActivity; +use App\Listeners\Activity\ExpenseDeletedActivity; +use App\Listeners\Activity\ExpenseRestoredActivity; +use App\Listeners\Activity\ExpenseUpdatedActivity; use App\Listeners\Activity\PaymentCreatedActivity; use App\Listeners\Activity\PaymentDeletedActivity; use App\Listeners\Activity\PaymentRefundedActivity; @@ -76,7 +97,15 @@ use App\Listeners\Activity\PaymentUpdatedActivity; use App\Listeners\Activity\PaymentVoidedActivity; use App\Listeners\Activity\QuoteUpdatedActivity; use App\Listeners\Activity\RestoreClientActivity; +use App\Listeners\Activity\TaskArchivedActivity; +use App\Listeners\Activity\TaskDeletedActivity; +use App\Listeners\Activity\TaskRestoredActivity; +use App\Listeners\Activity\TaskUpdatedActivity; use App\Listeners\Activity\UpdatedCreditActivity; +use App\Listeners\Activity\VendorArchivedActivity; +use App\Listeners\Activity\VendorDeletedActivity; +use App\Listeners\Activity\VendorRestoredActivity; +use App\Listeners\Activity\VendorUpdatedActivity; use App\Listeners\Contact\UpdateContactLastLogin; use App\Listeners\Credit\CreditRestoredActivity; use App\Listeners\Credit\CreditViewedActivity; @@ -163,6 +192,7 @@ class EventServiceProvider extends ServiceProvider ArchivedClientActivity::class, ], ClientWasUpdated::class =>[ + ClientUpdatedActivity::class, ], ClientWasDeleted::class =>[ DeleteClientActivity::class, @@ -206,14 +236,29 @@ class EventServiceProvider extends ServiceProvider CreditViewedActivity::class, ], //Designs - DesignWasArchived::class => [ - ], DesignWasUpdated::class => [ ], + DesignWasArchived::class => [ + ], DesignWasDeleted::class => [ ], DesignWasRestored::class => [ ], + ExpenseWasCreated::class => [ + CreatedExpenseActivity::class, + ], + ExpenseWasUpdated::class => [ + ExpenseUpdatedActivity::class, + ], + ExpenseWasArchived::class => [ + ExpenseArchivedActivity::class, + ], + ExpenseWasDeleted::class => [ + ExpenseDeletedActivity::class, + ], + ExpenseWasRestored::class => [ + ExpenseRestoredActivity::class + ], //Invoices InvoiceWasMarkedSent::class => [ CreateInvoiceHtmlBackup::class, @@ -288,9 +333,36 @@ class EventServiceProvider extends ServiceProvider QuoteWasRestored::class => [ QuoteRestoredActivity::class, ], + TaskWasCreated::class => [ + CreatedTaskActivity::class, + ], + TaskWasUpdated::class => [ + TaskUpdatedActivity::class, + ], + TaskWasArchived::class => [ + TaskArchivedActivity::class, + ], + TaskWasDeleted::class => [ + TaskDeletedActivity::class, + ], + TaskWasRestored::class => [ + TaskRestoredActivity::class, + ], VendorWasCreated::class => [ CreatedVendorActivity::class, - ] + ], + VendorWasArchived::class => [ + VendorArchivedActivity::class, + ], + VendorWasDeleted::class => [ + VendorDeletedActivity::class, + ], + VendorWasRestored::class => [ + VendorRestoredActivity::class, + ], + VendorWasUpdated::class => [ + VendorUpdatedActivity::class, + ], ]; diff --git a/app/Repositories/BaseRepository.php b/app/Repositories/BaseRepository.php index 582dd5165d55..553b869e51a1 100644 --- a/app/Repositories/BaseRepository.php +++ b/app/Repositories/BaseRepository.php @@ -60,7 +60,7 @@ class BaseRepository */ private function getEventClass($entity, $type) { - return 'App\Events\\'.ucfirst(class_basename($entity)).'Was'.$type; + return 'App\Events\\'.ucfirst(class_basename($entity)).'\\'.ucfirst(class_basename($entity)).'Was'.$type; } /** diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php new file mode 100644 index 000000000000..2df79eec7736 --- /dev/null +++ b/tests/Integration/EventTest.php @@ -0,0 +1,253 @@ +faker = \Faker\Factory::create(); + + $this->makeTestData(); + } + + //@TODO paymentwasvoided + //@TODO paymentwasrefunded + + public function testPaymentEvents() + { + + $this->expectsEvents([ + PaymentWasCreated::class, + PaymentWasUpdated::class, + PaymentWasArchived::class, + PaymentWasRestored::class, + PaymentWasDeleted::class, + ]); + + $data = [ + 'amount' => $this->invoice->amount, + 'client_id' => $this->client->hashed_id, + 'invoices' => [ + [ + 'invoice_id' => $this->invoice->hashed_id, + 'amount' => $this->invoice->amount, + ], + ], + 'date' => '2020/12/12', + + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments?include=invoices', $data) + ->assertStatus(200); + + $arr = $response->json(); + + $data = [ + 'transaction_reference' => 'testing' + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/payments/' . $arr['data']['id'], $data) + ->assertStatus(200); + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/payments/bulk?action=delete', $data) + ->assertStatus(200); + } + + + public function testInvoiceEvents() + { + + /* Test fire new invoice */ + $data = [ + 'client_id' => $this->client->hashed_id, + 'number' => 'dude', + ]; + + $this->expectsEvents([ + InvoiceWasCreated::class, + InvoiceWasUpdated::class, + InvoiceWasArchived::class, + InvoiceWasRestored::class, + InvoiceWasDeleted::class, + ]); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/', $data) + ->assertStatus(200); + + + $arr = $response->json(); + + $data = [ + 'client_id' => $this->client->hashed_id, + 'number' => 'dude2', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/invoices/' . $arr['data']['id'], $data) + ->assertStatus(200); + + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/invoices/bulk?action=delete', $data) + ->assertStatus(200); + + } + + + public function testClientEvents() + { + $this->expectsEvents([ + ClientWasCreated::class, + ClientWasUpdated::class, + ClientWasArchived::class, + ClientWasRestored::class, + ClientWasDeleted::class, + ]); + + $data = [ + 'name' => $this->faker->firstName, + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients/', $data) + ->assertStatus(200); + + + $arr = $response->json(); + + $data = [ + 'name' => $this->faker->firstName, + 'id_number' => 'Coolio', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/clients/' . $arr['data']['id'], $data) + ->assertStatus(200); + + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients/bulk?action=delete', $data) + ->assertStatus(200); + + } + +} From 5c13e1681bfdb239c29bbcce522c0e780f5a7b0e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Nov 2020 21:19:32 +1100 Subject: [PATCH 09/11] Tests for events --- app/Events/Quote/QuoteWasArchived.php | 1 + app/Events/Quote/QuoteWasCreated.php | 1 + app/Events/Quote/QuoteWasDeleted.php | 1 + app/Events/Quote/QuoteWasRestored.php | 1 + app/Http/Controllers/QuoteController.php | 23 +++++++- tests/Integration/EventTest.php | 68 ++++++++++++++++++++++++ 6 files changed, 93 insertions(+), 2 deletions(-) diff --git a/app/Events/Quote/QuoteWasArchived.php b/app/Events/Quote/QuoteWasArchived.php index 03fd3a82d985..873fecb31ef3 100644 --- a/app/Events/Quote/QuoteWasArchived.php +++ b/app/Events/Quote/QuoteWasArchived.php @@ -12,6 +12,7 @@ namespace App\Events\Quote; use App\Models\Company; +use App\Models\Quote; use Illuminate\Queue\SerializesModels; class QuoteWasArchived diff --git a/app/Events/Quote/QuoteWasCreated.php b/app/Events/Quote/QuoteWasCreated.php index 49420e087749..0fc4155da2bb 100644 --- a/app/Events/Quote/QuoteWasCreated.php +++ b/app/Events/Quote/QuoteWasCreated.php @@ -12,6 +12,7 @@ namespace App\Events\Quote; use App\Models\Company; +use App\Models\Quote; use Illuminate\Queue\SerializesModels; /** diff --git a/app/Events/Quote/QuoteWasDeleted.php b/app/Events/Quote/QuoteWasDeleted.php index fdf3273b2bd7..9bfac894e092 100644 --- a/app/Events/Quote/QuoteWasDeleted.php +++ b/app/Events/Quote/QuoteWasDeleted.php @@ -12,6 +12,7 @@ namespace App\Events\Quote; use App\Models\Company; +use App\Models\Quote; use Illuminate\Queue\SerializesModels; /** diff --git a/app/Events/Quote/QuoteWasRestored.php b/app/Events/Quote/QuoteWasRestored.php index 53abe1bc8ade..6f2e4dd97974 100644 --- a/app/Events/Quote/QuoteWasRestored.php +++ b/app/Events/Quote/QuoteWasRestored.php @@ -12,6 +12,7 @@ namespace App\Events\Quote; use App\Models\Company; +use App\Models\Quote; use Illuminate\Queue\SerializesModels; /** diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index 6cf4cdd25744..a8d93a3e713c 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -11,6 +11,8 @@ namespace App\Http\Controllers; +use App\Events\Quote\QuoteWasCreated; +use App\Events\Quote\QuoteWasUpdated; use App\Factory\CloneInvoiceFactory; use App\Factory\CloneInvoiceToQuoteFactory; use App\Factory\CloneQuoteFactory; @@ -31,6 +33,7 @@ use App\Models\Quote; use App\Repositories\QuoteRepository; use App\Transformers\InvoiceTransformer; use App\Transformers\QuoteTransformer; +use App\Utils\Ninja; use App\Utils\TempFile; use App\Utils\Traits\MakesHash; use Illuminate\Http\Request; @@ -204,6 +207,8 @@ class QuoteController extends BaseController $quote = $this->quote_repo->save($request->all(), QuoteFactory::create(auth()->user()->company()->id, auth()->user()->id)); + event(new QuoteWasCreated($quote, $quote->company, Ninja::eventVars())); + return $this->itemResponse($quote); } @@ -378,6 +383,8 @@ class QuoteController extends BaseController $quote = $this->quote_repo->save($request->all(), $quote); + event(new QuoteWasUpdated($quote, $quote->company, Ninja::eventVars())); + return $this->itemResponse($quote); } @@ -658,15 +665,26 @@ class QuoteController extends BaseController }, basename($quote->pdf_file_path())); //return response()->download(TempFile::path($quote->pdf_file_path()), basename($quote->pdf_file_path())); break; + case 'restore': + $this->quote_repo->restore($quote); + + if (!$bulk) + return $this->listResponse($quote); + + break; case 'archive': $this->quote_repo->archive($quote); - return $this->listResponse($quote); + if (!$bulk) + return $this->listResponse($quote); + break; case 'delete': $this->quote_repo->delete($quote); - return $this->listResponse($quote); + if (!$bulk) + return $this->listResponse($quote); + break; case 'email': $quote->service()->sendEmail(); @@ -679,6 +697,7 @@ class QuoteController extends BaseController if (! $bulk) { return $this->itemResponse($quote); } + break; // no break default: return response()->json(['message' => "The requested action `{$action}` is not available."], 400); diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php index 2df79eec7736..73bec63fce06 100644 --- a/tests/Integration/EventTest.php +++ b/tests/Integration/EventTest.php @@ -27,6 +27,11 @@ use App\Events\Payment\PaymentWasCreated; use App\Events\Payment\PaymentWasDeleted; use App\Events\Payment\PaymentWasRestored; use App\Events\Payment\PaymentWasUpdated; +use App\Events\Quote\QuoteWasArchived; +use App\Events\Quote\QuoteWasCreated; +use App\Events\Quote\QuoteWasDeleted; +use App\Events\Quote\QuoteWasRestored; +use App\Events\Quote\QuoteWasUpdated; use App\Models\Credit; use App\Models\Design; use App\Models\Invoice; @@ -59,6 +64,69 @@ class EventTest extends TestCase $this->makeTestData(); } + public function testQuoteEvents() + { + + /* Test fire new invoice */ + $data = [ + 'client_id' => $this->client->hashed_id, + 'number' => 'dude', + ]; + + $this->expectsEvents([ + QuoteWasCreated::class, + QuoteWasUpdated::class, + QuoteWasArchived::class, + QuoteWasRestored::class, + QuoteWasDeleted::class, + ]); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/quotes/', $data) + ->assertStatus(200); + + + $arr = $response->json(); + + $data = [ + 'client_id' => $this->client->hashed_id, + 'number' => 'dude2', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/quotes/' . $arr['data']['id'], $data) + ->assertStatus(200); + + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/quotes/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/quotes/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/quotes/bulk?action=delete', $data) + ->assertStatus(200); + + } + + //@TODO paymentwasvoided //@TODO paymentwasrefunded From 14fd4a5af42a7c8c38a55660714d78821a241839 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Nov 2020 23:35:05 +1100 Subject: [PATCH 10/11] Event Tests --- app/Events/Credit/CreditWasRestored.php | 1 + app/Factory/CloneQuoteToInvoiceFactory.php | 1 + .../ClientPortal/QuoteController.php | 4 +- app/Repositories/TaskRepository.php | 2 +- app/Services/Quote/ConvertQuote.php | 1 + app/Services/Quote/QuoteService.php | 9 +- tests/Integration/EventTest.php | 146 ++++++++++++++++++ 7 files changed, 160 insertions(+), 4 deletions(-) diff --git a/app/Events/Credit/CreditWasRestored.php b/app/Events/Credit/CreditWasRestored.php index 62f343eab3ca..70ba1d5fd463 100644 --- a/app/Events/Credit/CreditWasRestored.php +++ b/app/Events/Credit/CreditWasRestored.php @@ -11,6 +11,7 @@ namespace App\Events\Credit; +use App\Models\Company; use App\Models\Credit; use Illuminate\Queue\SerializesModels; diff --git a/app/Factory/CloneQuoteToInvoiceFactory.php b/app/Factory/CloneQuoteToInvoiceFactory.php index 326c33489822..0c02506d2c08 100644 --- a/app/Factory/CloneQuoteToInvoiceFactory.php +++ b/app/Factory/CloneQuoteToInvoiceFactory.php @@ -27,6 +27,7 @@ class CloneQuoteToInvoiceFactory unset($quote_array['hashed_id']); unset($quote_array['invoice_id']); unset($quote_array['id']); + unset($quote_array['invitations']); foreach ($quote_array as $key => $value) { $invoice->{$key} = $value; diff --git a/app/Http/Controllers/ClientPortal/QuoteController.php b/app/Http/Controllers/ClientPortal/QuoteController.php index 6d8a7b350e0e..30eb3e9738e4 100644 --- a/app/Http/Controllers/ClientPortal/QuoteController.php +++ b/app/Http/Controllers/ClientPortal/QuoteController.php @@ -109,8 +109,8 @@ class QuoteController extends Controller if ($process) { foreach ($quotes as $quote) { - $quote->service()->approve()->save(); - event(new QuoteWasApproved(auth()->user(), $quote, $quote->company, Ninja::eventVars())); + $quote->service()->approve(auth()->user())->save(); + event(new QuoteWasApproved($quote, $quote->company, Ninja::eventVars())); } return redirect() diff --git a/app/Repositories/TaskRepository.php b/app/Repositories/TaskRepository.php index e73f3109a357..639567c25686 100644 --- a/app/Repositories/TaskRepository.php +++ b/app/Repositories/TaskRepository.php @@ -51,7 +51,7 @@ class TaskRepository extends BaseRepository $task->fill($data); $task->save(); - $task->number = empty($task->number) ? $this->getNextTaskNumber($task) : $data['number']; + $task->number = empty($task->number) || !array_key_exists('number', $data) ? $this->getNextTaskNumber($task) : $data['number']; if (isset($data['description'])) { $task->description = trim($data['description']); diff --git a/app/Services/Quote/ConvertQuote.php b/app/Services/Quote/ConvertQuote.php index be13069ab525..f8a757c5e57f 100644 --- a/app/Services/Quote/ConvertQuote.php +++ b/app/Services/Quote/ConvertQuote.php @@ -34,6 +34,7 @@ class ConvertQuote public function run($quote) { $invoice = CloneQuoteToInvoiceFactory::create($quote, $quote->user_id); + $invoice = $this->invoice_repo->save([], $invoice); $invoice->fresh(); diff --git a/app/Services/Quote/QuoteService.php b/app/Services/Quote/QuoteService.php index 72aade07b952..f74dd3cfe590 100644 --- a/app/Services/Quote/QuoteService.php +++ b/app/Services/Quote/QuoteService.php @@ -11,12 +11,14 @@ namespace App\Services\Quote; +use App\Events\Quote\QuoteWasApproved; use App\Factory\CloneQuoteToInvoiceFactory; use App\Models\Invoice; use App\Models\Quote; use App\Repositories\QuoteRepository; use App\Services\Quote\CreateInvitations; use App\Services\Quote\GetQuotePdf; +use App\Utils\Ninja; class QuoteService { @@ -108,10 +110,15 @@ class QuoteService return $this; } - public function approve() :self + public function approve($contact = null) :self { $this->setStatus(Quote::STATUS_APPROVED)->save(); + if(!$contact) + $contact = $this->quote->invitations->first()->contact; + + event(new QuoteWasApproved($contact, $this->quote, $this->quote->company, Ninja::eventVars())); + $invoice = null; if ($this->quote->client->getSetting('auto_convert_quote')) { diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php index 73bec63fce06..b21deec1839f 100644 --- a/tests/Integration/EventTest.php +++ b/tests/Integration/EventTest.php @@ -17,6 +17,11 @@ use App\Events\Client\ClientWasCreated; use App\Events\Client\ClientWasDeleted; use App\Events\Client\ClientWasRestored; use App\Events\Client\ClientWasUpdated; +use App\Events\Credit\CreditWasArchived; +use App\Events\Credit\CreditWasCreated; +use App\Events\Credit\CreditWasDeleted; +use App\Events\Credit\CreditWasRestored; +use App\Events\Credit\CreditWasUpdated; use App\Events\Invoice\InvoiceWasArchived; use App\Events\Invoice\InvoiceWasCreated; use App\Events\Invoice\InvoiceWasDeleted; @@ -27,11 +32,17 @@ use App\Events\Payment\PaymentWasCreated; use App\Events\Payment\PaymentWasDeleted; use App\Events\Payment\PaymentWasRestored; use App\Events\Payment\PaymentWasUpdated; +use App\Events\Quote\QuoteWasApproved; use App\Events\Quote\QuoteWasArchived; use App\Events\Quote\QuoteWasCreated; use App\Events\Quote\QuoteWasDeleted; use App\Events\Quote\QuoteWasRestored; use App\Events\Quote\QuoteWasUpdated; +use App\Events\Task\TaskWasArchived; +use App\Events\Task\TaskWasCreated; +use App\Events\Task\TaskWasDeleted; +use App\Events\Task\TaskWasRestored; +use App\Events\Task\TaskWasUpdated; use App\Models\Credit; use App\Models\Design; use App\Models\Invoice; @@ -64,6 +75,130 @@ class EventTest extends TestCase $this->makeTestData(); } + public function testTaskEvents() + { + + /* Test fire new invoice */ + $data = [ + 'client_id' => $this->client->hashed_id, + 'description' => 'dude', + ]; + + $this->expectsEvents([ + TaskWasCreated::class, + TaskWasUpdated::class, + TaskWasArchived::class, + TaskWasRestored::class, + TaskWasDeleted::class, + ]); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/tasks/', $data) + ->assertStatus(200); + + + $arr = $response->json(); + + $data = [ + 'client_id' => $this->client->hashed_id, + 'description' => 'dude2', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/tasks/' . $arr['data']['id'], $data) + ->assertStatus(200); + + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/tasks/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/tasks/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/tasks/bulk?action=delete', $data) + ->assertStatus(200); + + } + + public function testCreditEvents() + { + + /* Test fire new invoice */ + $data = [ + 'client_id' => $this->client->hashed_id, + 'number' => 'dude', + ]; + + $this->expectsEvents([ + CreditWasCreated::class, + CreditWasUpdated::class, + CreditWasArchived::class, + CreditWasRestored::class, + CreditWasDeleted::class, + ]); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/credits/', $data) + ->assertStatus(200); + + + $arr = $response->json(); + + $data = [ + 'client_id' => $this->client->hashed_id, + 'number' => 'dude2', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/credits/' . $arr['data']['id'], $data) + ->assertStatus(200); + + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/credits/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/credits/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/credits/bulk?action=delete', $data) + ->assertStatus(200); + + } + public function testQuoteEvents() { @@ -79,6 +214,7 @@ class EventTest extends TestCase QuoteWasArchived::class, QuoteWasRestored::class, QuoteWasDeleted::class, + QuoteWasApproved::class, ]); $response = $this->withHeaders([ @@ -106,6 +242,10 @@ class EventTest extends TestCase 'ids' => [$arr['data']['id']], ]; + $quote = Quote::find($this->decodePrimaryKey($arr['data']['id'])); + $quote->status_id = Quote::STATUS_SENT; + $quote->save(); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, @@ -118,6 +258,12 @@ class EventTest extends TestCase ])->post('/api/v1/quotes/bulk?action=restore', $data) ->assertStatus(200); + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/quotes/bulk?action=approve', $data) + ->assertStatus(200); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token, From 6e6a24359c5a51b22d7b73b44e62d9ec38ab33b6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 3 Nov 2020 23:39:41 +1100 Subject: [PATCH 11/11] Expense events --- app/Http/Controllers/VendorController.php | 7 +- tests/Integration/EventTest.php | 129 ++++++++++++++++++++++ 2 files changed, 134 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/VendorController.php b/app/Http/Controllers/VendorController.php index 99fa589db1be..3957179560e0 100644 --- a/app/Http/Controllers/VendorController.php +++ b/app/Http/Controllers/VendorController.php @@ -11,10 +11,10 @@ namespace App\Http\Controllers; +use App\Events\Vendor\VendorWasCreated; +use App\Events\Vendor\VendorWasUpdated; use App\Factory\VendorFactory; use App\Filters\VendorFilters; -use App\Utils\Ninja; -use App\Events\Vendor\VendorWasCreated; use App\Http\Requests\Vendor\CreateVendorRequest; use App\Http\Requests\Vendor\DestroyVendorRequest; use App\Http\Requests\Vendor\EditVendorRequest; @@ -31,6 +31,7 @@ use App\Models\Vendor; use App\Repositories\BaseRepository; use App\Repositories\VendorRepository; use App\Transformers\VendorTransformer; +use App\Utils\Ninja; use App\Utils\Traits\BulkOptions; use App\Utils\Traits\MakesHash; use App\Utils\Traits\Uploadable; @@ -282,6 +283,8 @@ class VendorController extends BaseController $this->uploadLogo($request->file('company_logo'), $vendor->company, $vendor); + event(new VendorWasUpdated($vendor, $vendor->company, Ninja::eventVars())); + return $this->itemResponse($vendor->fresh()); } diff --git a/tests/Integration/EventTest.php b/tests/Integration/EventTest.php index b21deec1839f..991a6254f5be 100644 --- a/tests/Integration/EventTest.php +++ b/tests/Integration/EventTest.php @@ -22,6 +22,11 @@ use App\Events\Credit\CreditWasCreated; use App\Events\Credit\CreditWasDeleted; use App\Events\Credit\CreditWasRestored; use App\Events\Credit\CreditWasUpdated; +use App\Events\Expense\ExpenseWasArchived; +use App\Events\Expense\ExpenseWasCreated; +use App\Events\Expense\ExpenseWasDeleted; +use App\Events\Expense\ExpenseWasRestored; +use App\Events\Expense\ExpenseWasUpdated; use App\Events\Invoice\InvoiceWasArchived; use App\Events\Invoice\InvoiceWasCreated; use App\Events\Invoice\InvoiceWasDeleted; @@ -43,6 +48,11 @@ use App\Events\Task\TaskWasCreated; use App\Events\Task\TaskWasDeleted; use App\Events\Task\TaskWasRestored; use App\Events\Task\TaskWasUpdated; +use App\Events\Vendor\VendorWasArchived; +use App\Events\Vendor\VendorWasCreated; +use App\Events\Vendor\VendorWasDeleted; +use App\Events\Vendor\VendorWasRestored; +use App\Events\Vendor\VendorWasUpdated; use App\Models\Credit; use App\Models\Design; use App\Models\Invoice; @@ -75,6 +85,125 @@ class EventTest extends TestCase $this->makeTestData(); } + public function testExpenseEvents() + { + $this->expectsEvents([ + ExpenseWasCreated::class, + ExpenseWasUpdated::class, + ExpenseWasArchived::class, + ExpenseWasRestored::class, + ExpenseWasDeleted::class, + ]); + + $data = [ + 'public_notes' => $this->faker->firstName, + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/expenses/', $data) + ->assertStatus(200); + + + $arr = $response->json(); + + $data = [ + 'public_notes' => $this->faker->firstName, + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/expenses/' . $arr['data']['id'], $data) + ->assertStatus(200); + + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/expenses/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/expenses/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/expenses/bulk?action=delete', $data) + ->assertStatus(200); + + } + + + public function testVendorEvents() + { + $this->expectsEvents([ + VendorWasCreated::class, + VendorWasUpdated::class, + VendorWasArchived::class, + VendorWasRestored::class, + VendorWasDeleted::class, + ]); + + $data = [ + 'name' => $this->faker->firstName, + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/vendors/', $data) + ->assertStatus(200); + + + $arr = $response->json(); + + $data = [ + 'name' => $this->faker->firstName, + 'id_number' => 'Coolio', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->put('/api/v1/vendors/' . $arr['data']['id'], $data) + ->assertStatus(200); + + + $data = [ + 'ids' => [$arr['data']['id']], + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/vendors/bulk?action=archive', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/vendors/bulk?action=restore', $data) + ->assertStatus(200); + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/vendors/bulk?action=delete', $data) + ->assertStatus(200); + + } + + public function testTaskEvents() {