class CorePaymentsConvertService {

    public CmsPayment expandCommonPaymentWithCorePayment(CmsCommonPayment cmsCommonPayment) {
        switch (cmsCommonPayment.getPaymentType()) {
            case SINGLE:
                return cmsCommonPaymentMapper.mapToCmsSinglePayment(cmsCommonPayment);
            case BULK:
                return cmsCommonPaymentMapper.mapToCmsBulkPayment(cmsCommonPayment);
            case PERIODIC:
                return cmsCommonPaymentMapper.mapToCmsPeriodicPayment(cmsCommonPayment);
            default:
                return cmsCommonPayment;
        }
    }

}