<Project Sdk="Microsoft.NET.Sdk.Web">

    <PropertyGroup>
        <TargetFramework>net10.0</TargetFramework>
        <Nullable>enable</Nullable>
        <ImplicitUsings>enable</ImplicitUsings>
        <RootNamespace>UniVerse.Api</RootNamespace>
        <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
        <AllowMissingPrunePackageData>true</AllowMissingPrunePackageData>
        <GenerateDocumentationFile>true</GenerateDocumentationFile>
        <OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild>
        <OpenApiDocumentsDirectory>$(BaseIntermediateOutputPath)openapi</OpenApiDocumentsDirectory>
        <OpenApiGenerateDocumentsOptions>--file-name openapi</OpenApiGenerateDocumentsOptions>
        <RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
        <!-- Suppress warnings for public members without XML docs -->
        <NoWarn>$(NoWarn);1591</NoWarn>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.8" />
        <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.8">
          <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
          <PrivateAssets>all</PrivateAssets>
        </PackageReference>
        <PackageReference Include="Microsoft.Identity.Web" Version="4.14.2" />
        <PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="4.9.0" />
        <PackageReference Include="Quartz.Dashboard" Version="3.18.1" />
        <PackageReference Include="Swashbuckle.AspNetCore" Version="10.1.7" />
        <PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
        <PackageReference Include="Serilog.Sinks.Console" Version="6.1.1" />
        <PackageReference Include="FluentValidation.AspNetCore" Version="11.3.1" />
        <PackageReference Include="Quartz.Extensions.Hosting" Version="3.18.1" />
        <PackageReference Include="prometheus-net.AspNetCore" Version="8.2.1" />
    </ItemGroup>

    <ItemGroup>
        <ProjectReference Include="..\UniVerse.Application\UniVerse.Application.csproj" />
        <ProjectReference Include="..\UniVerse.Infrastructure\UniVerse.Infrastructure.csproj" />
        <ProjectReference Include="..\UniVerse.ServiceDefaults\UniVerse.ServiceDefaults.csproj" />
    </ItemGroup>

    <ItemGroup>
      <Content Include="..\.dockerignore">
        <Link>.dockerignore</Link>
      </Content>
    </ItemGroup>

    <Target
        Name="CopyGeneratedOpenApiDocument"
        AfterTargets="Build"
        Condition="Exists('$(OpenApiDocumentsDirectory)/openapi.json')">
        <Copy
            SourceFiles="$(OpenApiDocumentsDirectory)/openapi.json"
            DestinationFiles="$(MSBuildProjectDirectory)/openapi.json"
            SkipUnchangedFiles="true" />
    </Target>

</Project>
