Generator Changes at 10/13/2025 12:07:53 PM

This commit is contained in:
MeysamMoghaddam
2025-10-13 12:09:06 +03:30
parent cac1b1e3bc
commit 4e56dd1204
35 changed files with 1156 additions and 40 deletions

View File

@@ -0,0 +1,10 @@
namespace FrontOffice.BFF.Application.Common.Mappings;
public class TransactionProfile : IRegister
{
void IRegister.Register(TypeAdapterConfig config)
{
//config.NewConfig<Source,Destination>()
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
}
}

View File

@@ -0,0 +1,21 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Commands.PaymentRequest;
public record PaymentRequestCommand : IRequest<PaymentRequestResponseDto>
{
//مقدار
public long Amount { get; init; }
//آدرس اینترنتی بازگشت
public string CallbackUrl { get; init; }
//توضیحات
public string? Description { get; init; }
//موبایل
public string? Mobile { get; init; }
//ایمیل
public string? Email { get; init; }
//واحد پولی
public CurrencyEnum Currency { get; init; }
//نوع تراکنش
public TransactionTypeEnum Type { get; init; }
//شناسه سفارش
public string? OrderId { get; init; }
}

View File

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

View File

@@ -0,0 +1,24 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Commands.PaymentRequest;
public class PaymentRequestCommandValidator : AbstractValidator<PaymentRequestCommand>
{
public PaymentRequestCommandValidator()
{
RuleFor(model => model.Amount)
.NotNull();
RuleFor(model => model.CallbackUrl)
.NotEmpty();
RuleFor(model => model.Currency)
.IsInEnum()
.NotNull();
RuleFor(model => model.Type)
.IsInEnum()
.NotNull();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<PaymentRequestCommand>.CreateWithOptions((PaymentRequestCommand)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,7 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Commands.PaymentRequest;
public class PaymentRequestResponseDto
{
//آدرس اینترنتی درگاه پرداخت
public string PaymentGWUrl { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Commands.PaymentVerification;
public record PaymentVerificationCommand : IRequest<PaymentVerificationResponseDto>
{
//آتوریتی
public string Authority { get; init; }
//وضعیت
public string Status { get; init; }
}

View File

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

View File

@@ -0,0 +1,18 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Commands.PaymentVerification;
public class PaymentVerificationCommandValidator : AbstractValidator<PaymentVerificationCommand>
{
public PaymentVerificationCommandValidator()
{
RuleFor(model => model.Authority)
.NotEmpty();
RuleFor(model => model.Status)
.NotEmpty();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<PaymentVerificationCommand>.CreateWithOptions((PaymentVerificationCommand)model, x => x.IncludeProperties(propertyName)));
if (result.IsValid)
return Array.Empty<string>();
return result.Errors.Select(e => e.ErrorMessage);
};
}

View File

@@ -0,0 +1,17 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Commands.PaymentVerification;
public class PaymentVerificationResponseDto
{
//شناسه
public long Id { get; set; }
//وضعیت پرداخت
public bool PaymentStatus { get; set; }
//پیام
public string Message { get; set; }
//شناسه پرداخت
public string? RefId { get; set; }
//شناسه سفارش
public string? OrderId { get; set; }
//کد وضعیت فعال سازی
public int? VerificationStatusCode { get; set; }
}

View File

@@ -0,0 +1,55 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Queries.GetAllTransactionByFilter;
public record GetAllTransactionByFilterQuery : IRequest<GetAllTransactionByFilterResponseDto>
{
//موقعیت صفحه بندی
public PaginationState? PaginationState { get; init; }
//مرتب سازی بر اساس
public string? SortBy { get; init; }
//فیلتر
public GetAllTransactionByFilterFilter? Filter { get; init; }
}public class GetAllTransactionByFilterFilter
{
//شناسه
public long? Id { get; set; }
//شناسه بازرگانی
public string? MerchantId { get; set; }
//مقدار
public long? Amount { get; set; }
//آدرس اینترنتی برگشت به تماس
public string? CallbackUrl { get; set; }
//توضیحات
public string? Description { get; set; }
//موبایل
public string? Mobile { get; set; }
//ایمیل
public string? Email { get; set; }
//کد وضعیت درخواست
public int? RequestStatusCode { get; set; }
//پیام وضعیت درخواست
public string? RequestStatusMessage { get; set; }
//اتوریتی-اختیار
public string? Authority { get; set; }
//نوع کارمزد
public string? FeeType { get; set; }
//کارمزد
public long? Fee { get; set; }
//واحد پولی
public CurrencyEnum? Currency { get; set; }
//وضعیت پرداخت
public bool? PaymentStatus { get; set; }
//کد وضعیت فعال سازی
public int? VerificationStatusCode { get; set; }
//پیام وضعیت فعال سازی
public string? VerificationStatusMessage { get; set; }
//هش کارت
public string? CardHash { get; set; }
//شماره کارت
public string? CardPan { get; set; }
//شماره تراکنش
public string? RefId { get; set; }
//شناسه سفارش
public string? OrderId { get; set; }
//نوع تراکنش
public TransactionTypeEnum? Type { get; set; }
}

View File

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

View File

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

View File

@@ -0,0 +1,53 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Queries.GetAllTransactionByFilter;
public class GetAllTransactionByFilterResponseDto
{
//متادیتا
public MetaData MetaData { get; set; }
//مدل خروجی
public List<GetAllTransactionByFilterResponseModel>? Models { get; set; }
}public class GetAllTransactionByFilterResponseModel
{
//شناسه
public long Id { get; set; }
//شناسه بازرگانی
public string MerchantId { get; set; }
//مقدار
public long Amount { get; set; }
//آدرس اینترنتی برگشت به تماس
public string CallbackUrl { get; set; }
//توضیحات
public string Description { get; set; }
//موبایل
public string? Mobile { get; set; }
//ایمیل
public string? Email { get; set; }
//کد وضعیت درخواست
public int? RequestStatusCode { get; set; }
//پیام وضعیت درخواست
public string? RequestStatusMessage { get; set; }
//اتوریتی-اختیار
public string? Authority { get; set; }
//نوع کارمزد
public string? FeeType { get; set; }
//کارمزد
public long? Fee { get; set; }
//واحد پولی
public CurrencyEnum? Currency { get; set; }
//وضعیت پرداخت
public bool PaymentStatus { get; set; }
//کد وضعیت فعال سازی
public int? VerificationStatusCode { get; set; }
//پیام وضعیت فعال سازی
public string? VerificationStatusMessage { get; set; }
//هش کارت
public string? CardHash { get; set; }
//شماره کارت
public string? CardPan { get; set; }
//شماره تراکنش
public string? RefId { get; set; }
//شناسه سفارش
public string? OrderId { get; set; }
//نوع تراکنش
public TransactionTypeEnum Type { get; set; }
}

View File

@@ -0,0 +1,9 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Queries.GetTransaction;
public record GetTransactionQuery : IRequest<GetTransactionResponseDto>
{
//شناسه
public long? Id { get; init; }
//آتوریتی
public string? Authority { get; init; }
}

View File

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

View File

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

View File

@@ -0,0 +1,47 @@
namespace FrontOffice.BFF.Application.TransactionCQ.Queries.GetTransaction;
public class GetTransactionResponseDto
{
//شناسه
public long Id { get; set; }
//شناسه بازرگانی
public string MerchantId { get; set; }
//مقدار
public long Amount { get; set; }
//آدرس اینترنتی برگشت به تماس
public string CallbackUrl { get; set; }
//توضیحات
public string Description { get; set; }
//موبایل
public string? Mobile { get; set; }
//ایمیل
public string? Email { get; set; }
//کد وضعیت درخواست
public int? RequestStatusCode { get; set; }
//پیام وضعیت درخواست
public string? RequestStatusMessage { get; set; }
//اتوریتی-اختیار
public string? Authority { get; set; }
//نوع کارمزد
public string? FeeType { get; set; }
//کارمزد
public long? Fee { get; set; }
//واحد پولی
public CurrencyEnum? Currency { get; set; }
//وضعیت پرداخت
public bool PaymentStatus { get; set; }
//کد وضعیت فعال سازی
public int? VerificationStatusCode { get; set; }
//پیام وضعیت فعال سازی
public string? VerificationStatusMessage { get; set; }
//هش کارت
public string? CardHash { get; set; }
//شماره کارت
public string? CardPan { get; set; }
//شماره تراکنش
public string? RefId { get; set; }
//شناسه سفارش
public string? OrderId { get; set; }
//نوع تراکنش
public TransactionTypeEnum Type { get; set; }
}

View File

@@ -11,8 +11,6 @@ public record CreateNewUserOrderCommand : IRequest<CreateNewUserOrderResponseDto
public bool PaymentStatus { get; init; }
//تاریخ پرداخت
public DateTime? PaymentDate { get; init; }
//شناسه کاربر
public long UserId { get; init; }
//شناسه آدرس کاربر
public long UserAddressId { get; init; }

View File

@@ -9,8 +9,6 @@ public class CreateNewUserOrderCommandValidator : AbstractValidator<CreateNewUse
.NotNull();
RuleFor(model => model.PaymentStatus)
.NotNull();
RuleFor(model => model.UserId)
.NotNull();
RuleFor(model => model.UserAddressId)
.NotNull();
}

View File

@@ -3,17 +3,7 @@ public record UpdateUserOrderCommand : IRequest<Unit>
{
//شناسه
public long Id { get; init; }
//قیمت
public long Price { get; init; }
//شناسه پکیج
public long PackageId { get; init; }
//شناسه تراکنش
public long? TransactionId { get; init; }
//وضعیت پرداخت
public bool PaymentStatus { get; init; }
//تاریخ پرداخت
public DateTime? PaymentDate { get; init; }
//شناسه کاربر
public long UserId { get; init; }
}

View File

@@ -5,14 +5,6 @@ public class UpdateUserOrderCommandValidator : AbstractValidator<UpdateUserOrder
{
RuleFor(model => model.Id)
.NotNull();
RuleFor(model => model.Price)
.NotNull();
RuleFor(model => model.PackageId)
.NotNull();
RuleFor(model => model.PaymentStatus)
.NotNull();
RuleFor(model => model.UserId)
.NotNull();
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{