refactor: archive 12 dead gRPC RPCs with [ARCHIVED] markers
Archived RPCs (code preserved, marked obsolete): - fms.proto: excluded from csproj (CreateNewFileInfo, DeleteFileInfo) - UserOrderService: GetOrdersByDateRange, CreateNewOrderForCustomer, SubmitOrderForCustomer - ConfigurationService: DeactivateConfiguration, GetConfigurationHistory - CityService: UpdateCity, DeleteCity - HealthService: GetServiceHealth - CategoryService: GetCategoryByIdForCustomer - inventory.proto: BulkAdjustStock (no implementation existed) All archived RPCs wrapped in #region [ARCHIVED] with [Obsolete] attributes. No code deleted — archive only. Build passes with 0 errors.
This commit is contained in:
@@ -64,8 +64,8 @@
|
||||
<Protobuf Include="Protos\appversion.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<!-- Inventory Management System -->
|
||||
<Protobuf Include="Protos\inventory.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||
<!-- FMS (File Management Service) - gRPC Client only -->
|
||||
<Protobuf Include="Protos\fms.proto" ProtoRoot="Protos\" GrpcServices="Client" />
|
||||
<!-- [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" />
|
||||
|
||||
@@ -98,8 +98,11 @@ public class CategoryService : CategoryContract.CategoryContractBase
|
||||
return response;
|
||||
}
|
||||
|
||||
#region [ARCHIVED] GetCategoryByIdForCustomer — تکراری: GetCategory (admin) + GetAllCategoriesForCustomer کافی است
|
||||
[Obsolete("ARCHIVED: Use GetCategory or GetAllCategoriesForCustomer instead")]
|
||||
public override async Task<GetCategoryByIdForCustomerResponse> GetCategoryByIdForCustomer(GetCategoryByIdForCustomerRequest request, ServerCallContext context)
|
||||
{
|
||||
// [ARCHIVED] duplicate — GetCategory + GetAllCategoriesForCustomer cover this
|
||||
var query = new GetCategoryQuery { Id = request.Id };
|
||||
var result = await _sender.Send(query, context.CancellationToken);
|
||||
|
||||
@@ -118,4 +121,5 @@ public class CategoryService : CategoryContract.CategoryContractBase
|
||||
}
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -177,6 +177,8 @@ public class CityService : CityContract.CityContractBase
|
||||
};
|
||||
}
|
||||
|
||||
#region [ARCHIVED] UpdateCity & DeleteCity — شهرها seed data هستند، ویرایش/حذف دستی باعث خرابی آدرسها میشود
|
||||
[Obsolete("ARCHIVED: Cities are seed data — manual edit/delete breaks user addresses")]
|
||||
public override async Task<Empty> UpdateCity(
|
||||
UpdateCityRequest request, ServerCallContext context)
|
||||
{
|
||||
@@ -195,6 +197,7 @@ public class CityService : CityContract.CityContractBase
|
||||
return new Empty();
|
||||
}
|
||||
|
||||
[Obsolete("ARCHIVED: Cities are seed data — manual delete breaks user addresses")]
|
||||
public override async Task<Empty> DeleteCity(
|
||||
DeleteCityRequest request, ServerCallContext context)
|
||||
{
|
||||
@@ -206,6 +209,7 @@ public class CityService : CityContract.CityContractBase
|
||||
await _context.SaveChangesAsync(context.CancellationToken);
|
||||
return new Empty();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -154,18 +154,22 @@ public class ConfigurationService : ConfigurationContract.ConfigurationContractB
|
||||
throw new RpcException(new Status(StatusCode.FailedPrecondition, "تنظیمات سیستم فقط خواندنی هستند. تغییر از طریق کد انجام میشود"));
|
||||
}
|
||||
|
||||
#region [ARCHIVED] DeactivateConfiguration & GetConfigurationHistory — SystemConstants ثابت هستند، این RPCها بیمعنی
|
||||
[RequiresPermission(PermissionNames.SettingsManageConfiguration)]
|
||||
[Obsolete("ARCHIVED: SystemConstants are read-only — deactivation is meaningless")]
|
||||
public override Task<Empty> DeactivateConfiguration(DeactivateConfigurationRequest request, ServerCallContext context)
|
||||
{
|
||||
_logger.LogWarning("DeactivateConfiguration called but SystemConstants are read-only. Key: {Key}", request.Key);
|
||||
_logger.LogWarning("[ARCHIVED] DeactivateConfiguration called but SystemConstants are read-only. Key: {Key}", request.Key);
|
||||
throw new RpcException(new Status(StatusCode.FailedPrecondition, "تنظیمات سیستم فقط خواندنی هستند. غیرفعالسازی از طریق کد انجام میشود"));
|
||||
}
|
||||
|
||||
[Obsolete("ARCHIVED: SystemConstants have no history — always returns empty")]
|
||||
public override Task<GetConfigurationHistoryResponse> GetConfigurationHistory(GetConfigurationHistoryRequest request, ServerCallContext context)
|
||||
{
|
||||
// چون constant هستند، تاریخچهای وجود نداره
|
||||
// [ARCHIVED] چون constant هستند، تاریخچهای وجود نداره
|
||||
return Task.FromResult(new GetConfigurationHistoryResponse());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Private Helpers
|
||||
|
||||
|
||||
@@ -25,9 +25,11 @@ public class HealthService : HealthContract.HealthContractBase
|
||||
return result.Adapt<GetSystemHealthResponse>();
|
||||
}
|
||||
|
||||
#region [ARCHIVED] GetServiceHealth — تکراری: GetSystemHealth کل سیستم را برمیگرداند، فیلتر client-side کافی است
|
||||
[Obsolete("ARCHIVED: Use GetSystemHealth + client-side filter by service name")]
|
||||
public override async Task<GetServiceHealthResponse> GetServiceHealth(GetServiceHealthRequest request, ServerCallContext context)
|
||||
{
|
||||
// For now, just return system health filtered by service name
|
||||
// [ARCHIVED] duplicate — GetSystemHealth returns all, client can filter
|
||||
var systemHealthQuery = new GetSystemHealthQuery();
|
||||
var systemHealth = await _mediator.Send(systemHealthQuery, context.CancellationToken);
|
||||
|
||||
@@ -45,4 +47,5 @@ public class HealthService : HealthContract.HealthContractBase
|
||||
CheckedAt = Google.Protobuf.WellKnownTypes.Timestamp.FromDateTime(DateTime.UtcNow)
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
@@ -497,7 +497,9 @@ public class UserOrderService : UserOrderContract.UserOrderContractBase
|
||||
};
|
||||
}
|
||||
|
||||
#region [ARCHIVED] GetOrdersByDateRange — تکراری: GetAllUserOrderByFilter همین قابلیت + فیلترهای بیشتر دارد
|
||||
[RequiresPermission(PermissionNames.ReportsView)]
|
||||
[Obsolete("ARCHIVED: Use GetAllUserOrderByFilter instead — has date range + more filters")]
|
||||
public override async Task<GetOrdersByDateRangeResponse> GetOrdersByDateRange(GetOrdersByDateRangeRequest request, ServerCallContext context)
|
||||
{
|
||||
var pageNumber = request.PageNumber > 0 ? request.PageNumber : 1;
|
||||
@@ -551,6 +553,7 @@ public class UserOrderService : UserOrderContract.UserOrderContractBase
|
||||
Orders = { orders }
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
[RequiresPermission(PermissionNames.OrdersUpdate)]
|
||||
public override async Task<ApplyDiscountToOrderResponse> ApplyDiscountToOrder(ApplyDiscountToOrderRequest request, ServerCallContext context)
|
||||
@@ -624,17 +627,21 @@ public class UserOrderService : UserOrderContract.UserOrderContractBase
|
||||
|
||||
// ============= Customer-specific Methods =============
|
||||
|
||||
#region [ARCHIVED] CreateNewOrderForCustomer & SubmitOrderForCustomer — Stub خالی: مسیر سفارش مشتری از SubmitShopBuyOrder میگذرد
|
||||
[Obsolete("ARCHIVED: Empty stub — customer order flow uses SubmitShopBuyOrder")]
|
||||
public override async Task<CreateNewUserOrderResponse> CreateNewOrderForCustomer(CreateNewUserOrderRequest request, ServerCallContext context)
|
||||
{
|
||||
// For now, return empty response - will be implemented properly later
|
||||
// [ARCHIVED] Empty stub — مسیر سفارش مشتری از SubmitShopBuyOrder میگذرد
|
||||
return new CreateNewUserOrderResponse();
|
||||
}
|
||||
|
||||
[Obsolete("ARCHIVED: Empty stub — customer order flow uses SubmitShopBuyOrder")]
|
||||
public override async Task<SubmitShopBuyOrderResponse> SubmitOrderForCustomer(SubmitShopBuyOrderRequest request, ServerCallContext context)
|
||||
{
|
||||
// For now, return empty response - will be implemented properly later
|
||||
// [ARCHIVED] Empty stub — مسیر سفارش مشتری از SubmitShopBuyOrder میگذرد
|
||||
return new SubmitShopBuyOrderResponse();
|
||||
}
|
||||
#endregion
|
||||
|
||||
public override async Task<GetAllUserOrderByFilterResponse> GetCustomerOrders(GetAllUserOrderByFilterRequest request, ServerCallContext context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user