Generator Changes at 11/25/2025 2:22:16 AM +03:30

This commit is contained in:
masoodafar-web
2025-11-25 02:25:35 +03:30
parent c20b2432fb
commit 50ccd10e24
25 changed files with 783 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance;
public record TransferUserWalletBallanceCommand : IRequest<Unit>
{
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance;
public class TransferUserWalletBallanceCommandHandler : IRequestHandler<TransferUserWalletBallanceCommand, Unit>
{
private readonly IApplicationContractContext _context;
public TransferUserWalletBallanceCommandHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<Unit> Handle(TransferUserWalletBallanceCommand request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new Unit();
}
}

View File

@@ -0,0 +1,14 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance;
public class TransferUserWalletBallanceCommandValidator : AbstractValidator<Unit>
{
public TransferUserWalletBallanceCommandValidator()
{
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,5 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
public record WithdrawBalanceCommand : IRequest<WithdrawBalanceResponseDto>
{
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
public class WithdrawBalanceCommandHandler : IRequestHandler<WithdrawBalanceCommand, WithdrawBalanceResponseDto>
{
private readonly IApplicationContractContext _context;
public WithdrawBalanceCommandHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<WithdrawBalanceResponseDto> Handle(WithdrawBalanceCommand request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new WithdrawBalanceResponseDto();
}
}

View File

@@ -0,0 +1,14 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
public class WithdrawBalanceCommandValidator : AbstractValidator<Unit>
{
public WithdrawBalanceCommandValidator()
{
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,23 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
public class WithdrawBalanceResponseDto
{
//متادیتا
public MetaData MetaData { get; set; }
//مدل خروجی
public List<GetAllUserWalletChangeLogResponseModel>? Models { get; set; }
}public class GetAllUserWalletChangeLogResponseModel
{
//موجودی
public long CurrentBalance { get; set; }
//تغییر موجودی
public long ChangeValue { get; set; }
//موجودی جاری شبکه
public long CurrentNetworkBalance { get; set; }
//تغییر موجودی شبکه
public long ChangeNerworkValue { get; set; }
//افزایشی؟
public bool IsIncrease { get; set; }
//شناسه ارجاع
public long? RefrenceId { get; set; }
}

View File

@@ -0,0 +1,5 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
public record GetAllUserWalletChangeLogQuery : IRequest<Unit>
{
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
public class GetAllUserWalletChangeLogQueryHandler : IRequestHandler<GetAllUserWalletChangeLogQuery, Unit>
{
private readonly IApplicationContractContext _context;
public GetAllUserWalletChangeLogQueryHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<Unit> Handle(GetAllUserWalletChangeLogQuery request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new Unit();
}
}

View File

@@ -0,0 +1,14 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
public class GetAllUserWalletChangeLogQueryValidator : AbstractValidator<Unit>
{
public GetAllUserWalletChangeLogQueryValidator()
{
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,5 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet;
public record GetUserWalletQuery : IRequest<GetUserWalletResponseDto>
{
}

View File

@@ -0,0 +1,16 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet;
public class GetUserWalletQueryHandler : IRequestHandler<GetUserWalletQuery, GetUserWalletResponseDto>
{
private readonly IApplicationContractContext _context;
public GetUserWalletQueryHandler(IApplicationContractContext context)
{
_context = context;
}
public async Task<GetUserWalletResponseDto> Handle(GetUserWalletQuery request, CancellationToken cancellationToken)
{
//TODO: Implement your business logic
return new GetUserWalletResponseDto();
}
}

View File

@@ -0,0 +1,14 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet;
public class GetUserWalletQueryValidator : AbstractValidator<Unit>
{
public GetUserWalletQueryValidator()
{
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,9 @@
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet;
public class GetUserWalletResponseDto
{
//موجودی
public long Balance { get; set; }
//موجودی شبکه
public long NetworkBalance { get; set; }
}