package de.effigenix.infrastructure.stub;

import de.effigenix.domain.production.BatchError;
import de.effigenix.domain.production.BatchNumber;
import de.effigenix.domain.production.BatchNumberGenerator;
import de.effigenix.shared.common.Result;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

import java.time.LocalDate;

@Component
@Profile("no-db")
public class StubBatchNumberGenerator implements BatchNumberGenerator {

    @Override
    public Result<BatchError, BatchNumber> generateNext(LocalDate date) {
        return Result.failure(new BatchError.RepositoryFailure("Stub-Modus: keine Datenbankverbindung"));
    }
}
