Browse Source

Let Sinnk handle either a place or a region based on payload

feature/region_center
Bèr Kessels 4 months ago
parent
commit
a5cec23acb
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      bin/sink

+ 5
- 1
bin/sink View File

@@ -23,7 +23,11 @@ class EventSink

def object_parsed(obj)
log(Logger::DEBUG, '-- parsed object')
command = Hours::AddPlaceCommand.build(obj)
command = if obj.fetch(:properties, {})[:place]
Hours::AddRegionCommand.build(obj)
else
Hours::AddPlaceCommand.build(obj)
end
Hours::CommandHandler.new.handle(command)
rescue Hours::DuplicateError => e
log(Logger::INFO, e.message)

Loading…
Cancel
Save