ignatenkovnikita/yii2-def-code

Yii2 Def Code Module

v1.1 2018-04-03 15:31 UTC

This package is auto-updated.

Last update: 2024-11-24 06:10:05 UTC


README

Yii2 Def Code Module

Install

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