Merge branch 'master' of gitlab.com:jankstudio/resq into 555-log-warranty-data-sent-via-api
This commit is contained in:
commit
42c2b52690
9 changed files with 1524 additions and 2879 deletions
|
|
@ -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",
|
||||
|
|
|
|||
4263
composer.lock
generated
4263
composer.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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],
|
||||
];
|
||||
|
|
|
|||
19
config/packages/dev/monolog.yaml
Normal file
19
config/packages/dev/monolog.yaml
Normal file
|
|
@ -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"]
|
||||
8
config/packages/prod/deprecations.yaml
Normal file
8
config/packages/prod/deprecations.yaml
Normal file
|
|
@ -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
|
||||
17
config/packages/prod/monolog.yaml
Normal file
17
config/packages/prod/monolog.yaml
Normal file
|
|
@ -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"]
|
||||
12
config/packages/test/monolog.yaml
Normal file
12
config/packages/test/monolog.yaml
Normal file
|
|
@ -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
|
||||
|
|
@ -2977,11 +2977,7 @@ class APIController extends Controller implements LoggedController
|
|||
}
|
||||
|
||||
$sku = $warr_serial->getSKU();
|
||||
|
||||
// check if sku is null
|
||||
$batt = null;
|
||||
if ($sku != null)
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
$batt = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
// TODO: put this in a config file
|
||||
$image_url = $req->getSchemeAndHttpHost() . '/battery/generic.png';
|
||||
if ($batt != null)
|
||||
|
|
@ -3085,14 +3081,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, $rt);
|
||||
$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, $rt)
|
||||
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);
|
||||
|
|
@ -3124,7 +3120,7 @@ class APIController extends Controller implements LoggedController
|
|||
if (!$is_customer_warranty)
|
||||
{
|
||||
$res->setError(true)
|
||||
->setErrorMessage('Warranty registered to a vehicle not in your list of vehicles.');
|
||||
->setErrorMessage('Warranty registred to a vehicle not in your list of vehicles.');
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
@ -3136,12 +3132,15 @@ 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 = null;
|
||||
if ($sku != null)
|
||||
$sap_bty = $em->getRepository(SAPBattery::class)->find($sku);
|
||||
$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;
|
||||
}
|
||||
|
||||
// default date purchase to today
|
||||
// NOTE: might need to change this later
|
||||
|
|
|
|||
59
symfony.lock
59
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"
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue