# In-process events between application components: the use cases
# publish what the course recorded; billing and the notifier react. Two
# dispatchers, synchronous and queued, take the same subscriptions.
add_library(arch_events_core STATIC
  events/event.cpp events/queued_dispatcher.cpp billing/billing.cpp notify/notifier.cpp
  app/enrollment.cpp app/wiring.cpp)
target_include_directories(arch_events_core PUBLIC
  ${CMAKE_CURRENT_SOURCE_DIR}/events ${CMAKE_CURRENT_SOURCE_DIR}/billing
  ${CMAKE_CURRENT_SOURCE_DIR}/notify ${CMAKE_CURRENT_SOURCE_DIR}/app)
target_link_libraries(arch_events_core PUBLIC arch_agg_domain)

lld_add_example(arch_enrollment_events SOURCES main.cpp EXPECTED_OUTPUT expected_output.txt)
target_link_libraries(arch_enrollment_events PRIVATE arch_events_core)

lld_add_test(arch_events_sync_tests SOURCES tests/test_sync.cpp)
target_link_libraries(arch_events_sync_tests PRIVATE arch_events_core)
lld_add_test(arch_events_queued_tests SOURCES tests/test_queued.cpp)
target_link_libraries(arch_events_queued_tests PRIVATE arch_events_core)
