Whatever this is

This commit is contained in:
2025-02-12 18:12:19 -05:00
parent aed30707be
commit cc2cbd09e1
20 changed files with 496 additions and 434 deletions

View File

@@ -12,26 +12,28 @@ namespace PartSource.Services
{
public class PartService
{
private readonly PartSourceContext _context;
private readonly PartSourceContext _partSourceContext;
private readonly FitmentContext _fitmentContext;
public PartService(PartSourceContext context)
public PartService(PartSourceContext partSourceContext, FitmentContext fitmentContext)
{
_context = context;
_partSourceContext = partSourceContext;
_fitmentContext = fitmentContext;
}
public async Task<PartsAvailability> GetInventory(int sku, int storeNumber)
{
return await _context.PartAvailabilities.FirstOrDefaultAsync(s => s.Store == storeNumber && s.SKU == sku);
return await _partSourceContext.PartAvailabilities.FirstOrDefaultAsync(s => s.Store == storeNumber && s.SKU == sku);
}
public async Task<Part> GetPartBySku(string sku)
{
return await _context.Parts.SingleOrDefaultAsync(p => p.Sku == sku);
return await _fitmentContext.Parts.SingleOrDefaultAsync(p => p.Sku == sku);
}
public async Task<IList<DcfMapping>> GetDcfMapping(string partsourceLineCode)
{
return await _context.DcfMappings
return await _fitmentContext.DcfMappings
.Where(dcf => dcf.LineCode == partsourceLineCode)
.ToListAsync();
}