<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net9.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <Version>0.0.203</Version>
    <DebugType>None</DebugType>
    <DebugSymbols>False</DebugSymbols>
    <GeneratePackageOnBuild>False</GeneratePackageOnBuild>
    <PackageId>Foursat.CMSMicroservice.Protobuf</PackageId>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Google.Protobuf" Version="3.23.3" />
    <PackageReference Include="Grpc.Core.Api" Version="2.54.0" />
    <PackageReference Include="FluentValidation.DependencyInjectionExtensions" Version="11.2.2" />
    <PackageReference Include="Google.Api.CommonProtos" Version="2.10.0" />
    <PackageReference Include="Grpc.Tools" Version="2.55.1" >
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
  <ItemGroup>
    <Protobuf Include="Protos\public_messages.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\package.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\userorder.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\role.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\userrole.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\otptoken.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\user.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\useraddress.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\userwallet.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\userwallethistory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\usercarts.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\productgalleries.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\factordetails.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\products.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\productimages.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\transactions.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Added missing proto definitions so validators compile -->
    <Protobuf Include="Protos\contract.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\usercontract.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\productcategory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\category.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\City.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\tag.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\producttag.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Network Club Commission System - Phase 6 -->
    <Protobuf Include="Protos\configuration.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\clubmembership.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\networkmembership.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\commission.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- System Health Monitoring -->
    <Protobuf Include="Protos\health.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Manual Payment System -->
    <Protobuf Include="Protos\manualpayment.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Club Discount Shop System - Phase 9 -->
    <Protobuf Include="Protos\discountproduct.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\discountcategory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\discountshoppingcart.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\discountorder.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Geography System (GMS) -->
    <Protobuf Include="Protos\city.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- App Version Tracking System -->
    <Protobuf Include="Protos\appversion.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Inventory Management System -->
    <Protobuf Include="Protos\inventory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- [ARCHIVED] FMS (File Management Service) - سرویس هرگز پیاده‌سازی نشد. فایل‌ها از ImageResolver استفاده می‌کنند -->
    <!-- <Protobuf Include="Protos\fms.proto" ProtoRoot="Protos\" GrpcServices="Client" /> -->
    <!-- Blog & Content Management System -->
    <Protobuf Include="Protos\blogpost.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\blogcategory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\blogpostimage.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\sitepage.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\sitepagesettings.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Image Resolver Service -->
    <Protobuf Include="Protos\imageresolver.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <!-- Admin Report APIs -->
    <Protobuf Include="Protos\paymenttransaction.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\userpackagepurchase.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\clubmembershipcycle.proto" ProtoRoot="Protos\" GrpcServices="Both" />
    <Protobuf Include="Protos\clubmembershipcyclehistory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
  </ItemGroup>

  <Target Name="PushToFoursatNuget" AfterTargets="Pack" Condition="'$(CI)' != 'true'">
    <PropertyGroup>
      <NugetPackagePath>/home/masoud/Apps/project/FourSat/CMS/src/CMSMicroservice.Protobuf/bin/Debug/$(PackageId).$(Version).nupkg</NugetPackagePath>
      <PushCommand>dotnet nuget push "$(NugetPackagePath)" --source foursat-hosted --api-key admin:87zH26nbqT --skip-duplicate --configfile "$(MSBuildThisFileDirectory)../NuGet.config"</PushCommand>
    </PropertyGroup>

    <Exec Command="$(PushCommand)" WorkingDirectory="$(MSBuildThisFileDirectory)" />
  </Target>
</Project>
