import '../../../transactions/domain/entities/stock_transaction_input.dart';

/// 출고 생성 요청 입력 값.
///
/// - 결재 구성을 포함한 재고 트랜잭션 생성 데이터를 보관한다.
class CreateOutboundRequestInput {
  CreateOutboundRequestInput({
    required this.transactionTypeId,
    required this.transactionStatusId,
    required this.warehouseId,
    required this.transactionDate,
    required this.createdById,
    required this.approval,
    this.note,
    this.lines = const [],
    this.customers = const [],
  });

  final int transactionTypeId;
  final int transactionStatusId;
  final int warehouseId;
  final DateTime transactionDate;
  final int createdById;
  final String? note;
  final List<TransactionLineCreateInput> lines;
  final List<TransactionCustomerCreateInput> customers;
  final StockTransactionApprovalInput approval;

  /// 공통 재고 트랜잭션 입력 모델로 변환한다.
  StockTransactionCreateInput toTransactionInput() {
    return StockTransactionCreateInput(
      transactionTypeId: transactionTypeId,
      transactionStatusId: transactionStatusId,
      warehouseId: warehouseId,
      transactionDate: transactionDate,
      createdById: createdById,
      note: note,
      lines: lines,
      customers: customers,
      approval: approval,
    );
  }
}
