Skip to content

Commit

Permalink
Updated vendors for 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cezary Olejarczyk committed Oct 24, 2018
1 parent 52aaff2 commit 25f7e7c
Show file tree
Hide file tree
Showing 68 changed files with 2,534 additions and 738 deletions.
32 changes: 22 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.0.0] - 15-010-2018

### Notice
Next version will be 3.0 with a few big features
- multi language
- dropping support for client cockpit
- a new PWA Client Cockpit available in Enterprise version
- API versioning
- improved performance in Enterprise version
- changed API endpoints

The 3.0 version **will not be backward compatible** with version 2.10.0
### Added
- multi photos for reward campaigns (new feature)
- segments, levels and POS limits now available in the Geolocation Earning Rule (new feature)
- Custom Reward Campaign that allows to link with Custom Earning Rule or QRCode Earning rule and reward customer with points (new feature)
- QRCode Earning Rule (new feature)
- new currency HDK to the settings
- multi language for Levels, Reward Campaigns, Reward Campaigns Category (new feature)
- new API endpoint /api/settings/css allowing to get custom CSS rules for Client Cockpit
### Changed
- importing transaction with POS information is now simplified, you can define posIdentifier or posId
- size of textareas has been decreased
### Fixed
- data in Elastic Search was not always up to date
- unable to add a points transfer when customer databases was large
- a phone number was not copied from customer to transaction while matching transaction with customer
- customer could register twice with the same phone number when activation method is SMS
- a negative radius value in Geolocation Earning Rule caused 500 error
- while creating Reward Campaign there was only first 10 reward categories to choose, now unlimited
- buying a campaign when a customer has no phone number caused 500 error
- fixed typos
- missing translations

