Skip to content

Commit 5405d91

Browse files
committed
There's no need for these definitions to be public.
1 parent 0cbac67 commit 5405d91

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

ecommerce/processes/lib/processes/determine_vat_rates_on_order_placed.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def placed? = offer_accepted && order_placed
1515
Fulfillment::OrderRegistered
1616
)
1717

18+
private
19+
1820
def act
1921
determine_vat_rates if state.placed?
2022
end
@@ -40,8 +42,6 @@ def apply(event)
4042
end
4143
end
4244

43-
private
44-
4545
def fetch_id(event)
4646
event.data.fetch(:order_id)
4747
end

ecommerce/processes/lib/processes/order_item_invoicing_process.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ def can_create_invoice_item?
1818
Taxes::VatRateDetermined
1919
)
2020

21+
private
22+
2123
def act
2224
return unless state.can_create_invoice_item?
2325

@@ -51,8 +53,6 @@ def apply(event)
5153
end
5254
end
5355

54-
private
55-
5656
def fetch_id(event)
5757
"#{event.data.fetch(:order_id)}$#{event.data.fetch(:product_id)}"
5858
end

ecommerce/processes/lib/processes/release_payment_process.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ def release?
2121
Fulfillment::OrderConfirmed
2222
)
2323

24+
private
25+
2426
def act
2527
release_payment if state.release?
2628
end
@@ -43,8 +45,6 @@ def apply(event)
4345
end
4446
end
4547

46-
private
47-
4848
def release_payment
4949
command_bus.call(Payments::ReleasePayment.new(order_id: state.order_id))
5050
end

ecommerce/processes/lib/processes/reservation_process.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ def reserved_product_ids = order_lines.keys
1616
Fulfillment::OrderConfirmed
1717
)
1818

19+
private
20+
1921
def act
2022
case state
2123
in order: :accepted
@@ -48,16 +50,6 @@ def apply(event)
4850
end
4951
end
5052

51-
class SomeInventoryNotAvailable < StandardError
52-
attr_reader :unavailable_products
53-
54-
def initialize(unavailable_products)
55-
@unavailable_products = unavailable_products
56-
end
57-
end
58-
59-
private
60-
6153
def reserve_stock
6254
unavailable_products = []
6355
reserved_products = []
@@ -99,5 +91,13 @@ def reject_order(unavailable_product_ids)
9991
def fetch_id(event)
10092
event.data.fetch(:order_id)
10193
end
94+
95+
class SomeInventoryNotAvailable < StandardError
96+
attr_reader :unavailable_products
97+
98+
def initialize(unavailable_products)
99+
@unavailable_products = unavailable_products
100+
end
101+
end
102102
end
103103
end

0 commit comments

Comments
 (0)