Andy Brett
a67038720c
Merge pull request #7255 from mkllnk/fail-on-translations
...
Raise errors in specs with missing translations
2021-03-30 08:37:15 -07:00
Pau Pérez Fabregat
7d5726b6c7
Merge pull request #7150 from coopdevs/use-order-balance-object
...
Feature-toggle all remaining parts of the app where the order balance is shown
2021-03-30 15:58:12 +02:00
Maikel Linke
0980b81742
Raise errors in specs with missing translations
...
The previous mechanism didn't seem to work and newer Rails versions have
an easier config for this now.
Also fixing all i18n errors which were now failing specs.
2021-03-30 17:08:17 +11:00
Matt-Yorkley
2ccaf80013
Update EnterpriseFeeSummary report scopes
2021-03-23 18:19:06 +00:00
Matt-Yorkley
525fef14b1
Merge pull request #6974 from Matt-Yorkley/adjustments-line-item-fees
...
[Adjustments] Update line item enteprise fees
2021-03-23 19:06:02 +01:00
Pau Perez
1a1552a6ed
Make OrderUpdater use new balance implementation
...
In this class we properly calculated the balance taking into account the
orders in cancellation state so we need to use the new implementation if
we don't want to introduce a regression by using
`#old_oustanding_balance`.
I was initially a bit dubious because this method was checking
`order.payments` as well but now I see that was redundant. Is on
`payment_total` to take into account whether or not the order is paid or
any other payment related details.
2021-03-22 11:45:12 +01:00
Pau Perez
9762275555
Use old_outstanding_balance on disabled toggle
...
No need to go through the `OrderBalance` in this context since we
already check for the toggle.
2021-03-22 11:45:12 +01:00
Pau Perez
5815d1a4a4
Make #outstanding_balance return an OrderBalance
...
This will let us branch by abstraction. All existing calls to
`#outstanding_balance` will go through `OrderBalance` hence, will
check the feature toggle.
Note that by default, `OrderBalance` will end up calling
`#old_outstanding_balance`. As the name states, that's exactly what
`#outstanding_balance` was so far. This means no consumers will see any
change in behavior. We just added on item in the call stack (sort of).
2021-03-22 11:45:12 +01:00
Pau Pérez Fabregat
72b3dbbf44
Merge pull request #7149 from coopdevs/rearrange-order-updater-specs
...
Rearrange order updater tests to make them method-centric
2021-03-18 15:53:37 +01:00
Pau Pérez Fabregat
71b902d9d2
Merge pull request #6980 from drummer83/clean-footer
...
Cleaner and consistent design of front-end footer
2021-03-18 15:53:09 +01:00
Matt-Yorkley
62a495a42e
Allow line item enterprise fees to be found in EnterpriseFeeSummary report
2021-03-18 13:18:20 +00:00
Matt-Yorkley
be3e184651
Merge pull request #6973 from Matt-Yorkley/adjustments-line-item-taxes
...
[Adjustments] Update line item taxes
2021-03-18 11:50:01 +01:00
Pau Perez
93bc60664a
Fix long lines
2021-03-18 10:00:33 +01:00
Matt-Yorkley
064f7582cc
Update line_item included taxes
...
Drops use of the `spree_adjustments.included_tax` database field (when summing line item tax), which we are slowly deprecating before eventual removal
2021-03-17 22:23:04 +00:00
Pau Perez
b48677c624
Rearrange tests to make them method-centric
...
If these are unit tests, it's much easier to find a `describe` with the
method under test and putting all the tests exercising that method
together.
It turns out that `#update_payment_state` is by far the method that we
test the most which leads me to think:
a) this class might be doing too many things.
b) other methods might not be that well covered.
2021-03-17 17:05:19 +01:00
Matt-Yorkley
237075dd47
Replace deprecated before_filter syntax
2021-03-17 15:15:26 +00:00
Pau Pérez Fabregat
51f63060a4
Merge pull request #6879 from coopdevs/customer-balance-bulk-coop-report
...
Customer balance bulk coop report
2021-03-17 12:08:44 +01:00
Matt-Yorkley
dcf982c1c3
Fix params mangling issues in SubscriptionsController
2021-03-11 12:06:00 +00:00
Matt-Yorkley
2fdb1861a6
Fix uses of ActionController::TestResponse in specs
...
This class has moved / changed slightly.
2021-03-11 12:06:00 +00:00
Matt-Yorkley
791a47d170
Merge pull request #6858 from Matt-Yorkley/adjustments-shipping-cost
...
[Adjustments] Move shipping adjustment from order to shipment
2021-03-11 12:17:14 +01:00
Pau Perez
5c74668726
Make test rely on container rather than parent
...
This decouples it a bit from the actual HTML markup and makes it a bit
more resilient.
2021-03-08 16:20:07 +01:00
Matt-Yorkley
9deadc8ae1
Simplify order.adjustment_total sum
2021-03-04 14:27:02 +00:00
Matt-Yorkley
00f116f35f
Update Order::Updater to include shipment adjustments
2021-03-04 14:27:01 +00:00
Matt-Yorkley
9ed6ae588f
Update EnterpriseFeeSummary report adjustment scopes
2021-03-04 14:27:01 +00:00
Pau Perez
07481575dc
Remove subs-related performance specs
...
This is a rather naive take on assessing performance, it slows down the
test suite and clutters the output with timings without providing value
in return.
Stems from
https://github.com/openfoodfoundation/openfoodnetwork/pull/6902 .
2021-03-04 10:33:20 +01:00
Pau Perez
b49777062b
Include canceled orders in report when searching
...
It's a code smell to have a boolean control argument.
`Permissions::Order` goes too far and assumes we want to filter out
canceled orders when using report's search params and this is not the
case.
2021-03-03 18:21:44 +01:00
Pau Perez
21fb3f3da6
Extract orders relation as a query object
2021-03-03 18:21:10 +01:00
Pau Perez
b6ce9ca3ca
Test bulk coop report includes canceled orders
...
Without them numbers in the report don't match with /admin/customers and
/account where their order total is considered towards the customer
balance.
2021-03-03 18:19:26 +01:00
Pau Perez
3b7f45516c
Toggle bulk coop report balance calculation
...
This will make users hit the new method that implements the new
calculation we are aiming for, only if they have the feature enabled.
2021-03-03 18:19:26 +01:00
Pau Perez
58ffd00f4a
Extract private method
...
This was initially intended to cache the result of the `#map` and
`#uniq` calls but we're not confident enough and don't want to
scopecreep this. It's still worth to point out that this is what we
need, line items' `unique orders`. Hopefully, next time we find a way to
optimize it.
2021-03-03 18:19:26 +01:00
Pau Perez
49dfccfb51
Unit test #columns method
...
At least, this covers what we're investigating now.
2021-03-03 18:19:26 +01:00
Matt-Yorkley
ec7d1d8133
Introduce tax totals in Order::Updater
2021-02-20 19:03:19 +00:00
Matt-Yorkley
899552cfee
Improve summing of line item totals
2021-02-17 16:15:34 +00:00
Matt-Yorkley
752d8bd5a0
Start refactoring Order::Updater class
2021-02-17 16:15:34 +00:00
Andy Brett
0a7396eb1c
Merge pull request #6713 from andrewpbrett/sca-subs-emails
...
Send emails when subscription payments require SCA auth
2021-02-12 08:23:32 -08:00
Andy Brett
96a746175d
update spec with new behavior
2021-02-11 10:36:50 -08:00
Andy Brett
ef6d1a3afb
refactor flag param to module
2021-02-10 11:06:01 -08:00
Andy Brett
9104ca72a9
refactor to descriptive method authorization_action_required?
2021-02-10 09:36:35 -08:00
Andy Brett
5d2c612839
don't send emails if auth required during checkout
2021-02-03 10:05:51 -08:00
Andy Brett
5160140d88
move SCA Auth module out of Subscriptions since we reuse it in Checkout
2021-02-03 10:05:47 -08:00
Andy Brett
5f84cd9f13
add param to ScaAuthorize call for redirect url
2021-02-03 09:50:42 -08:00
Andy Brett
c0b3fc301e
add email template to notify hub that auth is required
2021-02-03 09:50:28 -08:00
Andy Brett
83d7d49e44
refactor sub confirm job; move email to service
2021-02-02 10:43:37 -08:00
Matt-Yorkley
0e82160b76
Touch the updated_at column when updating records via #update_column
...
#update_column(s) skips callbacks (which is useful), but it doesn't change the updated_at field on the record by default (which we should be doing in these cases).
This change is made in Spree 2.2 here: b367c629ce
2021-01-30 12:49:38 +00:00
Andy Brett
c28b65f772
update subs jobs delivery methods
2021-01-29 21:08:41 -08:00
Andy Brett
3ef4a74b84
Merge pull request #6655 from Matt-Yorkley/summing-amounts
...
Improve performance on summing adjustments and payment
2021-01-21 10:58:10 -08:00
Matt-Yorkley
bc9020a555
Update mail delivery mocks in subscription specs
2021-01-18 12:27:07 +00:00
Andy Brett
ca022e505a
Merge pull request #6684 from Matt-Yorkley/subs-delivery
...
Use deliver_now in Jobs
2021-01-16 09:11:25 -08:00
Matt-Yorkley
b713219690
Use deliver_now in Jobs
2021-01-16 13:19:00 +00:00
Matt-Yorkley
5593da2928
Delete dead code #update_hooks
...
These hooks allow Spree core to be modified by other gems and apps without changing Spree code. We don't use it. #YAGNI
2021-01-15 16:49:45 +00:00