Some checks failed
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Failing after 15m47s
31 lines
898 B
C#
31 lines
898 B
C#
using Domain.Dtos.Stock;
|
|
|
|
public class MockStockScanService : IStockScanService
|
|
{
|
|
public async Task<StockItemSelectionDto?> ParseAndMatchAsync(string rawInput, int locationId)
|
|
{
|
|
// Simula lógica de parseo de código escaneado
|
|
await Task.Delay(100); // simula delay
|
|
|
|
if (string.IsNullOrWhiteSpace(rawInput))
|
|
return null;
|
|
|
|
// Simulación: si empieza con 0108... devolvemos un producto de prueba
|
|
if (rawInput.StartsWith("0108"))
|
|
{
|
|
return new StockItemSelectionDto
|
|
{
|
|
StockItemId = 999,
|
|
ProductId = 88,
|
|
ProductName = "Tornillo 6x30 mm",
|
|
Batch = "LOTE-MOCK",
|
|
Expiration = DateTime.Today.AddMonths(10),
|
|
Quantity = 10,
|
|
LocationId = locationId
|
|
};
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|