Generator Changes at 9/27/2025 10:36:00 AM

This commit is contained in:
generator
2025-09-27 10:36:00 +03:30
parent 15a7933a7a
commit 0e32dc9359
220 changed files with 7313 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
namespace FrontOffice.BFF.Application.UserOrderCQ.Commands.CreateNewUserOrder;
public record CreateNewUserOrderCommand : IRequest<CreateNewUserOrderResponseDto>
{
//قیمت
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

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

View File

@@ -0,0 +1,22 @@
namespace FrontOffice.BFF.Application.UserOrderCQ.Commands.CreateNewUserOrder;
public class CreateNewUserOrderCommandValidator : AbstractValidator<CreateNewUserOrderCommand>
{
public CreateNewUserOrderCommandValidator()
{
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) =>
{
var result = await ValidateAsync(ValidationContext<CreateNewUserOrderCommand>.CreateWithOptions((CreateNewUserOrderCommand)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.UserOrderCQ.Commands.CreateNewUserOrder;
public class CreateNewUserOrderResponseDto
{
//شناسه
public long Id { get; set; }
}