feat: Implement user permission checks and manual payment functionalities
- Added CheckUserPermissionQuery and CheckUserPermissionQueryHandler for permission validation. - Introduced GetUserRolesQuery and GetUserRolesQueryHandler to retrieve user roles. - Created IPermissionService interface and its implementation in PermissionService. - Defined permission and role constants in PermissionDefinitions. - Developed SetDefaultVatPercentageCommand and its handler for VAT configuration. - Implemented GetCurrentVatPercentageQuery and handler to fetch current VAT settings. - Added manual payment commands: CreateManualPayment, ApproveManualPayment, and RejectManualPayment with respective handlers and validators. - Created GetManualPaymentsQuery and handler for retrieving manual payment records. - Integrated gRPC services for manual payments with appropriate permission checks. - Established Protobuf definitions for manual payment operations and metadata.
This commit is contained in:
+6
-6
@@ -1,12 +1,12 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using BackOffice.BFF.Package.Protobuf.Protos.Package;
|
||||
using CMSMicroservice.Protobuf.Protos.Package;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using BffPackage = BackOffice.BFF.Package.Protobuf.Protos.Package;
|
||||
using CmsPackage = CMSMicroservice.Protobuf.Protos.Package;
|
||||
|
||||
namespace BackOffice.BFF.Application.PackageCQ.Queries.GetUserPackageStatus;
|
||||
|
||||
public class GetUserPackageStatusQueryHandler : IRequestHandler<GetUserPackageStatusQuery, GetUserPackageStatusResponse>
|
||||
public class GetUserPackageStatusQueryHandler : IRequestHandler<GetUserPackageStatusQuery, BffPackage.GetUserPackageStatusResponse>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
private readonly ILogger<GetUserPackageStatusQueryHandler> _logger;
|
||||
@@ -19,9 +19,9 @@ public class GetUserPackageStatusQueryHandler : IRequestHandler<GetUserPackageSt
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public async Task<GetUserPackageStatusResponse> Handle(GetUserPackageStatusQuery request, CancellationToken cancellationToken)
|
||||
public async Task<BffPackage.GetUserPackageStatusResponse> Handle(GetUserPackageStatusQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var grpcRequest = new GetUserPackageStatusRequest
|
||||
var grpcRequest = new CmsPackage.GetUserPackageStatusRequest
|
||||
{
|
||||
UserId = request.UserId
|
||||
};
|
||||
@@ -30,7 +30,7 @@ public class GetUserPackageStatusQueryHandler : IRequestHandler<GetUserPackageSt
|
||||
|
||||
_logger.LogInformation("Retrieved package status for user {UserId}", request.UserId);
|
||||
|
||||
var result = new GetUserPackageStatusResponse
|
||||
var result = new BffPackage.GetUserPackageStatusResponse
|
||||
{
|
||||
UserId = response.UserId,
|
||||
PackagePurchaseMethod = response.PackagePurchaseMethod,
|
||||
|
||||
Reference in New Issue
Block a user