Skip to content

Commit d0d7f82

Browse files
committed
Remove debug leftovers.
1 parent ba152c5 commit d0d7f82

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

rails_application/app/processes/processes/reservation_process.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ def apply(event)
4949
def reserve_stock
5050
unavailable_products = []
5151
reserved_products = []
52-
puts "[DEBUG] reserve_stock - state.order_lines: #{state.order_lines.inspect}"
53-
puts "[DEBUG] reserve_stock - state.order_lines.class: #{state.order_lines.class}"
5452
state.order_lines.each do |product_id, quantity|
55-
puts "[DEBUG] Processing product_id: #{product_id}, quantity: #{quantity}"
5653
command_bus.(Inventory::Reserve.new(product_id: product_id, quantity: quantity))
5754
reserved_products << product_id
5855
rescue Inventory::InventoryEntry::InventoryNotAvailable

rails_application/lib/transformations/refund_to_return_event_mapper.rb

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,23 @@ def initialize(class_map)
55
end
66

77
def dump(record)
8-
if ENV['DEBUG_TRANSFORMATIONS'] == 'true'
9-
puts "[TRANSFORM] dump() called with event_type: #{record.event_type}"
10-
puts "[TRANSFORM] record class: #{record.class.name}"
11-
puts "[TRANSFORM] record timestamp: #{record.timestamp.inspect}"
12-
puts "[TRANSFORM] record valid_at: #{record.valid_at.inspect}"
13-
end
148
record
159
end
1610

1711
def load(record)
18-
if ENV['DEBUG_TRANSFORMATIONS'] == 'true'
19-
puts "[TRANSFORM] load() called with event_type: #{record.event_type}"
20-
puts "[TRANSFORM] record class: #{record.class.name}"
21-
puts "[TRANSFORM] record timestamp: #{record.timestamp.inspect}"
22-
puts "[TRANSFORM] record valid_at: #{record.valid_at.inspect}"
23-
end
24-
2512
old_class_name = record.event_type
2613
new_class_name = @class_map.fetch(old_class_name, old_class_name)
2714

2815
if old_class_name != new_class_name
29-
if ENV['DEBUG_TRANSFORMATIONS'] == 'true'
30-
puts "[TRANSFORM] Transforming: #{old_class_name} -> #{new_class_name}"
31-
end
32-
3316
transformed_data = transform_payload(record.data, old_class_name)
34-
new_record = record.class.new(
17+
record.class.new(
3518
event_id: record.event_id,
3619
event_type: new_class_name,
3720
data: transformed_data,
3821
metadata: record.metadata,
3922
timestamp: record.timestamp || Time.now.utc,
4023
valid_at: record.valid_at || Time.now.utc
4124
)
42-
43-
if ENV['DEBUG_TRANSFORMATIONS'] == 'true'
44-
puts "[TRANSFORM] Created new record with timestamp: #{new_record.timestamp.inspect}"
45-
end
46-
47-
new_record
4825
else
4926
record
5027
end

0 commit comments

Comments
 (0)