Skip to content

Commit 85052db

Browse files
committed
Cleanup
1 parent 326b2b6 commit 85052db

File tree

8 files changed

+8
-44
lines changed

8 files changed

+8
-44
lines changed

hanami_application/app/read_models/configuration.rb

-13
This file was deleted.

hanami_application/app/repositories/orders.rb

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module Ecommerce
22
module Repositories
33
class Orders < ROM::Repository[:orders]
4+
include Deps[container: "persistence.rom"]
5+
46
commands :create
57

68
def by_uuid(uuid)

hanami_application/config/providers/ecommerce.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
number_generator = -> { Ordering::NumberGenerator.new }
1010
payment_gateway = -> { Payments::FakeGateway.new }
1111

12-
Ecommerce::Configuration.new(
12+
config = Ecommerce::Configuration.new(
1313
event_store: event_store,
1414
command_bus: command_bus,
1515
number_generator: number_generator,
@@ -20,8 +20,6 @@
2020
]
2121
).call(event_store, command_bus)
2222

23-
event_store.subscribe(
24-
target["event_handlers.orders.submit"], to: [Ordering::OrderSubmitted]
25-
)
23+
register "config", config
2624
end
2725
end

hanami_application/config/providers/event_store.rb

+4
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,9 @@
1919

2020
register "repository", repository
2121
register "client", client
22+
23+
client.subscribe(
24+
target["event_handlers.orders.submit"], to: [Ordering::OrderSubmitted]
25+
)
2226
end
2327
end

hanami_application/config/providers/infra.rb

-9
This file was deleted.

hanami_application/config/providers/repositories.rb

-5
This file was deleted.

hanami_application/config/routes.rb

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
module Ecommerce
44
class Routes < Hanami::Routes
5-
root { "Hello from Hanami" }
6-
75
post "/orders", to: "orders.create"
86
end
97
end

hanami_application/spec/requests/root_spec.rb

-11
This file was deleted.

0 commit comments

Comments
 (0)