using Kean.Domain.Stock.Commands;
using System;
using System.Threading.Tasks;
namespace Kean.Domain.Stock.SharedServices
{
///
/// 重定位库存
///
public sealed class Relocate
{
private readonly ICommandBus _commandBus;
///
/// 依赖注入
///
public Relocate(ICommandBus commandBus) =>
_commandBus = commandBus;
///
/// 处理程序
///
/// 事务
/// 托盘条码
/// 负载规格
/// 起始位置
/// 目标位置
/// 操作者
/// 标签
/// 时间戳
public Task Handler(
string transaction,
string barcode,
int? spec,
int original,
int destination,
int @operator,
string tag,
(DateTime, DateTime) timestamp) =>
_commandBus.Execute(new RelocateCommand
{
Transaction = transaction,
Barcode = barcode,
Spec = spec,
Original = original,
Destination = destination,
Operator = @operator,
Tag = tag,
Timestamp = timestamp
});
}
}