initial commit
This commit is contained in:
+59
@@ -0,0 +1,59 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class DeliveryOrderCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class DeliveryOrderCreateInvenTransRequest : IRequest<DeliveryOrderCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class DeliveryOrderCreateInvenTransValidator : AbstractValidator<DeliveryOrderCreateInvenTransRequest>
|
||||
{
|
||||
public DeliveryOrderCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeliveryOrderCreateInvenTransHandler : IRequestHandler<DeliveryOrderCreateInvenTransRequest, DeliveryOrderCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public DeliveryOrderCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<DeliveryOrderCreateInvenTransResult> Handle(DeliveryOrderCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.DeliveryOrderCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new DeliveryOrderCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class DeliveryOrderDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class DeliveryOrderDeleteInvenTransRequest : IRequest<DeliveryOrderDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class DeliveryOrderDeleteInvenTransValidator : AbstractValidator<DeliveryOrderDeleteInvenTransRequest>
|
||||
{
|
||||
public DeliveryOrderDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeliveryOrderDeleteInvenTransHandler : IRequestHandler<DeliveryOrderDeleteInvenTransRequest, DeliveryOrderDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public DeliveryOrderDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<DeliveryOrderDeleteInvenTransResult> Handle(DeliveryOrderDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.DeliveryOrderDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new DeliveryOrderDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class DeliveryOrderUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class DeliveryOrderUpdateInvenTransRequest : IRequest<DeliveryOrderUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class DeliveryOrderUpdateInvenTransValidator : AbstractValidator<DeliveryOrderUpdateInvenTransRequest>
|
||||
{
|
||||
public DeliveryOrderUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class DeliveryOrderUpdateInvenTransHandler : IRequestHandler<DeliveryOrderUpdateInvenTransRequest, DeliveryOrderUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public DeliveryOrderUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<DeliveryOrderUpdateInvenTransResult> Handle(DeliveryOrderUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.DeliveryOrderUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new DeliveryOrderUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class GoodsReceiveCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsReceiveCreateInvenTransRequest : IRequest<GoodsReceiveCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class GoodsReceiveCreateInvenTransValidator : AbstractValidator<GoodsReceiveCreateInvenTransRequest>
|
||||
{
|
||||
public GoodsReceiveCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class GoodsReceiveCreateInvenTransHandler : IRequestHandler<GoodsReceiveCreateInvenTransRequest, GoodsReceiveCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public GoodsReceiveCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<GoodsReceiveCreateInvenTransResult> Handle(GoodsReceiveCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.GoodsReceiveCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new GoodsReceiveCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class GoodsReceiveDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsReceiveDeleteInvenTransRequest : IRequest<GoodsReceiveDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class GoodsReceiveDeleteInvenTransValidator : AbstractValidator<GoodsReceiveDeleteInvenTransRequest>
|
||||
{
|
||||
public GoodsReceiveDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class GoodsReceiveDeleteInvenTransHandler : IRequestHandler<GoodsReceiveDeleteInvenTransRequest, GoodsReceiveDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public GoodsReceiveDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<GoodsReceiveDeleteInvenTransResult> Handle(GoodsReceiveDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.GoodsReceiveDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new GoodsReceiveDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class GoodsReceiveUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class GoodsReceiveUpdateInvenTransRequest : IRequest<GoodsReceiveUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class GoodsReceiveUpdateInvenTransValidator : AbstractValidator<GoodsReceiveUpdateInvenTransRequest>
|
||||
{
|
||||
public GoodsReceiveUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class GoodsReceiveUpdateInvenTransHandler : IRequestHandler<GoodsReceiveUpdateInvenTransRequest, GoodsReceiveUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public GoodsReceiveUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<GoodsReceiveUpdateInvenTransResult> Handle(GoodsReceiveUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.GoodsReceiveUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new GoodsReceiveUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class NegativeAdjustmentCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentCreateInvenTransRequest : IRequest<NegativeAdjustmentCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentCreateInvenTransValidator : AbstractValidator<NegativeAdjustmentCreateInvenTransRequest>
|
||||
{
|
||||
public NegativeAdjustmentCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentCreateInvenTransHandler : IRequestHandler<NegativeAdjustmentCreateInvenTransRequest, NegativeAdjustmentCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public NegativeAdjustmentCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<NegativeAdjustmentCreateInvenTransResult> Handle(NegativeAdjustmentCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.NegativeAdjustmentCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new NegativeAdjustmentCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class NegativeAdjustmentDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentDeleteInvenTransRequest : IRequest<NegativeAdjustmentDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentDeleteInvenTransValidator : AbstractValidator<NegativeAdjustmentDeleteInvenTransRequest>
|
||||
{
|
||||
public NegativeAdjustmentDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentDeleteInvenTransHandler : IRequestHandler<NegativeAdjustmentDeleteInvenTransRequest, NegativeAdjustmentDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public NegativeAdjustmentDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<NegativeAdjustmentDeleteInvenTransResult> Handle(NegativeAdjustmentDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.NegativeAdjustmentDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new NegativeAdjustmentDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class NegativeAdjustmentUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentUpdateInvenTransRequest : IRequest<NegativeAdjustmentUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentUpdateInvenTransValidator : AbstractValidator<NegativeAdjustmentUpdateInvenTransRequest>
|
||||
{
|
||||
public NegativeAdjustmentUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class NegativeAdjustmentUpdateInvenTransHandler : IRequestHandler<NegativeAdjustmentUpdateInvenTransRequest, NegativeAdjustmentUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public NegativeAdjustmentUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<NegativeAdjustmentUpdateInvenTransResult> Handle(NegativeAdjustmentUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.NegativeAdjustmentUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new NegativeAdjustmentUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class PositiveAdjustmentCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentCreateInvenTransRequest : IRequest<PositiveAdjustmentCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentCreateInvenTransValidator : AbstractValidator<PositiveAdjustmentCreateInvenTransRequest>
|
||||
{
|
||||
public PositiveAdjustmentCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentCreateInvenTransHandler : IRequestHandler<PositiveAdjustmentCreateInvenTransRequest, PositiveAdjustmentCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public PositiveAdjustmentCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<PositiveAdjustmentCreateInvenTransResult> Handle(PositiveAdjustmentCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.PositiveAdjustmentCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new PositiveAdjustmentCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class PositiveAdjustmentDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentDeleteInvenTransRequest : IRequest<PositiveAdjustmentDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentDeleteInvenTransValidator : AbstractValidator<PositiveAdjustmentDeleteInvenTransRequest>
|
||||
{
|
||||
public PositiveAdjustmentDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentDeleteInvenTransHandler : IRequestHandler<PositiveAdjustmentDeleteInvenTransRequest, PositiveAdjustmentDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public PositiveAdjustmentDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<PositiveAdjustmentDeleteInvenTransResult> Handle(PositiveAdjustmentDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.PositiveAdjustmentDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new PositiveAdjustmentDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class PositiveAdjustmentUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentUpdateInvenTransRequest : IRequest<PositiveAdjustmentUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentUpdateInvenTransValidator : AbstractValidator<PositiveAdjustmentUpdateInvenTransRequest>
|
||||
{
|
||||
public PositiveAdjustmentUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class PositiveAdjustmentUpdateInvenTransHandler : IRequestHandler<PositiveAdjustmentUpdateInvenTransRequest, PositiveAdjustmentUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public PositiveAdjustmentUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<PositiveAdjustmentUpdateInvenTransResult> Handle(PositiveAdjustmentUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.PositiveAdjustmentUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new PositiveAdjustmentUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class PurchaseReturnCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class PurchaseReturnCreateInvenTransRequest : IRequest<PurchaseReturnCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class PurchaseReturnCreateInvenTransValidator : AbstractValidator<PurchaseReturnCreateInvenTransRequest>
|
||||
{
|
||||
public PurchaseReturnCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class PurchaseReturnCreateInvenTransHandler : IRequestHandler<PurchaseReturnCreateInvenTransRequest, PurchaseReturnCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public PurchaseReturnCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<PurchaseReturnCreateInvenTransResult> Handle(PurchaseReturnCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.PurchaseReturnCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new PurchaseReturnCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class PurchaseReturnDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class PurchaseReturnDeleteInvenTransRequest : IRequest<PurchaseReturnDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class PurchaseReturnDeleteInvenTransValidator : AbstractValidator<PurchaseReturnDeleteInvenTransRequest>
|
||||
{
|
||||
public PurchaseReturnDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class PurchaseReturnDeleteInvenTransHandler : IRequestHandler<PurchaseReturnDeleteInvenTransRequest, PurchaseReturnDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public PurchaseReturnDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<PurchaseReturnDeleteInvenTransResult> Handle(PurchaseReturnDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.PurchaseReturnDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new PurchaseReturnDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class PurchaseReturnUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class PurchaseReturnUpdateInvenTransRequest : IRequest<PurchaseReturnUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class PurchaseReturnUpdateInvenTransValidator : AbstractValidator<PurchaseReturnUpdateInvenTransRequest>
|
||||
{
|
||||
public PurchaseReturnUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class PurchaseReturnUpdateInvenTransHandler : IRequestHandler<PurchaseReturnUpdateInvenTransRequest, PurchaseReturnUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public PurchaseReturnUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<PurchaseReturnUpdateInvenTransResult> Handle(PurchaseReturnUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.PurchaseReturnUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new PurchaseReturnUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class SalesReturnCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class SalesReturnCreateInvenTransRequest : IRequest<SalesReturnCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class SalesReturnCreateInvenTransValidator : AbstractValidator<SalesReturnCreateInvenTransRequest>
|
||||
{
|
||||
public SalesReturnCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class SalesReturnCreateInvenTransHandler : IRequestHandler<SalesReturnCreateInvenTransRequest, SalesReturnCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public SalesReturnCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<SalesReturnCreateInvenTransResult> Handle(SalesReturnCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.SalesReturnCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new SalesReturnCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class SalesReturnDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class SalesReturnDeleteInvenTransRequest : IRequest<SalesReturnDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class SalesReturnDeleteInvenTransValidator : AbstractValidator<SalesReturnDeleteInvenTransRequest>
|
||||
{
|
||||
public SalesReturnDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class SalesReturnDeleteInvenTransHandler : IRequestHandler<SalesReturnDeleteInvenTransRequest, SalesReturnDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public SalesReturnDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<SalesReturnDeleteInvenTransResult> Handle(SalesReturnDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.SalesReturnDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new SalesReturnDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class SalesReturnUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class SalesReturnUpdateInvenTransRequest : IRequest<SalesReturnUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? WarehouseId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class SalesReturnUpdateInvenTransValidator : AbstractValidator<SalesReturnUpdateInvenTransRequest>
|
||||
{
|
||||
public SalesReturnUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.WarehouseId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class SalesReturnUpdateInvenTransHandler : IRequestHandler<SalesReturnUpdateInvenTransRequest, SalesReturnUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public SalesReturnUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<SalesReturnUpdateInvenTransResult> Handle(SalesReturnUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.SalesReturnUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.WarehouseId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new SalesReturnUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class ScrappingCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class ScrappingCreateInvenTransRequest : IRequest<ScrappingCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class ScrappingCreateInvenTransValidator : AbstractValidator<ScrappingCreateInvenTransRequest>
|
||||
{
|
||||
public ScrappingCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class ScrappingCreateInvenTransHandler : IRequestHandler<ScrappingCreateInvenTransRequest, ScrappingCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public ScrappingCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<ScrappingCreateInvenTransResult> Handle(ScrappingCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.ScrappingCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new ScrappingCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class ScrappingDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class ScrappingDeleteInvenTransRequest : IRequest<ScrappingDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class ScrappingDeleteInvenTransValidator : AbstractValidator<ScrappingDeleteInvenTransRequest>
|
||||
{
|
||||
public ScrappingDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class ScrappingDeleteInvenTransHandler : IRequestHandler<ScrappingDeleteInvenTransRequest, ScrappingDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public ScrappingDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<ScrappingDeleteInvenTransResult> Handle(ScrappingDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.ScrappingDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new ScrappingDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class ScrappingUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class ScrappingUpdateInvenTransRequest : IRequest<ScrappingUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class ScrappingUpdateInvenTransValidator : AbstractValidator<ScrappingUpdateInvenTransRequest>
|
||||
{
|
||||
public ScrappingUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class ScrappingUpdateInvenTransHandler : IRequestHandler<ScrappingUpdateInvenTransRequest, ScrappingUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public ScrappingUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<ScrappingUpdateInvenTransResult> Handle(ScrappingUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.ScrappingUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new ScrappingUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class StockCountCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class StockCountCreateInvenTransRequest : IRequest<StockCountCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? QtySCCount { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class StockCountCreateInvenTransValidator : AbstractValidator<StockCountCreateInvenTransRequest>
|
||||
{
|
||||
public StockCountCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.QtySCCount).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class StockCountCreateInvenTransHandler : IRequestHandler<StockCountCreateInvenTransRequest, StockCountCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public StockCountCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<StockCountCreateInvenTransResult> Handle(StockCountCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.StockCountCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.ProductId,
|
||||
request.QtySCCount,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new StockCountCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class StockCountDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class StockCountDeleteInvenTransRequest : IRequest<StockCountDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class StockCountDeleteInvenTransValidator : AbstractValidator<StockCountDeleteInvenTransRequest>
|
||||
{
|
||||
public StockCountDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class StockCountDeleteInvenTransHandler : IRequestHandler<StockCountDeleteInvenTransRequest, StockCountDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public StockCountDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<StockCountDeleteInvenTransResult> Handle(StockCountDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.StockCountDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new StockCountDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class StockCountUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class StockCountUpdateInvenTransRequest : IRequest<StockCountUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? QtySCCount { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class StockCountUpdateInvenTransValidator : AbstractValidator<StockCountUpdateInvenTransRequest>
|
||||
{
|
||||
public StockCountUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.QtySCCount).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class StockCountUpdateInvenTransHandler : IRequestHandler<StockCountUpdateInvenTransRequest, StockCountUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public StockCountUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<StockCountUpdateInvenTransResult> Handle(StockCountUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.StockCountUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.ProductId,
|
||||
request.QtySCCount,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new StockCountUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class TransferInCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class TransferInCreateInvenTransRequest : IRequest<TransferInCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class TransferInCreateInvenTransValidator : AbstractValidator<TransferInCreateInvenTransRequest>
|
||||
{
|
||||
public TransferInCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class TransferInCreateInvenTransHandler : IRequestHandler<TransferInCreateInvenTransRequest, TransferInCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public TransferInCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<TransferInCreateInvenTransResult> Handle(TransferInCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.TransferInCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new TransferInCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class TransferInDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class TransferInDeleteInvenTransRequest : IRequest<TransferInDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class TransferInDeleteInvenTransValidator : AbstractValidator<TransferInDeleteInvenTransRequest>
|
||||
{
|
||||
public TransferInDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class TransferInDeleteInvenTransHandler : IRequestHandler<TransferInDeleteInvenTransRequest, TransferInDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public TransferInDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<TransferInDeleteInvenTransResult> Handle(TransferInDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.TransferInDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new TransferInDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class TransferInUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class TransferInUpdateInvenTransRequest : IRequest<TransferInUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class TransferInUpdateInvenTransValidator : AbstractValidator<TransferInUpdateInvenTransRequest>
|
||||
{
|
||||
public TransferInUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class TransferInUpdateInvenTransHandler : IRequestHandler<TransferInUpdateInvenTransRequest, TransferInUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public TransferInUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<TransferInUpdateInvenTransResult> Handle(TransferInUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.TransferInUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new TransferInUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class TransferOutCreateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class TransferOutCreateInvenTransRequest : IRequest<TransferOutCreateInvenTransResult>
|
||||
{
|
||||
public string? ModuleId { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? CreatedById { get; init; }
|
||||
}
|
||||
|
||||
public class TransferOutCreateInvenTransValidator : AbstractValidator<TransferOutCreateInvenTransRequest>
|
||||
{
|
||||
public TransferOutCreateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.ModuleId).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.CreatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class TransferOutCreateInvenTransHandler : IRequestHandler<TransferOutCreateInvenTransRequest, TransferOutCreateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public TransferOutCreateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<TransferOutCreateInvenTransResult> Handle(TransferOutCreateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.TransferOutCreateInvenTrans(
|
||||
request.ModuleId,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.CreatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new TransferOutCreateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class TransferOutDeleteInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class TransferOutDeleteInvenTransRequest : IRequest<TransferOutDeleteInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? DeletedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class TransferOutDeleteInvenTransValidator : AbstractValidator<TransferOutDeleteInvenTransRequest>
|
||||
{
|
||||
public TransferOutDeleteInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.DeletedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class TransferOutDeleteInvenTransHandler : IRequestHandler<TransferOutDeleteInvenTransRequest, TransferOutDeleteInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public TransferOutDeleteInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<TransferOutDeleteInvenTransResult> Handle(TransferOutDeleteInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.TransferOutDeleteInvenTrans(
|
||||
request.Id,
|
||||
request.DeletedById,
|
||||
cancellationToken);
|
||||
|
||||
return new TransferOutDeleteInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
using Domain.Entities;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace Application.Features.InventoryTransactionManager.Commands;
|
||||
|
||||
public class TransferOutUpdateInvenTransResult
|
||||
{
|
||||
public InventoryTransaction? Data { get; set; }
|
||||
}
|
||||
|
||||
public class TransferOutUpdateInvenTransRequest : IRequest<TransferOutUpdateInvenTransResult>
|
||||
{
|
||||
public string? Id { get; init; }
|
||||
public string? ProductId { get; init; }
|
||||
public double? Movement { get; init; }
|
||||
public string? UpdatedById { get; init; }
|
||||
|
||||
}
|
||||
|
||||
public class TransferOutUpdateInvenTransValidator : AbstractValidator<TransferOutUpdateInvenTransRequest>
|
||||
{
|
||||
public TransferOutUpdateInvenTransValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty();
|
||||
RuleFor(x => x.ProductId).NotEmpty();
|
||||
RuleFor(x => x.Movement).NotEmpty();
|
||||
RuleFor(x => x.UpdatedById).NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public class TransferOutUpdateInvenTransHandler : IRequestHandler<TransferOutUpdateInvenTransRequest, TransferOutUpdateInvenTransResult>
|
||||
{
|
||||
private readonly InventoryTransactionService _inventoryTransactionService;
|
||||
|
||||
public TransferOutUpdateInvenTransHandler(
|
||||
InventoryTransactionService inventoryTransactionService
|
||||
)
|
||||
{
|
||||
_inventoryTransactionService = inventoryTransactionService;
|
||||
}
|
||||
|
||||
public async Task<TransferOutUpdateInvenTransResult> Handle(TransferOutUpdateInvenTransRequest request, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var entity = await _inventoryTransactionService.TransferOutUpdateInvenTrans(
|
||||
request.Id,
|
||||
request.ProductId,
|
||||
request.Movement,
|
||||
request.UpdatedById,
|
||||
cancellationToken);
|
||||
|
||||
return new TransferOutUpdateInvenTransResult
|
||||
{
|
||||
Data = entity
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user