mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-19 13:54:25 +01:00
(bug) unable to update Store Order sub type in statistics
This commit is contained in:
parent
6e014ddfe6
commit
bd6e4fe0ab
@ -1,6 +1,8 @@
|
||||
# Changelog Fab-manager
|
||||
|
||||
- Fix a bug: unable to show project step image in markdown file
|
||||
- Fix a bug: unable to update Store Order sub type in statistics
|
||||
- [TODO DEPLOY] `rails fablab:maintenance:regenerate_statistics[2014,1]`
|
||||
|
||||
## v6.0.8 2023 July 03
|
||||
|
||||
|
@ -45,7 +45,13 @@ class Orders::OrderService
|
||||
|
||||
# update in elasticsearch (statistics)
|
||||
stat_order = Stats::Order.search(query: { term: { orderId: order.id } })
|
||||
stat_order.map { |s| s.update(state: state) }
|
||||
sub_type = if state.in?(%w[paid in_progress ready delivered])
|
||||
'paid-processed'
|
||||
elsif state.in?(%w[payment_failed refunded canceled])
|
||||
'aborted'
|
||||
end
|
||||
|
||||
stat_order.map { |s| s.update(subType: sub_type, state: state) } if sub_type.present?
|
||||
|
||||
order
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user