Add trips
This commit is contained in:
16
slices/admin/commands/trips/add_post.rb
Normal file
16
slices/admin/commands/trips/add_post.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module Admin
|
||||
module Commands
|
||||
module Trips
|
||||
class AddPost
|
||||
include Dry::Monads[:result]
|
||||
include Deps["repos.post_trip_repo"]
|
||||
|
||||
def call(trip_id:, post_id:)
|
||||
post_trip_repo.create(trip_id: trip_id, post_id: post_id)
|
||||
|
||||
Success()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
16
slices/admin/commands/trips/create.rb
Normal file
16
slices/admin/commands/trips/create.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
module Admin
|
||||
module Commands
|
||||
module Trips
|
||||
class Create
|
||||
include Dry::Monads[:result]
|
||||
include Deps["repos.trip_repo"]
|
||||
|
||||
def call(trip:)
|
||||
trip_repo.create(trip)
|
||||
|
||||
Success()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user