Commit Graph

48 Commits

Author SHA1 Message Date
Kristina Lim
b0a82b0e21 Exclude $0 adjustments from report 2019-02-18 16:53:19 +08:00
Kristina Lim
36fd385f7d Add test showing $0 mandatory adjustments included 2019-02-18 16:53:19 +08:00
Kristina Lim
19f99255fa Exclude non-eligible entries from report 2019-02-18 16:53:18 +08:00
Kristina Lim
8ce7337c9d Add test showing $0 non-mandatory adjustments included 2019-02-18 16:53:18 +08:00
Kristina Lim
ca2c8e6ff2 Add test showing non-"eligible" entries included 2019-02-18 16:53:18 +08:00
Kristina Lim
5e8a336e24 Initialize data representation classes with data
There is no more need to pass the summarizer.
2019-02-13 01:51:34 +11:00
Kristina Lim
ddc788ed5d Move data representation translations to class 2019-02-13 01:51:34 +11:00
Kristina Lim
bc95560598 Add descriptions for data representation classes 2019-02-13 01:51:33 +11:00
Kristina Lim
664943a6e5 Include UsingEnterpriseFee instead of inheriting 2019-02-13 01:51:33 +11:00
Kristina Lim
b9c144bb1f Prepare to change AssociatedEnterpriseFee to module
The superclasses will include this module, instead of inheriting the class.
2019-02-13 01:51:32 +11:00
Kristina Lim
373e3e1039 Simplify name of SQL data summarizer class 2019-02-13 01:51:32 +11:00
Kristina Lim
7a76355cfe Separate summarizing of SQL data by source 2019-02-13 01:51:32 +11:00
Kristina Lim
c4801aafd4 Fix Fee Calc on Transfer Through and Tax Category
For exchange fees with calculator that is order-based:

* "Fee Calc on Transfer Through" should show "Entire Orders through
  DISTRIBUTOR_NAME".
* For tax category:
  a. If the enterprise fee itself has a tax category, this is used.
  b. If the enterprise fee inherits the product's tax category, this is
     "Various".
  c. If the enterprise fee has no tax, this is blank.

For coordinator fees:

* "Fee Calc on Transfer Through" should be "All".
* For tax category: Same as abova.
2019-02-13 01:51:31 +11:00
Kristina Lim
8f65beeb0b Clarify method name in report scope 2019-02-13 01:51:31 +11:00
Kristina Lim
e550be9bda Add test for using order-based exchange fees
This is not filling the "Fee Calc on Transfer Through" column. This will
be addressed in another commit.
2019-02-13 01:51:31 +11:00
Kristina Lim
0212454041 Refactor SQL result summarizer for report 2019-02-13 01:51:30 +11:00
Kristina Lim
f59834ddc8 Use receiver as "Fee Calc on Transfer Through" for outgoing exchanges 2019-02-08 21:26:38 +00:00
Kristina Lim
ddf15f1d30 Add scenario test for enterprise fee summary
Add test for more complex scenario where there is a coordinator and
distributor fee for an incoming exchange, and a producer and coordinator
fee for an outgoing exchange.
2019-02-08 21:26:38 +00:00
Kristina Lim
625069cb5a Add :per_item factory trait to shipping and payment methods 2019-02-08 21:26:38 +00:00
Kristina Lim
d2e49b8b49 Move variant setup to new factory trait 2019-02-08 21:26:38 +00:00
Kristina Lim
f36d13a736 Rename helper for setting up incomplete order 2019-02-08 21:26:38 +00:00
Kristina Lim
ce030aeb07 Move order setup to new factory traits 2019-02-08 21:26:38 +00:00
Kristina Lim
a3aa594c42 Use enterprise fee factory trait where applicable 2019-02-08 21:26:38 +00:00
Kristina Lim
5dda3b67eb Use factory for tax category in entperprise fee summary tests 2019-02-08 21:26:38 +00:00
Kristina Lim
53c458f817 Clean up setup data for enterprise fee summary tests 2019-02-08 21:26:38 +00:00
Kristina Lim
4a73b1d26c Do not include incomplete orders in report 2019-02-08 21:26:38 +00:00
Kristina Lim
eaa7800427 Do not assign I18n translation to constants
The preferred language could change dynamically.
2019-02-08 21:26:38 +00:00
Kristina Lim
6378afdddb Address Rubocop violation 2019-02-08 21:26:38 +00:00
Kristina Lim
c81be75530 Move engine libraries except Engine and Version to services 2019-02-08 21:26:38 +00:00
Kristina Lim
3e499faa7c Do not use ReportData::EnterpriseFeeTypeTotals 2019-02-08 21:26:38 +00:00
Kristina Lim
3f84d0008a Move some in OpenFoodNetwork to engine services
This removes the OpenFoodNetwork namespace from these too.
2019-02-08 21:26:38 +00:00
Kristina Lim
95e3a2f45d Move authorization to the ::Parameters class 2019-02-08 21:26:38 +00:00
Kristina Lim
c61a83faca Move routes for enterprise fee summary to engine 2019-02-08 21:26:38 +00:00
Kristina Lim
9e035efd50 Render enterprise fee report directly in renderer 2019-02-08 21:26:38 +00:00
Kristina Lim
207b6c7f30 Use shorthand for RSpec expect(subject).to 2019-02-08 21:26:38 +00:00
Kristina Lim
b78e2b4720 Move lib files for enterprise fee summary to engine 2019-02-08 21:26:38 +00:00
Kristina Lim
0cdcd96bb5 Add skeleton for OrderManagement engine 2019-02-08 21:26:38 +00:00
Kristina Lim
fb5a9356dc Fix spec_helper.rb of web engine
This fixes the tests of the web engine when running the following from
its root: bundle exec rspec

