dprmc / clear-structure-sentry-data-service
A library that allows you to import standard import files into the Sentry system.
Installs: 2 730
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 2
Requires
- ext-simplexml: *
- ext-soap: *
- dprmc/excel: ^2.0
- nesbot/carbon: ^2.35|^3.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^9.2|^10.0|^11.0
- dev-master
- v2.0.17
- v2.0.16
- v2.0.15
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0
- v0.18
- v0.17
- v0.16
- v0.15
- v0.14
- v0.13
- v0.12
- v0.1
- dev-dependabot/composer/guzzlehttp/guzzle-7.7.0
- dev-dependabot/composer/guzzlehttp/psr7-2.5.0
This package is auto-updated.
Last update: 2024-11-18 20:04:59 UTC
README
ImportExcel
Used to import Standard Import Files as defined by ClearStructure.
Check Sentry's documentation for the proper format if a Standard Import File.
// This will attempt to import the contents of 'standard_import_file.xlsx' into the UAT site. // Change the 2nd parameter of the run() method to true to import to your production site. use DPRMC\ClearStructure\Sentry\DataService\Services\ImportExcel; $uatUrl = 'http://your-uat-url'; $prodUrl = 'http://your-prod-url'; $user = 'yourSentryUserName'; $pass = 'yourEncryptedSentryPassword'; $pathToImportFile = 'standard_import_file.xlsx'; $postToUAT = true; $importExcelResponse = ImportExcel::init( $uatUrl, $prodUrl, $user, $pass, $postToUAT ) ->setData($pathToImportFile) ->run(); // Contents of $importExcelResponse->response() if everything goes well: Array ( [time] => Carbon\Carbon Object ( [date] => 2018-08-03 16:12:23.000000 [timezone_type] => 3 [timezone] => UTC ) [name] => Security_Attribute_Update [num] => 2 [runtime] => 296.8872 [errors] => Array ( ) [warnings] => Array ( ) ) // Call path() to get the local filepath of the xlsx that was uploaded to Sentry. $importExcelResponse->path();
Deleting Data
$data = []; $data[] = [ 'scheme_identifier' => 42, 'scheme_name' => 'SentryId', 'market_data_authority_name' => 'DB', 'action' => 'DELETE', 'as_of_date' => '1/1/2018', ]; $data[] = [ 'scheme_identifier' => 'ABCDEFGH1', 'scheme_name' => 'CUSIP', 'market_data_authority_name' => 'DB', 'action' => 'DELETE', 'as_of_date' => '1/1/2018', ]; $deleteExcelResponse = DeleteExcelSecurityPricing::init( $uatUrl, $prodUrl, $user, $pass, $postToUAT ) ->setData($data) ->delete();
Testing
Want to run the PHPUnit tests?
foo@bar:~$ php ./phpunit-5.7.27.phar