import { CreditCardTransactionsProvider } from '../providers/creditcard-transactions.provider.js';
export const CreditCardTransactionsResolvers = {
    CreditcardBankCharge: {
        creditCardTransactions: async (dbCharge, _, { injector }) => {
            return injector
                .get(CreditCardTransactionsProvider)
                .getCreditCardTransactionsByChargeIdLoader.load(dbCharge.id)
                .then(res => res.map(dbTransaction => dbTransaction.id).filter(Boolean));
        },
        validCreditCardAmount: async (dbCharge, _, { injector }) => {
            try {
                const res = await injector
                    .get(CreditCardTransactionsProvider)
                    .validateCreditCardTransactionsAmountByChargeIdLoader.load(dbCharge.id);
                return res ?? false;
            }
            catch (error) {
                console.error(error);
                return false;
            }
        },
    },
};
//# sourceMappingURL=creditcard-transactions.resolver.js.map