An engine is meant to have some independence from the main application,
and its tests should be run independently.

This should be using the engine's own dummy application, actually, or
the dummy application of a dependency.
2018-12-15 16:11:15 +08:00
luisramos0
93e1310deb Fixed bug in cookies css, import colors, not branding 2018-11-29 11:47:51 +00:00
luisramos0
cdc5899791 Moved cookies policy modal and cookies banner colors to darkswarm/base/colors.scss 2018-11-29 11:47:51 +00:00
luisramos0
574f031020 Fix typo in matomo optout iframe url in cookies_policy_helper 2018-10-05 21:36:03 +01:00
luisramos0
3cf10020bf Fix bug on slow page loads where banner and policy modal were both loaded
This solution makes the banner aware of the policy modal: the banner doesnt open if the policy modal is enabled
2018-09-27 17:47:36 +01:00
luisramos0
921105301c Move angular-templates route and controller into Web engine
The route and controller were in the main app and the views in the engine, with this commit they stay all inside the engine
This is done to keep it simple and remove the unnecessary dependency between main app and engine
If we use this mechanism in the future for other things in the main app or other engines, we can find a way to extract/abstract this
2018-09-26 12:39:51 +01:00
luisramos0
a23b1b980d Make Web engine an isolated namespace engine mounted on / (without /web prefix)
This approach is better to separate concerns, see “Isolated Engine” here: https://api.rubyonrails.org/v3.2/classes/Rails/Engine.html
2018-09-26 12:30:06 +01:00
luisramos0
c22ac0086b Moved cookies_policy_helper to Web engine and respective spec 2018-09-17 16:05:38 +01:00
luisramos0
bded530137 Moved web api endpoint from /api to /web/api 2018-09-17 16:05:38 +01:00
luisramos0
dc5eb6448e Change web/all.css from sprockets to SASS and include web/all.css through darkswarm/all.css 2018-09-17 16:05:38 +01:00
luisramos0
d170a4d489 New domain Web (rails engine) with the following features extracted from the main app:
- cookies banner
- cookies policy page
- cookies policy and privacy policy links in the footer
2018-09-17 16:05:32 +01:00