1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

(feat) save operator id in order activity after paid

This commit is contained in:
Du Peng 2022-10-14 10:12:28 +02:00
parent 5a8aa747e5
commit 6dea7ba6b3

View File

@ -31,7 +31,7 @@ module Payments::PaymentConcern
if payment_id && payment_type
order.payment_gateway_object = PaymentGatewayObject.new(gateway_object_id: payment_id, gateway_object_type: payment_type)
end
order.order_activities.create(activity_type: 'paid')
order.order_activities.create(activity_type: 'paid', operator_profile_id: order.operator_profile_id)
order.order_items.each do |item|
ProductService.update_stock(item.orderable,
[{ stock_type: 'external', reason: 'sold', quantity: item.quantity, order_item_id: item.id }]).save