This commit is contained in:
2023-09-13 09:41:33 -04:00
parent 547c5c935c
commit 6a81fe4f87
9 changed files with 37 additions and 105 deletions

View File

@@ -19,12 +19,29 @@ namespace PartSource.Api.Controllers
private readonly NexpartService _nexpartService;
private readonly PartService _partService;
private readonly VehicleService _vehicleService;
private readonly FitmentService _fitmentService;
public PartsController(NexpartService nexpartService, PartService partService, VehicleService vehicleService)
public PartsController(NexpartService nexpartService, PartService partService, VehicleService vehicleService, FitmentService fitmentService)
{
_nexpartService = nexpartService;
_partService = partService;
_vehicleService = vehicleService;
_fitmentService = fitmentService;
}
[HttpGet]
[Route("fitment")]
[Route("fitmentnote")]
public async Task<ActionResult> GetFitment([FromQuery] string sku, [FromQuery] int vehicleId)
{
VehicleFitmentDto vehicleFitment = await _fitmentService.GetFitmentNotes(sku, vehicleId);
if (vehicleFitment == null)
{
return NotFound();
}
return Ok(vehicleFitment);
}
[HttpGet]
@@ -54,10 +71,10 @@ namespace PartSource.Api.Controllers
IList<DcfMapping> mappings = await _partService.GetDcfMapping(part.LineCode);
Item[] items = mappings.Select(m => new Item
{
PartNumber = part.PartNumber,
MfrCode = m.WhiCode
})
{
PartNumber = part.PartNumber,
MfrCode = m.WhiCode
})
.ToArray();
SmartPageDataSearch smartPageDataSearch = new SmartPageDataSearch
@@ -76,9 +93,9 @@ namespace PartSource.Api.Controllers
}
PartType[] partTypes = smartPageResponse.ResponseBody.Item.Select(i => new PartType
{
Id = i.Part.PartType.Id
})
{
Id = i.Part.PartType.Id
})
.ToArray();
ApplicationSearch applicationSearch = new ApplicationSearch

View File

@@ -35,6 +35,7 @@
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Ratermania.Shopify" Version="6.16.11" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.1" />
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" Version="6.3.1" />
</ItemGroup>

View File

@@ -50,8 +50,9 @@ namespace PartSource.Api
});
services.AddAutoMapper(typeof(PartSourceProfile));
services.AddTransient<PartService>();
services.AddTransient<FitmentService>();
services.AddTransient<PartService>();
services.AddTransient<NexpartService>();
services.AddTransient<SecurityService>();
services.AddTransient<VehicleService>();