-
Notifications
You must be signed in to change notification settings - Fork 24
Roadmap
result = Operation.(params: params, **)
Both model
and contract
are not included per default.
Operation
supports dependency injection and auto-injection.
result = Operation.(params: params, "policy.create" => Comment::Policy::Create)
Operation
supports auto_inject.
class Create < Trailblazer::Operation
include AutoInject[:user_repository]
end
The operation in Trailblazer 1.2 returns a Result
object that is compatible with dry-matcher.
result = Operation.(params: params, **)
res = matcher.(result) do |m|
m.success do |v|
"Yay: #{v}"
end
m.failure :not_found do |v|
"Oops, not found: #{v}"
end
m.failure do |v|
"Boo: #{v}"
end
end
Standard Case
s are provided.
Endpoint
s can be hooked to routes in the infrastructure framework (e.g. Rails or Hanami-router). The provide generic logic such as
- HTTP status/redirect/bodys for document APIs (similar to responders work in Rails).
- Serialize the outbound document using a configured representer (or serializer).
Goal of endpoints is to have generic handling code that is neither coupled to Trailblazer::Operation
nor to a specific infrastructure framework.
Operation
integrates dry-transaction with a nice slim API for transactions in the operation.
Make it possible to separate deserialization and validation. Make deserializer a separate step that builds the virtual object graph, then run arbitrary validations on it.