feat: implement Kavenegar SMS service and refactor system configurations to use static constants
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m38s
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 1m38s
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
using CMSMicroservice.WebApi.Common.Services;
|
||||
using CMSMicroservice.Application.ConfigurationCQ.Commands.SetConfigurationValue;
|
||||
using CMSMicroservice.Application.ConfigurationCQ.Commands.DeactivateConfiguration;
|
||||
using CMSMicroservice.Application.ConfigurationCQ.Queries.GetConfigurationByKey;
|
||||
using CMSMicroservice.Application.ConfigurationCQ.Queries.GetAllConfigurations;
|
||||
using CMSMicroservice.Application.ConfigurationCQ.Queries.GetConfigurationHistory;
|
||||
|
||||
namespace CMSMicroservice.WebApi.Services;
|
||||
|
||||
public class ConfigurationService : ConfigurationContract.ConfigurationContractBase
|
||||
{
|
||||
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
|
||||
|
||||
public ConfigurationService(IDispatchRequestToCQRS dispatchRequestToCQRS)
|
||||
{
|
||||
_dispatchRequestToCQRS = dispatchRequestToCQRS;
|
||||
}
|
||||
|
||||
public override async Task<Empty> CreateOrUpdateConfiguration(CreateOrUpdateConfigurationRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<CreateOrUpdateConfigurationRequest, SetConfigurationValueCommand>(request, context);
|
||||
}
|
||||
|
||||
public override async Task<Empty> DeactivateConfiguration(DeactivateConfigurationRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<DeactivateConfigurationRequest, DeactivateConfigurationCommand>(request, context);
|
||||
}
|
||||
|
||||
public override async Task<GetConfigurationByKeyResponse> GetConfigurationByKey(GetConfigurationByKeyRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<GetConfigurationByKeyRequest, GetConfigurationByKeyQuery, GetConfigurationByKeyResponse>(request, context);
|
||||
}
|
||||
|
||||
public override async Task<GetAllConfigurationsResponse> GetAllConfigurations(GetAllConfigurationsRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<GetAllConfigurationsRequest, GetAllConfigurationsQuery, GetAllConfigurationsResponse>(request, context);
|
||||
}
|
||||
|
||||
public override async Task<GetConfigurationHistoryResponse> GetConfigurationHistory(GetConfigurationHistoryRequest request, ServerCallContext context)
|
||||
{
|
||||
return await _dispatchRequestToCQRS.Handle<GetConfigurationHistoryRequest, GetConfigurationHistoryQuery, GetConfigurationHistoryResponse>(request, context);
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,8 @@ public class DayaLoanCheckWorker
|
||||
var processCommand = new ProcessDayaLoanApprovalCommand
|
||||
{
|
||||
UserId = user.Id,
|
||||
ContractNumber = result.ContractNumber
|
||||
ContractNumber = result.ContractNumber,
|
||||
LockedWalletAmount = 0, // TODO: not needed for now
|
||||
};
|
||||
|
||||
var processResult = await _mediator.Send(processCommand);
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
"Sms": {
|
||||
"Enabled": true,
|
||||
"Provider": "Kavenegar",
|
||||
"KavenegarApiKey": "YOUR_KAVENEGAR_API_KEY",
|
||||
"Sender": "10008663"
|
||||
"KavenegarApiKey": "497263626F32626A48685A6137524C4F78575A766E4C74694A556B79317648424964655030682B554545413D",
|
||||
"Sender": "1000001110100"
|
||||
},
|
||||
"DayaPayment": {
|
||||
"BaseUrl": "https://api.daya.ir",
|
||||
|
||||
Reference in New Issue
Block a user