Skip to content

Commit

Permalink
Merge pull request #59 from logeecom/feature/whitelabel
Browse files Browse the repository at this point in the history
Release version 3.2.0
  • Loading branch information
Morato authored May 5, 2021
2 parents c3955da + 370feee commit ec188f1
Show file tree
Hide file tree
Showing 104 changed files with 2,790 additions and 1,098 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@ 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/).

## [3.2.0](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.1.1...v3.2.0) - 2021-04-29
**BREAKING CHANGES**
Whitelabel project changes:

### Added
- Added BrandConfigurationService. Integration should register PacklinkConfigurationService instance for Packlink brand or adequate implementation for other brand(s) during the bootstraping.
- Added PacklinkConfigurationService.
- Added FileResolverService. Integration should initialize FileResolverService with an array of folders where source files should be searched for.
- Added new method getLabels to \Packlink\BusinessLogic\CountryLabels\CountryService.

### Changed

- \Packlink\BusinessLogic\Language\TranslationService renamed to CountryService.
- TranslationService::translate renamed to CountryService::getText.
- Files from Resources/lang moved to Resources/countries. In integration, change path to translations to fit new folder names in core.
- Configuration::getCurrentLanguage and Configuration::setCurrentLanguage changed to Configuration::getUICountryCode and Configuration::setUICountryCode.

Following changes will work properly once BrandConfigurationService is registered in Bootstrap:
- Removed hardcoded source value from ShippingServiceSearch.
- Removed hardcoded platform code from Proxy, Draft and RegistrationRequest.
- Removed platform country code from RegisterModalController.js.
- Added platform_country to RegistrationController:getRegisterData response.
- RegisterController.js function populateInitialValues() populates platform_country.
- Registration link and platform country removed from CountryService::$supportedCountries.
- Removed Packlink\BusinessLogic\Country\RegistrationCountry.
- Added validation for platform country in RegistrationRequest::doValidate and UserAccountService::initializeUser.
- Removed $supportedCountries from CountryService and WarehouseCountryService.
- Packlink\BusinessLogic\Language\TranslationService renamed to CountryService and moved to CountryLabels directory.

