phronCare/phronCare.UIBlazor/Services/Stock/MockStockScanService.cs
Leandro Hernan Rojas 1c4c241266
Some checks failed
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Failing after 15m47s
Add StockItemModal v1
2025-08-18 00:47:37 -03:00

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;
}
}