Skip to content

Move application specific RES configuration to rails_app #461

@andrzejkrzywda

Description

@andrzejkrzywda

require_relative "../../../rails_application/lib/transformations/refund_to_return_event_mapper" rescue nil
begin
mapper = RubyEventStore::Mappers::PipelineMapper.new(
RubyEventStore::Mappers::Pipeline.new(
preserve_types,
Transformations::RefundToReturnEventMapper.new(
'Ordering::DraftRefundCreated' => 'Ordering::DraftReturnCreated',
'Ordering::ItemAddedToRefund' => 'Ordering::ItemAddedToReturn',
'Ordering::ItemRemovedFromRefund' => 'Ordering::ItemRemovedFromReturn'
),
RubyEventStore::Mappers::Transformation::SymbolizeMetadataKeys.new,
to_domain_event: RubyEventStore::Mappers::Transformation::DomainEvent.new
)
)
client = RailsEventStore::JSONClient.new(mapper: mapper)
rescue => e
puts "Mapper creation failed: #{e.message}"
client = RailsEventStore::JSONClient.new
end

now it's part of infra which is supposed to be independent of specific apps

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions