eab978188a
- Changed Protobuf imports from FrontOffice.BFF to CMSMicroservice in Profile components (EditAddressDialog, Index, PaymentCallback, Personal, Settings). - Updated CheckoutSummary, OrderDetail, OrderTracking, and Orders pages to use new UserOrder Protobuf definitions. - Refactored WalletService, PackageService, and other utility services to align with new Protobuf structure. - Adjusted appsettings.json for local development URL. - Removed unused validators and simplified validation logic in AuthDialog. - Enhanced ClubMembershipContractDialog to utilize new OtpToken service for OTP handling.
69 lines
2.1 KiB
C#
69 lines
2.1 KiB
C#
using CMSMicroservice.Protobuf.Protos.Configuration;
|
|
|
|
namespace FrontOffice.Main.Utilities;
|
|
|
|
/// <summary>
|
|
/// سرویس تنظیمات باشگاه مشتریان
|
|
/// </summary>
|
|
public class ClubConfigurationService
|
|
{
|
|
private readonly ConfigurationContract.ConfigurationContractClient _client;
|
|
|
|
public ClubConfigurationService(ConfigurationContract.ConfigurationContractClient client)
|
|
{
|
|
_client = client;
|
|
}
|
|
|
|
/// <summary>
|
|
/// دریافت تنظیمات باشگاه مشتریان
|
|
/// </summary>
|
|
public async Task<ClubConfigDto> GetClubConfigurationAsync()
|
|
{
|
|
var response = await _client.GetClubConfigurationAsync(new Google.Protobuf.WellKnownTypes.Empty());
|
|
|
|
return new ClubConfigDto
|
|
{
|
|
ActivationFee = response.ActivationFee,
|
|
MembershipGiftValue = response.MembershipGiftValue
|
|
};
|
|
}
|
|
|
|
/// <summary>
|
|
/// دریافت لیست فیچرهای باشگاه برای کاربر جاری
|
|
/// </summary>
|
|
public async Task<List<ClubFeatureDto>> GetClubFeaturesAsync()
|
|
{
|
|
var response = await _client.GetClubFeaturesAsync(new Google.Protobuf.WellKnownTypes.Empty());
|
|
|
|
return response.Features.Select(f => new ClubFeatureDto
|
|
{
|
|
Id = f.Id,
|
|
Title = f.Title,
|
|
Description = f.Description,
|
|
IsEnabled = f.IsEnabled,
|
|
DisplayOrder = f.DisplayOrder,
|
|
GrantedAt = f.GrantedAt?.ToDateTime(),
|
|
CreatedAt = f.CreatedAt?.ToDateTime(),
|
|
Notes = f.Notes
|
|
}).ToList();
|
|
}
|
|
}
|
|
|
|
public class ClubConfigDto
|
|
{
|
|
public long ActivationFee { get; set; }
|
|
public long MembershipGiftValue { get; set; }
|
|
}
|
|
|
|
public class ClubFeatureDto
|
|
{
|
|
public long Id { get; set; }
|
|
public string Title { get; set; } = string.Empty;
|
|
public string? Description { get; set; }
|
|
public bool IsEnabled { get; set; }
|
|
public int DisplayOrder { get; set; }
|
|
public DateTime? GrantedAt { get; set; }
|
|
public DateTime? CreatedAt { get; set; }
|
|
public string? Notes { get; set; }
|
|
}
|