## [3.1.1](https://github.com/packlink-dev/ecommerce_module_core/compare/v3.1.0...v3.1.1) - 2021-03-26
### Added
- Added additional ISO codes to the postal code transformer.
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
"autoload": {
"psr-4": {
"Logeecom\\Infrastructure\\": "src/Infrastructure",
"Packlink\\BusinessLogic\\": "src/BusinessLogic"
"Packlink\\BusinessLogic\\": "src/BusinessLogic",
"Packlink\\Brands\\": "src/Brands"
}
},
"autoload-dev": {
"psr-4": {
"Logeecom\\Tests\\Infrastructure\\": "tests/Infrastructure",
"Logeecom\\Tests\\BusinessLogic\\": "tests/BusinessLogic"
"Logeecom\\Tests\\BusinessLogic\\": "tests/BusinessLogic",
"Logeecom\\Tests\\Brands\\": "tests/Brands"
}
},
"require-dev": {
Expand Down
149 changes: 149 additions & 0 deletions src/Brands/Packlink/PacklinkConfigurationService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
<?php


namespace Packlink\Brands\Packlink;

use Packlink\BusinessLogic\Brand\BrandConfigurationService;
use Packlink\BusinessLogic\Brand\DTO\BrandConfiguration;

/**
* Class PacklinkConfigurationService
*
* @package Packlink\Brands\Packlink
*/
class PacklinkConfigurationService implements BrandConfigurationService
{
/**
* Allowed values for platform countries.
*
* @var string[]
*/
protected static $supportedPlatformCountries = array(
'ES',
'DE',
'FR',
'IT',
'UN',
);
/**
* List of supported registration countries.
*
* @var array
*/
protected static $supportedRegistrationCountries = array(
'ES' => array(
'code' => 'ES',
'postal_code' => '28001',
),
'DE' => array(
'code' => 'DE',
'postal_code' => '10115',
),
'FR' => array(
'code' => 'FR',
'postal_code' => '75001',
),
'IT' => array(
'code' => 'IT',
'postal_code' => '00118',
),
'AT' => array(
'code' => 'AT',
'postal_code' => '1010',
),
'NL' => array(
'code' => 'NL',
'postal_code' => '1011',
),
'BE' => array(
'code' => 'BE',
'postal_code' => '1000',
),
'PT' => array(
'code' => 'PT',
'postal_code' => '1000-017',
),
'TR' => array(
'code' => 'TR',
'postal_code' => '06010',
),
'IE' => array(
'code' => 'IE',
'postal_code' => 'D1',
),
'GB' => array(
'code' => 'GB',
'postal_code' => 'E1 6AN',
),
'HU' => array(
'code' => 'HU',
'postal_code' => '1014',
),
);
/**
* List of countries available only for warehouse selection.
*
* @var array
*/
protected static $additionalWarehouseCountries = array(
'PL' => array(
'code' => 'PL',
'postal_code' => '00-694',
),
'CH' => array(
'code' => 'CH',
'postal_code' => '3000',
),
'LU' => array(
'code' => 'LU',
'postal_code' => '1009',
),
'AR' => array(
'code' => 'AR',
'postal_code' => 'C1258 AAA',
),
'US' => array(
'code' => 'US',
'postal_code' => '01223',
),
'BO' => array(
'code' => 'BO',
'postal_code' => 'La Paz',
),
'MX' => array(
'code' => 'MX',
'postal_code' => '21900',
),
'CL' => array(
'code' => 'CL',
'postal_code' => '7500599',
),
'CZ' => array(
'code' => 'CZ',
'postal_code' => '186 00',
),
'SE' => array(
'code' => 'SE',
'postal_code' => '103 16',
),
);

/**
* @inheritDoc
*/
public function get()
{
$brandConfiguration = new BrandConfiguration();

$brandConfiguration->platformCode = 'PRO';
$brandConfiguration->shippingServiceSource = 'PRO';
$brandConfiguration->platformCountries = static::$supportedPlatformCountries;
$brandConfiguration->registrationCountries = static::$supportedRegistrationCountries;
$brandConfiguration->warehouseCountries = array_merge(
static::$supportedRegistrationCountries,
static::$additionalWarehouseCountries
);

return $brandConfiguration;
}
}
6 changes: 6 additions & 0 deletions src/Brands/Packlink/Resources/countries/at.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"register": {
"termsAndConditionsUrl": "https://support-pro.packlink.com/hc/de/articles/360010011480",
"privacyPolicyUrl": "https://support-pro.packlink.com/hc/de/articles/360010011480"
}
}
6 changes: 6 additions & 0 deletions src/Brands/Packlink/Resources/countries/be.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"register": {
"termsAndConditionsUrl": "https://support-pro.packlink.com/hc/nl/articles/360010011480",
"privacyPolicyUrl": "https://support-pro.packlink.com/hc/nl/articles/360010011560"
}
}
57 changes: 57 additions & 0 deletions src/Brands/Packlink/Resources/countries/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"general": {
"packlinkPro": "Packlink PRO Shipping",
"saveUp": "Sparen Sie bis zu 70% bei Ihren Versandkosten. Keine festen Gebühren, kein Mindestvolumen beim Versand. Verwalten Sie alle Ihre Sendungen auf einer einzigen Plattform.",
"packlinkShipping": "Packlink Shipping S.L.",
"noContract": "Ohne Vertragsbindung – Sofortiger Zugriff auf über 300 Versanddienste in einer einzigen Plattform. Verbinden Sie Ihren Onlineshop und steuern Sie alle Sendungen über Packlink PRO.",
"developedAndManaged": "Entwickelt und verwaltet von Packlink"
},
"login": {
"welcome": "Willkommen zu Packlink PRO",
"connectYourService": "Verbinden Sie Ihren Dienst, indem Sie Ihren API-Schlüssel verwenden. Sie finden ihn unter <br><strong>„Packlink Pro API-Schlüssel“</strong> bei den <strong>„Einstellungen“</strong>."
},
"register": {
"startEnjoying": "Genießen Sie ab jetzt Packlink PRO!",
"termsAndConditions": "<pre>Ich akzeptiere die <a href=\"%s\" target=\"_blank\">Nutzungsbedingungen</a> und die <a href=\"%s\" target=\"_blank\">Datenschutzerklärung</a> von Packlink</pre>",
"termsAndConditionsUrl": "https://pro.packlink.de/agb/",
"privacyPolicyUrl": "https://support-pro.packlink.com/hc/de/articles/360010011560-Datenschutzerklarung-der-Packlink-Shipping-S-L-",
"marketingEmails": "Ich ermächtige Packlink Shipping S.L., mir kommerzielle Mitteilungen per E-Mail zuzusenden"
},
"configuration": {
"helpUrl": "https://support-pro.packlink.com/hc/de",
"contactUrl": "business@packlink.com",
"contactUrlMail": "mailto::business@packlink.com"
},
"orderStatusMapping": {
"description": "Mit Packlink können Sie Ihren %s Bestellstatus mit Versandinformationen aktualisieren. <br>Sie können die Informationen jederzeit bearbeiten.",
"packlinkProShipmentStatus": "<strong>VERSANDSTATUS</strong> von Packlink PRO"
},
"shippingServices": {
"packlinkPrices": "Packlink-Preise",
"pricePolicyDescription": "Standardmäßig werden <strong>die Packlink Basispreise </strong> eingestellt sein. Sie können diese jedoch weiter unten genauer konfigurieren.",
"packlinkPrice": "Packlink-Preise",
"percentagePacklinkPrices": "% der Packlink-Preise",
"percentagePacklinkPricesWithData": "% der Packlink-Preise: %s von %s%",
"usePacklinkRange": "Für alle anderen Bereiche gelten die Packlink-Preise"
},
"orderListAndDetails": {
"packlinkOrderDraft": "Packlink Auftragsentwurf",
"printShipmentLabels": "Packlink PRO Versandetiketten drucken",
"packlinkReferenceNumber": "Packlink Referenznummer",
"packlinkShippingPrice": "Packlink Versandpreis",
"viewOnPacklink": "Auf Packlink PRO ansehen",
"draftIsBeingCreated": "Der Entwurf wird gerade in Packlink PRO erstellt",
"createOrderDraft": "Entwurf der Bestellung in Packlink PRO erstellen",
"packlinkShipping": "Packlink Shipping",
"sendWithPacklink": "Send with Packlink",
"shipmentUrl": "https://pro.packlink.de/private/shipments/"
},
"systemLogMessages": {
"webhookReceived": "Webhook von Packlink erhalten"
},
"autoTest": {
"moduleAutoTest": "Automatischer Test PacklinkPRO-Modul",
"useThisPageTestConfiguration": "Auf dieser Seite können Sie die Systemkonfiguration und die Dienste des PacklinkPRO-Moduls testen.",
"openModule": "PacklinkPRO-Modul öffnen"
}
}
57 changes: 57 additions & 0 deletions src/Brands/Packlink/Resources/countries/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"general": {
"packlinkPro": "Packlink PRO Shipping",
"saveUp": "Save up to 70% on your shipping costs. No fixed fees, no minimum shipping volume required. Manage all your shipments in a single platform.",
"packlinkShipping": "Packlink Shipping S.L.",
"noContract": "No contract needed! More than 300 transport services into a single platform. You can connect all your ecommerce and manage all your shipments in Packlink PRO.",
"developedAndManaged": "Developed and managed by Packlink"
},
"login": {
"welcome": "Welcome to Packlink PRO",
"connectYourService": "Connect your service using your key. You'll find it in the <br><strong>\"Packlink Pro API Key\"</strong> section of the <strong>\"Settings\"</strong>."
},
"register": {
"startEnjoying": "Start enjoying Packlink PRO!",
"termsAndConditions": "<pre>I accept the <a href=\"%s\" target=\"_blank\">Terms of Service</a> and the <a href=\"%s\" target=\"_blank\">Privacy Policy</a> of Packlink</pre>",
"termsAndConditionsUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011480",
"privacyPolicyUrl": "https://support-pro.packlink.com/hc/en-gb/articles/360010011560",
"marketingEmails": "I authorise Packlink Shipping S.L. to send me commercial communications by e-mail"
},
"configuration": {
"helpUrl": "https://support-pro.packlink.com/hc/en-gb",
"contactUrl": "business@packlink.com",
"contactUrlMail": "mailto::business@packlink.com"
},
"orderStatusMapping": {
"description": "With Packlink you can update your %s order status with shipping information. <br>You can edit it at any time.",
"packlinkProShipmentStatus": "Packlink PRO <strong>SHIPMENT</strong> STATUS"
},
"shippingServices": {
"packlinkPrices": "Packlink prices",
"pricePolicyDescription": "The default <strong>will be Packlink's basic prices.</strong> But you can configure these in a more precise way below.",
"packlinkPrice": "Packlink Price",
"percentagePacklinkPrices": "% of Packlink prices",
"percentagePacklinkPricesWithData": "% of Packlink prices: %s by %s%",
"usePacklinkRange": "For all other ranges, apply Packlink prices"
},
"orderListAndDetails": {
"packlinkOrderDraft": "Packlink order draft",
"printShipmentLabels": "Print Packlink PRO Shipment Labels",
"packlinkReferenceNumber": "Packlink reference number",
"packlinkShippingPrice": "Packlink shipping price",
"viewOnPacklink": "View on Packlink PRO",
"draftIsBeingCreated": "Draft is currently being created in Packlink PRO",
"createOrderDraft": "Create order draft in Packlink PRO",
"packlinkShipping": "Packlink Shipping",
"sendWithPacklink": "Send with Packlink",
"shipmentUrl": "https://pro.packlink.com/private/shipments/"
},
"systemLogMessages": {
"webhookReceived": "Webhook from Packlink received."
},
"autoTest": {
"moduleAutoTest": "PacklinkPRO module auto-test",
"useThisPageTestConfiguration": "Use this page to test the system configuration and PacklinkPRO module services.",
"openModule": "Open PacklinkPRO module"
}
}
57 changes: 57 additions & 0 deletions src/Brands/Packlink/Resources/countries/es.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"general": {
"packlinkPro": "Packlink PRO Shipping",
"saveUp": "Ahorra hasta un 70% en tus gastos de envío. Sin tarifas fijas, sin volumen de envíos mínimo. Gestiona todos tus envíos en una sola plataforma.",
"packlinkShipping": "Packlink Shipping S.L.",
"noContract": "Sin contratos, accede inmediatamente a más de 300 servicios de transporte en una única plataforma. No importa cuantos puntos de venta tengas, todo lo podrás gestionar desde Packlink PRO.",
"developedAndManaged": "Desarrollado y gestionado por Packlink"
},
"login": {
"welcome": "Te damos la bienvenida a Packlink PRO",
"connectYourService": "Conecta tu servicio mediante tu clave. La encontrarás en la <br>sección <strong>\"Configuración\"</strong> apartado <strong>\"Packlink Pro API Key\"</strong>"
},
"register": {
"startEnjoying": "¡Empieza a disfrutar de Packlink PRO!",
"termsAndConditions": "<pre>Acepto los <a href=\"%s\" target=\"_blank\">Términos y condiciones</a> y la <a href=\"%s\" target=\"_blank\">Política de privacidad</a> de Packlink</pre>",
"termsAndConditionsUrl": "https://pro.packlink.es/terminos-y-condiciones/",
"privacyPolicyUrl": "https://support-pro.packlink.com/hc/es-es/articles/360010011560-Poitica-de-Privacidad",
"marketingEmails": "Autorizo a Packlink Shipping S.L. a enviarme información comercial por correo electrónico"
},
"configuration": {
"helpUrl": "https://support-pro.packlink.com/hc/es-es",
"contactUrl": "business@packlink.com",
"contactUrlMail": "mailto::business@packlink.com"
},
"orderStatusMapping": {
"description": "Con Packlink puedes actualizar el estado de tu pedido de %s con la información de envío. <br>Puedes editarla en cualquier momento.",
"packlinkProShipmentStatus": "ESTADO DEL <strong>ENVÍO</strong> de Packlink PRO"
},
"shippingServices": {
"packlinkPrices": "Precios de Packlink",
"pricePolicyDescription": "Por defecto <strong>serán los precios base de Packlink.</strong> Pero puedes configurarlos de manera más precisa a continuación.",
"packlinkPrice": "Precio Packlink",
"percentagePacklinkPrices": "% de los precio de Packlink",
"percentagePacklinkPricesWithData": "% de los precio de Packlink: %s por %s%",
"usePacklinkRange": "Para el resto de rangos, aplicar precios Packlink"
},
"orderListAndDetails": {
"packlinkOrderDraft": "Borrador del pedido de Packlink",
"printShipmentLabels": "Imprimir Packlink PRO etiquetas de los envíos",
"packlinkReferenceNumber": "Número de referencia Packlink",
"packlinkShippingPrice": "Precio de envío de Packlink",
"viewOnPacklink": "Ver en Packlink PRO",
"draftIsBeingCreated": "El borrador se está creando actualmente en Packlink PRO",
"createOrderDraft": "Crear borrador en Packlink PRO",
"packlinkShipping": "Packlink Shipping",
"sendWithPacklink": "Send with Packlink",
"shipmentUrl": "https://pro.packlink.es/private/shipments/"
},
"systemLogMessages": {
"webhookReceived": "Webhook de Packlink recibido"
},
"autoTest": {
"moduleAutoTest": "Prueba automática del módulo PacklinkPRO",
"useThisPageTestConfiguration": "Utiliza esta página para probar la configuración del sistema y los servicios del módulo PacklinkPRO.",
"openModule": "Abrir el módulo PacklinkPRO"
}
}
Loading

0 comments on commit ec188f1

Please sign in to comment.