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

/// 대여 생성 요청 입력 값.
///
/// - 대여 반납 예정일과 결재 구성을 포함한다.
class CreateRentalRequestInput {
  CreateRentalRequestInput({
    required this.transactionTypeId,
    required this.transactionStatusId,
    required this.warehouseId,
    required this.transactionDate,
    required this.createdById,
    required this.approval,
    this.expectedReturnDate,
    this.note,
    this.lines = const [],
    this.customers = const [],
  });

  final int transactionTypeId;
  final int transactionStatusId;
  final int warehouseId;
  final DateTime transactionDate;
  final int createdById;
  final DateTime? expectedReturnDate;
  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,
      expectedReturnDate: expectedReturnDate,
      lines: lines,
      customers: customers,
      approval: approval,
    );
  }
}
