Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing variable being used #491

Open
Varagos opened this issue Jun 13, 2023 · 0 comments
Open

Missing variable being used #491

Varagos opened this issue Jun 13, 2023 · 0 comments
Labels
bug Something isn't working semantic

Comments

@Varagos
Copy link
Contributor

Varagos commented Jun 13, 2023

I should get an error that the variable amount is not defined but i don't

// Structs and DTOs...

DomainService ReconciliationDomainService(reconciliationService: ReconciliationServicePort) {

    public reconcile(ledgerFinancialDocument: FinancialDocumentEntity, externalFinancialDocument: FinancialDocumentEntity): (OK(ReconciliationReportEntity),Errors(
        DomainErrors.DuplicateTransactionIdsError
        | DomainErrors.CreditDebitSumError
        | DomainErrors.DocumentStatusNotValidatedError
    )) {

        const ledgerTransactions = [];
        for (transaction of ledgerFinancialDocument.financialTransactions){
            creditAmount: float;
            debitAmount: float;
            if(transaction.amount.type == 'credit') {
                creditAmount = amount.amount;
            } 
            if(transaction.amount.type == 'debit') {
                debitAmount = amount.amount;
            } 
            const ledgerTransaction = LedgerTransaction({
                ledgerId: transaction.financialTransactionId,
                id: transaction.rowId,
                credit: creditAmount,
                debit: debitAmount,
                balance: transaction.balance,
                date: transaction.date,
                description: transaction.description,
                reference: transaction.reference,
                rowId: transaction.rowId,
            });
            ledgerTransactions.push(ledgerTransaction);
        }

        // ...
    }
}
@Varagos Varagos added bug Something isn't working semantic labels Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working semantic
Projects
None yet
Development

No branches or pull requests

1 participant