001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2025 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.camel;
011
012import ca.cdr.api.model.enm.TransactionLogEventSubTypeEnum;
013import ca.cdr.api.model.enm.TransactionLogEventTypeEnum;
014import ca.cdr.api.model.json.TransactionLogStepJson;
015import org.apache.camel.Exchange;
016
017import java.util.List;
018
019/**
020 * Transaction log helper to be used by for CDA Camel procedures
021 */
022public interface ICdaCamelProcessorTxLogHelper extends ICamelProcessorTxLogHelper {
023        /**
024         * Adds a transaction log step If a transaction log is present or a new transaction log otherwise
025         * @param theProcedureName the calling procedure name
026         * @param theExchange the camel exchange
027         * @param theMessage the CDA message
028         *
029         */
030        void logRawCcd(String theProcedureName, Exchange theExchange, String theMessage);
031
032        /**
033         * If transaction logging is active, logs a step if transaction log is present or a new transaction log otherwise
034         * @param theExchange the camel exchange
035         * @param theConversionResult the input {@code ICdaCamelConversionResultJson}
036         * @param theLogType the {@code TransactionLogEventTypeEnum}
037         * @param theLogSubType the {@code TransactionLogEventSubTypeEnum}
038         * @param theStepsProvider the {@code ICdaTxLogStepsProvider}
039         *
040         */
041        void addCdaLogStepOrNewLog(
042                        Exchange theExchange,
043                        ICdaCamelConversionResultJson theConversionResult,
044                        TransactionLogEventTypeEnum theLogType,
045                        TransactionLogEventSubTypeEnum theLogSubType,
046                        ICdaTxLogStepsProvider theStepsProvider)
047                        throws Exception;
048
049        /**
050         * @param theExchange the camel exchange
051         * @param theConversionResult the input {@code ICdaCamelConversionResultJson}
052         * @param theProcedureName the calling procedure name
053         * @param theLogSubType the log step subType
054         *
055         */
056        List<TransactionLogStepJson> getCdaLogStepsForBundles(
057                        Exchange theExchange,
058                        ICdaCamelConversionResultJson theConversionResult,
059                        String theProcedureName,
060                        TransactionLogEventSubTypeEnum theLogSubType);
061}