Skip to content

Commit 36b97d6

Browse files
committed
Cleanup
1 parent 326b2b6 commit 36b97d6

File tree

11 files changed

+9
-58
lines changed

11 files changed

+9
-58
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/lib/ecommerce/types.rb

-11
This file was deleted.

hanami_application/spec/requests/root_spec.rb

-11
This file was deleted.

hanami_application/spec/spec_helper.rb

-2
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@
88

99
require_relative "support/rspec"
1010
require_relative "support/requests"
11-
12-
Hanami.app.boot

hanami_application/spec/support/requests.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "rack/test"
44

55
RSpec.shared_context "Hanami app" do
6-
let(:app) { Hanami.app }
6+
let(:app) { Hanami.app.boot }
77
end
88

99
RSpec.configure do |config|

0 commit comments

Comments
 (0)