Comments (5)
We have this file https://github.com/RailsEventStore/ecommerce/blob/master/ecommerce/crm/lib/crm.rb which registers the command handler for a command. Is it missing in your code?
from ecommerce.
But i required that too,
require "infra"
require_relative "crm/commands/promote_customer_to_vip"
require_relative "crm/commands/register_customer"
require_relative "crm/commands/assign_customer_to_order"
require_relative "crm/events/customer_promoted_to_vip"
require_relative "crm/events/customer_registered"
require_relative "crm/events/customer_assigned_to_order.rb"
require_relative "crm/customer_service"
require_relative "crm/customer"
require_relative "crm/order_service"
require_relative "crm/order"
module Crm
class Configuration
def call(event_store, command_bus)
command_bus.register(RegisterCustomer, OnRegistration.new(event_store))
end
end
end
Is there any requirement needed for command handler registration
from ecommerce.
Can you show the code where you call this Configuration class?
from ecommerce.
lib/configuration.rb
frozen_string_literal: true
require_relative '../../bloggie/configuration'
require_relative '../../infra/lib/infra'
require_relative '../app/read_models/Topics/register_topic'
require_relative '../app/read_models/Topics/update_topic'
class Configuration
def call(event_store, command_bus)
enable_res_infra_event_linking(event_store)
enable_topic_read_model(event_store)
Bloggie::Configuration.new.call(event_store, command_bus)
end
private
def enable_res_infra_event_linking(event_store)
[
RailsEventStore::LinkByEventType.new,
RailsEventStore::LinkByCorrelationId.new,
RailsEventStore::LinkByCausationId.new
].each { |h| event_store.subscribe_to_all_events(h) }
end
def enable_topic_read_model(event_store)
Topics::Configuration.new.call(event_store)
end
end
bloggie/configuration.rb
frozen_string_literal: true
require_relative 'TopicSupport/lib/topic_support'
require_relative '../rails_application/app/read_models/Topics/register_topic'
require_relative '../rails_application/app/read_models/Topics/update_topic'
module Bloggie
class Configuration
def initialize
super
end
def call(event_store, command_bus)
configure_bounded_contexts
end
def configure_bounded_contexts
event_store = Rails.configuration.event_store
command_bus = Rails.configuration.command_bus
[TopicSupport::Configuration.new].each { |c| c.call(event_store, command_bus) }
end
end
end
i made some mistakes in call then i fixed now its working,
Thank you @andrzejkrzywda
from ecommerce.
Cool, I'm glad it works now.
Feel free to ask in case of other questions.
from ecommerce.
Related Issues (20)
- Decouple Customers read model from ClientOrders in UpdatePaidOrdersSummary HOT 1
- Make ReservationProcess asynchronous
- Consider if invariant in Crm::Order is really needed
- Review Ordering::Order possible state transitions and/or update docs
- Move Omnibus directive related stuff from ClientOrders to PublicOffer read model HOT 2
- Allow users to set password
- create ClientAuthentication read model
- Generating an invoice doesn't work
- Decouple domain modules from sidekiq HOT 1
- Setting future price to 0 crashes the app
- Reset discount - link doesn't work
- Submitting order crashes sometimes HOT 4
- After reset discount the page doesn't refresh HOT 1
- After update discount the page doesn't refresh
- Setting discount on empty order crashes HOT 1
- Integration test for adding unavailable item to order (as client)
- Rename Pricing::Order to Pricing::Offer HOT 1
- Consider creating Sales BC which contains Pricing and maybe others HOT 1
- Log out when detecting unexisting client_id in cookies HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecommerce.