Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
norbertnytko committed Oct 6, 2023
1 parent 326b2b6 commit 36b97d6
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 58 deletions.
13 changes: 0 additions & 13 deletions hanami_application/app/read_models/configuration.rb

This file was deleted.

2 changes: 2 additions & 0 deletions hanami_application/app/repositories/orders.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Ecommerce
module Repositories
class Orders < ROM::Repository[:orders]
include Deps[container: "persistence.rom"]

commands :create

def by_uuid(uuid)
Expand Down
6 changes: 2 additions & 4 deletions hanami_application/config/providers/ecommerce.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
number_generator = -> { Ordering::NumberGenerator.new }
payment_gateway = -> { Payments::FakeGateway.new }

Ecommerce::Configuration.new(
config = Ecommerce::Configuration.new(
event_store: event_store,
command_bus: command_bus,
number_generator: number_generator,
Expand All @@ -20,8 +20,6 @@
]
).call(event_store, command_bus)

event_store.subscribe(
target["event_handlers.orders.submit"], to: [Ordering::OrderSubmitted]
)
register "config", config
end
end
4 changes: 4 additions & 0 deletions hanami_application/config/providers/event_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@

register "repository", repository
register "client", client

client.subscribe(
target["event_handlers.orders.submit"], to: [Ordering::OrderSubmitted]
)
end
end
9 changes: 0 additions & 9 deletions hanami_application/config/providers/infra.rb

This file was deleted.

5 changes: 0 additions & 5 deletions hanami_application/config/providers/repositories.rb

This file was deleted.

2 changes: 0 additions & 2 deletions hanami_application/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

module Ecommerce
class Routes < Hanami::Routes
root { "Hello from Hanami" }

post "/orders", to: "orders.create"
end
end
11 changes: 0 additions & 11 deletions hanami_application/lib/ecommerce/types.rb

This file was deleted.

11 changes: 0 additions & 11 deletions hanami_application/spec/requests/root_spec.rb

This file was deleted.

2 changes: 0 additions & 2 deletions hanami_application/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@

require_relative "support/rspec"
require_relative "support/requests"

Hanami.app.boot
2 changes: 1 addition & 1 deletion hanami_application/spec/support/requests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require "rack/test"

RSpec.shared_context "Hanami app" do
let(:app) { Hanami.app }
let(:app) { Hanami.app.boot }
end

RSpec.configure do |config|
Expand Down

0 comments on commit 36b97d6

Please sign in to comment.