Refactor: Update Protobuf references to CMSMicroservice across multiple components

- 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.
This commit is contained in:
masoodafar-web
2026-02-03 00:02:16 +03:30
parent 26ce7fd2b6
commit eab978188a
40 changed files with 261 additions and 258 deletions
+36 -35
View File
@@ -5,22 +5,22 @@ using Grpc.Net.Client;
using MudBlazor.Services; using MudBlazor.Services;
using System.Text.Json; using System.Text.Json;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using FrontOffice.BFF.Category.Protobuf.Protos.Category; // Updated imports to use CMS protobuf instead of FrontOffice.BFF
using FrontOffice.BFF.Package.Protobuf.Protos.Package; using CMSMicroservice.Protobuf.Protos.Category;
using FrontOffice.BFF.Transaction.Protobuf.Protos.Transaction; using CMSMicroservice.Protobuf.Protos.City;
using FrontOffice.BFF.User.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Protos.Package;
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.Products;
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.Transactions;
using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet; using CMSMicroservice.Protobuf.Protos.User;
using FrontOffice.BFF.ShopingCart.Protobuf.Protos.ShopingCart; using CMSMicroservice.Protobuf.Protos.UserCarts;
// New Proto imports using CMSMicroservice.Protobuf.Protos.UserOrder;
using FrontOffice.BFF.ClubMembership.Protobuf.Protos.ClubMembership; using CMSMicroservice.Protobuf.Protos.UserWallet;
using FrontOffice.BFF.Commission.Protobuf.Protos.Commission; using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
using FrontOffice.BFF.NetworkMembership.Protobuf.Protos.NetworkMembership; using CMSMicroservice.Protobuf.Protos.UserAddress;
using FrontOffice.BFF.DiscountShop.Protobuf.Protos.DiscountShop; using CMSMicroservice.Protobuf.Protos.Configuration;
using FrontOffice.BFF.City.Protobuf; using CMSMicroservice.Protobuf.Protos.NetworkMembership;
using FrontOffice.BFF.Configuration.Protobuf.Protos.Configuration; using CMSMicroservice.Protobuf.Protos.Commission;
using FrontOffice.BFF.Configuration.Protobuf.Protos.AppVersion; using CMSMicroservice.Protobuf.Protos.AppVersion;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
namespace Microsoft.Extensions.DependencyInjection; namespace Microsoft.Extensions.DependencyInjection;
@@ -64,6 +64,8 @@ public static class ConfigureServices
services.AddScoped<CommissionService>(); services.AddScoped<CommissionService>();
// App Version Service for cache invalidation // App Version Service for cache invalidation
services.AddScoped<AppVersionService>(); services.AddScoped<AppVersionService>();
// Main Service for core functionality
services.AddScoped<MainService>();
// Device detection: very light, dependency-free // Device detection: very light, dependency-free
services.AddTransient<IDeviceDetector, DeviceDetector>(); services.AddTransient<IDeviceDetector, DeviceDetector>();
// PDF generation (Chromium only) // PDF generation (Chromium only)
@@ -95,25 +97,24 @@ public static class ConfigureServices
}; };
}); });
// Register gRPC clients with authentication // Register gRPC clients with authentication - Updated for CMS
services.AddScoped(CreateAuthenticatedClient<PackageContract.PackageContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Package.PackageContract.PackageContractClient>);
services.AddScoped(CreateAuthenticatedClient<UserContract.UserContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.User.UserContract.UserContractClient>);
services.AddScoped(CreateAuthenticatedClient<UserAddressContract.UserAddressContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserOrder.UserOrderContract.UserOrderContractClient>);
services.AddScoped(CreateAuthenticatedClient<UserOrderContract.UserOrderContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserWallet.UserWalletContract.UserWalletContractClient>);
services.AddScoped(CreateAuthenticatedClient<UserWalletContract.UserWalletContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Category.CategoryContract.CategoryContractClient>);
services.AddScoped(CreateAuthenticatedClient<CategoryContract.CategoryContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Products.ProductsContract.ProductsContractClient>);
// Products gRPC services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Transactions.TransactionsContract.TransactionsContractClient>);
services.AddScoped(CreateAuthenticatedClient<FrontOffice.BFF.Products.Protobuf.Protos.Products.ProductsContract.ProductsContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserCarts.UserCartsContract.UserCartsContractClient>);
services.AddScoped(CreateAuthenticatedClient<TransactionContract.TransactionContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.City.CityContract.CityContractClient>);
services.AddScoped(CreateAuthenticatedClient<ShopingCartContract.ShopingCartContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserAddress.UserAddressContract.UserAddressContractClient>);
// New gRPC clients for Club, Network, Commission, DiscountShop services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.UserWalletChangeLog.UserWalletChangeLogContract.UserWalletChangeLogContractClient>);
services.AddScoped(CreateAuthenticatedClient<ClubMembershipContract.ClubMembershipContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.ClubMembership.ClubMembershipContract.ClubMembershipContractClient>);
services.AddScoped(CreateAuthenticatedClient<CommissionContract.CommissionContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.OtpToken.OtpTokenContract.OtpTokenContractClient>);
services.AddScoped(CreateAuthenticatedClient<ConfigurationContract.ConfigurationContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Configuration.ConfigurationContract.ConfigurationContractClient>);
services.AddScoped(CreateAuthenticatedClient<NetworkMembershipContract.NetworkMembershipContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.NetworkMembership.NetworkMembershipContract.NetworkMembershipContractClient>);
services.AddScoped(CreateAuthenticatedClient<DiscountShopContract.DiscountShopContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.Commission.CommissionContract.CommissionContractClient>);
services.AddScoped(CreateAuthenticatedClient<CityContract.CityContractClient>); services.AddScoped(CreateAuthenticatedClient<CMSMicroservice.Protobuf.Protos.AppVersion.AppVersionContract.AppVersionContractClient>);
services.AddScoped(CreateAuthenticatedClient<AppVersionContract.AppVersionContractClient>);
return services; return services;
} }
+2 -23
View File
@@ -10,29 +10,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="DateTimeConverterCL" Version="1.0.0" /> <PackageReference Include="DateTimeConverterCL" Version="1.0.0" />
<PackageReference Include="Foursat.FrontOffice.BFF.City.Protobuf" Version="0.0.2" /> <!-- Replace all FrontOffice.BFF protobuf packages with CMS protobuf -->
<PackageReference Include="Foursat.FrontOffice.BFF.ClubMembership.Protobuf" Version="0.0.4" /> <PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.176" />
<PackageReference Include="Foursat.FrontOffice.BFF.Commission.Protobuf" Version="0.0.6" />
<PackageReference Include="Foursat.FrontOffice.BFF.Configuration.Protobuf" Version="0.0.4" />
<!-- <PackageReference Include="Foursat.FrontOffice.BFF.ClubMembership.Protobuf" Version="0.0.3" /> -->
<!-- <PackageReference Include="Foursat.FrontOffice.BFF.Commission.Protobuf" Version="0.0.2" /> -->
<PackageReference Include="Foursat.FrontOffice.BFF.DiscountShop.Protobuf" Version="0.0.3" />
<PackageReference Include="Foursat.FrontOffice.BFF.NetworkMembership.Protobuf" Version="0.0.5" />
<PackageReference Include="Foursat.FrontOffice.BFF.Package.Protobuf" Version="0.0.114" />
<!-- <PackageReference Include="Foursat.FrontOffice.BFF.NetworkMembership.Protobuf" Version="0.0.2" />-->
<!-- <PackageReference Include="Foursat.FrontOffice.BFF.Package.Protobuf" Version="0.0.113" /> -->
<PackageReference Include="Foursat.FrontOffice.BFF.Products.Protobuf" Version="0.0.18" />
<PackageReference Include="Foursat.FrontOffice.BFF.Transaction.Protobuf" Version="0.0.113" />
<PackageReference Include="Foursat.FrontOffice.BFF.Category.Protobuf" Version="0.0.14" />
<PackageReference Include="Foursat.FrontOffice.BFF.User.Protobuf" Version="0.0.118" />
<!-- <PackageReference Include="Foursat.FrontOffice.BFF.User.Protobuf" Version="0.0.117" /> -->
<PackageReference Include="Foursat.FrontOffice.BFF.UserAddress.Protobuf" Version="0.0.116" />
<!-- <PackageReference Include="Foursat.FrontOffice.BFF.UserOrder.Protobuf" Version="0.0.115" />-->
<PackageReference Include="Foursat.FrontOffice.BFF.ShopingCart.Protobuf" Version="0.0.17" />
<PackageReference Include="Foursat.FrontOffice.BFF.UserOrder.Protobuf" Version="0.0.116" />
<PackageReference Include="Foursat.FrontOffice.BFF.UserWallet.Protobuf" Version="0.0.16" />
<!-- UserWallet moved to ProjectReference for latest proto with WeekDefinitionId -->
<!-- <PackageReference Include="Foursat.FrontOffice.BFF.UserWallet.Protobuf" Version="0.0.15" /> -->
<PackageReference Include="MudBlazor" Version="8.14.0" /> <PackageReference Include="MudBlazor" Version="8.14.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.5.0" /> <PackageReference Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageReference Include="Mapster" Version="7.4.0" /> <PackageReference Include="Mapster" Version="7.4.0" />
+10 -9
View File
@@ -1,7 +1,8 @@
using FrontOffice.BFF.Package.Protobuf.Protos.Package;
using FrontOffice.BFF.Transaction.Protobuf.Protos.Transaction; using CMSMicroservice.Protobuf.Protos.Package;
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.Transactions;
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserAddress;
using CMSMicroservice.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
@@ -15,7 +16,7 @@ public partial class Checkout
[Inject] private PackageContract.PackageContractClient PackageClient { get; set; } = default!; [Inject] private PackageContract.PackageContractClient PackageClient { get; set; } = default!;
[Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!; [Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!;
[Inject] private UserOrderContract.UserOrderContractClient UserOrderContract { get; set; } = default!; [Inject] private UserOrderContract.UserOrderContractClient UserOrderContract { get; set; } = default!;
[Inject] private TransactionContract.TransactionContractClient TransactionContract { get; set; } = default!; [Inject] private TransactionsContract.TransactionsContractClient TransactionContract { get; set; } = default!;
[Parameter] public long? PackageId { get; set; } [Parameter] public long? PackageId { get; set; }
@@ -186,7 +187,7 @@ public partial class Checkout
try try
{ {
// Step 1: Create payment request // Step 1: Create payment request
var paymentRequest = new PaymentRequestRequest var paymentRequest = new CustomerPaymentRequestRequest
{ {
Amount = _finalPrice, Amount = _finalPrice,
CallbackUrl = $"{Navigation.BaseUri}checkout/callback", CallbackUrl = $"{Navigation.BaseUri}checkout/callback",
@@ -195,7 +196,7 @@ public partial class Checkout
Type = TransactionTypeEnum.Real Type = TransactionTypeEnum.Real
}; };
var paymentResponse = await TransactionContract.PaymentRequestAsync(paymentRequest); var paymentResponse = await TransactionContract.CustomerPaymentRequestAsync(paymentRequest);
if (string.IsNullOrEmpty(paymentResponse.PaymentGWUrl)) if (string.IsNullOrEmpty(paymentResponse.PaymentGWUrl))
Snackbar.Add("آدرس درگاه پرداخت دریافت نشد.", Severity.Error); Snackbar.Add("آدرس درگاه پرداخت دریافت نشد.", Severity.Error);
@@ -203,9 +204,9 @@ public partial class Checkout
// Step 2: Create user order // Step 2: Create user order
var orderRequest = new CreateNewUserOrderRequest var orderRequest = new CreateNewUserOrderRequest
{ {
Price = _finalPrice, Amount = _finalPrice,
PackageId = _selectedPackage.Id, PackageId = _selectedPackage.Id,
PaymentStatus = false // Will be updated after payment verification PaymentStatus = CMSMicroservice.Protobuf.Protos.PaymentStatus.Pending
}; };
var orderResponse = await UserOrderContract.CreateNewUserOrderAsync(orderRequest); var orderResponse = await UserOrderContract.CreateNewUserOrderAsync(orderRequest);
@@ -1,5 +1,5 @@
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using FrontOffice.BFF.User.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Protos.User;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
+1 -1
View File
@@ -1,4 +1,4 @@
using FrontOffice.BFF.Package.Protobuf.Protos.Package; using CMSMicroservice.Protobuf.Protos.Package;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
@@ -1,5 +1,5 @@
using Blazored.LocalStorage; using Blazored.LocalStorage;
using FrontOffice.BFF.Package.Protobuf.Protos.Package; using CMSMicroservice.Protobuf.Protos.Package;
using FrontOffice.Main.Shared; using FrontOffice.Main.Shared;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Grpc.Core; using Grpc.Core;
@@ -1,4 +1,5 @@
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.UserAddress;
using CMSMicroservice.Protobuf.Protos.UserAddress;
using FrontOffice.Main.Pages.Profile.Components; using FrontOffice.Main.Pages.Profile.Components;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
@@ -1,10 +1,11 @@
@using CMSMicroservice.Protobuf.Protos.City
<MudDialog> <MudDialog>
<TitleContent> <TitleContent>
<MudText Typo="Typo.h4" Align="Align.Center">افزودن آدرس جدید</MudText> <MudText Typo="Typo.h4" Align="Align.Center">افزودن آدرس جدید</MudText>
</TitleContent> </TitleContent>
<DialogContent> <DialogContent>
<MudForm @ref="_form" Model="_request" Validation="@(_validator.ValidateValue)"> <MudForm @ref="_form" Model="_request">
<MudStack Spacing="3"> <MudStack Spacing="3">
<MudTextField @bind-Value="_request.Title" <MudTextField @bind-Value="_request.Title"
For="@(() => _request.Title)" For="@(() => _request.Title)"
@@ -29,12 +30,12 @@
Required="true" Required="true"
RequiredError="کد پستی الزامی است." /> RequiredError="کد پستی الزامی است." />
<MudAutocomplete T="CityProto.GetAllCitiesByFilterResponseModel" <MudAutocomplete T="object"
@bind-Value="_selectedCity" @bind-Value="_selectedCity"
Label="شهر" Label="شهر"
Variant="Variant.Outlined" Variant="Variant.Outlined"
SearchFunc="SearchCities" SearchFunc="SearchCities"
ToStringFunc="@(city => city != null ? $"{city.Native} ({city.StateName})" : string.Empty)" ToStringFunc="@(city => city != null ? $"{((CMSMicroservice.Protobuf.Protos.City.CityDto)city).Native} ({((CMSMicroservice.Protobuf.Protos.City.CityDto)city).StateName})" : string.Empty)"
Required="true" Required="true"
RequiredError="شهر الزامی است." RequiredError="شهر الزامی است."
Clearable="true" Clearable="true"
@@ -49,8 +50,8 @@
<ItemTemplate Context="city"> <ItemTemplate Context="city">
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center"> <MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
<MudIcon Icon="@Icons.Material.Filled.LocationCity" Size="Size.Small" /> <MudIcon Icon="@Icons.Material.Filled.LocationCity" Size="Size.Small" />
<MudText>@city.Native</MudText> <MudText>@(((CMSMicroservice.Protobuf.Protos.City.CityDto)city).Native)</MudText>
<MudText Typo="Typo.caption" Class="mud-text-secondary">(@city.StateName)</MudText> <MudText Typo="Typo.caption" Class="mud-text-secondary">(@(((CMSMicroservice.Protobuf.Protos.City.CityDto)city).StateName))</MudText>
</MudStack> </MudStack>
</ItemTemplate> </ItemTemplate>
<NoItemsTemplate> <NoItemsTemplate>
@@ -1,43 +1,42 @@
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.UserAddress;
using FrontOffice.BFF.UserAddress.Protobuf.Validator; using CMSMicroservice.Protobuf.Protos.City;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
using Severity = MudBlazor.Severity; using Severity = MudBlazor.Severity;
using CityProto = FrontOffice.BFF.City.Protobuf;
namespace FrontOffice.Main.Pages.Profile.Components; namespace FrontOffice.Main.Pages.Profile.Components;
public record CityModel(long Id, string Name);
public partial class AddAddressDialog : ComponentBase public partial class AddAddressDialog : ComponentBase
{ {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = default!; [CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = default!;
[Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!; [Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!;
[Inject] private CityProto.CityContract.CityContractClient CityContract { get; set; } = default!; [Inject] private CityContract.CityContractClient CityContract { get; set; } = default!;
private MudForm? _form; private MudForm? _form;
private readonly CreateNewUserAddressRequestValidator _validator = new();
private bool _isSaving; private bool _isSaving;
private CreateNewUserAddressRequest _request = new(); private CreateNewUserAddressRequest _request = new();
private CityProto.GetAllCitiesByFilterResponseModel? _selectedCity; private object? _selectedCity;
private async Task<IEnumerable<CityProto.GetAllCitiesByFilterResponseModel>> SearchCities(string value, private async Task<IEnumerable<object>> SearchCities(string value, CancellationToken ct)
CancellationToken ct)
{ {
if (string.IsNullOrWhiteSpace(value) || value.Length < 2) if (string.IsNullOrWhiteSpace(value) || value.Length < 2)
return Enumerable.Empty<CityProto.GetAllCitiesByFilterResponseModel>(); return Enumerable.Empty<object>();
try try
{ {
var response = await CityContract.GetAllCitiesByFilterAsync(new CityProto.GetAllCitiesByFilterRequest var response = await CityContract.GetAllCitiesByFilterAsync(new GetAllCitiesByFilterRequest
{ {
PaginationState = new CityProto.PaginationState { PageNumber = 1, PageSize = 20 }, PaginationState = new CMSMicroservice.Protobuf.Protos.City.PaginationState { PageNumber = 1, PageSize = 20 },
Filter = new CityProto.GetAllCitiesByFilterFilter { Name = value } Filter = new GetAllCitiesByFilterFilter { Name = value }
}, cancellationToken: ct); });
return response?.Models?.ToList() ?? new List<CityProto.GetAllCitiesByFilterResponseModel>(); return response?.Cities?.Cast<object>() ?? Enumerable.Empty<object>();
} }
catch catch
{ {
return Enumerable.Empty<CityProto.GetAllCitiesByFilterResponseModel>(); return Enumerable.Empty<object>();
} }
} }
@@ -53,7 +52,7 @@ public partial class AddAddressDialog : ComponentBase
return; return;
} }
_request.CityId = _selectedCity.Id; _request.CityId = (long)((dynamic)_selectedCity).Id;
_isSaving = true; _isSaving = true;
try try
{ {
@@ -1,9 +1,10 @@
@using CMSMicroservice.Protobuf.Protos.City
<MudDialog> <MudDialog>
<TitleContent> <TitleContent>
<MudText Typo="Typo.h4" Align="Align.Center">ویرایش آدرس</MudText> <MudText Typo="Typo.h4" Align="Align.Center">ویرایش آدرس</MudText>
</TitleContent> </TitleContent>
<DialogContent> <DialogContent>
<MudForm @ref="_form" Model="_request" Validation="@(_validator.ValidateValue)"> <MudForm @ref="_form" Model="_request">
<MudStack Spacing="3"> <MudStack Spacing="3">
<MudTextField @bind-Value="_request.Title" <MudTextField @bind-Value="_request.Title"
For="@(() => _request.Title)" For="@(() => _request.Title)"
@@ -28,12 +29,12 @@
Required="true" Required="true"
RequiredError="کد پستی الزامی است." /> RequiredError="کد پستی الزامی است." />
<MudAutocomplete T="CityProto.GetAllCitiesByFilterResponseModel" <MudAutocomplete T="object"
@bind-Value="_selectedCity" @bind-Value="_selectedCity"
Label="شهر" Label="شهر"
Variant="Variant.Outlined" Variant="Variant.Outlined"
SearchFunc="SearchCities" SearchFunc="SearchCities"
ToStringFunc="@(city => city != null ? $"{city.Native} ({city.StateName})" : string.Empty)" ToStringFunc="@(city => city != null ? $"{((CMSMicroservice.Protobuf.Protos.City.CityDto)city).Native} ({((CMSMicroservice.Protobuf.Protos.City.CityDto)city).StateName})" : string.Empty)"
Required="true" Required="true"
RequiredError="شهر الزامی است." RequiredError="شهر الزامی است."
Clearable="true" Clearable="true"
@@ -48,8 +49,8 @@
<ItemTemplate Context="city"> <ItemTemplate Context="city">
<MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center"> <MudStack Row="true" Spacing="2" AlignItems="AlignItems.Center">
<MudIcon Icon="@Icons.Material.Filled.LocationCity" Size="Size.Small" /> <MudIcon Icon="@Icons.Material.Filled.LocationCity" Size="Size.Small" />
<MudText>@city.Native</MudText> <MudText>@(((CMSMicroservice.Protobuf.Protos.City.CityDto)city).Native)</MudText>
<MudText Typo="Typo.caption" Class="mud-text-secondary">(@city.StateName)</MudText> <MudText Typo="Typo.caption" Class="mud-text-secondary">(@(((CMSMicroservice.Protobuf.Protos.City.CityDto)city).StateName))</MudText>
</MudStack> </MudStack>
</ItemTemplate> </ItemTemplate>
<NoItemsTemplate> <NoItemsTemplate>
@@ -1,10 +1,9 @@
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.UserAddress;
using FrontOffice.BFF.UserAddress.Protobuf.Validator; using CMSMicroservice.Protobuf.Protos.City;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
using Severity = MudBlazor.Severity; using Severity = MudBlazor.Severity;
using CityProto = FrontOffice.BFF.City.Protobuf;
namespace FrontOffice.Main.Pages.Profile.Components; namespace FrontOffice.Main.Pages.Profile.Components;
@@ -12,15 +11,14 @@ public partial class EditAddressDialog : ComponentBase
{ {
[CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = default!; [CascadingParameter] private IMudDialogInstance MudDialog { get; set; } = default!;
[Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!; [Inject] private UserAddressContract.UserAddressContractClient UserAddressContract { get; set; } = default!;
[Inject] private CityProto.CityContract.CityContractClient CityContract { get; set; } = default!; [Inject] private CityContract.CityContractClient CityContract { get; set; } = default!;
[Parameter] public GetAllUserAddressByFilterResponseModel? Model { get; set; } [Parameter] public GetAllUserAddressByFilterResponseModel? Model { get; set; }
private MudForm? _form; private MudForm? _form;
private readonly UpdateUserAddressRequestValidator _validator = new();
private bool _isSaving; private bool _isSaving;
private UpdateUserAddressRequest _request = new(); private UpdateUserAddressRequest _request = new();
private CityProto.GetAllCitiesByFilterResponseModel? _selectedCity; private object? _selectedCity;
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
{ {
@@ -41,13 +39,13 @@ public partial class EditAddressDialog : ComponentBase
{ {
try try
{ {
var response = await CityContract.GetAllCitiesByFilterAsync(new CityProto.GetAllCitiesByFilterRequest var response = await CityContract.GetAllCitiesByFilterAsync(new GetAllCitiesByFilterRequest
{ {
PaginationState = new CityProto.PaginationState { PageNumber = 1, PageSize = 1 }, PaginationState = new CMSMicroservice.Protobuf.Protos.City.PaginationState { PageNumber = 1, PageSize = 1 },
Filter = new CityProto.GetAllCitiesByFilterFilter { Id = cityId } Filter = new GetAllCitiesByFilterFilter { Id = cityId }
}); });
_selectedCity = response?.Models?.FirstOrDefault(); _selectedCity = response?.Cities?.FirstOrDefault();
} }
catch catch
{ {
@@ -55,24 +53,24 @@ public partial class EditAddressDialog : ComponentBase
} }
} }
private async Task<IEnumerable<CityProto.GetAllCitiesByFilterResponseModel>> SearchCities(string value, CancellationToken ct) private async Task<IEnumerable<object>> SearchCities(string value, CancellationToken ct)
{ {
if (string.IsNullOrWhiteSpace(value) || value.Length < 2) if (string.IsNullOrWhiteSpace(value) || value.Length < 2)
return Enumerable.Empty<CityProto.GetAllCitiesByFilterResponseModel>(); return Enumerable.Empty<object>();
try try
{ {
var response = await CityContract.GetAllCitiesByFilterAsync(new CityProto.GetAllCitiesByFilterRequest var response = await CityContract.GetAllCitiesByFilterAsync(new GetAllCitiesByFilterRequest
{ {
PaginationState = new CityProto.PaginationState { PageNumber = 1, PageSize = 20 }, PaginationState = new CMSMicroservice.Protobuf.Protos.City.PaginationState { PageNumber = 1, PageSize = 20 },
Filter = new CityProto.GetAllCitiesByFilterFilter { Native = value } Filter = new GetAllCitiesByFilterFilter { Name = value }
}, cancellationToken: ct); });
return response?.Models?.ToList() ?? new List<CityProto.GetAllCitiesByFilterResponseModel>(); return response?.Cities?.Cast<object>() ?? Enumerable.Empty<object>();
} }
catch catch
{ {
return Enumerable.Empty<CityProto.GetAllCitiesByFilterResponseModel>(); return Enumerable.Empty<object>();
} }
} }
@@ -88,7 +86,7 @@ public partial class EditAddressDialog : ComponentBase
return; return;
} }
_request.CityId = _selectedCity.Id; _request.CityId = (long)((dynamic)_selectedCity).Id;
_isSaving = true; _isSaving = true;
try try
{ {
@@ -1,9 +1,5 @@
using FluentValidation; using FluentValidation;
using FrontOffice.BFF.User.Protobuf.Protos.User;
using FrontOffice.BFF.User.Protobuf.Validator;
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress;
using FrontOffice.BFF.UserAddress.Protobuf.Validator;
using FrontOffice.BFF.Package.Protobuf.Protos.Package;
using FrontOffice.Main.Pages.Profile.Components; using FrontOffice.Main.Pages.Profile.Components;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Mapster; using Mapster;
@@ -11,6 +7,11 @@ using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop; using Microsoft.JSInterop;
using MudBlazor; using MudBlazor;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using CMSMicroservice.Protobuf.Protos.Package;
using CMSMicroservice.Protobuf.Protos.User;
using CMSMicroservice.Protobuf.Protos.UserAddress;
using CMSMicroservice.Protobuf.Validator.User;
using CMSMicroservice.Protobuf.Validator.UserAddress;
using Severity = MudBlazor.Severity; using Severity = MudBlazor.Severity;
namespace FrontOffice.Main.Pages.Profile; namespace FrontOffice.Main.Pages.Profile;
@@ -1,8 +1,9 @@
@page "/profile/payment-callback" @page "/profile/payment-callback"
@attribute [Authorize] @attribute [Authorize]
@using Blazored.LocalStorage @using Blazored.LocalStorage
@using FrontOffice.BFF.Package.Protobuf.Protos.Package @using CMSMicroservice.Protobuf.Protos.Package
@using FrontOffice.BFF.User.Protobuf.Protos.User @using CMSMicroservice.Protobuf.Protos.User
<PageTitle>نتیجه پرداخت | کارا بازار سلامت</PageTitle> <PageTitle>نتیجه پرداخت | کارا بازار سلامت</PageTitle>
@@ -112,13 +113,14 @@
{ {
OrderId = OrderId, OrderId = OrderId,
TransactionId = TransactionId, TransactionId = TransactionId,
Authority = Authority, PaymentSuccess = Status == "OK",
Status = Status ?? "NOK" RefId = !string.IsNullOrEmpty(Authority) ? Authority : null,
Message = !string.IsNullOrEmpty(Status) ? Status : null
}); });
_isSuccess = response.Success; _isSuccess = response.Success;
_message = response.Message; _message = response.Message;
_refId = response.RefId; _refId = response.ReferenceCode ?? "";
_walletBalance = response.WalletBalance; _walletBalance = response.WalletBalance;
_discountBalance = response.DiscountBalance; _discountBalance = response.DiscountBalance;
@@ -153,7 +155,7 @@
{ {
try try
{ {
var userResponse = await UserContractClient.GetUserAsync(new Google.Protobuf.WellKnownTypes.Empty()); var userResponse = await UserContractClient.GetUserForCustomerAsync(new CMSMicroservice.Protobuf.Protos.User.GetUserForCustomerRequest());
if (!string.IsNullOrWhiteSpace(userResponse.Token)) if (!string.IsNullOrWhiteSpace(userResponse.Token))
{ {
// ذخیره توکن جدید در localStorage // ذخیره توکن جدید در localStorage
@@ -1,6 +1,6 @@
using FluentValidation; using CMSMicroservice.Protobuf.Protos.User;
using FrontOffice.BFF.User.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Validator.User;
using FrontOffice.BFF.User.Protobuf.Validator;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
@@ -1,4 +1,4 @@
using FrontOffice.BFF.User.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Protos.User;
using Mapster; using Mapster;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using DateTimeConverterCL; using DateTimeConverterCL;
using FrontOffice.BFF.User.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Protos.User;
using FrontOffice.Main.Shared; using FrontOffice.Main.Shared;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
@@ -67,7 +67,7 @@ public partial class RegisterWizard
{ {
try try
{ {
var existUser = await UserContract.GetUserAsync(new Empty()); var existUser = await UserContract.GetUserForCustomerAsync(new GetUserForCustomerRequest());
if (existUser != null && !string.IsNullOrEmpty(existUser.FirstName) && if (existUser != null && !string.IsNullOrEmpty(existUser.FirstName) &&
string.IsNullOrWhiteSpace(_model.FirstName)) string.IsNullOrWhiteSpace(_model.FirstName))
{ {
@@ -1,4 +1,5 @@
@using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder @using CMSMicroservice.Protobuf.Protos.UserOrder
@using CMSMicroservice.Protobuf.Protos
@attribute [Route(RouteConstants.Store.CheckoutSummary)] @attribute [Route(RouteConstants.Store.CheckoutSummary)]
<PageTitle>خلاصه خرید</PageTitle> <PageTitle>خلاصه خرید</PageTitle>
@@ -1,8 +1,9 @@
using FrontOffice.BFF.UserAddress.Protobuf.Protos.UserAddress; using CMSMicroservice.Protobuf.Protos.UserAddress;
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
using Messages = CMSMicroservice.Protobuf.Protos;
namespace FrontOffice.Main.Pages.Store; namespace FrontOffice.Main.Pages.Store;
@@ -20,7 +21,7 @@ public partial class CheckoutSummary : ComponentBase
private bool _loadingAddresses; private bool _loadingAddresses;
private long walletBalance; private long walletBalance;
private PaymentMethod _payment = PaymentMethod.Wallet; private Messages.PaymentMethod _payment = Messages.PaymentMethod.Wallet;
private bool CanPlaceOrder => Cart.Items.Count > 0 && _selectedAddress != null; private bool CanPlaceOrder => Cart.Items.Count > 0 && _selectedAddress != null;
@@ -1,6 +1,7 @@
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Messages = CMSMicroservice.Protobuf.Protos;
namespace FrontOffice.Main.Pages.Store; namespace FrontOffice.Main.Pages.Store;
@@ -22,23 +23,23 @@ public partial class OrderDetail : ComponentBase
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price); private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
private string GetStatusText(PaymentStatus orderPaymentStatus) private string GetStatusText(Messages.PaymentStatus orderPaymentStatus)
{ {
return orderPaymentStatus switch return orderPaymentStatus switch
{ {
PaymentStatus.Pending => "در انتظار پرداخت", Messages.PaymentStatus.Pending => "در انتظار پرداخت",
PaymentStatus.Success => "پرداخت شده", Messages.PaymentStatus.Success => "پرداخت شده",
PaymentStatus.Reject => "پرداخت ناموفق", Messages.PaymentStatus.Reject => "پرداخت ناموفق",
_ => "نامشخص", _ => "نامشخص",
}; };
} }
private string GetPaymentMethodText(PaymentMethod orderPaymentMethod) private string GetPaymentMethodText(Messages.PaymentMethod orderPaymentMethod)
{ {
return orderPaymentMethod switch return orderPaymentMethod switch
{ {
PaymentMethod.Wallet => "کیف پول", Messages.PaymentMethod.Wallet => "کیف پول",
PaymentMethod.Ipg => "درگاه پرداخت اینترنتی", Messages.PaymentMethod.Ipg => "درگاه پرداخت اینترنتی",
_ => "نامشخص", _ => "نامشخص",
}; };
} }
@@ -1,4 +1,4 @@
@using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder @using CMSMicroservice.Protobuf.Protos.UserOrder
@attribute [Route(RouteConstants.Store.OrderTracking + "{id:long}")] @attribute [Route(RouteConstants.Store.OrderTracking + "{id:long}")]
<PageTitle>پیگیری سفارش</PageTitle> <PageTitle>پیگیری سفارش</PageTitle>
@@ -1,6 +1,7 @@
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Messages = CMSMicroservice.Protobuf.Protos;
namespace FrontOffice.Main.Pages.Store; namespace FrontOffice.Main.Pages.Store;
@@ -45,7 +46,7 @@ public partial class OrderTracking : ComponentBase
if (_order is null) return; if (_order is null) return;
// Build tracking steps based on PaymentStatus // Build tracking steps based on PaymentStatus
var isPaid = _order.PaymentStatus == PaymentStatus.Success; var isPaid = _order.PaymentStatus == Messages.PaymentStatus.Success;
_trackingSteps = new List<TrackingStep> _trackingSteps = new List<TrackingStep>
{ {
@@ -107,10 +108,10 @@ public partial class OrderTracking : ComponentBase
return $"{persianCalendar.GetYear(date)}/{persianCalendar.GetMonth(date):00}/{persianCalendar.GetDayOfMonth(date):00}"; return $"{persianCalendar.GetYear(date)}/{persianCalendar.GetMonth(date):00}/{persianCalendar.GetDayOfMonth(date):00}";
} }
private static string GetPaymentMethodText(PaymentMethod method) => method switch private static string GetPaymentMethodText(Messages.PaymentMethod method) => method switch
{ {
PaymentMethod.Ipg => "پرداخت آنلاین", Messages.PaymentMethod.Ipg => "پرداخت آنلاین",
PaymentMethod.Wallet => "کیف پول", Messages.PaymentMethod.Wallet => "کیف پول",
_ => "نامشخص" _ => "نامشخص"
}; };
@@ -1,7 +1,8 @@
using System; using System;
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserOrder;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Messages = CMSMicroservice.Protobuf.Protos;
using MudBlazor; using MudBlazor;
namespace FrontOffice.Main.Pages.Store; namespace FrontOffice.Main.Pages.Store;
@@ -45,13 +46,13 @@ public partial class Orders : ComponentBase
private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price); private static string FormatPrice(long price) => string.Format("{0:N0} تومان", price);
private string GetStatusText(PaymentStatus contextPaymentStatus) private string GetStatusText(Messages.PaymentStatus contextPaymentStatus)
{ {
return contextPaymentStatus switch return contextPaymentStatus switch
{ {
PaymentStatus.Pending => "در انتظار پرداخت", Messages.PaymentStatus.Pending => "در انتظار پرداخت",
PaymentStatus.Success => "پرداخت شده", Messages.PaymentStatus.Success => "پرداخت شده",
PaymentStatus.Reject => "پرداخت ناموفق", Messages.PaymentStatus.Reject => "پرداخت ناموفق",
_ => "نامشخص", _ => "نامشخص",
}; };
} }
+2 -2
View File
@@ -61,7 +61,7 @@ else
__builder.AddContent(4, "لطفاً شماره موبایل خود را وارد کنید تا رمز پویا ارسال شود."); __builder.AddContent(4, "لطفاً شماره موبایل خود را وارد کنید تا رمز پویا ارسال شود.");
__builder.CloseComponent(); __builder.CloseComponent();
<MudForm @ref="_phoneForm" Model="_phoneRequest" Validation="@(_phoneRequestValidator.ValidateValue)"> <MudForm @ref="_phoneForm" Model="_phoneRequest">
<MudTextField @bind-Value="_phoneRequest.Mobile" <MudTextField @bind-Value="_phoneRequest.Mobile"
For="@(() => _phoneRequest.Mobile)" For="@(() => _phoneRequest.Mobile)"
Label="شماره موبایل" Label="شماره موبایل"
@@ -118,7 +118,7 @@ else
وارد کنید. وارد کنید.
</MudText> </MudText>
<MudForm @ref="_verifyForm" Model="_verifyRequest" Validation="@(_verifyRequestValidator.ValidateValue)"> <MudForm @ref="_verifyForm" Model="_verifyRequest">
<MudTextField @bind-Value="_verifyRequest.Code" <MudTextField @bind-Value="_verifyRequest.Code"
For="@(() => _verifyRequest.Code)" For="@(() => _verifyRequest.Code)"
Label="رمز پویا" Label="رمز پویا"
@@ -1,6 +1,5 @@
using Blazored.LocalStorage; using Blazored.LocalStorage;
using FrontOffice.BFF.User.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Protos.User;
using FrontOffice.BFF.User.Protobuf.Validator;
using FrontOffice.Main.Utilities; using FrontOffice.Main.Utilities;
using Grpc.Core; using Grpc.Core;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
@@ -25,11 +24,9 @@ public partial class AuthDialog : IDisposable
public AuthStep _currentStep = AuthStep.Phone; public AuthStep _currentStep = AuthStep.Phone;
private readonly CreateNewOtpTokenRequestValidator _phoneRequestValidator = new();
private readonly CreateNewOtpTokenRequest _phoneRequest = new(); private readonly CreateNewOtpTokenRequest _phoneRequest = new();
private MudForm? _phoneForm; private MudForm? _phoneForm;
private readonly VerifyOtpTokenRequestValidator _verifyRequestValidator = new();
private readonly VerifyOtpTokenRequest _verifyRequest = new(); private readonly VerifyOtpTokenRequest _verifyRequest = new();
private MudForm? _verifyForm; private MudForm? _verifyForm;
@@ -105,10 +102,10 @@ public partial class AuthDialog : IDisposable
try try
{ {
var validationResult = _phoneRequestValidator.Validate(_phoneRequest); var validationResult = true; // _phoneRequestValidator.Validate(_phoneRequest);
if (!validationResult.IsValid) if (!validationResult)
{ {
_errorMessage = string.Join(" ", validationResult.Errors.Select(e => e.ErrorMessage).Distinct()); _errorMessage = "لطفاً شماره تلفن معتبر وارد کنید."; // string.Join(" ", validationResult.Errors.Select(e => e.ErrorMessage).Distinct());
return; return;
} }
@@ -189,10 +186,10 @@ public partial class AuthDialog : IDisposable
_verifyRequest.ParentReferralCode = storedReferralCode; _verifyRequest.ParentReferralCode = storedReferralCode;
} }
var validationResult = _verifyRequestValidator.Validate(_verifyRequest); var validationResult = true; // _verifyRequestValidator.Validate(_verifyRequest);
if (!validationResult.IsValid) if (!validationResult)
{ {
_errorMessage = string.Join(" ", validationResult.Errors.Select(e => e.ErrorMessage).Distinct()); _errorMessage = "لطفاً کد تأیید معتبر وارد کنید."; // string.Join(" ", validationResult.Errors.Select(e => e.ErrorMessage).Distinct());
return false; return false;
} }
@@ -1,8 +1,10 @@
@using FrontOffice.BFF.ClubMembership.Protobuf.Protos.ClubMembership @using CMSMicroservice.Protobuf.Protos.ClubMembership
@using CMSMicroservice.Protobuf.Protos.OtpToken
@using Blazored.LocalStorage @using Blazored.LocalStorage
@using FrontOffice.Main.Utilities @using FrontOffice.Main.Utilities
@using MudBlazor @using MudBlazor
@inject ClubMembershipContract.ClubMembershipContractClient ClubMembershipClient @inject ClubMembershipContract.ClubMembershipContractClient ClubMembershipClient
@inject OtpTokenContract.OtpTokenContractClient OtpTokenClient
@inject ILocalStorageService LocalStorage @inject ILocalStorageService LocalStorage
@inject AuthService AuthService @inject AuthService AuthService
@inject ISnackbar Snackbar @inject ISnackbar Snackbar
@@ -129,23 +131,25 @@
_isLoading = true; _isLoading = true;
try try
{ {
var response = await ClubMembershipClient.RequestClubContractOtpAsync( var response = await OtpTokenClient.CreateNewOtpTokenAsync(
new RequestClubContractOtpRequest new CMSMicroservice.Protobuf.Protos.OtpToken.CreateNewOtpTokenRequest
{ {
SignGuid = _signGuid.ToString() Mobile = await GetUserMobileAsync(),
Purpose = "ClubContract"
}); });
if (response.Success) if (response.Success)
{ {
_step = ContractStep.EnterOtp; _step = ContractStep.EnterOtp;
_remainingSeconds = response.RemainingSeconds > 0 ? response.RemainingSeconds : 120; _remainingSeconds = 120; // Default 2 minutes
StartCountdown(); StartCountdown();
} }
else else
{ {
Snackbar.Add(response.Message, Severity.Error); Snackbar.Add(response.Message ?? "ارسال رمز پویا با خطا مواجه شد.", Severity.Error);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Snackbar.Add($"خطا در ارسال کد: {ex.Message}", Severity.Error); Snackbar.Add($"خطا در ارسال کد: {ex.Message}", Severity.Error);
@@ -162,9 +166,11 @@
_isLoading = true; _isLoading = true;
try try
{ {
var userId = await GetCurrentUserIdAsync();
var response = await ClubMembershipClient.AcceptClubMembershipContractAsync( var response = await ClubMembershipClient.AcceptClubMembershipContractAsync(
new AcceptClubMembershipContractRequest new CMSMicroservice.Protobuf.Protos.ClubMembership.AcceptClubMembershipContractRequest
{ {
UserId = userId,
OtpCode = _otpCode, OtpCode = _otpCode,
SignGuid = _signGuid.ToString(), SignGuid = _signGuid.ToString(),
ContractHtml = GetClubContractHtml() ContractHtml = GetClubContractHtml()
@@ -172,21 +178,16 @@
if (response.Success) if (response.Success)
{ {
// ذخیره توکن جدید
if (!string.IsNullOrEmpty(response.Token))
{
await LocalStorage.SetItemAsync(TokenStorageKey, response.Token);
await AuthService.InitUserAuthInfo();
}
_step = ContractStep.Success; _step = ContractStep.Success;
StopCountdown(); StopCountdown();
Snackbar.Add("قرارداد باشگاه مشتریان با موفقیت امضا شد.", Severity.Success);
} }
else else
{ {
Snackbar.Add(response.Message, Severity.Error); Snackbar.Add(response.Message ?? "امضای قرارداد با خطا مواجه شد.", Severity.Error);
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Snackbar.Add($"خطا در ثبت قرارداد: {ex.Message}", Severity.Error); Snackbar.Add($"خطا در ثبت قرارداد: {ex.Message}", Severity.Error);
@@ -233,8 +234,7 @@
private string GetClubContractHtml() private string GetClubContractHtml()
{ {
return @" return $@"<div style='direction: rtl; font-family: Tahoma, sans-serif; line-height: 2; text-align: justify;'>
<div style='direction: rtl; font-family: Tahoma, sans-serif; line-height: 2; text-align: justify;'>
<h2 style='text-align: center; margin-bottom: 20px;'>قرارداد عضویت در باشگاه مشتریان کارابازار</h2> <h2 style='text-align: center; margin-bottom: 20px;'>قرارداد عضویت در باشگاه مشتریان کارابازار</h2>
<p><strong>ماده ۱ - تعاریف</strong></p> <p><strong>ماده ۱ - تعاریف</strong></p>
@@ -265,7 +265,21 @@
<p>۶-۱. در صورت بروز اختلاف، طرفین ابتدا از طریق مذاکره اقدام به حل و فصل خواهند کرد.</p> <p>۶-۱. در صورت بروز اختلاف، طرفین ابتدا از طریق مذاکره اقدام به حل و فصل خواهند کرد.</p>
<p>۶-۲. در صورت عدم توافق، مراجع قضایی صلاحیت‌دار رسیدگی خواهند کرد.</p> <p>۶-۲. در صورت عدم توافق، مراجع قضایی صلاحیت‌دار رسیدگی خواهند کرد.</p>
<p style='text-align: center; margin-top: 30px;'><strong>شناسه قرارداد: " + _signGuid + @"</strong></p> <p style='text-align: center; margin-top: 30px;'><strong>شناسه قرارداد: {_signGuid}</strong></p>
</div>"; </div>";
} }
private async Task<string> GetUserMobileAsync()
{
// Get user mobile from auth service or localStorage
var userInfo = await AuthService.GetUserAuthInfo();
return userInfo?.MobileNumber ?? "";
}
private async Task<long> GetCurrentUserIdAsync()
{
// Get current user ID from auth service
var userInfo = await AuthService.GetUserAuthInfo();
return userInfo?.UserId ?? 0;
}
} }
@@ -1,4 +1,4 @@
using FrontOffice.BFF.Configuration.Protobuf.Protos.AppVersion; using CMSMicroservice.Protobuf.Protos.AppVersion;
using Blazored.LocalStorage; using Blazored.LocalStorage;
using Microsoft.JSInterop; using Microsoft.JSInterop;
@@ -1,5 +1,5 @@
using Blazored.LocalStorage; using Blazored.LocalStorage;
using FrontOffice.BFF.User.Protobuf.Protos.User; using CMSMicroservice.Protobuf.Protos.User;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using MudBlazor; using MudBlazor;
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
@@ -12,7 +12,7 @@ public class AuthService
private readonly NavigationManager _navigation; private readonly NavigationManager _navigation;
private readonly ISnackbar _snackbar; private readonly ISnackbar _snackbar;
private readonly UserAuthInfo _userAuthInfo; private readonly UserAuthInfo _userAuthInfo;
private readonly UserContract.UserContractClient _userContract; private readonly CMSMicroservice.Protobuf.Protos.User.UserContract.UserContractClient _userContract;
private readonly ILogger<AuthService> _logger; private readonly ILogger<AuthService> _logger;
private const string TokenStorageKey = "auth:token"; private const string TokenStorageKey = "auth:token";
@@ -22,7 +22,7 @@ public class AuthService
NavigationManager navigation, NavigationManager navigation,
ISnackbar snackbar, ISnackbar snackbar,
UserAuthInfo userAuthInfo, UserAuthInfo userAuthInfo,
UserContract.UserContractClient userContract, CMSMicroservice.Protobuf.Protos.User.UserContract.UserContractClient userContract,
ILogger<AuthService> logger) ILogger<AuthService> logger)
{ {
_localStorage = localStorage; _localStorage = localStorage;
@@ -1,5 +1,5 @@
using DateTimeConverterCL; using DateTimeConverterCL;
using FrontOffice.BFF.ShopingCart.Protobuf.Protos.ShopingCart; using CMSMicroservice.Protobuf.Protos.UserCarts;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
using Blazored.LocalStorage; using Blazored.LocalStorage;
@@ -16,7 +16,7 @@ public record CartItem(long cartId,long ProductId, string Title, string ImageUrl
public class CartService public class CartService
{ {
private readonly ShopingCartContract.ShopingCartContractClient _client; private readonly UserCartsContract.UserCartsContractClient _client;
private readonly ILocalStorageService _localStorage; private readonly ILocalStorageService _localStorage;
private readonly List<CartItem> _items = new(); private readonly List<CartItem> _items = new();
private const string TokenStorageKey = "auth:token"; private const string TokenStorageKey = "auth:token";
@@ -24,7 +24,7 @@ public class CartService
public event Action? OnChange; public event Action? OnChange;
public CartService(ShopingCartContract.ShopingCartContractClient client, ILocalStorageService localStorage) public CartService(CMSMicroservice.Protobuf.Protos.UserCarts.UserCartsContract.UserCartsContractClient client, ILocalStorageService localStorage)
{ {
_client = client; _client = client;
_localStorage = localStorage; _localStorage = localStorage;
@@ -83,6 +83,7 @@ public class CartService
await _client.UpdateUserCartAsync(new UpdateUserCartRequest await _client.UpdateUserCartAsync(new UpdateUserCartRequest
{ {
UserCartId = existing.cartId, UserCartId = existing.cartId,
Count = newQuantity Count = newQuantity
}); });
} }
@@ -214,7 +215,7 @@ public class CartService
try try
{ {
var response = await _client.GetAllUserCartAsync(new Empty()); var response = await _client.GetCustomerCartAsync(new GetUserCartForCustomerRequest());
_items.Clear(); _items.Clear();
foreach (var model in response.Models) foreach (var model in response.Models)
{ {
@@ -1,7 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using FrontOffice.BFF.Category.Protobuf.Protos.Category; using CMSMicroservice.Protobuf.Protos.Category;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -9,10 +9,10 @@ public sealed record CategoryItem(long Id, string Title, long? ParentId, string?
public class CategoryService public class CategoryService
{ {
private readonly CategoryContract.CategoryContractClient _client; private readonly CMSMicroservice.Protobuf.Protos.Category.CategoryContract.CategoryContractClient _client;
private List<CategoryItem>? _cache; private List<CategoryItem>? _cache;
public CategoryService(CategoryContract.CategoryContractClient client) public CategoryService(CMSMicroservice.Protobuf.Protos.Category.CategoryContract.CategoryContractClient client)
{ {
_client = client; _client = client;
} }
@@ -24,7 +24,7 @@ public class CategoryService
return _cache; return _cache;
} }
var response = await _client.GetAllCategoriesAsync(new GetCategoriesRequest()); var response = await _client.GetAllCategoriesForCustomerAsync(new GetAllCategoriesForCustomerRequest());
_cache = response.Models _cache = response.Models
.Select(dto => new CategoryItem( .Select(dto => new CategoryItem(
Id: dto.Id, Id: dto.Id,
@@ -1,4 +1,4 @@
using FrontOffice.BFF.Configuration.Protobuf.Protos.Configuration; using CMSMicroservice.Protobuf.Protos.Configuration;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -1,4 +1,4 @@
using FrontOffice.BFF.ClubMembership.Protobuf.Protos.ClubMembership; using CMSMicroservice.Protobuf.Protos.ClubMembership;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -24,7 +24,8 @@ public class ClubMembershipService
{ {
try try
{ {
var response = await _client.GetMyClubMembershipAsync(new Empty()); var userId = await GetCurrentUserIdAsync();
var response = await _client.GetClubMembershipAsync(new GetClubMembershipRequest { UserId = userId });
return new ClubMembershipDto return new ClubMembershipDto
{ {
UserId = response.UserId, UserId = response.UserId,
@@ -57,8 +58,10 @@ public class ClubMembershipService
{ {
try try
{ {
var request = new ActivateMyClubMembershipRequest var userId = await GetCurrentUserIdAsync();
var request = new ActivateClubMembershipRequest
{ {
UserId = userId,
PackageId = packageId, PackageId = packageId,
DurationMonths = durationMonths DurationMonths = durationMonths
}; };
@@ -68,13 +71,14 @@ public class ClubMembershipService
request.ActivationCode = activationCode; request.ActivationCode = activationCode;
} }
var response = await _client.ActivateMyClubMembershipAsync(request); await _client.ActivateClubMembershipAsync(request);
// Note: CMS ActivateClubMembership returns Empty, not detailed response
return new ClubActivationResponseDto return new ClubActivationResponseDto
{ {
Success = response.Success, Success = true,
Message = response.Message, Message = "عضویت باشگاه با موفقیت فعال شد.",
ActivationDate = response.ActivationDate?.ToDateTime(), ActivationDate = DateTime.Now,
AmountPaid = response.AmountPaid AmountPaid = 0 // Not available in CMS response
}; };
} }
catch (Grpc.Core.RpcException ex) catch (Grpc.Core.RpcException ex)
@@ -88,4 +92,11 @@ public class ClubMembershipService
}; };
} }
} }
private async Task<long> GetCurrentUserIdAsync()
{
// Get current user ID from auth service or JWT token
// This is a placeholder - should be implemented based on your auth system
return 1; // TODO: Implement proper user ID retrieval
}
} }
@@ -1,4 +1,4 @@
using FrontOffice.BFF.Commission.Protobuf.Protos.Commission; using CMSMicroservice.Protobuf.Protos.Commission;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -1,4 +1,4 @@
using FrontOffice.BFF.NetworkMembership.Protobuf.Protos.NetworkMembership; using CMSMicroservice.Protobuf.Protos.NetworkMembership;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -122,7 +122,7 @@ public class NetworkMembershipService
#region Helper Methods #region Helper Methods
private static NetworkNodeDto? MapNodeFromProto(NetworkNodeModel? node) private static NetworkNodeDto? MapNodeFromProto(NetworkTreeNodeModel? node)
{ {
if (node == null) return null; if (node == null) return null;
+8 -11
View File
@@ -1,4 +1,4 @@
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserOrder;
using Mapster; using Mapster;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -35,9 +35,9 @@ public class OrderService
{ {
private long _seq = 1000; private long _seq = 1000;
private readonly List<GetUserOrderResponse> _orders = new(); private readonly List<GetUserOrderResponse> _orders = new();
private readonly UserOrderContract.UserOrderContractClient _userOrderContractClient; private readonly CMSMicroservice.Protobuf.Protos.UserOrder.UserOrderContract.UserOrderContractClient _userOrderContractClient;
public OrderService(UserOrderContract.UserOrderContractClient userOrderContractClient) public OrderService(CMSMicroservice.Protobuf.Protos.UserOrder.UserOrderContract.UserOrderContractClient userOrderContractClient)
{ {
_userOrderContractClient = userOrderContractClient; _userOrderContractClient = userOrderContractClient;
} }
@@ -83,21 +83,18 @@ public class OrderService
/// <summary> /// <summary>
/// دریافت نرخ مالیات بر ارزش افزوده /// دریافت نرخ مالیات بر ارزش افزوده
/// </summary> /// </summary>
public async Task<GetVATRateResponse> GetVATRateAsync() public async Task<double> GetVATRateAsync()
{ {
try try
{ {
return await _userOrderContractClient.GetVATRateAsync(new Google.Protobuf.WellKnownTypes.Empty()); // TODO: Use Configuration service to get VAT rate
// return await _userOrderContractClient.GetVATRateAsync(new Google.Protobuf.WellKnownTypes.Empty());
return 0.10; // Default 10%
} }
catch catch
{ {
// در صورت خطا، مقادیر پیش‌فرض // در صورت خطا، مقادیر پیش‌فرض
return new GetVATRateResponse return 0.10;
{
VatRate = 0.10,
VatPercentage = 10,
IsEnabled = true
};
} }
} }
} }
@@ -1,4 +1,4 @@
using FrontOffice.BFF.Package.Protobuf.Protos.Package; using CMSMicroservice.Protobuf.Protos.Package;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -31,9 +31,9 @@ public record UserPackageStatusDto(
/// </summary> /// </summary>
public class PackageService public class PackageService
{ {
private readonly PackageContract.PackageContractClient _client; private readonly CMSMicroservice.Protobuf.Protos.Package.PackageContract.PackageContractClient _client;
public PackageService(PackageContract.PackageContractClient client) public PackageService(CMSMicroservice.Protobuf.Protos.Package.PackageContract.PackageContractClient client)
{ {
_client = client; _client = client;
} }
@@ -45,16 +45,9 @@ public class PackageService
{ {
try try
{ {
var request = new GetAllPackageByFilterRequest var request = new GetCustomerPackagesRequest();
{
PaginationState = new PaginationState
{
PageNumber = 1,
PageSize = 100
}
};
var response = await _client.GetAllPackageByFilterAsync(request, cancellationToken: ct); var response = await _client.GetCustomerPackagesAsync(request, cancellationToken: ct);
return response.Models return response.Models
.Select(m => new PackageDto( .Select(m => new PackageDto(
@@ -81,8 +74,8 @@ public class PackageService
{ {
try try
{ {
var response = await _client.GetPackageAsync( var response = await _client.GetCustomerPackageDetailsAsync(
new GetPackageRequest { Id = id }, new GetCustomerPackageDetailsRequest { PackageId = id },
cancellationToken: ct); cancellationToken: ct);
if (response == null) return null; if (response == null) return null;
@@ -3,7 +3,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using FrontOffice.BFF.Products.Protobuf.Protos.Products; using CMSMicroservice.Protobuf.Protos.Products;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -51,9 +51,9 @@ public class ProductService
{ {
private readonly ConcurrentDictionary<long, CacheEntry> _cache = new(); private readonly ConcurrentDictionary<long, CacheEntry> _cache = new();
private static readonly TimeSpan CacheDuration = TimeSpan.FromMinutes(1); private static readonly TimeSpan CacheDuration = TimeSpan.FromMinutes(1);
private readonly ProductsContract.ProductsContractClient _client; private readonly CMSMicroservice.Protobuf.Protos.Products.ProductsContract.ProductsContractClient _client;
public ProductService(ProductsContract.ProductsContractClient client) public ProductService(CMSMicroservice.Protobuf.Protos.Products.ProductsContract.ProductsContractClient client)
{ {
_client = client; _client = client;
} }
+2 -2
View File
@@ -1,5 +1,5 @@
using Blazored.LocalStorage; using Blazored.LocalStorage;
using FrontOffice.BFF.UserOrder.Protobuf.Protos.UserOrder; using CMSMicroservice.Protobuf.Protos.UserOrder;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -93,7 +93,7 @@ public class VATService
{ {
// ایجاد scope برای دریافت client و localStorage // ایجاد scope برای دریافت client و localStorage
using var scope = _serviceProvider.CreateScope(); using var scope = _serviceProvider.CreateScope();
var client = scope.ServiceProvider.GetRequiredService<UserOrderContract.UserOrderContractClient>(); var client = scope.ServiceProvider.GetRequiredService<CMSMicroservice.Protobuf.Protos.UserOrder.UserOrderContract.UserOrderContractClient>();
// var localStorage = scope.ServiceProvider.GetRequiredService<ILocalStorageService>(); // var localStorage = scope.ServiceProvider.GetRequiredService<ILocalStorageService>();
var response = await client.GetVATRateAsync(new Google.Protobuf.WellKnownTypes.Empty()); var response = await client.GetVATRateAsync(new Google.Protobuf.WellKnownTypes.Empty());
+14 -13
View File
@@ -1,5 +1,6 @@
using DateTimeConverterCL; using DateTimeConverterCL;
using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet; using CMSMicroservice.Protobuf.Protos.UserWallet;
using CMSMicroservice.Protobuf.Protos.UserWalletChangeLog;
using Google.Protobuf.WellKnownTypes; using Google.Protobuf.WellKnownTypes;
namespace FrontOffice.Main.Utilities; namespace FrontOffice.Main.Utilities;
@@ -16,9 +17,9 @@ public record WithdrawalSettings(long MinWithdrawalAmount);
public class WalletService public class WalletService
{ {
private readonly UserWalletContract.UserWalletContractClient _client; private readonly CMSMicroservice.Protobuf.Protos.UserWallet.UserWalletContract.UserWalletContractClient _client;
public WalletService(UserWalletContract.UserWalletContractClient client) public WalletService(CMSMicroservice.Protobuf.Protos.UserWallet.UserWalletContract.UserWalletContractClient client)
{ {
_client = client; _client = client;
} }
@@ -27,7 +28,7 @@ public class WalletService
{ {
try try
{ {
var response = await _client.GetUserWalletAsync(new Empty()); var response = await _client.GetCustomerWalletAsync(new Empty());
return new WalletBalances(response.Balance, response.DiscountBalance, response.NetworkBalance); return new WalletBalances(response.Balance, response.DiscountBalance, response.NetworkBalance);
} }
catch catch
@@ -41,7 +42,7 @@ public class WalletService
{ {
try try
{ {
var request = new GetAllUserWalletChangeLogRequest(); var request = new GetCustomerWalletChangeLogRequest();
if (referenceId.HasValue) if (referenceId.HasValue)
{ {
request.ReferenceId = referenceId.Value; request.ReferenceId = referenceId.Value;
@@ -50,7 +51,7 @@ public class WalletService
{ {
request.IsIncrease = isIncrease.Value; request.IsIncrease = isIncrease.Value;
} }
var response = await _client.GetAllUserWalletChangeLogAsync(request); var response = await _client.GetCustomerWalletChangeLogAsync(request);
return response.Models return response.Models
.Select(t => new WalletTransaction( .Select(t => new WalletTransaction(
ResolveTransactionDate(t), ResolveTransactionDate(t),
@@ -67,7 +68,7 @@ public class WalletService
} }
} }
private static string ResolveTransactionDate(GetAllUserWalletChangeLogResponseModel model) private static string ResolveTransactionDate(CustomerWalletChangeLogModel model)
{ {
if (model.CreatedAt is not null) if (model.CreatedAt is not null)
{ {
@@ -84,7 +85,7 @@ public class WalletService
return DateTime.Now.MiladiToJalaliWithTime(); return DateTime.Now.MiladiToJalaliWithTime();
} }
private static string ResolveDescription(GetAllUserWalletChangeLogResponseModel model) private static string ResolveDescription(CustomerWalletChangeLogModel model)
{ {
if (model.ChangeValue > 0) return "شارژ کیف پول"; if (model.ChangeValue > 0) return "شارژ کیف پول";
if (model.ChangeValue < 0) return "برداشت/خرید"; if (model.ChangeValue < 0) return "برداشت/خرید";
@@ -93,7 +94,7 @@ public class WalletService
public async Task<bool> RequestWithdrawalAsync(long payoutId, WithdrawalMethodClient method, string? iban) public async Task<bool> RequestWithdrawalAsync(long payoutId, WithdrawalMethodClient method, string? iban)
{ {
var request = new WithdrawBalanceRequest var request = new CustomerWithdrawBalanceRequest
{ {
PayoutId = payoutId, PayoutId = payoutId,
WithdrawalMethod = (int)method WithdrawalMethod = (int)method
@@ -104,7 +105,7 @@ public class WalletService
} }
try try
{ {
await _client.WithdrawBalanceAsync(request); await _client.CustomerWithdrawBalanceAsync(request);
return true; return true;
} }
catch (Grpc.Core.RpcException ex) catch (Grpc.Core.RpcException ex)
@@ -117,13 +118,13 @@ public class WalletService
{ {
try try
{ {
var request = new GetUserWithdrawalsRequest(); var request = new GetCustomerWithdrawalsRequest();
if (status.HasValue) if (status.HasValue)
{ {
request.Status = status.Value; request.Status = status.Value;
} }
var response = await _client.GetUserWithdrawalsAsync(request); var response = await _client.GetCustomerWithdrawalsAsync(request);
return response.Models return response.Models
.Select(m => new WalletWithdrawal( .Select(m => new WalletWithdrawal(
m.Id, m.Id,
@@ -146,7 +147,7 @@ public class WalletService
{ {
try try
{ {
var response = await _client.GetWithdrawalSettingsAsync(new Empty()); var response = await _client.GetCustomerWithdrawalSettingsAsync(new Empty());
return new WithdrawalSettings(response.MinWithdrawalAmount); return new WithdrawalSettings(response.MinWithdrawalAmount);
} }
catch catch
+1 -1
View File
@@ -12,7 +12,7 @@
@using MudBlazor @using MudBlazor
@using FrontOffice.Main.Utilities @using FrontOffice.Main.Utilities
@using DateTimeConverterCL @using DateTimeConverterCL
@using CityProto = FrontOffice.BFF.City.Protobuf
@inject NavigationManager Navigation @inject NavigationManager Navigation
@inject IDialogService DialogService @inject IDialogService DialogService
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
// "GwUrl": "https://localhost:34781", // "GwUrl": "https://localhost:34781",
"GwUrl": "https://frontoffice-bff.se.kbs1.ir", "GwUrl": "https://localhost:32846",
"DownloadUrl": "https://dl.afrino.co", "DownloadUrl": "https://dl.afrino.co",
"EncryptionSettings": { "EncryptionSettings": {
"Key": "kmcQ3XTmH4mrdh8VHziuscyf8LLYjG//Kyni81nH/0E=", "Key": "kmcQ3XTmH4mrdh8VHziuscyf8LLYjG//Kyni81nH/0E=",