From c2914c6669e0c60f8d763ba5d27e0d3731022190 Mon Sep 17 00:00:00 2001 From: Genar Trias Ortiz Date: Tue, 3 Sep 2024 13:31:20 +0200 Subject: [PATCH] remove repository boilerplate and outcome usages --- lib/public/repositories/base.rb | 25 ------------------------- lib/public/repositories/outcome.rb | 3 --- 2 files changed, 28 deletions(-) diff --git a/lib/public/repositories/base.rb b/lib/public/repositories/base.rb index 2dbc80d..c6dcaf8 100644 --- a/lib/public/repositories/base.rb +++ b/lib/public/repositories/base.rb @@ -38,31 +38,6 @@ def read(dto:, context:) raise_error(__method__) end - sig { overridable.params(dto: T.untyped).returns(Outcome[Entity]) } - def create(dto:) - raise_error(__method__) - end - - sig { overridable.params(dto: T.untyped).returns(Outcome[Entity]) } - def update(dto:) - raise_error(__method__) - end - - sig { overridable.params(dto: T.untyped).returns(Outcome[Entity]) } - def delete(dto:) - raise_error(__method__) - end - - sig { params(dto: T.untyped).returns(Outcome[Entity]) } - def find(dto:) - read(dto: dto).entities.map do |array| - entity = array.first - return Outcome.missing_resource if entity.nil? - - entity - end - end - sig { overridable.params(entity: Entity, tags: T::Set[T.untyped]).returns(T::Hash[Symbol, T.untyped]) } def serialize(entity:, tags: []) serializer.serialize(entity: entity, tags: tags) diff --git a/lib/public/repositories/outcome.rb b/lib/public/repositories/outcome.rb index 900c1e2..e54adc0 100644 --- a/lib/public/repositories/outcome.rb +++ b/lib/public/repositories/outcome.rb @@ -10,9 +10,6 @@ module Outcome Elem = type_member(:out) interface! - - sig { abstract.returns(Elem) } - def unwrap!; end end end end