Yii2 Def Code Module
composer require ignatenkovnikita/yii2-def-code:dev-master
Add to backend config
'defcode' => [
'class' => 'ignatenkovnikita\defcode\Module',
'controllerNamespace' => \ignatenkovnikita\defcode\Module::backendControllerNamespace(),
'viewPath' => '@vendor/ignatenkovnikita/yii2-def-code/backend/views',
],
Add to console config
'bootstrap' => ['def-code']
'modules' => [
...
'def-code' => [
'class' => \ignatenkovnikita\defcode\Module::class,
'listUrl' => [
DefCode::TYPE_ABC9 => 'https://rossvyaz.ru/data/DEF-9xx.csv',
],
'smscLogin' => 'SMSC_LOGIN',
'smscPassword' => 'SMSC_PASSWORD',
],
...
],
Apply Migration
./console/yii migrate/create --migrationPath=vendor/ignatenkovnikita/yii2-def-code/migrations/
Workflow load and import data:
- Download files, command
./console/yii def-code/download-all
- After import files, command
./console/yii def-code/import
- Delete old files
./console/yii def-code/delete-old-files
Mnp download full and import
./console/yii mnp/download
./console/yii mnp/import
Mnp download detail, date yesterday, advise run in hour night
./console/yii mnp/download-detail
./console/yii mnp/import-detail
TODO
- add test
- refactoring