diff --git a/.env.dist b/.env.dist index f6d35eec..33902df3 100644 --- a/.env.dist +++ b/.env.dist @@ -57,6 +57,7 @@ COUNTRY_CODE=+insert_country_code_here # redis hash LATEST_ACTIVE_JO=latest_active_jo +HUB_JO_KEY=hub_jo_count # dashboard DASHBOARD_ENABLE=set_to_true_or_false diff --git a/composer.json b/composer.json index 20b9c833..5313b64a 100644 --- a/composer.json +++ b/composer.json @@ -25,6 +25,7 @@ "symfony/flex": "^1.0", "symfony/framework-bundle": "^4.0", "symfony/maker-bundle": "^1.0", + "symfony/monolog-bundle": "^3.7", "symfony/orm-pack": "^1.0", "symfony/process": "^4.0", "symfony/profiler-pack": "^1.0", diff --git a/composer.lock b/composer.lock index dcd7eb19..b4855595 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ad9d56a6dff26742f024917e58b919f9", + "content-hash": "ec7f40b23cfd3577e34ebf2646576889", "packages": [ { "name": "catalyst/auth-bundle", @@ -538,40 +538,39 @@ }, { "name": "doctrine/cache", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "13e3381b25847283a91948d04640543941309727" + "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", - "reference": "13e3381b25847283a91948d04640543941309727", + "url": "https://api.github.com/repos/doctrine/cache/zipball/a9c1b59eba5a08ca2770a76eddb88922f504e8e0", + "reference": "a9c1b59eba5a08ca2770a76eddb88922f504e8e0", "shasum": "" }, "require": { "php": "~7.1 || ^8.0" }, "conflict": { - "doctrine/common": ">2.2,<2.4" + "doctrine/common": ">2.2,<2.4", + "psr/cache": ">=3" }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", - "doctrine/coding-standard": "^6.0", + "cache/integration-tests": "dev-master", + "doctrine/coding-standard": "^8.0", "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^7.0", - "predis/predis": "~1.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", + "predis/predis": "~1.0", + "psr/cache": "^1.0 || ^2.0", + "symfony/cache": "^4.4 || ^5.2" }, "suggest": { "alcaeus/mongo-php-adapter": "Required to use legacy MongoDB driver" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9.x-dev" - } - }, "autoload": { "psr-4": { "Doctrine\\Common\\Cache\\": "lib/Doctrine/Common/Cache" @@ -618,7 +617,7 @@ ], "support": { "issues": "https://github.com/doctrine/cache/issues", - "source": "https://github.com/doctrine/cache/tree/1.10.x" + "source": "https://github.com/doctrine/cache/tree/1.11.0" }, "funding": [ { @@ -634,7 +633,7 @@ "type": "tidelift" } ], - "time": "2020-07-07T18:54:01+00:00" + "time": "2021-04-13T14:46:17+00:00" }, { "name": "doctrine/collections", @@ -808,16 +807,16 @@ }, { "name": "doctrine/dbal", - "version": "2.13.0", + "version": "2.13.1", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "67d56d3203b33db29834e6b2fcdbfdc50535d796" + "reference": "c800380457948e65bbd30ba92cc17cda108bf8c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/67d56d3203b33db29834e6b2fcdbfdc50535d796", - "reference": "67d56d3203b33db29834e6b2fcdbfdc50535d796", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/c800380457948e65bbd30ba92cc17cda108bf8c9", + "reference": "c800380457948e65bbd30ba92cc17cda108bf8c9", "shasum": "" }, "require": { @@ -832,6 +831,7 @@ "jetbrains/phpstorm-stubs": "2020.2", "phpstan/phpstan": "0.12.81", "phpunit/phpunit": "^7.5.20|^8.5|9.5.0", + "squizlabs/php_codesniffer": "3.6.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", "vimeo/psalm": "4.6.4" }, @@ -894,7 +894,7 @@ ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.13.0" + "source": "https://github.com/doctrine/dbal/tree/2.13.1" }, "funding": [ { @@ -910,7 +910,7 @@ "type": "tidelift" } ], - "time": "2021-03-28T18:10:53+00:00" + "time": "2021-04-17T17:30:19+00:00" }, { "name": "doctrine/deprecations", @@ -1343,26 +1343,26 @@ }, { "name": "doctrine/inflector", - "version": "1.4.3", + "version": "1.4.4", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c" + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/4650c8b30c753a76bf44fb2ed00117d6f367490c", - "reference": "4650c8b30c753a76bf44fb2ed00117d6f367490c", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", + "reference": "4bd5c1cdfcd00e9e2d8c484f79150f67e5d355d9", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^7.0", - "phpstan/phpstan": "^0.11", - "phpstan/phpstan-phpunit": "^0.11", - "phpstan/phpstan-strict-rules": "^0.11", + "doctrine/coding-standard": "^8.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "type": "library", @@ -1419,7 +1419,7 @@ ], "support": { "issues": "https://github.com/doctrine/inflector/issues", - "source": "https://github.com/doctrine/inflector/tree/1.4.x" + "source": "https://github.com/doctrine/inflector/tree/1.4.4" }, "funding": [ { @@ -1435,7 +1435,7 @@ "type": "tidelift" } ], - "time": "2020-05-29T07:19:59+00:00" + "time": "2021-04-16T17:34:40+00:00" }, { "name": "doctrine/instantiator", @@ -2284,16 +2284,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.8.1", + "version": "1.8.2", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1" + "reference": "dc960a912984efb74d0a90222870c72c87f10c91" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/35ea11d335fd638b5882ff1725228b3d35496ab1", - "reference": "35ea11d335fd638b5882ff1725228b3d35496ab1", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dc960a912984efb74d0a90222870c72c87f10c91", + "reference": "dc960a912984efb74d0a90222870c72c87f10c91", "shasum": "" }, "require": { @@ -2353,9 +2353,9 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.8.1" + "source": "https://github.com/guzzle/psr7/tree/1.8.2" }, - "time": "2021-03-21T16:25:00+00:00" + "time": "2021-04-26T09:17:50+00:00" }, { "name": "laminas/laminas-code", @@ -2648,6 +2648,102 @@ }, "time": "2020-12-28T07:59:51+00:00" }, + { + "name": "monolog/monolog", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "reference": "1cb1cde8e8dd0f70cc0fe51354a59acad9302084", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1" + }, + "provide": { + "psr/log-implementation": "1.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7", + "graylog2/gelf-php": "^1.4.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4", + "php-console/php-console": "^3.1.3", + "phpspec/prophecy": "^1.6.1", + "phpstan/phpstan": "^0.12.59", + "phpunit/phpunit": "^8.5", + "predis/predis": "^1.1", + "rollbar/rollbar": "^1.3", + "ruflin/elastica": ">=0.90 <7.0.1", + "swiftmailer/swiftmailer": "^5.3|^6.0" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "php-console/php-console": "Allow sending log messages to Google Chrome", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.2.0" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "time": "2020-12-14T13:15:25+00:00" + }, { "name": "nikic/php-parser", "version": "v4.10.4", @@ -3096,18 +3192,22 @@ }, { "name": "setasign/fpdf", - "version": "1.8.2", + "version": "1.8.3", "source": { "type": "git", "url": "https://github.com/Setasign/FPDF.git", - "reference": "d77904018090c17dc9f3ab6e944679a7a47e710a" + "reference": "6a83253ece0df1c5b6c05fe7a900c660ae38afc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Setasign/FPDF/zipball/d77904018090c17dc9f3ab6e944679a7a47e710a", - "reference": "d77904018090c17dc9f3ab6e944679a7a47e710a", + "url": "https://api.github.com/repos/Setasign/FPDF/zipball/6a83253ece0df1c5b6c05fe7a900c660ae38afc3", + "reference": "6a83253ece0df1c5b6c05fe7a900c660ae38afc3", "shasum": "" }, + "require": { + "ext-gd": "*", + "ext-zlib": "*" + }, "type": "library", "autoload": { "classmap": [ @@ -3132,22 +3232,22 @@ "pdf" ], "support": { - "source": "https://github.com/Setasign/FPDF/tree/1.8.2" + "source": "https://github.com/Setasign/FPDF/tree/1.8.3" }, - "time": "2019-12-08T10:32:10+00:00" + "time": "2021-04-20T09:49:57+00:00" }, { "name": "symfony/asset", - "version": "v4.4.20", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/asset.git", - "reference": "f2204a526c34945b1614cde033692983b6102eb8" + "reference": "aeedecee0bce60320521083efaf6c359ad710e20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/asset/zipball/f2204a526c34945b1614cde033692983b6102eb8", - "reference": "f2204a526c34945b1614cde033692983b6102eb8", + "url": "https://api.github.com/repos/symfony/asset/zipball/aeedecee0bce60320521083efaf6c359ad710e20", + "reference": "aeedecee0bce60320521083efaf6c359ad710e20", "shasum": "" }, "require": { @@ -3186,7 +3286,7 @@ "description": "Manages URL generation and versioning of web assets such as CSS stylesheets, JavaScript files and image files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/asset/tree/v4.4.20" + "source": "https://github.com/symfony/asset/tree/v4.4.22" }, "funding": [ { @@ -3202,20 +3302,20 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2021-04-07T15:47:03+00:00" }, { "name": "symfony/cache", - "version": "v5.2.6", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "093d69bb10c959553c8beb828b8d4ea250a247dd" + "reference": "1d801d1dc5e3840e832568db6b35a954cfb435a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/093d69bb10c959553c8beb828b8d4ea250a247dd", - "reference": "093d69bb10c959553c8beb828b8d4ea250a247dd", + "url": "https://api.github.com/repos/symfony/cache/zipball/1d801d1dc5e3840e832568db6b35a954cfb435a8", + "reference": "1d801d1dc5e3840e832568db6b35a954cfb435a8", "shasum": "" }, "require": { @@ -3281,7 +3381,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v5.2.6" + "source": "https://github.com/symfony/cache/tree/v5.2.7" }, "funding": [ { @@ -3297,25 +3397,25 @@ "type": "tidelift" } ], - "time": "2021-03-16T09:10:13+00:00" + "time": "2021-04-23T16:56:33+00:00" }, { "name": "symfony/cache-contracts", - "version": "v2.2.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb" + "reference": "c0446463729b89dd4fa62e9aeecc80287323615d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/8034ca0b61d4dd967f3698aaa1da2507b631d0cb", - "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/c0446463729b89dd4fa62e9aeecc80287323615d", + "reference": "c0446463729b89dd4fa62e9aeecc80287323615d", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/cache": "^1.0" + "psr/cache": "^1.0|^2.0|^3.0" }, "suggest": { "symfony/cache-implementation": "" @@ -3323,7 +3423,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -3360,7 +3460,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.2.0" + "source": "https://github.com/symfony/cache-contracts/tree/v2.4.0" }, "funding": [ { @@ -3376,20 +3476,20 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/config", - "version": "v5.2.4", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "212d54675bf203ff8aef7d8cee8eecfb72f4a263" + "reference": "3817662ada105c8c4d1afdb4ec003003efd1d8d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/212d54675bf203ff8aef7d8cee8eecfb72f4a263", - "reference": "212d54675bf203ff8aef7d8cee8eecfb72f4a263", + "url": "https://api.github.com/repos/symfony/config/zipball/3817662ada105c8c4d1afdb4ec003003efd1d8d8", + "reference": "3817662ada105c8c4d1afdb4ec003003efd1d8d8", "shasum": "" }, "require": { @@ -3438,7 +3538,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.2.4" + "source": "https://github.com/symfony/config/tree/v5.2.7" }, "funding": [ { @@ -3454,20 +3554,20 @@ "type": "tidelift" } ], - "time": "2021-02-23T23:58:19+00:00" + "time": "2021-04-07T16:07:52+00:00" }, { "name": "symfony/console", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23" + "reference": "36bbd079b69b94bcc9c9c9e1e37ca3b1e7971625" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", - "reference": "1ba4560dbbb9fcf5ae28b61f71f49c678086cf23", + "url": "https://api.github.com/repos/symfony/console/zipball/36bbd079b69b94bcc9c9c9e1e37ca3b1e7971625", + "reference": "36bbd079b69b94bcc9c9c9e1e37ca3b1e7971625", "shasum": "" }, "require": { @@ -3527,7 +3627,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.21" + "source": "https://github.com/symfony/console/tree/v4.4.22" }, "funding": [ { @@ -3543,20 +3643,20 @@ "type": "tidelift" } ], - "time": "2021-03-26T09:23:24+00:00" + "time": "2021-04-16T17:32:19+00:00" }, { "name": "symfony/debug", - "version": "v4.4.20", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16" + "reference": "45b2136377cca5f10af858968d6079a482bca473" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/157bbec4fd773bae53c5483c50951a5530a2cc16", - "reference": "157bbec4fd773bae53c5483c50951a5530a2cc16", + "url": "https://api.github.com/repos/symfony/debug/zipball/45b2136377cca5f10af858968d6079a482bca473", + "reference": "45b2136377cca5f10af858968d6079a482bca473", "shasum": "" }, "require": { @@ -3596,7 +3696,7 @@ "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v4.4.20" + "source": "https://github.com/symfony/debug/tree/v4.4.22" }, "funding": [ { @@ -3612,20 +3712,20 @@ "type": "tidelift" } ], - "time": "2021-01-28T16:54:48+00:00" + "time": "2021-04-02T07:50:12+00:00" }, { "name": "symfony/dependency-injection", - "version": "v5.2.6", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "1e66194bed2a69fa395d26bf1067e5e34483afac" + "reference": "6ca378b99e3c9ba6127eb43b68389fb2b7348577" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1e66194bed2a69fa395d26bf1067e5e34483afac", - "reference": "1e66194bed2a69fa395d26bf1067e5e34483afac", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/6ca378b99e3c9ba6127eb43b68389fb2b7348577", + "reference": "6ca378b99e3c9ba6127eb43b68389fb2b7348577", "shasum": "" }, "require": { @@ -3683,7 +3783,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v5.2.6" + "source": "https://github.com/symfony/dependency-injection/tree/v5.2.7" }, "funding": [ { @@ -3699,20 +3799,20 @@ "type": "tidelift" } ], - "time": "2021-03-22T11:10:24+00:00" + "time": "2021-04-24T14:32:26+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.2.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665" + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665", - "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5f38c8804a9e97d23e0c8d63341088cd8a22d627", + "reference": "5f38c8804a9e97d23e0c8d63341088cd8a22d627", "shasum": "" }, "require": { @@ -3721,7 +3821,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -3750,7 +3850,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/master" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.4.0" }, "funding": [ { @@ -3766,20 +3866,20 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/doctrine-bridge", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/doctrine-bridge.git", - "reference": "e643bddb38277b4a1c2973d1489768c6e6c0db80" + "reference": "9d42bb12f287bf2378500f745174aae519a2c922" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/e643bddb38277b4a1c2973d1489768c6e6c0db80", - "reference": "e643bddb38277b4a1c2973d1489768c6e6c0db80", + "url": "https://api.github.com/repos/symfony/doctrine-bridge/zipball/9d42bb12f287bf2378500f745174aae519a2c922", + "reference": "9d42bb12f287bf2378500f745174aae519a2c922", "shasum": "" }, "require": { @@ -3856,7 +3956,7 @@ "description": "Provides integration for Doctrine with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/doctrine-bridge/tree/v4.4.21" + "source": "https://github.com/symfony/doctrine-bridge/tree/v4.4.22" }, "funding": [ { @@ -3872,20 +3972,20 @@ "type": "tidelift" } ], - "time": "2021-03-09T16:20:30+00:00" + "time": "2021-04-16T13:04:32+00:00" }, { "name": "symfony/error-handler", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "48e81a375525872e788c2418430f54150d935810" + "reference": "76603a8df8e001436df80758eb03a8baa5324175" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/48e81a375525872e788c2418430f54150d935810", - "reference": "48e81a375525872e788c2418430f54150d935810", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/76603a8df8e001436df80758eb03a8baa5324175", + "reference": "76603a8df8e001436df80758eb03a8baa5324175", "shasum": "" }, "require": { @@ -3925,7 +4025,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v4.4.21" + "source": "https://github.com/symfony/error-handler/tree/v4.4.22" }, "funding": [ { @@ -3941,7 +4041,7 @@ "type": "tidelift" } ], - "time": "2021-03-08T10:28:40+00:00" + "time": "2021-04-02T07:50:12+00:00" }, { "name": "symfony/event-dispatcher", @@ -4107,16 +4207,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "940826c465be2690c9fae91b2793481e5cbd6834" + "reference": "f0f06656a18304cdeacb2c4c0113a2b78a2b4c2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/940826c465be2690c9fae91b2793481e5cbd6834", - "reference": "940826c465be2690c9fae91b2793481e5cbd6834", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/f0f06656a18304cdeacb2c4c0113a2b78a2b4c2a", + "reference": "f0f06656a18304cdeacb2c4c0113a2b78a2b4c2a", "shasum": "" }, "require": { @@ -4149,7 +4249,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v4.4.21" + "source": "https://github.com/symfony/filesystem/tree/v4.4.22" }, "funding": [ { @@ -4165,7 +4265,7 @@ "type": "tidelift" } ], - "time": "2021-03-28T09:59:32+00:00" + "time": "2021-04-01T10:24:12+00:00" }, { "name": "symfony/finder", @@ -4298,16 +4398,16 @@ }, { "name": "symfony/framework-bundle", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/framework-bundle.git", - "reference": "fc72fbb0f9a69d2eb5d94cc8c231176265db680a" + "reference": "98e855fd35dd2c4614f61d349b1fd7dd3622b9b9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/fc72fbb0f9a69d2eb5d94cc8c231176265db680a", - "reference": "fc72fbb0f9a69d2eb5d94cc8c231176265db680a", + "url": "https://api.github.com/repos/symfony/framework-bundle/zipball/98e855fd35dd2c4614f61d349b1fd7dd3622b9b9", + "reference": "98e855fd35dd2c4614f61d349b1fd7dd3622b9b9", "shasum": "" }, "require": { @@ -4423,7 +4523,7 @@ "description": "Provides a tight integration between Symfony components and the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/framework-bundle/tree/v4.4.21" + "source": "https://github.com/symfony/framework-bundle/tree/v4.4.22" }, "funding": [ { @@ -4439,20 +4539,20 @@ "type": "tidelift" } ], - "time": "2021-03-18T09:22:03+00:00" + "time": "2021-04-14T13:03:08+00:00" }, { "name": "symfony/http-client-contracts", - "version": "v2.3.1", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/http-client-contracts.git", - "reference": "41db680a15018f9c1d4b23516059633ce280ca33" + "reference": "7e82f6084d7cae521a75ef2cb5c9457bbda785f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/41db680a15018f9c1d4b23516059633ce280ca33", - "reference": "41db680a15018f9c1d4b23516059633ce280ca33", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/7e82f6084d7cae521a75ef2cb5c9457bbda785f4", + "reference": "7e82f6084d7cae521a75ef2cb5c9457bbda785f4", "shasum": "" }, "require": { @@ -4463,9 +4563,8 @@ }, "type": "library", "extra": { - "branch-version": "2.3", "branch-alias": { - "dev-main": "2.3-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -4502,7 +4601,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/http-client-contracts/tree/v2.3.1" + "source": "https://github.com/symfony/http-client-contracts/tree/v2.4.0" }, "funding": [ { @@ -4518,20 +4617,20 @@ "type": "tidelift" } ], - "time": "2020-10-14T17:08:19+00:00" + "time": "2021-04-11T23:07:08+00:00" }, { "name": "symfony/http-foundation", - "version": "v5.2.4", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf" + "reference": "a416487a73bb9c9d120e9ba3a60547f4a3fb7a1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/54499baea7f7418bce7b5ec92770fd0799e8e9bf", - "reference": "54499baea7f7418bce7b5ec92770fd0799e8e9bf", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/a416487a73bb9c9d120e9ba3a60547f4a3fb7a1f", + "reference": "a416487a73bb9c9d120e9ba3a60547f4a3fb7a1f", "shasum": "" }, "require": { @@ -4575,7 +4674,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.2.4" + "source": "https://github.com/symfony/http-foundation/tree/v5.2.7" }, "funding": [ { @@ -4591,20 +4690,20 @@ "type": "tidelift" } ], - "time": "2021-02-25T17:16:57+00:00" + "time": "2021-05-01T13:46:24+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "0248214120d00c5f44f1cd5d9ad65f0b38459333" + "reference": "cd2e325fc34a4a5bbec91eecf69dda8ee8c5ea4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/0248214120d00c5f44f1cd5d9ad65f0b38459333", - "reference": "0248214120d00c5f44f1cd5d9ad65f0b38459333", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/cd2e325fc34a4a5bbec91eecf69dda8ee8c5ea4f", + "reference": "cd2e325fc34a4a5bbec91eecf69dda8ee8c5ea4f", "shasum": "" }, "require": { @@ -4679,7 +4778,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v4.4.21" + "source": "https://github.com/symfony/http-kernel/tree/v4.4.22" }, "funding": [ { @@ -4695,7 +4794,7 @@ "type": "tidelift" } ], - "time": "2021-03-29T05:11:04+00:00" + "time": "2021-05-01T14:38:48+00:00" }, { "name": "symfony/maker-bundle", @@ -4785,6 +4884,169 @@ ], "time": "2021-03-23T13:53:38+00:00" }, + { + "name": "symfony/monolog-bridge", + "version": "v5.2.7", + "source": { + "type": "git", + "url": "https://github.com/symfony/monolog-bridge.git", + "reference": "ddb9c33dfa1bd89c956892c3d1ba35f324e3ccd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/monolog-bridge/zipball/ddb9c33dfa1bd89c956892c3d1ba35f324e3ccd8", + "reference": "ddb9c33dfa1bd89c956892c3d1ba35f324e3ccd8", + "shasum": "" + }, + "require": { + "monolog/monolog": "^1.25.1|^2", + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/service-contracts": "^1.1|^2" + }, + "conflict": { + "symfony/console": "<4.4", + "symfony/http-foundation": "<4.4" + }, + "require-dev": { + "symfony/console": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/mailer": "^4.4|^5.0", + "symfony/mime": "^4.4|^5.0", + "symfony/security-core": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "symfony/console": "For the possibility to show log messages in console commands depending on verbosity settings.", + "symfony/http-kernel": "For using the debugging handlers together with the response life cycle of the HTTP kernel.", + "symfony/var-dumper": "For using the debugging handlers like the console handler or the log server handler." + }, + "type": "symfony-bridge", + "autoload": { + "psr-4": { + "Symfony\\Bridge\\Monolog\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides integration for Monolog with various Symfony components", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/monolog-bridge/tree/v5.2.7" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-04-07T16:07:52+00:00" + }, + { + "name": "symfony/monolog-bundle", + "version": "v3.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/monolog-bundle.git", + "reference": "4054b2e940a25195ae15f0a49ab0c51718922eb4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/monolog-bundle/zipball/4054b2e940a25195ae15f0a49ab0c51718922eb4", + "reference": "4054b2e940a25195ae15f0a49ab0c51718922eb4", + "shasum": "" + }, + "require": { + "monolog/monolog": "~1.22 || ~2.0", + "php": ">=7.1.3", + "symfony/config": "~4.4 || ^5.0", + "symfony/dependency-injection": "^4.4 || ^5.0", + "symfony/http-kernel": "~4.4 || ^5.0", + "symfony/monolog-bridge": "~4.4 || ^5.0" + }, + "require-dev": { + "symfony/console": "~4.4 || ^5.0", + "symfony/phpunit-bridge": "^5.1", + "symfony/yaml": "~4.4 || ^5.0" + }, + "type": "symfony-bundle", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Bundle\\MonologBundle\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony MonologBundle", + "homepage": "https://symfony.com", + "keywords": [ + "log", + "logging" + ], + "support": { + "issues": "https://github.com/symfony/monolog-bundle/issues", + "source": "https://github.com/symfony/monolog-bundle/tree/v3.7.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-31T07:20:47+00:00" + }, { "name": "symfony/orm-pack", "version": "v1.2.0", @@ -5483,16 +5745,16 @@ }, { "name": "symfony/process", - "version": "v4.4.20", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "7e950b6366d4da90292c2e7fa820b3c1842b965a" + "reference": "f5481b22729d465acb1cea3455fc04ce84b0148b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/7e950b6366d4da90292c2e7fa820b3c1842b965a", - "reference": "7e950b6366d4da90292c2e7fa820b3c1842b965a", + "url": "https://api.github.com/repos/symfony/process/zipball/f5481b22729d465acb1cea3455fc04ce84b0148b", + "reference": "f5481b22729d465acb1cea3455fc04ce84b0148b", "shasum": "" }, "require": { @@ -5524,7 +5786,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.20" + "source": "https://github.com/symfony/process/tree/v4.4.22" }, "funding": [ { @@ -5540,7 +5802,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T09:09:26+00:00" + "time": "2021-04-07T16:22:29+00:00" }, { "name": "symfony/profiler-pack", @@ -5670,16 +5932,16 @@ }, { "name": "symfony/property-info", - "version": "v5.2.4", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/property-info.git", - "reference": "7185bbc74e6f49c3f1b5936b4d9e4ca133921189" + "reference": "f5850c8d4d987fd1990e2cbdf29f48c663c433e7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-info/zipball/7185bbc74e6f49c3f1b5936b4d9e4ca133921189", - "reference": "7185bbc74e6f49c3f1b5936b4d9e4ca133921189", + "url": "https://api.github.com/repos/symfony/property-info/zipball/f5850c8d4d987fd1990e2cbdf29f48c663c433e7", + "reference": "f5850c8d4d987fd1990e2cbdf29f48c663c433e7", "shasum": "" }, "require": { @@ -5740,7 +6002,7 @@ "validator" ], "support": { - "source": "https://github.com/symfony/property-info/tree/v5.2.4" + "source": "https://github.com/symfony/property-info/tree/v5.2.7" }, "funding": [ { @@ -5756,20 +6018,20 @@ "type": "tidelift" } ], - "time": "2021-02-17T15:24:54+00:00" + "time": "2021-04-16T17:25:34+00:00" }, { "name": "symfony/routing", - "version": "v5.2.6", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "31fba555f178afd04d54fd26953501b2c3f0c6e6" + "reference": "3f0cab2e95b5e92226f34c2c1aa969d3fc41f48c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/31fba555f178afd04d54fd26953501b2c3f0c6e6", - "reference": "31fba555f178afd04d54fd26953501b2c3f0c6e6", + "url": "https://api.github.com/repos/symfony/routing/zipball/3f0cab2e95b5e92226f34c2c1aa969d3fc41f48c", + "reference": "3f0cab2e95b5e92226f34c2c1aa969d3fc41f48c", "shasum": "" }, "require": { @@ -5792,7 +6054,6 @@ "symfony/yaml": "^4.4|^5.0" }, "suggest": { - "doctrine/annotations": "For using the annotation loader", "symfony/config": "For using the all-in-one router or any loader", "symfony/expression-language": "For using expression matching", "symfony/http-foundation": "For using a Symfony Request object", @@ -5830,7 +6091,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v5.2.6" + "source": "https://github.com/symfony/routing/tree/v5.2.7" }, "funding": [ { @@ -5846,20 +6107,20 @@ "type": "tidelift" } ], - "time": "2021-03-14T13:53:33+00:00" + "time": "2021-04-11T22:55:21+00:00" }, { "name": "symfony/security-bundle", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/security-bundle.git", - "reference": "607dcdb60ef74d63fbeb86549c52075f040ae4cc" + "reference": "e9cf8e6bd48d1dab8dc223ce4d30ff0d9340e1cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-bundle/zipball/607dcdb60ef74d63fbeb86549c52075f040ae4cc", - "reference": "607dcdb60ef74d63fbeb86549c52075f040ae4cc", + "url": "https://api.github.com/repos/symfony/security-bundle/zipball/e9cf8e6bd48d1dab8dc223ce4d30ff0d9340e1cd", + "reference": "e9cf8e6bd48d1dab8dc223ce4d30ff0d9340e1cd", "shasum": "" }, "require": { @@ -5925,7 +6186,7 @@ "description": "Provides a tight integration of the Security component into the Symfony full-stack framework", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-bundle/tree/v4.4.21" + "source": "https://github.com/symfony/security-bundle/tree/v4.4.22" }, "funding": [ { @@ -5941,20 +6202,20 @@ "type": "tidelift" } ], - "time": "2021-03-22T08:54:48+00:00" + "time": "2021-04-12T14:25:43+00:00" }, { "name": "symfony/security-core", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/security-core.git", - "reference": "19a7caa988be4f013669a057861a1d2a3eacbbf3" + "reference": "e06e67aa97b7bba1d381e3fda1ca7706fef86bff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-core/zipball/19a7caa988be4f013669a057861a1d2a3eacbbf3", - "reference": "19a7caa988be4f013669a057861a1d2a3eacbbf3", + "url": "https://api.github.com/repos/symfony/security-core/zipball/e06e67aa97b7bba1d381e3fda1ca7706fef86bff", + "reference": "e06e67aa97b7bba1d381e3fda1ca7706fef86bff", "shasum": "" }, "require": { @@ -6011,7 +6272,7 @@ "description": "Symfony Security Component - Core Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-core/tree/v4.4.21" + "source": "https://github.com/symfony/security-core/tree/v4.4.22" }, "funding": [ { @@ -6027,20 +6288,20 @@ "type": "tidelift" } ], - "time": "2021-03-10T13:26:08+00:00" + "time": "2021-04-30T14:11:22+00:00" }, { "name": "symfony/security-csrf", - "version": "v5.2.4", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/security-csrf.git", - "reference": "e22ef49d5d3773014942f3dfe301b168a4a833dc" + "reference": "0ed3353e3c053711a1d86a74395f25736fc333de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-csrf/zipball/e22ef49d5d3773014942f3dfe301b168a4a833dc", - "reference": "e22ef49d5d3773014942f3dfe301b168a4a833dc", + "url": "https://api.github.com/repos/symfony/security-csrf/zipball/0ed3353e3c053711a1d86a74395f25736fc333de", + "reference": "0ed3353e3c053711a1d86a74395f25736fc333de", "shasum": "" }, "require": { @@ -6082,7 +6343,7 @@ "description": "Symfony Security Component - CSRF Library", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-csrf/tree/v5.2.4" + "source": "https://github.com/symfony/security-csrf/tree/v5.2.7" }, "funding": [ { @@ -6098,7 +6359,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-04-07T16:07:52+00:00" }, { "name": "symfony/security-guard", @@ -6168,16 +6429,16 @@ }, { "name": "symfony/security-http", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/security-http.git", - "reference": "c5546b762376e4d9a806b08bf4495b2633573ff8" + "reference": "2b2e821d414cc5ef6569a006292e0cfe8bd04d3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/security-http/zipball/c5546b762376e4d9a806b08bf4495b2633573ff8", - "reference": "c5546b762376e4d9a806b08bf4495b2633573ff8", + "url": "https://api.github.com/repos/symfony/security-http/zipball/2b2e821d414cc5ef6569a006292e0cfe8bd04d3f", + "reference": "2b2e821d414cc5ef6569a006292e0cfe8bd04d3f", "shasum": "" }, "require": { @@ -6226,7 +6487,7 @@ "description": "Symfony Security Component - HTTP Integration", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/security-http/tree/v4.4.21" + "source": "https://github.com/symfony/security-http/tree/v4.4.22" }, "funding": [ { @@ -6242,25 +6503,25 @@ "type": "tidelift" } ], - "time": "2021-03-12T01:21:32+00:00" + "time": "2021-04-07T15:47:03+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.2.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", - "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", + "reference": "f040a30e04b57fbcc9c6cbcf4dbaa96bd318b9bb", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/container": "^1.0" + "psr/container": "^1.1" }, "suggest": { "symfony/service-implementation": "" @@ -6268,7 +6529,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6305,7 +6566,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/master" + "source": "https://github.com/symfony/service-contracts/tree/v2.4.0" }, "funding": [ { @@ -6321,20 +6582,20 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-04-01T10:43:52+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.2.4", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c" + "reference": "d99310c33e833def36419c284f60e8027d359678" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b12274acfab9d9850c52583d136a24398cdf1a0c", - "reference": "b12274acfab9d9850c52583d136a24398cdf1a0c", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/d99310c33e833def36419c284f60e8027d359678", + "reference": "d99310c33e833def36419c284f60e8027d359678", "shasum": "" }, "require": { @@ -6367,7 +6628,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.2.4" + "source": "https://github.com/symfony/stopwatch/tree/v5.3.0-BETA1" }, "funding": [ { @@ -6383,7 +6644,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:15:41+00:00" + "time": "2021-03-29T15:28:41+00:00" }, { "name": "symfony/string", @@ -6558,16 +6819,16 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.3.0", + "version": "v2.4.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105" + "reference": "95c812666f3e91db75385749fe219c5e494c7f95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e2eaa60b558f26a4b0354e1bbb25636efaaad105", - "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/95c812666f3e91db75385749fe219c5e494c7f95", + "reference": "95c812666f3e91db75385749fe219c5e494c7f95", "shasum": "" }, "require": { @@ -6579,7 +6840,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -6616,7 +6877,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.3.0" + "source": "https://github.com/symfony/translation-contracts/tree/v2.4.0" }, "funding": [ { @@ -6632,20 +6893,20 @@ "type": "tidelift" } ], - "time": "2020-09-28T13:05:58+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/twig-bridge", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/twig-bridge.git", - "reference": "f5d0492a38c5325d9c322d406dbe95bc26fc530d" + "reference": "48b4ae9cf1b42d37710ea5857770c13f0b9d5579" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/f5d0492a38c5325d9c322d406dbe95bc26fc530d", - "reference": "f5d0492a38c5325d9c322d406dbe95bc26fc530d", + "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/48b4ae9cf1b42d37710ea5857770c13f0b9d5579", + "reference": "48b4ae9cf1b42d37710ea5857770c13f0b9d5579", "shasum": "" }, "require": { @@ -6732,7 +6993,7 @@ "description": "Provides integration for Twig with various Symfony components", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/twig-bridge/tree/v4.4.21" + "source": "https://github.com/symfony/twig-bridge/tree/v4.4.22" }, "funding": [ { @@ -6748,7 +7009,7 @@ "type": "tidelift" } ], - "time": "2021-03-16T08:08:39+00:00" + "time": "2021-04-07T15:47:03+00:00" }, { "name": "symfony/twig-bundle", @@ -6839,16 +7100,16 @@ }, { "name": "symfony/validator", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/validator.git", - "reference": "c00da06b82b8591548f52b4d6aad0faa0985843e" + "reference": "65525b93ebc48c2992271f435e1391bbb049367a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/validator/zipball/c00da06b82b8591548f52b4d6aad0faa0985843e", - "reference": "c00da06b82b8591548f52b4d6aad0faa0985843e", + "url": "https://api.github.com/repos/symfony/validator/zipball/65525b93ebc48c2992271f435e1391bbb049367a", + "reference": "65525b93ebc48c2992271f435e1391bbb049367a", "shasum": "" }, "require": { @@ -6924,7 +7185,7 @@ "description": "Provides tools to validate values", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/validator/tree/v4.4.21" + "source": "https://github.com/symfony/validator/tree/v4.4.22" }, "funding": [ { @@ -6940,20 +7201,20 @@ "type": "tidelift" } ], - "time": "2021-03-23T11:25:54+00:00" + "time": "2021-04-14T09:41:13+00:00" }, { "name": "symfony/var-dumper", - "version": "v5.2.6", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "89412a68ea2e675b4e44f260a5666729f77f668e" + "reference": "27cb9f7cfa3853c736425c7233a8f68814b19636" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89412a68ea2e675b4e44f260a5666729f77f668e", - "reference": "89412a68ea2e675b4e44f260a5666729f77f668e", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/27cb9f7cfa3853c736425c7233a8f68814b19636", + "reference": "27cb9f7cfa3853c736425c7233a8f68814b19636", "shasum": "" }, "require": { @@ -7012,7 +7273,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.2.6" + "source": "https://github.com/symfony/var-dumper/tree/v5.2.7" }, "funding": [ { @@ -7028,20 +7289,20 @@ "type": "tidelift" } ], - "time": "2021-03-28T09:42:18+00:00" + "time": "2021-04-19T14:07:32+00:00" }, { "name": "symfony/var-exporter", - "version": "v5.2.4", + "version": "v5.2.7", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307" + "reference": "01184a5ab95eb9500b9b0ef3e525979e003d9c81" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/5aed4875ab514c8cb9b6ff4772baa25fa4c10307", - "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/01184a5ab95eb9500b9b0ef3e525979e003d9c81", + "reference": "01184a5ab95eb9500b9b0ef3e525979e003d9c81", "shasum": "" }, "require": { @@ -7085,7 +7346,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v5.2.4" + "source": "https://github.com/symfony/var-exporter/tree/v5.3.0-BETA1" }, "funding": [ { @@ -7101,7 +7362,7 @@ "type": "tidelift" } ], - "time": "2021-01-27T10:01:46+00:00" + "time": "2021-04-01T10:42:13+00:00" }, { "name": "symfony/web-profiler-bundle", @@ -7188,16 +7449,16 @@ }, { "name": "symfony/yaml", - "version": "v4.4.21", + "version": "v4.4.22", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "3871c720871029f008928244e56cf43497da7e9d" + "reference": "1c2fd24147961525eaefb65b11987cab75adab59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/3871c720871029f008928244e56cf43497da7e9d", - "reference": "3871c720871029f008928244e56cf43497da7e9d", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1c2fd24147961525eaefb65b11987cab75adab59", + "reference": "1c2fd24147961525eaefb65b11987cab75adab59", "shasum": "" }, "require": { @@ -7239,7 +7500,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.21" + "source": "https://github.com/symfony/yaml/tree/v4.4.22" }, "funding": [ { @@ -7255,7 +7516,7 @@ "type": "tidelift" } ], - "time": "2021-03-05T17:58:50+00:00" + "time": "2021-04-23T12:09:37+00:00" }, { "name": "twig/twig", diff --git a/config/bundles.php b/config/bundles.php index fba2661f..79841817 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -14,4 +14,5 @@ return [ Catalyst\APIBundle\CatalystAPIBundle::class => ['all' => true], Catalyst\AuthBundle\CatalystAuthBundle::class => ['all' => true], Catalyst\MenuBundle\CatalystMenuBundle::class => ['all' => true], + Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], ]; diff --git a/config/packages/dev/monolog.yaml b/config/packages/dev/monolog.yaml new file mode 100644 index 00000000..b1998da1 --- /dev/null +++ b/config/packages/dev/monolog.yaml @@ -0,0 +1,19 @@ +monolog: + handlers: + main: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug + channels: ["!event"] + # uncomment to get logging in your browser + # you may have to allow bigger header sizes in your Web server configuration + #firephp: + # type: firephp + # level: info + #chromephp: + # type: chromephp + # level: info + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine", "!console"] diff --git a/config/packages/prod/deprecations.yaml b/config/packages/prod/deprecations.yaml new file mode 100644 index 00000000..60026a1b --- /dev/null +++ b/config/packages/prod/deprecations.yaml @@ -0,0 +1,8 @@ +# As of Symfony 5.1, deprecations are logged in the dedicated "deprecation" channel when it exists +#monolog: +# channels: [deprecation] +# handlers: +# deprecation: +# type: stream +# channels: [deprecation] +# path: php://stderr diff --git a/config/packages/prod/monolog.yaml b/config/packages/prod/monolog.yaml new file mode 100644 index 00000000..2c02ad8e --- /dev/null +++ b/config/packages/prod/monolog.yaml @@ -0,0 +1,17 @@ +monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + buffer_size: 50 # How many messages should be saved? Prevent memory leaks + nested: + type: stream + path: php://stderr + level: debug + formatter: monolog.formatter.json + console: + type: console + process_psr_3_messages: false + channels: ["!event", "!doctrine"] diff --git a/config/packages/test/monolog.yaml b/config/packages/test/monolog.yaml new file mode 100644 index 00000000..fc40641d --- /dev/null +++ b/config/packages/test/monolog.yaml @@ -0,0 +1,12 @@ +monolog: + handlers: + main: + type: fingers_crossed + action_level: error + handler: nested + excluded_http_codes: [404, 405] + channels: ["!event"] + nested: + type: stream + path: "%kernel.logs_dir%/%kernel.environment%.log" + level: debug diff --git a/config/services.yaml b/config/services.yaml index 75c83d1d..29231ef0 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -266,3 +266,21 @@ services: event: 'postPersist' entity: 'App\Entity\CustomerVehicle' + # hub service + App\Service\HubSelector: + arguments: + $em: "@doctrine.orm.entity_manager" + $im: "@App\\Service\\InventoryManager" + $hub_distributor: "@App\\Service\\HubDistributor" + $hub_filter_logger: "@App\\Service\\HubFilterLogger" + + # hub distributor + App\Service\HubDistributor: + arguments: + $redis: "@App\\Service\\RedisClientProvider" + $hub_jo_key: "%env(HUB_JO_KEY)%" + + # hub filter logger + App\Service\HubFilterLogger: + arguments: + $em: "@doctrine.orm.entity_manager" diff --git a/src/Command/ResetHubJoCountCommand.php b/src/Command/ResetHubJoCountCommand.php new file mode 100644 index 00000000..ea2314f3 --- /dev/null +++ b/src/Command/ResetHubJoCountCommand.php @@ -0,0 +1,39 @@ +redis = $redis->getRedisClient(); + + parent::__construct(); + } + + protected function configure() + { + $this->setName('hub:jo:reset') + ->setDescription('Reset hub\'s job order count') + ->setHelp('Reset hub\'s job order count'); + } + + + protected function execute(InputInterface $input, OutputInterface $output) + { + $key = 'hub_jo_count'; + + $this->redis->del($key); + + return 0; + } +} diff --git a/src/Controller/APIController.php b/src/Controller/APIController.php index b03f057e..24aaff76 100644 --- a/src/Controller/APIController.php +++ b/src/Controller/APIController.php @@ -28,6 +28,8 @@ use App\Ramcar\TradeInType; use App\Ramcar\JOEventType; use App\Ramcar\AdvanceOrderSlot; use App\Ramcar\AutoAssignStatus; +use App\Ramcar\HubCriteria; +use App\Ramcar\WillingToWaitContent; use App\Service\InvoiceGeneratorInterface; use App\Service\RisingTideGateway; @@ -37,6 +39,9 @@ use App\Service\RiderTracker; use App\Service\MapTools; use App\Service\InventoryManager; use App\Service\RiderAssignmentHandlerInterface; +use App\Service\HubSelector; +use App\Service\HubDistributor; +use App\Service\HubFilterLogger; use App\Entity\MobileSession; use App\Entity\Customer; @@ -844,7 +849,8 @@ class APIController extends Controller implements LoggedController public function requestJobOrder(Request $req, InvoiceGeneratorInterface $ic, GeofenceTracker $geo, MapTools $map_tools, InventoryManager $im, MQTTClient $mclient, - RiderAssignmentHandlerInterface $rah) + RiderAssignmentHandlerInterface $rah, HubSelector $hub_select, + HubDistributor $hub_dist, HubFilterLogger $hub_filter_logger) { // check required parameters and api key $required_params = [ @@ -917,6 +923,14 @@ class APIController extends Controller implements LoggedController } $jo->setServiceType($stype); + // check if willing to wait is true or not + $will_wait = $req->request->get('willing_to_wait'); + // check for 'false' text + if ($will_wait === false || $will_wait === 0 || $will_wait === '0' || $will_wait == 'false') + $jo->setWillWait(WillingToWaitContent::NOT_WILLING_TO_WAIT); + else + $jo->setWillWait(WillingToWaitContent::WILLING_TO_WAIT); + // validate warranty $warr = $req->request->get('warranty'); if (!WarrantyClass::validate($warr)) @@ -1009,49 +1023,73 @@ class APIController extends Controller implements LoggedController $invoice = $ic->generateInvoice($icrit); $jo->setInvoice($invoice); - // assign hub and rider - if (($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW) || - ($jo->getServicetype() == ServiceType::BATTERY_REPLACEMENT_WARRANTY)) + + // TODO: set this properly, since the other flags + // are on default values + $hub_criteria = new HubCriteria(); + $hub_criteria->setPoint($jo->getCoordinates()) + ->setJoType($jo->getServiceType()); + + // add battery to items + $sku = $batt->getSAPCode(); + if (!empty($sku)) + $hub_criteria->addItem($batt->getSAPCode(), 1); + + // add payment method to criteria + if (!empty($jo->getModeOfPayment())) + $hub_criteria->setPaymentMethod($jo->getModeOfPayment()); + + // check if willing to wait is true or not + if ($jo->getWillWait() == WillingToWaitContent::NOT_WILLING_TO_WAIT) { - // get nearest hub - // $nearest_hub = $this->findNearestHubWithInventory($jo, $batt, $em, $map_tools, $im); - $nearest_hub = $this->findNearestHub($jo, $em, $map_tools); - } - else - { - $nearest_hub = $this->findNearestHub($jo, $em, $map_tools); + $hub_criteria->setEmergency(true); } - if (!empty($nearest_hub)) + // find nearest hubs + $nearest_hubs = $hub_select->find($hub_criteria); + + if (!empty($nearest_hubs)) { + // go through the hub list, find the nearest hub + // with an available rider //error_log('found nearest hub ' . $nearest_hub->getID()); - // assign rider - $available_riders = $nearest_hub->getAvailableRiders(); - if (count($available_riders) > 0) + foreach ($nearest_hubs as $nearest_hub) { - $assigned_rider = null; - if (count($available_riders) > 1) + $available_riders = $nearest_hub['hub']->getAvailableRiders(); + if (count($available_riders) >= 1) { - // TODO: the setting of riders into an array - // will no longer be necessary when the contents - // of randomizeRider changes - $riders = []; - foreach ($available_riders as $rider) + $assigned_rider = null; + if (count($available_riders) == 1) { - $riders[] = $rider; + $assigned_rider = $available_riders[0]; + } + else + { + // TODO: the setting of riders into an array + // will no longer be necessary when the contents + // of randomizeRider changes + $riders = []; + foreach ($available_riders as $rider) + { + $riders[] = $rider; + } + + $assigned_rider = $this->randomizeRider($riders); } - $assigned_rider = $this->randomizeRider($riders); - } - else - $assigned_rider = $available_riders[0]; - - //error_log('found rider ' . $assigned_rider->getID()); - $jo->setHub($nearest_hub); - $jo->setRider($assigned_rider); - $jo->setStatus(JOStatus::ASSIGNED); + $jo->setHub($nearest_hub['hub']); + $jo->setRider($assigned_rider); + $jo->setStatus(JOStatus::ASSIGNED); + $jo->setStatusAutoAssign(AutoAssignStatus::HUB_AND_RIDER_ASSIGNED); - $assigned_rider->setAvailable(false); + $assigned_rider->setAvailable(false); + + // update redis hub_jo_count for hub + $hub_dist->incrementJoCountForHub($nearest_hub['hub']); + + // break out of loop + break; + } } } @@ -2330,7 +2368,8 @@ class APIController extends Controller implements LoggedController public function newRequestJobOrder(Request $req, InvoiceGeneratorInterface $ic, GeofenceTracker $geo, MapTools $map_tools, InventoryManager $im, MQTTClient $mclient, - RiderAssignmentHandlerInterface $rah) + RiderAssignmentHandlerInterface $rah, HubSelector $hub_select, + HubDistributor $hub_dist, HubFilterLogger $hub_filter_logger) { // check required parameters and api key $required_params = [ @@ -2419,6 +2458,14 @@ class APIController extends Controller implements LoggedController } $jo->setServiceType($stype); + // check if willing to wait is true or not + $will_wait = $req->request->get('willing_to_wait'); + // check for 'false' text + if ($will_wait === false || $will_wait === 0 || $will_wait === '0' || $will_wait == 'false') + $jo->setWillWait(WillingToWaitContent::NOT_WILLING_TO_WAIT); + else + $jo->setWillWait(WillingToWaitContent::WILLING_TO_WAIT); + // validate warranty $warr = $req->request->get('warranty'); if (!WarrantyClass::validate($warr)) @@ -2515,50 +2562,72 @@ class APIController extends Controller implements LoggedController // check if hub is null if ($hub == null) { - // find nearest hub - if (($jo->getServiceType() == ServiceType::BATTERY_REPLACEMENT_NEW) || - ($jo->getServicetype() == ServiceType::BATTERY_REPLACEMENT_WARRANTY)) + // TODO: set this properly, since the other flags + // are on default values + $hub_criteria = new HubCriteria(); + $hub_criteria->setPoint($jo->getCoordinates()) + ->setJoType($jo->getServiceType()); + + // add battery to items + $sku = $batt->getSAPCode(); + if (!empty($sku)) + $hub_criteria->addItem($batt->getSAPCode(), 1); + + // add payment method to criteria + if (!empty($jo->getModeOfPayment())) + $hub_criteria->setPaymentMethod($jo->getModeOfPayment()); + + // check if willing to wait is true or not + if ($jo->getWillWait() == WillingToWaitContent::NOT_WILLING_TO_WAIT) { - // get nearest hub - // $nearest_hub = $this->findNearestHubWithInventory($jo, $batt, $em, $map_tools, $im); - $nearest_hub = $this->findNearestHub($jo, $em, $map_tools); - } - else - { - $nearest_hub = $this->findNearestHub($jo, $em, $map_tools); + $hub_criteria->setEmergency(true); } - if (!empty($nearest_hub)) + // find nearest hubs + $nearest_hubs = $hub_select->find($hub_criteria); + + if (!empty($nearest_hubs)) { + // go through the hub list, find the nearest hub + // with an available rider //error_log('found nearest hub ' . $nearest_hub->getID()); - // assign rider - $available_riders = $nearest_hub->getAvailableRiders(); - if (count($available_riders) > 0) + foreach ($nearest_hubs as $nearest_hub) { - $assigned_rider = null; - if (count($available_riders) > 1) + $available_riders = $nearest_hub['hub']->getAvailableRiders(); + if (count($available_riders) >= 1) { - // TODO: the setting of riders into an array - // will no longer be necessary when the contents - // of randomizeRider changes - $riders = []; - foreach ($available_riders as $rider) + $assigned_rider = null; + if (count($available_riders) == 1) { - $riders[] = $rider; + $assigned_rider = $available_riders[0]; + } + else + { + // TODO: the setting of riders into an array + // will no longer be necessary when the contents + // of randomizeRider changes + $riders = []; + foreach ($available_riders as $rider) + { + $riders[] = $rider; + } + + $assigned_rider = $this->randomizeRider($riders); } - $assigned_rider = $this->randomizeRider($riders); + $jo->setHub($nearest_hub['hub']); + $jo->setRider($assigned_rider); + $jo->setStatus(JOStatus::ASSIGNED); + $jo->setStatusAutoAssign(AutoAssignStatus::HUB_AND_RIDER_ASSIGNED); + + $assigned_rider->setAvailable(false); + + // update redis hub_jo_count for hub + $hub_dist->incrementJoCountForHub($nearest_hub['hub']); + + // break out of loop + break; } - else - $assigned_rider = $available_riders[0]; - - //error_log('found rider ' . $assigned_rider->getID()); - $jo->setHub($nearest_hub); - $jo->setRider($assigned_rider); - $jo->setStatus(JOStatus::ASSIGNED); - $jo->setStatusAutoAssign(AutoAssignStatus::HUB_AND_RIDER_ASSIGNED); - - $assigned_rider->setAvailable(false); } } } @@ -2581,7 +2650,10 @@ class APIController extends Controller implements LoggedController $jo->setStatusAutoAssign(AutoAssignStatus::HUB_ASSIGNED); if ($date_schedule != null) - $jo->setDateSchedule($date_schedule); + $jo->setDateSchedule($date_schedule); + + // update redis hub_jo_count for hub + $hub_dist->incrementJoCountForHub($hub); } $em->persist($jo); @@ -2905,7 +2977,11 @@ class APIController extends Controller implements LoggedController } $sku = $warr_serial->getSKU(); - $batt = $em->getRepository(SAPBattery::class)->find($sku); + + // check if sku is null + $batt = null; + if ($sku != null) + $batt = $em->getRepository(SAPBattery::class)->find($sku); // TODO: put this in a config file $image_url = $req->getSchemeAndHttpHost() . '/battery/generic.png'; if ($batt != null) @@ -3009,14 +3085,14 @@ class APIController extends Controller implements LoggedController // $cust = $this->updateCustomerInfo($req, $em); // update warranty - $res = $this->updateWarranty($res, $em, $trans, $req, $serial, $inv_filename, $wcard_filename); + $res = $this->updateWarranty($res, $em, $rt, $trans, $req, $serial, $inv_filename, $wcard_filename); $em->flush(); return $res->getReturnResponse(); } - protected function updateWarranty($res, $em, $trans, $req, $serial, $inv_filename = null, $wcard_filename = null) + protected function updateWarranty($res, $em, $rt, $trans, $req, $serial, $inv_filename = null, $wcard_filename = null) { // get serial $warr_serial = $em->getRepository(WarrantySerial::class)->find($serial); @@ -3048,7 +3124,7 @@ class APIController extends Controller implements LoggedController if (!$is_customer_warranty) { $res->setError(true) - ->setErrorMessage('Warranty registred to a vehicle not in your list of vehicles.'); + ->setErrorMessage('Warranty registered to a vehicle not in your list of vehicles.'); return $res; } @@ -3060,15 +3136,12 @@ class APIController extends Controller implements LoggedController $sms_msg = $trans->trans('warranty_register_confirm'); } + // check if sku is null // get sap battery $sku = $warr_serial->getSKU(); - $sap_bty = $em->getRepository(SAPBattery::class)->find($sku); - if ($sap_bty == null) - { - $res->setError(true) - ->setErrorMessage('Could not find battery entry for warranty.'); - return $res; - } + $sap_bty = null; + if ($sku != null) + $sap_bty = $em->getRepository(SAPBattery::class)->find($sku); // default date purchase to today // NOTE: might need to change this later diff --git a/src/Controller/CAPI/CustomerWarrantyController.php b/src/Controller/CAPI/CustomerWarrantyController.php index 0ebc2c60..52b305c9 100644 --- a/src/Controller/CAPI/CustomerWarrantyController.php +++ b/src/Controller/CAPI/CustomerWarrantyController.php @@ -232,7 +232,11 @@ class CustomerWarrantyController extends APIController } $sku = $warr_serial->getSKU(); - $batt = $em->getRepository(SAPBattery::class)->find($sku); + // check if sku is null + $batt = null; + if ($sku != null) + $batt = $em->getRepository(SAPBattery::class)->find($sku); + // TODO: put this in a config file $image_url = $req->getSchemeAndHttpHost() . '/battery/generic.png'; if ($batt != null) @@ -279,6 +283,8 @@ class CustomerWarrantyController extends APIController { error_log('HERE - register'); // check required parameters + // TODO: maybe add vmake_id? since warranty cannot be created with no vmake + // TODO: maye also add mobile and email since customer creation won't let mobile and email be null $required_params = [ 'first_name', 'last_name', @@ -381,10 +387,16 @@ class CustomerWarrantyController extends APIController error_log('sap battery check'); // get sap battery $sku = $warr_serial->getSKU(); - $sap_bty = $em->getRepository(SAPBattery::class)->find($sku); - if ($sap_bty == null) + $sap_bty = null; + + // check if sku is null + if ($sku != null) { - return new APIResponse(false, 'Could not find battery entry for warranty.'); + $sap_bty = $em->getRepository(SAPBattery::class)->find($sku); + //if ($sap_bty == null) + //{ + // return new APIResponse(false, 'Could not find battery entry for warranty.'); + //} } // vehicle fetch @@ -403,15 +415,19 @@ class CustomerWarrantyController extends APIController // default date purchase to today // NOTE: might need to change this later $date_pur = new DateTime(); + $date_pur_cust = new DateTime(); // get date purchase specified by customer - $date_pur_cust = DateTime::createFromFormat('Y-m-d', $req->request->get('date_purchase')); - if (!$date_pur_cust) + if (!empty($req->request->get('date_purchase'))) { - return new APIResponse(false, 'Invalid date format for date of purchase.'); + $date_pur_cust = DateTime::createFromFormat('Y-m-d', $req->request->get('date_purchase')); + if (!$date_pur_cust) + { + return new APIResponse(false, 'Invalid date format for date of purchase.'); + } } - // chstomer check + // customer check $priv_promo = $req->request->get('priv_promo', false); if ($cust == null) { diff --git a/src/Controller/CAPI/WarrantyController.php b/src/Controller/CAPI/WarrantyController.php index c444370c..31dbec58 100644 --- a/src/Controller/CAPI/WarrantyController.php +++ b/src/Controller/CAPI/WarrantyController.php @@ -199,10 +199,16 @@ class WarrantyController extends APIController if (!$plate) return new APIResponse(false, 'Invalid plate number.'); - // battery - $batt = $em->getRepository(SAPBattery::class)->find($sku); - if ($batt == null) - return new APIResponse(false, 'Invalid battery SKU.'); + // check if sku is blank + if ((empty($sku)) || ($sku == null)) + $batt = null; + else + { + // battery + $batt = $em->getRepository(SAPBattery::class)->find($sku); + if ($batt == null) + return new APIResponse(false, 'Invalid battery SKU.'); + } /* // battery model @@ -382,10 +388,16 @@ class WarrantyController extends APIController if (!$plate) return new APIResponse(false, 'Invalid plate number.'); - // battery - $batt = $em->getRepository(SAPBattery::class)->find($sku); - if ($batt == null) - return new APIResponse(false, 'Invalid battery SKU.'); + // check if sku is blank + if ((empty($sku)) || ($sku == null)) + $batt = null; + else + { + // battery + $batt = $em->getRepository(SAPBattery::class)->find($sku); + if ($batt == null) + return new APIResponse(false, 'Invalid battery SKU.'); + } $warr->setSerial($serial) ->setWarrantyClass($warr_class) @@ -634,6 +646,7 @@ class WarrantyController extends APIController $w_last_name = $warranty->getLastName(); $new_cust = new Customer(); + // TODO: add customer source $new_cust->setFirstName($w_first_name) ->setLastName($w_last_name) ->setPhoneMobile($w_mobile_num); diff --git a/src/Controller/HubController.php b/src/Controller/HubController.php index edc6e599..3becdf97 100644 --- a/src/Controller/HubController.php +++ b/src/Controller/HubController.php @@ -17,8 +17,12 @@ use DateTime; use Catalyst\MenuBundle\Annotation\Menu; -use App\Service\MapTools; use App\Service\RiderTracker; +use App\Service\RisingTideGateway; +use App\Service\HubSelector; + +use App\Ramcar\HubCriteria; +use App\Ramcar\ModeOfPayment; class HubController extends Controller { @@ -128,6 +132,7 @@ class HubController extends Controller $params = []; $params['obj'] = new Hub(); $params['mode'] = 'create'; + $params['payment_methods'] = ModeOfPayment::getCollection(); // response return $this->render('hub/form.html.twig', $params); @@ -154,7 +159,17 @@ class HubController extends Controller ->setBranchCode($req->request->get('branch_code', '')) ->setStatusOpen($req->request->get('status_open', false)) ->setRiderSlots($req->request->get('rider_slots', 0)) - ->setHubViewFlag($req->request->get('flag_hub_view', false)); + ->setHubViewFlag($req->request->get('flag_hub_view', false)) + ->setNotifNumber($req->request->get('notif_number')) + ->clearPaymentMethods(); + + // set payment methods + $payment_methods = $req->request->get('payment_methods'); + + if (!empty($payment_methods)) + { + $obj->setPaymentMethods($payment_methods); + } } protected function setQueryFilters($datatable, QueryBuilder $query) @@ -166,7 +181,7 @@ class HubController extends Controller } } - public function addSubmit(Request $req, EncoderFactoryInterface $ef, ValidatorInterface $validator) + public function addSubmit(Request $req, EncoderFactoryInterface $ef, ValidatorInterface $validator, RisingTideGateway $rt) { $this->denyAccessUnlessGranted('hub.add', null, 'No access.'); @@ -176,14 +191,23 @@ class HubController extends Controller $em = $this->getDoctrine()->getManager(); $obj = new Hub(); + // initialize error list + $error_array = []; + + // validate the notification number + $mobile = $req->request->get('notif_number'); + if (!empty($mobile)) + { + $is_valid = $rt->validatePhoneNumber($mobile); + if (!$is_valid) + $error_array['notif_number'] = 'Invalid notification number'; + } + $this->setObject($obj, $req); // validate $errors = $validator->validate($obj); - // initialize error list - $error_array = []; - // add errors to list foreach ($errors as $error) { $error_array[$error->getPropertyPath()] = $error->getMessage(); @@ -226,12 +250,13 @@ class HubController extends Controller $params = []; $params['obj'] = $obj; $params['mode'] = 'update'; + $params['payment_methods'] = ModeOfPayment::getCollection(); // response return $this->render('hub/form.html.twig', $params); } - public function updateSubmit(Request $req, EncoderFactoryInterface $ef, ValidatorInterface $validator, $id) + public function updateSubmit(Request $req, EncoderFactoryInterface $ef, ValidatorInterface $validator, $id, RisingTideGateway $rt) { $this->denyAccessUnlessGranted('hub.update', null, 'No access.'); @@ -243,14 +268,23 @@ class HubController extends Controller if (empty($obj)) throw $this->createNotFoundException('The item does not exist'); + // initialize error list + $error_array = []; + + // validate the notification number + $mobile = $req->request->get('notif_number'); + if (!empty($mobile)) + { + $is_valid = $rt->validatePhoneNumber($mobile); + if (!$is_valid) + $error_array['notif_number'] = 'Invalid notification number'; + } + $this->setObject($obj, $req); // validate $errors = $validator->validate($obj); - // initialize error list - $error_array = []; - // add errors to list foreach ($errors as $error) { $error_array[$error->getPropertyPath()] = $error->getMessage(); @@ -295,7 +329,7 @@ class HubController extends Controller $response->send(); } - public function nearest(MapTools $map_tools, Request $req) + public function nearest(HubSelector $hub_selector, Request $req) { // get lat / long $lat = $req->query->get('lat'); @@ -303,7 +337,12 @@ class HubController extends Controller // get nearest hubs according to position $point = new Point($long, $lat); - $result = $map_tools->getClosestHubs($point, 10, date("H:i:s")); + + // set up hub criteria + $hub_criteria = new HubCriteria(); + $hub_criteria->setPoint($point); + $hub_selector->find($hub_criteria); + //$result = $map_tools->getClosestHubs($point, 10, date("H:i:s")); $hubs = []; foreach ($result as $hub_res) diff --git a/src/Controller/JobOrderController.php b/src/Controller/JobOrderController.php index 11c7edf0..15f524d6 100644 --- a/src/Controller/JobOrderController.php +++ b/src/Controller/JobOrderController.php @@ -23,6 +23,7 @@ use App\Service\MapTools; use App\Service\MQTTClient; use App\Service\APNSClient; use App\Service\InventoryManager; +use App\Service\HubSelector; use App\Service\RiderTracker; use App\Service\MotivConnector; @@ -315,13 +316,13 @@ class JobOrderController extends Controller /** * @Menu(selected="jo_proc") */ - public function processingForm(MapTools $map_tools, $id, JobOrderHandlerInterface $jo_handler, GISManagerInterface $gis, MotivConnector $motiv) + public function processingForm(HubSelector $hub_selector, $id, JobOrderHandlerInterface $jo_handler, GISManagerInterface $gis, MotivConnector $motiv) { $this->denyAccessUnlessGranted('jo_proc.list', null, 'No access.'); try { - $params = $jo_handler->initializeProcessingForm($id, $map_tools, $motiv); + $params = $jo_handler->initializeProcessingForm($id, $hub_selector, $motiv); } catch (AccessDeniedHttpException $e) { @@ -504,14 +505,14 @@ class JobOrderController extends Controller /** * @Menu(selected="jo_open") */ - public function openHubForm(MapTools $map_tools, $id, JobOrderHandlerInterface $jo_handler, + public function openHubForm(HubSelector $hub_selector, $id, JobOrderHandlerInterface $jo_handler, GISManagerInterface $gis) { $this->denyAccessUnlessGranted('jo_open.list', null, 'No access.'); try { - $params = $jo_handler->initializeHubForm($id, $map_tools); + $params = $jo_handler->initializeHubForm($id, $hub_selector); } catch (NotFoundHttpException $e) { @@ -1204,6 +1205,7 @@ class JobOrderController extends Controller ]); } + // this is uncalled or does not display in admin panel /** * @Menu(selected="jo_autoassign") */ @@ -1223,6 +1225,7 @@ class JobOrderController extends Controller return $this->render($template, $params); } + // this is uncalled or does not display in admin panel public function autoAssignSubmit(Request $req, JobOrderHandlerInterface $jo_handler, EntityManagerInterface $em, MapTools $map_tools, InventoryManager $im) diff --git a/src/Controller/WarrantyController.php b/src/Controller/WarrantyController.php index b1f2442e..2208ecb1 100644 --- a/src/Controller/WarrantyController.php +++ b/src/Controller/WarrantyController.php @@ -181,31 +181,52 @@ class WarrantyController extends Controller } // custom validation for battery model - $model = $em->getRepository(BatteryModel::class) - ->find($req->request->get('battery_model')); + // check if battery model is blank + $bmodel = $req->request->get('battery_model'); + if (!empty($bmodel)) + { + $model = $em->getRepository(BatteryModel::class) + ->find($req->request->get('battery_model')); - if (empty($model)) - $error_array['battery_model'] = 'Invalid model selected.'; + if (empty($model)) + $error_array['battery_model'] = 'Invalid model selected.'; + else + $obj->setBatteryModel($model); + } else - $obj->setBatteryModel($model); + $obj->setBatteryModel(NULL); // custom validation for battery size - $size = $em->getRepository(BatterySize::class) - ->find($req->request->get('battery_size')); + // check if battery size is blank + $bsize = $req->request->get('battery_size'); + if (!empty($bsize)) + { + $size = $em->getRepository(BatterySize::class) + ->find($req->request->get('battery_size')); - if (empty($size)) - $error_array['battery_size'] = 'Invalid size selected.'; + if (empty($size)) + $error_array['battery_size'] = 'Invalid size selected.'; + else + $obj->setBatterySize($size); + } else - $obj->setBatterySize($size); + $obj->setBatterySize(NULL); // custom validation for SAP battery - $sap = $em->getRepository(SAPBattery::class) - ->find($req->request->get('sap_battery')); + // check if sap battery is blank + $sap_battery = $req->request->get('sap_battery'); + if (!empty($sap_battery)) + { + $sap = $em->getRepository(SAPBattery::class) + ->find($req->request->get('sap_battery')); - if (empty($sap)) - $error_array['sap_battery'] = 'Invalid SAP battery selected.'; + if (empty($sap)) + $error_array['sap_battery'] = 'Invalid SAP battery selected.'; + else + $obj->setSAPBattery($sap); + } else - $obj->setSAPBattery($sap); + $obj->setSAPBattery(NULL); // validate $errors = $validator->validate($obj); @@ -303,31 +324,52 @@ class WarrantyController extends Controller } // custom validation for battery model - $model = $em->getRepository(BatteryModel::class) - ->find($req->request->get('battery_model')); + // check if battery model is blank + $bmodel = $req->request->get('battery_model'); + if (!empty($bmodel)) + { + $model = $em->getRepository(BatteryModel::class) + ->find($req->request->get('battery_model')); - if (empty($model)) - $error_array['battery_model'] = 'Invalid model selected.'; + if (empty($model)) + $error_array['battery_model'] = 'Invalid model selected.'; + else + $obj->setBatteryModel($model); + } else - $obj->setBatteryModel($model); + $obj->setBatteryModel(null); // custom validation for battery size - $size = $em->getRepository(BatterySize::class) - ->find($req->request->get('battery_size')); + // check if battery size is blank + $bsize = $req->request->get('battery_size'); + if (!empty($bsize)) + { + $size = $em->getRepository(BatterySize::class) + ->find($req->request->get('battery_size')); - if (empty($size)) - $error_array['battery_size'] = 'Invalid size selected.'; + if (empty($size)) + $error_array['battery_size'] = 'Invalid size selected.'; + else + $obj->setBatterySize($size); + } else - $obj->setBatterySize($size); + $obj->setBatterySize(null); // custom validation for SAP battery - $sap = $em->getRepository(SAPBattery::class) - ->find($req->request->get('sap_battery')); + // check if sap battery is blank + $sap_battery = $req->request->get('sap_battery'); + if (!empty($sap_battery)) + { + $sap = $em->getRepository(SAPBattery::class) + ->find($req->request->get('sap_battery')); - if (empty($sap)) - $error_array['sap_battery'] = 'Invalid SAP battery selected.'; + if (empty($sap)) + $error_array['sap_battery'] = 'Invalid SAP battery selected.'; + else + $obj->setSAPBattery($sap); + } else - $obj->setSAPBattery($sap); + $obj->setSAPBattery(null); // validate $errors = $validator->validate($obj); diff --git a/src/Entity/Hub.php b/src/Entity/Hub.php index 0b1769b2..b40bc395 100644 --- a/src/Entity/Hub.php +++ b/src/Entity/Hub.php @@ -68,6 +68,18 @@ class Hub */ protected $flag_hub_view; + // notification number to send SMS to if hub doesn't have item + /** + * @ORM\Column(type="string", length=30) + */ + protected $notif_number; + + // payment methods + /** + * @ORM\Column(type="array", nullable=true) + */ + protected $payment_methods; + public function __construct() { $this->time_open = new DateTime(); @@ -76,6 +88,8 @@ class Hub $this->outlets = new ArrayCollection(); $this->status_open = true; $this->flag_hub_view = false; + $this->notif_number = ''; + $this->payment_methods = new ArrayCollection(); } public function getRiders() @@ -185,5 +199,38 @@ class Hub return $this->flag_hub_view; } + public function setNotifNumber($notif_number) + { + $this->notif_number = $notif_number; + return $this; + } + + public function getNotifNumber() + { + return $this->notif_number; + } + + public function getPaymentMethods() + { + return $this->payment_methods; + } + + public function setPaymentMethods(array $payment_methods) + { + $this->payment_methods = new ArrayCollection(); + + foreach ($payment_methods as $payment_method) + { + $this->payment_methods->add($payment_method); + } + + return $this; + } + + public function clearPaymentMethods() + { + $this->payment_methods = new ArrayCollection(); + return $this; + } } diff --git a/src/Entity/HubFilterLog.php b/src/Entity/HubFilterLog.php new file mode 100644 index 00000000..00f8394d --- /dev/null +++ b/src/Entity/HubFilterLog.php @@ -0,0 +1,83 @@ +date_create = new DateTime(); + } + + public function getID() + { + return $this->id; + } + + public function getDateCreate() + { + return $this->date_create; + } + + public function setHub(Hub $hub) + { + $this->hub = $hub; + return $this; + } + + public function getHub() + { + return $this->hub; + } + + public function setFilterTypeId($filter_type_id) + { + $this->filter_type_id = $filter_type_id; + return $this; + } + + public function getFilterTypeId() + { + return $this->filter_type_id; + } +} diff --git a/src/Entity/Warranty.php b/src/Entity/Warranty.php index 9af986d3..36c4a781 100644 --- a/src/Entity/Warranty.php +++ b/src/Entity/Warranty.php @@ -73,14 +73,14 @@ class Warranty // battery model /** * @ORM\ManyToOne(targetEntity="BatteryModel", inversedBy="warranties") - * @ORM\JoinColumn(name="bty_model_id", referencedColumnName="id") + * @ORM\JoinColumn(name="bty_model_id", referencedColumnName="id", nullable=true) */ protected $bty_model; // battery size /** * @ORM\ManyToOne(targetEntity="BatterySize", inversedBy="warranties") - * @ORM\JoinColumn(name="bty_size_id", referencedColumnName="id") + * @ORM\JoinColumn(name="bty_size_id", referencedColumnName="id", nullable=true) */ protected $bty_size; @@ -371,7 +371,7 @@ class Warranty return $this->mobile_number; } - public function setBatteryModel(BatteryModel $model) + public function setBatteryModel(BatteryModel $model = null) { $this->bty_model = $model; return $this; @@ -382,7 +382,7 @@ class Warranty return $this->bty_model; } - public function setBatterySize(BatterySize $size) + public function setBatterySize(BatterySize $size = null) { $this->bty_size = $size; return $this; @@ -393,7 +393,7 @@ class Warranty return $this->bty_size; } - public function setSAPBattery(SAPBattery $sap_bty) + public function setSAPBattery(SAPBattery $sap_bty = null) { $this->sap_bty = $sap_bty; return $this; diff --git a/src/Ramcar/HubCriteria.php b/src/Ramcar/HubCriteria.php new file mode 100644 index 00000000..f00c1281 --- /dev/null +++ b/src/Ramcar/HubCriteria.php @@ -0,0 +1,140 @@ +limit_results = 10; + $this->limit_distance = 500; + $this->jo_type = ''; + $this->date_time = null; + $this->flag_inventory_check = false; + $this->items = []; + $this->payment_method = ''; + $flag_emergency = false; + } + + public function setPoint(Point $point) + { + $this->point = $point; + return $this; + } + + public function getPoint() + { + return $this->point; + } + + public function setLimitResults($limit_results) + { + $this->limit_results = $limit_results; + return $this; + } + + public function getLimitResults() + { + return $this->limit_results; + } + + public function setLimitDistance($limit_distance) + { + $this->limit_distance = $limit_distance; + return $this; + } + + public function getLimitDistance() + { + return $this->limit_distance; + } + + public function setInventoryCheck($flag_inventory_check = true) + { + $this->flag_inventory_check = $flag_inventory_check; + return $this; + } + + public function hasInventoryCheck() + { + return $this->flag_inventory_check; + } + + public function setJoType($jo_type) + { + // TODO: validate the jo type + $this->jo_type = $jo_type; + return $this; + } + + public function getJoType() + { + return $this->jo_type; + } + + public function setDateTime(DateTime $date_time) + { + $this->date_time = $date_time; + return $this; + } + + public function getDateTime() + { + return $this->date_time; + } + + public function addItem($sku, $quantity) + { + // at this point, sku is assumed to be a valid item + $this->items[$sku] = $quantity; + return $this; + } + + public function getItems() + { + return $this->items; + } + + public function setItems($items) + { + $this->items = $items; + return $this; + } + + public function setPaymentMethod($payment_method) + { + $this->payment_method = $payment_method; + return $this; + } + + public function getPaymentMethod() + { + return $this->payment_method; + } + + public function setEmergency($flag_emergency = true) + { + $this->flag_emergency = $flag_emergency; + return $this; + } + + public function isEmergency() + { + return $this->flag_emergency; + } +} diff --git a/src/Service/HubDistributor.php b/src/Service/HubDistributor.php new file mode 100644 index 00000000..e401a4a1 --- /dev/null +++ b/src/Service/HubDistributor.php @@ -0,0 +1,109 @@ +redis = $redis->getRedisClient(); + $this->hub_jo_key = $hub_jo_key; + } + + public function incrementJoCountForHub(Hub $hub) + { + $key = $hub->getID(); + + // get current count + $jo_count = $this->redis->hget($this->hub_jo_key, $key); + if ($jo_count == false) + { + // hub not in hash + // add hub to hash + // set to 1 since this is first jo for hub + $this->redis->hset($this->hub_jo_key, $key, 1); + } + else + { + // hub exist in hash + // add to count + $this->redis->hset($this->hub_jo_key, $key, $jo_count + 1); + } + } + + public function decrementJoCountForHub(Hub $hub) + { + $key = $hub->getID(); + + // get current count + $jo_count = $this->redis->hget($this->hub_jo_key, $key); + if ($jo_count) + { + // hub exist in hash + // decrement count + $this->redis->hset($this->hub_jo_key, $key, $jo_count - 1); + } + } + + public function arrangeHubs($hubs) + { + if (count($hubs) == 1) + return $hubs; + + $arranged_hubs = []; + + foreach ($hubs as $hub_data) + { + $hub = $hub_data['hub']; + + // need the id of hub + $key = $hub->getID(); + + // get jo count of hub + $hub_jo_count = $this->redis->hget($this->hub_jo_key, $key); + + // check if hub is in hash. if not, hub has no jobs + // but should still be added to results + if ($hub_jo_count != null) + { + $arranged_hubs[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + 'jo_count' => $hub_jo_count, + ]; + } + else + { + $arranged_hubs[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + 'jo_count' => 0, + ]; + } + } + + usort($arranged_hubs, function($a, $b) { + if ($a['jo_count'] == $b['jo_count']) + return 0; + if ($a['jo_count'] < $b['jo_count']) + return -1; + else + return 1; + }); + + //error_log('arranged hubs ' . json_encode($arranged_hubs)); + + return $arranged_hubs; + } +} diff --git a/src/Service/HubFilterLogger.php b/src/Service/HubFilterLogger.php new file mode 100644 index 00000000..71cc1929 --- /dev/null +++ b/src/Service/HubFilterLogger.php @@ -0,0 +1,29 @@ +em = $em; + } + + public function logFilteredHub(Hub $hub, $filter_type) + { + $hub_filter_log = new HubFilterLog(); + + $hub_filter_log->setHub($hub) + ->setFilterTypeId($filter_type); + + $this->em->persist($hub_filter_log); + $this->em->flush(); + } +} diff --git a/src/Service/HubSelector.php b/src/Service/HubSelector.php new file mode 100644 index 00000000..046fe757 --- /dev/null +++ b/src/Service/HubSelector.php @@ -0,0 +1,479 @@ +em = $em; + $this->im = $im; + $this->hub_distributor = $hub_distributor; + $this->hub_filter_logger = $hub_filter_logger; + $this->trans = $trans; + $this->rt = $rt; + } + + public function find(HubCriteria $criteria) + { + $point = $criteria->getPoint(); + $limit_results = $criteria->getLimitResults(); + $limit_distance = $criteria->getLimitDistance(); + $jo_type = $criteria->getJoType(); + $flag_inventory_check = $criteria->hasInventoryCheck(); + $items = $criteria->getItems(); + $date_time = $criteria->getDateTime(); + $payment_method = $criteria->getPaymentMethod(); + $flag_emergency = $criteria->isEmergency(); + + $results = []; + + // get all the hubs within distance + $filtered_hubs = $this->getClosestHubs($point, $limit_distance); + + //error_log('closest hubs ' . json_encode($filtered_hubs)); + + if (!$flag_emergency) + { + // filter the first hub results for date and opening times + $hubs_date_time = $this->filterHubsByDateAndTime($filtered_hubs, $date_time); + $filtered_hubs = $hubs_date_time; + + // filter jo types + $hubs_jo_type = $this->filterHubsByJoType($filtered_hubs, $jo_type); + $filtered_hubs = $hubs_jo_type; + + // filter hubs by payment methods + $hubs_payment_method = $this->filterHubsByPaymentMethod($filtered_hubs, $payment_method); + $filtered_hubs = $hubs_payment_method; + + // filter hubs by rider availability + $hubs_rider_availability = $this->filterHubsByRiderAvailability($filtered_hubs); + $filtered_hubs = $hubs_rider_availability; + + // inventory filter + $hubs_inventory = $this->filterHubsByInventory($filtered_hubs, $flag_inventory_check, + $jo_type, $items); + $filtered_hubs = $hubs_inventory; + + // round robin filter + $hubs_round_robin = $this->filterHubsByRoundRobin($filtered_hubs); + $filtered_hubs = $hubs_round_robin; + + //error_log(json_encode($filtered_hubs)); + + // max results filter + $hubs_max_result = $this->filterHubsByMaxResults($filtered_hubs, $limit_results); + $filtered_hubs = $hubs_max_result; + } + + $results = $filtered_hubs; + + error_log(json_encode($results)); + + return $results; + } + + protected function filterHubsByRoundRobin($hubs) + { + if (empty($hubs)) + return $hubs; + + $results = []; + // call hub distributor service + $arranged_hubs = $this->hub_distributor->arrangeHubs($hubs); + $results = $arranged_hubs; + + return $results; + + } + + protected function filterHubsByMaxResults($hubs, $limit_result) + { + if (empty($hubs)) + return $hubs; + if (empty($limit_result)) + return $hubs; + + $results = []; + for ($i = 0; $i < count($hubs); $i++) + { + if ($i < $limit_result) + $results[] = $hubs[$i]; + else + $this->hub_filter_logger->logFilteredHub($hubs[$i]['hub'], 'max_results'); + } + + return $results; + } + + protected function filterHubsByJoType($hubs, $jo_type) + { + if (empty($hubs)) + return $hubs; + if (empty($jo_type)) + return $hubs; + + $results = []; + foreach ($hubs as $hub_data) + { + $hub = $hub_data['hub']; + + // TODO: for now, have this return true + $has_jo_type = true; + // check if hub offers the jo_type + // TODO: add service to hub + if ($has_jo_type) + $results[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + ]; + else + $this->hub_filter_logger->logFilteredHub($hub, 'job_order_type'); + } + + return $results; + } + + protected function filterHubsByPaymentMethod($hubs, $payment_method) + { + if (empty($hubs)) + return $hubs; + if (empty($payment_method)) + return $hubs; + + $results = []; + foreach ($hubs as $hub_data) + { + $hub = $hub_data['hub']; + + // name of payment method is what is saved + $payment_methods = $hub->getPaymentMethods(); + if ($payment_methods != null) + { + $flag_found_pmethod = false; + foreach ($payment_methods as $pmethod) + { + if ($pmethod == $payment_method) + { + $results[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + ]; + } + $flag_found_pmethod = true; + } + + if (!$flag_found_pmethod) + $this->hub_filter_logger->logFilteredHub($hub, 'no_payment_method'); + } + else + $this->hub_filter_logger->logFilteredHub($hub, 'no_payment_method'); + } + + return $results; + } + + protected function filterHubsByRiderAvailability($hubs) + { + if (empty($hubs)) + return $hubs; + + $results = []; + foreach ($hubs as $hub_data) + { + $hub = $hub_data['hub']; + + // get hub's riders + $riders = $hub->getRiders(); + $avail_rider_count = 0; + foreach ($riders as $rider) + { + if ($rider->isAvailable()) + $avail_rider_count = $avail_rider_count + 1; + } + + error_log('HUB ' . $hub->getID() . ' RIDER COUNT' . $avail_rider_count); + + if ($avail_rider_count > 0) + $results[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + ]; + else + $this->hub_filter_logger->logFilteredHub($hub, 'no_available_rider'); + } + + return $results; + } + + protected function filterHubsByDateAndTime($hubs, $date_time) + { + if (empty($hubs)) + return $hubs; + + if ($date_time == null) + return $hubs; + + $results = []; + + foreach ($hubs as $hub_data) + { + // go through each hub's opening times to check if hub is open + // for the specified time + // get hub opening and closing times + // TODO: maybe in the future, might also have to check if hub + // is open/available on date/day + $hub = $hub_data['hub']; + + $time_open = $hub->getTimeOpen()->format("H:i:s"); + $time_close = $hub->getTimeClose()->format("H:i:s"); + + $filter_time = $date_time->format("H:i:s"); + + if (($filter_time >= $time_open) && + ($filter_time <= $time_close)) + { + $results[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + ]; + } + else + $this->hub_filter_logger->logFilteredHub($hub, 'date_and_time'); + } + + return $results; + } + + protected function filterHubsByInventory($hubs, $flag_inventory_check, $jo_type, $items) + { + if (empty($hubs)) + return $hubs; + + if (!$flag_inventory_check) + return $hubs; + + $results = []; + if ($flag_inventory_check) + { + foreach ($hubs as $hub_data) + { + $hub = $hub_data['hub']; + + if ($jo_type == ServiceType::BATTERY_REPLACEMENT_NEW) + { + // call inventory + $has_items = $this->checkInventory($items, $hub); + if ($has_items) + $results[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + ]; + else + { + // get the skus for the message + $sku_text = ''; + foreach ($items as $key => $value) + { + $sku_text .= ' ' . $key; + } + // send SMS to hub + $message = str_replace('item_display', trim($sku_text), $this->trans->trans('no_inventory_message')); + error_log($message); + $this->sendSMSMessage($hub, $items); + $this->hub_filter_logger->logFilteredHub($hub, 'no_inventory'); + } + } + if ($jo_type == ServiceType::BATTERY_REPLACEMENT_WARRANTY) + { + // call inventory + $has_items = $this->checkInventory($items, $hub); + if ($has_items) + $results[] = [ + 'hub' => $hub, + 'db_distance' => $hub_data['db_distance'], + 'distance' => $hub_data['distance'], + 'duration' => $hub_data['duration'], + ]; + else + { + // get the skus for the message + $sku_text = ''; + foreach ($items as $key => $value) + { + $sku_text .= ' ' . $key; + } + // send SMS to hub + $message = str_replace('item_display', trim($sku_text), $this->trans->trans('no_inventory_message')); + error_log($message); + $this->sendSMSMessage($hub, $items); + $this->hub_filter_logger->logFilteredHub($hub, 'no_inventory'); + } + } + } + } + + return $results; + } + + protected function sendSMSMessage($hub, $items) + { + // compose message + // get the skus for the message + $sku_text = ''; + foreach ($items as $key => $value) + { + $sku_text .= ' ' . $key; + } + $message = str_replace('item_display', trim($sku_text), $this->trans->trans('no_inventory_message')); + + // get hub notification number + $number = $hub->getNotifNumber(); + + if (!empty($number)) + { + // send SMS message + $mobile_number = '63' . $number; + error_log('sending sms to - ' . $mobile_number); + $this->rt->sendSMS($mobile_number, 'MOTOLITE', $message); + } + } + + protected function getClosestHubs(Point $point, $limit_distance) + { + // get closest hubs based on st_distance function from db + $query_string = 'SELECT h, st_distance(h.coordinates, point(:lng, :lat)) as dist FROM App\Entity\Hub h WHERE h.status_open = true ORDER BY dist'; + + $query = $this->em->createQuery($query_string) + ->setParameter('lat', $point->getLatitude()) + ->setParameter('lng', $point->getLongitude()); + + // error_log($query->getSql()); + $result = $query->getResult(); + + $hubs = []; + $hubs_data = []; + foreach ($result as $row) + { + $hubs[] = $row[0]; + + // get coordinates of hub + $hub_coordinates = $row[0]->getCoordinates(); + + $cust_lat = $point->getLatitude(); + $cust_lng = $point->getLongitude(); + + $hub_lat = $hub_coordinates->getLatitude(); + $hub_lng = $hub_coordinates->getLongitude(); + + // get distance in kilometers from customer point to hub point + $dist = $this->distance($cust_lat, $cust_lng, $hub_lat, $hub_lng); + + if ($dist < $limit_distance) + { + $hubs_data[] = [ + 'hub' => $row[0], + 'db_distance' => $row['dist'], + 'distance' => $dist, + 'duration' => 0, + ]; + } + else + { + $this->hub_filter_logger->logFilteredHub($row[0], 'distance'); + } + } + + return $hubs_data; + } + + protected function checkInventory($items, $hub) + { + // check if hub has all items + $skus = []; + $branch_codes[] = $hub->getBranchCode(); + $result = false; + + foreach ($items as $key=> $value) + { + // add sap code of item/battery into array since + // getBranchesInventory takes in an array of hubs/branches + // and an array of skus + // $items as format: $items[sku] = quantity + $skus[] = $key; + } + + // call InventoryManager's getBranchesInventory to check if hub has all items + $branches_with_items = $this->im->getBranchesInventory($branch_codes, $skus); + + if (!empty($branches_with_items)) + { + // check if branch has enough quantity for item + foreach ($branches_with_items as $branch) + { + // get quantity from call + $qty_available = $branch['Quantity']; + + // get the quantity request + $sku_requested = $branch['SapCode']; + $qty_requested = $items[$sku_requested]; + if ($qty_available >= $qty_requested) + $result = true; + } + } + + // return true or false + return $result; + } + + // convert db distance to kilometers + protected function distance($lat1, $lon1, $lat2, $lon2) + { + if (($lat1 == $lat2) && ($lon1 == $lon2)) + return 0; + + $theta = $lon1 - $lon2; + $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); + $dist = acos($dist); + $dist = rad2deg($dist); + $miles = $dist * 60 * 1.1515; + + return round(($miles * 1.609344), 1); + } +} diff --git a/src/Service/InventoryManager.php b/src/Service/InventoryManager.php index 4dc5a8b1..f0669559 100644 --- a/src/Service/InventoryManager.php +++ b/src/Service/InventoryManager.php @@ -71,6 +71,7 @@ class InventoryManager // check if the response is empty $results = []; + //error_log($response); if (!empty($response)) $results = json_decode($response, true); diff --git a/src/Service/JobOrderHandler/ResqJobOrderHandler.php b/src/Service/JobOrderHandler/ResqJobOrderHandler.php index 10d5b2f8..fd1fb2af 100644 --- a/src/Service/JobOrderHandler/ResqJobOrderHandler.php +++ b/src/Service/JobOrderHandler/ResqJobOrderHandler.php @@ -40,6 +40,7 @@ use App\Ramcar\JORejectionReason; use App\Ramcar\CustomerNotWaitReason; use App\Ramcar\NoTradeInReason; use App\Ramcar\WillingToWaitContent; +use App\Ramcar\HubCriteria; use App\Service\InvoiceGeneratorInterface; use App\Service\JobOrderHandlerInterface; @@ -49,6 +50,8 @@ use App\Service\MQTTClient; use App\Service\APNSClient; use App\Service\MapTools; use App\Service\RisingTideGateway; +use App\Service\HubSelector; +use App\Service\HubDistributor; use CrEOF\Spatial\PHP\Types\Geometry\Point; @@ -70,13 +73,15 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface protected $country_code; protected $wh; protected $rt; + protected $hub_dist; protected $template_hash; public function __construct(Security $security, EntityManagerInterface $em, InvoiceGeneratorInterface $ic, ValidatorInterface $validator, TranslatorInterface $translator, RiderAssignmentHandlerInterface $rah, - string $country_code, WarrantyHandler $wh, RisingTideGateway $rt) + string $country_code, WarrantyHandler $wh, RisingTideGateway $rt, + HubDistributor $hub_dist) { $this->em = $em; $this->ic = $ic; @@ -87,6 +92,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $this->country_code = $country_code; $this->wh = $wh; $this->rt = $rt; + $this->hub_dist = $hub_dist; $this->loadTemplates(); } @@ -755,6 +761,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface 'event' => 'outlet_assign' ]; $mclient->sendEvent($obj, $payload); + + // update redis hub jo count + $this->hub_dist->incrementJoCountForHub($hub); } return $error_array; @@ -1124,6 +1133,9 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $more_reason = $req->request->get('not_wait_notes'); } + // get previously assigned hub, if any + $old_hub = $obj->getHub(); + if (empty($error_array)) { // rider mqtt event @@ -1197,6 +1209,13 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface 'event' => 'outlet_assign' ]; $mclient->sendEvent($obj, $payload); + + // update redis hub_jo_count for hub + // decrement old hub's count and increment new hub's count + if ($old_hub != null) + $this->hub_dist->decrementJoCountForHub($old_hub); + if ($hub != null) + $this->hub_dist->incrementJoCountForHub($hub); } return $error_array; @@ -1632,6 +1651,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface return $params; } + // CMB code public function initializeOneStepEditForm($id, $map_tools) { $em = $this->em; @@ -1812,7 +1832,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface } // initialize dispatch/processing job order form - public function initializeProcessingForm($id, $map_tools, $motiv) + public function initializeProcessingForm($id, HubSelector $hub_selector, $motiv) { $em = $this->em; @@ -1878,8 +1898,44 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface // get rejection reasons $params['rejection_reasons'] = JORejectionReason::getCollection(); + // get battery (if any) + $skus = []; + $items = []; + $invoice = $obj->getInvoice(); + $inv_items = $invoice->getItems(); + foreach ($inv_items as $inv_item) + { + $batt = $inv_item->getBattery(); + if ($batt == null) + continue; + + $skus[] = $batt->getSapCode(); + $item_count = 1; + if (!empty($batt->getSapCode())) + { + $sap_code = $batt->getSapCode(); + if (isset($items[$sap_code])) + $items[$sap_code] = $item_count + 1; + else + $items[$sap_code] = $item_count; + } + } + // get closest hubs - $hubs = $map_tools->getClosestHubs($obj->getCoordinates(), 50, date("H:i:s")); + // set hub criteria + $hub_criteria = new HubCriteria(); + $hub_criteria->setPoint($obj->getCoordinates()) + ->setLimitResults(50) + ->setPaymentMethod($obj->getModeOfPayment()) + ->setJoType($obj->getServiceType()); + + // check if emergency or not + $willing_to_wait = $obj->getWillWait(); + if ($willing_to_wait == WillingToWaitContent::NOT_WILLING_TO_WAIT) + $hub_criteria->setEmergency(true); + + $hubs = $hub_selector->find($hub_criteria); + //$hubs = $map_tools->getClosestHubs($obj->getCoordinates(), 50, date("H:i:s")); $params['hubs'] = []; @@ -1946,19 +2002,6 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface // get template to display $params['template'] = $this->getTwigTemplate('jo_processing_form'); - // get battery (if any) - $skus = []; - $invoice = $obj->getInvoice(); - $inv_items = $invoice->getItems(); - foreach ($inv_items as $inv_item) - { - $batt = $inv_item->getBattery(); - if ($batt == null) - continue; - - $skus[] = $batt->getSapCode(); - } - // get inventory $mres = $motiv->getInventory($branch_codes, $skus); foreach ($mres as $mres_item) @@ -2103,7 +2146,7 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface } // initialize hub form - public function initializeHubForm($id, $map_tools) + public function initializeHubForm($id, HubSelector $hub_selector) { $em = $this->em; @@ -2128,7 +2171,11 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface $params['rejection_reasons'] = JORejectionReason::getCollection(); // get closest hubs - $hubs = $map_tools->getClosestHubs($obj->getCoordinates(), 50, date("H:i:s")); + $hub_criteria = new HubCriteria(); + $hub_criteria->setPoint($obj->getCoordinates()) + ->setLimitResults(50); + $hubs = $hub_selector->find($hub_criteria); + //$hubs = $map_tools->getClosestHubs($obj->getCoordinates(), 50, date("H:i:s")); $params['status_cancelled'] = JOStatus::CANCELLED; $params['hubs'] = []; diff --git a/src/Service/JobOrderHandlerInterface.php b/src/Service/JobOrderHandlerInterface.php index 59aea943..cff06242 100644 --- a/src/Service/JobOrderHandlerInterface.php +++ b/src/Service/JobOrderHandlerInterface.php @@ -7,6 +7,7 @@ use Symfony\Component\HttpFoundation\Request; use App\Service\MQTTClient; use App\Service\APNSClient; use App\Service\MapTools; +use App\Service\HubSelector; use App\Entity\JobOrder; @@ -67,7 +68,7 @@ interface JobOrderHandlerInterface public function initializeAllForm(int $id); // initialize dispatch/processing job order form - public function initializeProcessingForm(int $id, MapTools $map_tools, $motiv); + public function initializeProcessingForm(int $id, HubSelector $hub_selector, $motiv); // initialize assign job order form public function initializeAssignForm(int $id); @@ -76,7 +77,7 @@ interface JobOrderHandlerInterface public function initializeFulfillmentForm(int $id); // initialize hub form - public function initializeHubForm(int $id, MapTools $map_tools); + public function initializeHubForm(int $id, HubSelector $hub_selector); // initialize rider form public function initializeRiderForm(int $id); diff --git a/src/Service/RisingTideGateway.php b/src/Service/RisingTideGateway.php index 38276619..acd7d4d5 100644 --- a/src/Service/RisingTideGateway.php +++ b/src/Service/RisingTideGateway.php @@ -83,4 +83,28 @@ class RisingTideGateway error_log($result); } + + public function validatePhoneNumber($mobile) + { + // check valid number + $num = trim($mobile); + + // should be 10 digits + if (strlen($num) != 10) + return false; + + // should start with '9' + if ($num[0] != '9') + return false; + + // should be numeric + if (!is_numeric($num)) + return false; + + // should not be 9900000000 + if ($num == '9900000000') + return false; + + return true; + } } diff --git a/symfony.lock b/symfony.lock index f04e7137..51cef542 100644 --- a/symfony.lock +++ b/symfony.lock @@ -44,9 +44,6 @@ "doctrine/dbal": { "version": "v2.6.3" }, - "doctrine/deprecations": { - "version": "v0.5.3" - }, "doctrine/doctrine-bundle": { "version": "1.6", "recipe": { @@ -101,15 +98,9 @@ "doctrine/reflection": { "version": "v1.0.0" }, - "doctrine/sql-formatter": { - "version": "1.1.1" - }, "edwinhoksberg/php-fcm": { "version": "1.0.0" }, - "friendsofphp/proxy-manager-lts": { - "version": "v1.0.3" - }, "guzzlehttp/guzzle": { "version": "6.3.0" }, @@ -122,21 +113,15 @@ "jdorn/sql-formatter": { "version": "v1.2.17" }, - "laminas/laminas-code": { - "version": "3.4.1" - }, - "laminas/laminas-eventmanager": { - "version": "3.2.1" - }, - "laminas/laminas-zendframework-bridge": { - "version": "1.1.1" - }, "microsoft/azure-storage-blob": { "version": "1.5.2" }, "microsoft/azure-storage-common": { "version": "1.5.1" }, + "monolog/monolog": { + "version": "2.2.0" + }, "nikic/php-parser": { "version": "v4.1.0" }, @@ -207,7 +192,7 @@ "version": "v4.0.2" }, "symfony/deprecation-contracts": { - "version": "v2.2.0" + "version": "v2.4.0" }, "symfony/doctrine-bridge": { "version": "v4.0.2" @@ -248,9 +233,6 @@ "ref": "18f6fdceb63737d991efbb37ae9619a6f6c978c8" } }, - "symfony/http-client-contracts": { - "version": "v2.3.1" - }, "symfony/http-foundation": { "version": "v4.0.2" }, @@ -272,21 +254,33 @@ "symfony/mime": { "version": "v4.3.0" }, + "symfony/monolog-bridge": { + "version": "v5.2.5" + }, + "symfony/monolog-bundle": { + "version": "3.7", + "recipe": { + "repo": "github.com/symfony/recipes", + "branch": "master", + "version": "3.7", + "ref": "329f6a5ef2e7aa033f802be833ef8d1268dd0848" + }, + "files": [ + "config/packages/dev/monolog.yaml", + "config/packages/prod/deprecations.yaml", + "config/packages/prod/monolog.yaml", + "config/packages/test/monolog.yaml" + ] + }, "symfony/orm-pack": { "version": "v1.0.5" }, "symfony/polyfill-ctype": { "version": "v1.9.0" }, - "symfony/polyfill-intl-grapheme": { - "version": "v1.22.1" - }, "symfony/polyfill-intl-idn": { "version": "v1.11.0" }, - "symfony/polyfill-intl-normalizer": { - "version": "v1.22.1" - }, "symfony/polyfill-mbstring": { "version": "v1.6.0" }, @@ -296,9 +290,6 @@ "symfony/polyfill-php73": { "version": "v1.11.0" }, - "symfony/polyfill-php80": { - "version": "v1.22.1" - }, "symfony/process": { "version": "v4.4.9" }, @@ -308,9 +299,6 @@ "symfony/property-access": { "version": "v4.0.2" }, - "symfony/property-info": { - "version": "v5.2.4" - }, "symfony/routing": { "version": "4.0", "recipe": { @@ -347,9 +335,6 @@ "symfony/stopwatch": { "version": "v4.0.2" }, - "symfony/string": { - "version": "v5.2.6" - }, "symfony/thanks": { "version": "v1.1.0" }, diff --git a/templates/hub/form.html.twig b/templates/hub/form.html.twig index d7101260..3c8947c1 100644 --- a/templates/hub/form.html.twig +++ b/templates/hub/form.html.twig @@ -90,6 +90,18 @@
+
+ +
+ {% trans %}country_code_prefix{% endtrans %} + + +
+
+ +
+
+
+ +
+ {% for key, value in payment_methods %} + + {% endfor %} +
+ + Check all payment methods that apply +
+
+ {% for model in batt_models %} {% endfor %} diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml index 70fe10ca..48265ab4 100644 --- a/translations/messages.en.yaml +++ b/translations/messages.en.yaml @@ -13,6 +13,7 @@ add_cust_vehicle_battery_info: This vehicle is using a Motolite battery jo_title_pdf: Motolite Res-Q Job Order country_code_prefix: '+63' delivery_instructions_label: Delivery Instructions +no_inventory_message: No stock for [item_display] # images image_logo_login: /assets/images/logo-resq.png diff --git a/utils/bulk_get_warranty_serial/download_warranty_serial_bulk.php b/utils/bulk_get_warranty_serial/download_warranty_serial_bulk.php new file mode 100644 index 00000000..a720af21 --- /dev/null +++ b/utils/bulk_get_warranty_serial/download_warranty_serial_bulk.php @@ -0,0 +1,57 @@ +format('m-d-y'); + +$flag_done_processing = false; +$proc_date = $start_date; + +while (!$flag_done_processing) { + $filename = 'warrantylogs' . $proc_date . '.csv'; + echo $filename, PHP_EOL; + + try { + // NOTE: via download blob + $res = $blob_client->getBlob('warranty', $filename); + // print_r($res); + + file_put_contents("/tmp/output.txt", $res->getContentStream(), FILE_APPEND); + } catch (Exception $e) + { + echo 'Caught exception: ', $e->getMessage(), "\n"; + } + + // change proc_date to next day + $next_date = DateTime::createFromFormat('m-d-y', $proc_date); + $next_date->modify('+1 day'); + $proc_date = $next_date->format('m-d-y'); + + if ($end_date == $proc_date) { + $flag_done_processing = true; + } +} + diff --git a/utils/get_warranty_serial/get_serials.php b/utils/get_warranty_serial/get_serials.php index 367df263..dc92b565 100644 --- a/utils/get_warranty_serial/get_serials.php +++ b/utils/get_warranty_serial/get_serials.php @@ -23,16 +23,21 @@ $blob_client = BlobRestProxy::createBlobService($conn_string); $current_date = new DateTime(); $current_date->modify("-1 day"); -$date = $current_date->format('m-d-Y'); +$date = $current_date->format('m-d-y'); $filename = 'warrantylogs' . $date . '.csv'; //print_r($filename); -// NOTE: via download blob -$res = $blob_client->getBlob('warranty', $filename); -// print_r($res); +try { + // NOTE: via download blob + $res = $blob_client->getBlob('warranty', $filename); + // print_r($res); + + file_put_contents("/tmp/output.txt", $res->getContentStream()); +} catch (Exception $e) { + file_put_contents("/tmp/serial_download_error.txt", $filename . "\n" . $e->getMessage() . "\n" . "\n", FILE_APPEND); +} -file_put_contents("/tmp/output.txt", $res->getContentStream()); /* // NOTE: getting via url