dataworksbi / open-loyalty-framework
Requires
- php: >=7.1
- ext-json: *
- ext-simplexml: *
- a2lix/translation-form-bundle: ^3.0
- beberlei/doctrineextensions: ^1.0
- broadway/broadway: ^2.0.1
- broadway/broadway-bundle: ^0.4.1
- broadway/event-store-dbal: ^0.2.0
- broadway/read-model-elasticsearch: ^0.3.0
- broadway/snapshotting: ^0.2.0
- broadway/uuid-generator: ^0.4.0
- doctrine/doctrine-bundle: ^1.6
- doctrine/doctrine-cache-bundle: ^1.2
- doctrine/doctrine-fixtures-bundle: ^2.3
- doctrine/doctrine-migrations-bundle: ^1.3
- doctrine/orm: ^2.5
- elasticsearch/elasticsearch: ^5.0
- erusev/parsedown: ^1.7
- friendsofsymfony/rest-bundle: ^2.0
- fzaninotto/faker: ^1.6
- gesdinet/jwt-refresh-token-bundle: ^0.1.7
- gumlet/php-image-resize: ^1.9
- guzzlehttp/guzzle: ~6.0
- incenteev/composer-parameter-handler: ^2.0
- jms-serializer/serializer-bundle: ^1.1
- knplabs/doctrine-behaviors: ~1.1
- knplabs/knp-gaufrette-bundle: ^0.3.0
- lexik/jwt-authentication-bundle: ^1.6
- misd/phone-number-bundle: ^1.3
- nelmio/api-doc-bundle: ^2.13
- nelmio/cors-bundle: ^1.4
- ocramius/proxy-manager: ^1.0
- phpdocumentor/reflection-docblock: ^3.2
- phpdocumentor/type-resolver: ^0.3
- pixers/salesmanago-api: 1.1.1
- prewk/xml-string-streamer: ^0.11.0
- ramsey/uuid-doctrine: 1.4.3
- sensio/distribution-bundle: ^5.0
- sensio/framework-extra-bundle: ^3.0.2
- sensio/generator-bundle: ^3.0
- smsapi/php-client: ^1.8
- symfony/monolog-bundle: ^2.8
- symfony/polyfill-apcu: ^1.0
- symfony/swiftmailer-bundle: ^2.3
- symfony/symfony: 3.4.14
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.10
- phpstan/phpstan: ^0.10.5
- phpstan/phpstan-doctrine: ^0.10.0
- phpstan/phpstan-phpunit: ^0.10.0
- phpstan/phpstan-symfony: ^0.10.2
- phpstan/phpstan-webmozart-assert: ^0.10.0
- phpunit/phpunit: ^7.0
- symfony/phpunit-bridge: ^3.0
This package is not auto-updated.
Last update: 2024-11-08 20:52:57 UTC
README
jwt token structure
{
exp: 1470299383,
username: "admin",
roles: [
"ROLE_ADMIN"
],
iat: "1470212983"
}
obtaining jwt token
admin url: /api/admin/login_check customer url: /api/customer/login_check seller url: /api/seller/login_check
method: POST
body:
- _username: admin
- _password: open
response:
{
"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyJ9.eyJleHA",
"refresh_token":"44588da231e2f480bd4"
}
refreshing jwt token
url: /api/token/refresh
method: POST
body:
- refresh_token: 'token'
response:
{
"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXUyJ9.eyJleHA",
"refresh_token":"44588da231e2f480bd4"
}
events
system events
Proper listener should be created to handle system events. Example definition of such listener:
oloy.listener:
class: 'OpenLoyalty\Listener.php'
tags:
- { name: broadway.event_listener, event: oloy.customer.registered, method: handle }
'oloy.customer.registered' - customer added to PL
Event class: OpenLoyalty\Domain\Customer\SystemEvent\CustomerRegisteredSystemEvent
'oloy.customer.updated'
Event class: OpenLoyalty\Domain\Customer\SystemEvent\CustomerUpdatedSystemEvent
'oloy.customer.agreements_updated'
Event class: OpenLoyalty\Domain\Customer\SystemEvent\CustomerAgreementsUpdatedSystemEvent
'oloy.customer.deactivated'
Event class: OpenLoyalty\Domain\Customer\SystemEvent\CustomerDeactivatedSystemEvent
'oloy.segment.customer_added_to_segment'
Event class: OpenLoyalty\Domain\Segment\SystemEvent\CustomerAddedToSegmentSystemEvent
'oloy.segment.customer_removed_from_segment'
Event class: OpenLoyalty\Domain\Segment\SystemEvent\CustomerRemovedFromSegmentSystemEvent
domain events
Proper listener should be created to handle domain events. This listener must implement Broadway\EventHandling\EventListenerInterface
Example definition of such listener:
oloy.listener:
class: 'OpenLoyalty\Listener.php'
lazy: true
tags:
- { name: broadway.domain.event_listener }