diff --git a/ROLES.markdown b/ROLES.markdown deleted file mode 100644 index d7b0d5b..0000000 --- a/ROLES.markdown +++ /dev/null @@ -1,5 +0,0 @@ -- ROLE_EXCHANGE_RATE_MANAGER -- ROLE_EXCHANGE_RATE_LIST -- ROLE_EXCHANGE_RATE_EDIT -- ROLE_EXCHANGE_RATE_DELETE -- ROLE_EXCHANGE_RATE_CREATE \ No newline at end of file diff --git a/Readme.markdown b/Readme.markdown index 670849d..d448b96 100755 --- a/Readme.markdown +++ b/Readme.markdown @@ -1,8 +1,9 @@ Exchange rate bundle -==== +==================== + *Fetch, store and use currency exchange rates in your application* -Exchange rate bundle is Symfony2 and Symfony3 wrapper for [RunOpenCode/exchange-rate](https://github.com/RunOpenCode/exchange-rate) +Exchange rate bundle is Symfony wrapper for [RunOpenCode/exchange-rate](https://github.com/RunOpenCode/exchange-rate) library. [![Packagist](https://img.shields.io/packagist/v/RunOpenCode/exchange-rate-bundle.svg)](https://packagist.org/packages/runopencode/exchange-rate-bundle) @@ -13,13 +14,28 @@ library. [![SensioLabsInsight](https://insight.sensiolabs.com/projects/7d45e1cd-63a2-474e-a252-9a11ee8faafb/big.png)](https://insight.sensiolabs.com/projects/7d45e1cd-63a2-474e-a252-9a11ee8faafb) +## Features + +- Easy integration with exchange rate sources +(such as [National bank of Serba](https://github.com/RunOpenCode/exchange-rate-nbs) +and [Banca Intesa Serbia](https://github.com/RunOpenCode/exchange-rate-intesa-rs)) via configuration. +- Console commands for debugging configuration. +- Console commands for fetching configured rates via cron tasks or queue +implementations. +- Configurable e-mail notifications support for successful retrieval of +rates, as well as errors. +- CRUD controllers for viewing, editing, deleting and creating rates, with +configurable role-based security. +- Public REST api enabling you to deliver rates to other applications +and third parties. +- Easy extensibility and customization of each portion of bundle. + +## License -Bundle is in active development phase, currently is in beta stage, unit testing must be completed and documentation must be -written. +This bundle is published under MIT license. Please see [LICENSE](LICENSE) file distributed +with this package. -TODO: +## Documentation -- Provide unit tests -- Provide documentation -- Write Doctrine ORM repository -- Write Doctrine Document repository \ No newline at end of file +For more detailed information about the features of this bundle, +refer to the [documentation](docs/index.md). \ No newline at end of file diff --git a/docs/configuration.md b/docs/configuration.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/index.md b/docs/index.md index b1700b5..f61e1f7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,31 @@ Exchange rate bundle -==== -*Fetch, store and use currency exchange rates in your application* +==================== -Exchange rate bundle is Symfony3 wrapper for [RunOpenCode/exchange-rate](https://github.com/RunOpenCode/exchange-rate) -library. \ No newline at end of file +*Fetch, store and use currency exchange rates in your Symfony application* + +Exchange rate bundle is Symfony wrapper for [RunOpenCode/exchange-rate](https://github.com/RunOpenCode/exchange-rate) +library. + +It will enable you to easily fetch, query and manage exchange rates in your +Symfony application when dealing with payments and prices in foreign currencies. + +## Features + +- Easy integration with exchange rate sources +(such as [National bank of Serba](https://github.com/RunOpenCode/exchange-rate-nbs) +and [Banca Intesa Serbia](https://github.com/RunOpenCode/exchange-rate-intesa-rs)) via configuration. +- Console commands for debugging configuration. +- Console commands for fetching configured rates via cron tasks or queue +implementations. +- Configurable e-mail notifications support for successful retrieval of +rates, as well as errors. +- CRUD controllers for viewing, editing, deleting and creating rates, with +configurable role-based security. +- Public REST api enabling you to deliver rates to other applications +and third parties. +- Easy extensibility and customization of each portion of bundle. + +## Table of contents + +- [Instalation](installation.md) +- [Configuration](configuration.md) \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 0000000..f0e6e76 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,35 @@ +Installation +============ + +## Step 1. - Download the Bundle + +Open a command console, enter your project directory, and execute the +following command to download the latest stable version of this bundle +and add it as a dependency to your project: + + composer require runopencode/exchange-rate-bundle + +## Step 2. - Enable the Bundle + +Enable the bundle by adding `new RunOpenCode\Bundle\ExchangeRate\ExchangeRateBundle()` +to the bundles array of the registerBundles method in your project's +`app/AppKernel.php` file: + + redirectAfterSuccess(); } - return $this->render('@ExchangeRate/create.html.twig', [ + return $this->render($this->getTwigTemplate(), [ 'form' => $form->createView(), ]); } @@ -131,4 +131,14 @@ protected function redirectAfterSuccess() { return $this->redirectToRoute('runopencode_exchange_rate_list'); } + + /** + * Get Twig template path. + * + * @return string + */ + protected function getTwigTemplate() + { + return '@ExchangeRate/create.html.twig'; + } } diff --git a/src/RunOpenCode/Bundle/ExchangeRate/Controller/DeleteController.php b/src/RunOpenCode/Bundle/ExchangeRate/Controller/DeleteController.php index 5c1aec2..65e8c77 100644 --- a/src/RunOpenCode/Bundle/ExchangeRate/Controller/DeleteController.php +++ b/src/RunOpenCode/Bundle/ExchangeRate/Controller/DeleteController.php @@ -31,7 +31,7 @@ class DeleteController extends Controller */ public function indexAction(Request $request) { - return $this->render('@ExchangeRate/delete.html.twig', [ + return $this->render($this->getTwigTemplate(), [ 'rate' => $this->getRateFromRequest($request) ]); } @@ -121,4 +121,14 @@ protected function redirectAfterSuccess() { return $this->redirectToRoute('runopencode_exchange_rate_list'); } + + /** + * Get Twig template path. + * + * @return string + */ + protected function getTwigTemplate() + { + return '@ExchangeRate/delete.html.twig'; + } } diff --git a/src/RunOpenCode/Bundle/ExchangeRate/Controller/EditController.php b/src/RunOpenCode/Bundle/ExchangeRate/Controller/EditController.php index 764f3fd..29e886e 100644 --- a/src/RunOpenCode/Bundle/ExchangeRate/Controller/EditController.php +++ b/src/RunOpenCode/Bundle/ExchangeRate/Controller/EditController.php @@ -61,7 +61,7 @@ public function indexAction(Request $request) return $this->redirectAfterSuccess(); } - return $this->render('@ExchangeRate/edit.html.twig', [ + return $this->render($this->getTwigTemplate(), [ 'form' => $form->createView(), 'rate' => $rate ]); @@ -144,4 +144,14 @@ protected function redirectAfterSuccess() { return $this->redirectToRoute('runopencode_exchange_rate_list'); } + + /** + * Get Twig template path. + * + * @return string + */ + protected function getTwigTemplate() + { + return '@ExchangeRate/edit.html.twig'; + } } diff --git a/src/RunOpenCode/Bundle/ExchangeRate/Controller/ListController.php b/src/RunOpenCode/Bundle/ExchangeRate/Controller/ListController.php index e505b2f..96bf779 100644 --- a/src/RunOpenCode/Bundle/ExchangeRate/Controller/ListController.php +++ b/src/RunOpenCode/Bundle/ExchangeRate/Controller/ListController.php @@ -38,7 +38,7 @@ public function indexAction(Request $request) $filterForm = $this->getFilterForm($request); - return $this->render('@ExchangeRate/list.html.twig', [ + return $this->render($this->getTwigTemplate(), [ 'rates' => $this->getRates($filterForm), 'form' => $filterForm->createView(), ]); @@ -90,4 +90,14 @@ protected function getFilterFormType() { return FilterType::class; } + + /** + * Get Twig template path. + * + * @return string + */ + protected function getTwigTemplate() + { + return '@ExchangeRate/list.html.twig'; + } }