## [2.10.0] - 24-09-2018

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Then, please execute following commands:
vagrant up
vagrant ssh
docker-compose -f docker/docker-compose.yml up -d
docker-compose -f docker/docker-compose.yml exec php phing setup
docker-compose -f docker/docker-compose.yml --user=www-data exec php phing setup
```

That's all. Now you can go to admin panel [openloyalty.localhost:8182](http://openloyalty.localhost:8182).
Expand Down Expand Up @@ -87,7 +87,7 @@ docker-compose -f docker/docker-compose.dev.yml up
Remember about setup database using bellow command:

```
docker-compose -f docker/docker-compose.dev.yml exec php phing setup
docker-compose -f docker/docker-compose.dev.yml --user=www-data exec php phing setup
```

After starting Open Loyalty in developer mode it's exposes services under slightly different URLs:
Expand Down
71 changes: 71 additions & 0 deletions UPGRADE-3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
UPGRADE FROM 2.10 to 3.0
=======================

Before you upgrade
------------------

Before you start upgrading, always backup your data in case something goes wrong.

1. Backup your data from PostgreSQL database

`docker exec -t open_loyalty_db pg_dumpall -U openloyalty > dump.sql`

2. If you have a lot of data in Elasticsearch, it's a good idea to create a snapshot to speed up process of recovering data.

https://www.elastic.co/guide/en/elasticsearch/reference/2.2/modules-snapshots.html

If somehow you can't do a snapshot, you can always rebuild data in Elasticsearch using commands

`docker exec -it open_loyalty_backend bash`

`su www-data`

`bin/console oloy:user:projections:purge`

`bin/console oloy:utility:read-models:recreate`

Note that recreating a lot of data may take a while and is not as fast as using snapshots.

Upgrading to 3.0.0
------------------

1. Upgrade Open Loyalty version

The first step depends on how you use Open Loyalty version.

2. Login to the PHP container

`docker exec -it open_loyalty_backend bash`

`su www-data`

3. Remove cache

`rm -rf var/cache/*`

4. Run migration command

`phing migrate_2.10_to_3.0`

Depending on how big your database is, this command may take a while.

I have an older version
-----------------------

If you have an older version than 2.10.0 then you have to run below commands for each version.

1. Upgrade to next version

2. Login to the PHP container

`docker exec -it open_loyalty_backend bash`

`su www-data`

3. Remove cache

`rm -rf var/cache/*`

4. Run database update

`bin/console doctrine:schema:update --force`
4 changes: 4 additions & 0 deletions backend/app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public function registerBundles(): array
new JMS\SerializerBundle\JMSSerializerBundle(),
new Gesdinet\JWTRefreshTokenBundle\GesdinetJWTRefreshTokenBundle(),
new Misd\PhoneNumberBundle\MisdPhoneNumberBundle(),
new Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle(),
new A2lix\AutoFormBundle\A2lixAutoFormBundle(),
new A2lix\TranslationFormBundle\A2lixTranslationFormBundle(),
new OpenLoyalty\Bundle\SettingsBundle\OpenLoyaltySettingsBundle(),
new OpenLoyalty\Bundle\UserBundle\OpenLoyaltyUserBundle(),
new OpenLoyalty\Bundle\LevelBundle\OpenLoyaltyLevelBundle(),
Expand All @@ -46,6 +49,7 @@ public function registerBundles(): array
new OpenLoyalty\Bundle\UtilityBundle\OpenLoyaltyUtilityBundle(),
new OpenLoyalty\Bundle\AuditBundle\OpenLoyaltyAuditBundle(),
new OpenLoyalty\Bundle\EmailSettingsBundle\OpenLoyaltyEmailSettingsBundle(),
new OpenLoyalty\Bundle\TranslationBundle\OpenLoyaltyTranslationBundle(),
new Knp\Bundle\GaufretteBundle\KnpGaufretteBundle(),
new OpenLoyalty\Bundle\CoreBundle\OpenLoyaltyCoreBundle(),
new OpenLoyaltyPlugin\SalesManagoBundle\SalesManagoBundle(),
Expand Down
2 changes: 1 addition & 1 deletion backend/app/Resources/translations/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
2 changes: 1 addition & 1 deletion backend/app/Resources/translations/messages.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -296,4 +296,4 @@
</trans-unit>
</body>
</file>
</xliff>
</xliff>
6 changes: 6 additions & 0 deletions backend/app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,9 @@ monolog:
# log *all* messages (debug is lowest level)
level: debug
channels: [plugins]

knp_doctrine_behaviors:
translatable: true

a2lix_translation_form:
locale_provider: OpenLoyalty\Bundle\TranslationBundle\Provider\A2lixLocaleProvider
15 changes: 14 additions & 1 deletion backend/app/config/config_test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
imports:
- { resource: config_dev.yml }
- { resource: services_test.yml }

framework:
test: ~
Expand All @@ -13,4 +14,16 @@ web_profiler:
intercept_redirects: false

swiftmailer:
disable_delivery: true
disable_delivery: true

knp_gaufrette:
adapters:
campaign_photos_local:
local:
directory: "%kernel.root_dir%/uploads/tests/"
create: true

filesystems:
campaign_photos:
adapter: "%oloy.campaign.photos_adapter%"
alias: campaign_photos_filesystem
3 changes: 2 additions & 1 deletion backend/app/config/parameters.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ parameters:
frontend_password_reset_url: '%env(frontend_password_reset_url)%'
frontend_activate_account_url: '%env(frontend_activate_account_url)%'
frontend_customer_panel_url: '%env(frontend_customer_panel_url)%'
frontend_invitation_url: '%env(frontend_invitation_url)%'

env(frontend_password_reset_url): 'localhost:8182/#!/password/reset'
env(frontend_activate_account_url): '#!/customer/panel/customer/registration/activate'
env(frontend_invitation_url): '#!/register/'
env(frontend_customer_panel_url): 'http://localhost:8183/'
loyalty_program_name: OpenLoyalty
ecommerce_address: http://ecommerce.local

es_max_result_window_size: 2000000
fallback_frontend_translations_file: english.json

campaign_photos_adapter: campaign_photos_local
campaign_photos_adapter_env: CAMPAIGN_PHOTOS_ADAPTER
Expand Down
4 changes: 3 additions & 1 deletion backend/app/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ services:
- false
- '@broadway.uuid.converter'

OpenLoyalty\Component\Core\Infrastructure\Serializer\SimpleInterfaceSerializer: ~

oloy.read_model.repository.factory:
class: OpenLoyalty\Component\Core\Infrastructure\Repository\OloyElasticsearchRepositoryFactory
arguments:
- '@broadway.elasticsearch.client'
- '@broadway.serializer.readmodel'
- '@OpenLoyalty\Component\Core\Infrastructure\Serializer\SimpleInterfaceSerializer'
- '%es_max_result_window_size%'

12 changes: 0 additions & 12 deletions backend/app/config/services_deprecated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ services:
alias: OpenLoyalty\Bundle\PaginationBundle\Service\Paginator
deprecated: The "%service_id%" service is deprecated since 2.8.0

oloy.campaign.photo_uploader:
alias: OpenLoyalty\Bundle\CampaignBundle\Service\CampaignPhotoUploader
deprecated: The "%service_id%" service is deprecated since 2.8.0

ol.settings.form_type.settings:
alias: OpenLoyalty\Bundle\SettingsBundle\Form\Type\SettingsFormType
deprecated: The "%service_id%" service is deprecated since 2.8.0
Expand All @@ -26,14 +22,6 @@ services:
alias: OpenLoyalty\Bundle\SettingsBundle\Service\GeneralSettingsManager
deprecated: The "%service_id%" service is deprecated since 2.8.0

ol.settings.translations.file_based:
alias: OpenLoyalty\Bundle\SettingsBundle\Service\FileBasedTranslationsProvider
deprecated: The "%service_id%" service is deprecated since 2.8.0

ol.settings.translations:
alias: ol.settings.translations.file_based
deprecated: The "%service_id%" service is deprecated since 2.8.0

ol.settings.validator.not_used_key:
alias: OpenLoyalty\Bundle\SettingsBundle\Validator\Constraints\NotUsedKeyValidator
deprecated: The "%service_id%" service is deprecated since 2.8.0
Expand Down
5 changes: 5 additions & 0 deletions backend/app/config/services_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
services:
_defaults:
autowire: true
autoconfigure: true

14 changes: 12 additions & 2 deletions backend/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<target name="none">
<echo>By default I do nothing! Add -l to see all available tasks</echo>
</target>
<target name="migrate" description="Migrate database schema" depends="generate-jwt-keys">
<target name="migrate" description="Migrate database schema">
<property name="env" value="prod" />
<exec command="bin/console doctrine:schema:update --env=${env} -n --force" checkreturn="true" passthru="true"/>
<exec command="bin/console oloy:user:projections:index:create --drop-old -n --env=${env}" checkreturn="true" passthru="true"/>
Expand Down Expand Up @@ -36,7 +36,7 @@
<target name="basic-setup" description="Setup everything and load only required data" depends="generate-jwt-keys">
<phingcall target="prepare-for-tests">
<property name="env" value="prod" />
<property name="fixtures" value="--fixtures=src/OpenLoyalty/Bundle/SettingsBundle/DataFixtures/ORM/LoadSettingsData.php --fixtures=src/OpenLoyalty/Bundle/UserBundle/DataFixtures/ORM/LoadRoleData.php --fixtures=src/OpenLoyalty/Bundle/EmailSettingsBundle/DataFixtures/ORM/LoadEmailsData.php --fixtures=src/OpenLoyalty/Bundle/UserBundle/DataFixtures/ORM/LoadAdminData.php" />
<property name="fixtures" value="--fixtures=vendor/divante-ltd/open-loyalty-framework/src/OpenLoyalty/Bundle/SettingsBundle/DataFixtures/ORM/LoadSettingsData.php --fixtures=vendor/divante-ltd/open-loyalty-framework/src/OpenLoyalty/Bundle/UserBundle/DataFixtures/ORM/LoadRoleData.php --fixtures=vendor/divante-ltd/open-loyalty-framework/src/OpenLoyalty/Bundle/EmailSettingsBundle/DataFixtures/ORM/LoadEmailsData.php --fixtures=vendor/divante-ltd/open-loyalty-framework/src/OpenLoyalty/Bundle/UserBundle/DataFixtures/ORM/LoadAdminData.php" />
</phingcall>
</target>
<target name="fix-code" description="Fix code">
Expand Down Expand Up @@ -100,4 +100,14 @@
</else>
</if>
</target>
<target name="migrate_2.10_to_3.0" description="Migrate application from 2.10 to 3.0">
<property name="env" value="prod" />
<exec command="bin/console oloy:translation:upgrade_to_3 --force --env=${env}" checkreturn="true" passthru="true"/>
<exec command="bin/console doctrine:schema:update --force --env=${env}" checkreturn="true" passthru="true"/>
<exec command="bin/console oloy:translation:migrate2database english.json en --force --setAsDefault --env=${env}" checkreturn="true" passthru="true"/>
<exec command="bin/console oloy:translation:migrate2database polish.json pl --force --env=${env}" checkreturn="true" passthru="true"/>
<phingcall target="migrate">
<property name="env" value="${env}" />
</phingcall>
</target>
</project>
2 changes: 1 addition & 1 deletion backend/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"require": {
"php": ">=7.1",
"divante-ltd/open-loyalty-framework": "^2.0",
"divante-ltd/open-loyalty-framework": "^3.0",
"phpdocumentor/reflection-docblock": "^3.2",
"phpdocumentor/type-resolver": "^0.3",
"symfony/symfony": "3.4.14"
Expand Down
Loading

0 comments on commit 25f7e7c

Please sign in to comment.