package de.effigenix.infrastructure.stub;

import de.effigenix.shared.common.Result;
import de.effigenix.shared.persistence.UnitOfWork;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

import java.util.function.Supplier;

@Component
@Profile("no-db")
public class StubUnitOfWork implements UnitOfWork {

    @Override
    public <E, T> Result<E, T> executeAtomically(Supplier<Result<E, T>> work) {
        return work.get();
    }
}
