class Xs2aToSpiBulkPaymentMapper {

    public SpiBulkPayment mapToSpiBulkPayment(BulkPayment payment, String paymentProduct) {
        SpiBulkPayment bulk = new SpiBulkPayment();
        bulk.setPaymentId(payment.getPaymentId());
        bulk.setBatchBookingPreferred(payment.getBatchBookingPreferred());
        bulk.setDebtorAccount(xs2aToSpiAccountReferenceMapper.mapToSpiAccountReference(payment.getDebtorAccount()));
        if (payment.getTransactionStatus() != null) {
            bulk.setPaymentStatus(payment.getTransactionStatus());
        }
        bulk.setPaymentProduct(paymentProduct);
        bulk.setRequestedExecutionDate(payment.getRequestedExecutionDate());
        bulk.setRequestedExecutionTime(payment.getRequestedExecutionTime());
        bulk.setPayments(mapToListSpiSinglePayment(payment.getPayments(), paymentProduct));
        bulk.setPsuDataList(xs2aToSpiPsuDataMapper.mapToSpiPsuDataList(payment.getPsuDataList()));
        bulk.setStatusChangeTimestamp(payment.getStatusChangeTimestamp());
        bulk.setCreationTimestamp(payment.getCreationTimestamp());
        bulk.setContentType(payment.getContentType());
        bulk.setInstanceId(payment.getInstanceId());
        return bulk;
    }

}