Add the jump type in the tunnel flight
This commit is contained in:
@@ -19,7 +19,7 @@ namespace skydiveLogs_api.DomainBusiness.Interfaces
|
||||
|
||||
IEnumerable<Statistic> GetTunnelFlightGroupByMonth(string beginDate, string endDate);
|
||||
|
||||
void AddNewFlight(int tunnelId, TunnelFlight newFlight);
|
||||
void AddNewFlight(int tunnelId, int jumpTypeId, TunnelFlight newFlight);
|
||||
|
||||
void DeleteTunnelFlightById(int id);
|
||||
|
||||
|
||||
@@ -11,11 +11,13 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public TunnelFlightService(ITunnelFlightRepository tunnelFlightRepository,
|
||||
public TunnelFlightService(IJumpTypeService jumpTypeService,
|
||||
ITunnelFlightRepository tunnelFlightRepository,
|
||||
IDropZoneService dropZoneService,
|
||||
IIdentityService identityService)
|
||||
{
|
||||
_dropZoneService = dropZoneService;
|
||||
_jumpTypeService = jumpTypeService;
|
||||
_identityService = identityService;
|
||||
_tunnelFlightRepository = tunnelFlightRepository;
|
||||
}
|
||||
@@ -73,8 +75,8 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
|
||||
return _tunnelFlightRepository.GetBetweenDate(_identityService.ConnectedUser, convertedBeginDate, convertedEndDate);
|
||||
}
|
||||
|
||||
public void AddNewFlight(int tunnelId, TunnelFlight newFlight)
|
||||
|
||||
public void AddNewFlight(int tunnelId, int jumpTypeId, TunnelFlight newFlight)
|
||||
{
|
||||
var tmp = _dropZoneService.GetDzById(tunnelId);
|
||||
var selectedTunnel = new Tunnel
|
||||
@@ -88,7 +90,11 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
Longitude = tmp.Longitude
|
||||
};
|
||||
|
||||
var selectedJumpType = _jumpTypeService.GetJumpTypeById(jumpTypeId);
|
||||
|
||||
|
||||
newFlight.Tunnel = selectedTunnel;
|
||||
newFlight.JumpType = selectedJumpType;
|
||||
_tunnelFlightRepository.Add(newFlight);
|
||||
}
|
||||
|
||||
@@ -112,6 +118,7 @@ namespace skydiveLogs_api.DomainBusiness
|
||||
#region Private Fields
|
||||
|
||||
private readonly IDropZoneService _dropZoneService;
|
||||
private readonly IJumpTypeService _jumpTypeService;
|
||||
private readonly ITunnelFlightRepository _tunnelFlightRepository;
|
||||
private readonly IIdentityService _identityService;
|
||||
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RootNamespace>skydiveLogs_api.DomainBusiness</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<RootNamespace>skydiveLogs_api.DomainBusiness</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.Caching" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skydiveLogs-api.DomainService\skydiveLogs-api.DomainService.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Domain\skydiveLogs-api.Domain.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Infrastructure\skydiveLogs-api.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.Caching" Version="7.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\skydiveLogs-api.DomainService\skydiveLogs-api.DomainService.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Domain\skydiveLogs-api.Domain.csproj" />
|
||||
<ProjectReference Include="..\skydiveLogs-api.Infrastructure\skydiveLogs-api.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user