solodkiy / alfabank-ru-csv-analyzer
0.1.6
2021-09-07 17:08 UTC
Requires
- php: ^7.1
- ext-iconv: *
- ext-json: *
- brick/date-time: ^0.1.3
- brick/money: ^0.2.4
- myclabs/php-enum: ^1.6
- psr/log: ^1
- solodkiy/freeze: ~0.1.0
- solodkiy/uuid: ~0.1.0
- webmozart/assert: ~1.1
Requires (Dev)
- phpunit/phpunit: ^7
- squizlabs/php_codesniffer: ^3.3
- symfony/var-dumper: ^3.3
README
TransactionsComparator Поволяет анализировать csv скаченные с click.alfabank.ru, а также сравнивать их между собой
$loader = new CsvLoader(); $currentCollection = YourStorage::loadCurrentTransactionsFromDb(); $newCollection = $loader->loadFromFile(__DIR__ .'/../tests/data/movementList_2018-03-07_19:45:18.csv'); $differ = new TransactionsComparator(); $diff = $differ->diff($currentCollection, $newCollection); YourStorage::insertTransactionsToDb($diff->getNewCommitted()); YourStorage::insertTransactionsToDb($diff->getNewHold()); YourStorage::updateTransactionsInDb($diff->getUpdated()); YourStorage::deleteTransactionsFromDb($diff->getDeletedIds());