State of OMG-LEGION prior to merge

This commit is contained in:
2022-10-30 10:54:20 -04:00
parent 9924880b51
commit 48844127d7
45 changed files with 1350 additions and 868 deletions

View File

@@ -10,7 +10,6 @@ using System.Threading.Tasks;
namespace PartSource.Services
{
[Obsolete]
public class PartService
{
private readonly PartSourceContext _context;
@@ -20,31 +19,21 @@ namespace PartSource.Services
_context = context;
}
public Part GetPart(string partNumber, string lineCode)
{
return _context.Parts.FirstOrDefault(p => p.PartNumber == partNumber && p.Manufacturer.LineCode == lineCode);
}
public Part GetPart(int sku)
{
return _context.Parts.FirstOrDefault(p => p.Sku == sku);
}
public async Task<PartsAvailability> GetInventory(int sku, int storeNumber)
{
return await _context.PartAvailabilities.FirstOrDefaultAsync(s => s.Store == storeNumber && s.SKU == sku);
}
public IList<Fitment> GetFitments(FitmentSearchDto fitmentSearchDto)
public async Task<Part> GetPartBySku(string sku)
{
return null;
return await _context.Parts.SingleOrDefaultAsync(p => p.Sku == sku);
}
//return _context.Fitments.Where(f =>
// f.ManufacturerCode == fitmentSearchDto.ManufacturerCode &&
// f.PartNumber == fitmentSearchDto.PartNumber &&
// f.BaseVehicleId == fitmentSearchDto.BaseVehicleId &&
// f.EngineConfigId == fitmentSearchDto.EngineConfigId
//).ToList();
public async Task<IList<DcfMapping>> GetDcfMapping(string partsourceLineCode)
{
return await _context.DcfMappings
.Where(dcf => dcf.LineCode == partsourceLineCode)
.ToListAsync();
}
}
}